Hooks - Xerasin/Sit-Anywhere GitHub Wiki
Client
ShouldSit (Player ply)
return true to disable needing walk to sit
Server
OnPlayerSit (Player ply, Vector pos, Angle ang, Entity parent, Number parentbone, Entity vehicle)
Called whenever a player sits down return false to cancel sit
OnGroundSit (Player ply, Table EyeTrace)
Called whenever a player sits down return false to cancel ground sit
CheckValidSit (Player ply, Table EyeTrace)
Checks if a sit is valid before sitting, takes priority over ConVars.
| Return value | Effect |
|---|---|
| true | The seat position is valid |
| false | The seat position isn't valid |
| none | Default behavior |
ShouldAllowSit (Player ply)
Return false to disable sitting for a player, takes priority over admin only convar.
| Return value | Effect |
|---|---|
| true | Allows sit even when not admin |
| false | Denies sitting under any circumstance |
| none | Default behavior |
HandleSit (Player ply, Table dist_profile, TraceResult eyeTrace)
Bit of an internal function that allows you to define your own behavior for when someone presses ALT+E (look at ground_sit for an example)
| Return value | Return value 2 | Effect |
|---|---|---|
| true | Vehicle veh | Stop sit processing and return vehicle if created |
| any | any | Continue sit processing |