Skip to content

OnPlayerStanceChange

A player crouched, stood up, got into a saddle or sat down in a cart.

stance is the new one, previous the one before: STANCE_STANDING, STANCE_CROUCHING, STANCE_MOUNTED or STANCE_SEATED. A crouch comes once it has held for a quarter of a second, so a quick dip does not call it. GetPlayerStance reads the stance at any time. STANCE_SEATED is a cart’s seat only: a player who sits on a bench, a chair or a bed of the level stays STANCE_STANDING - OnPlayerSeatChange tells that.

function OnPlayerStanceChange(pid, stance, previous)
-- ...
end
Parameter Type
pid number the player
stance number the new stance
previous number the stance before
-- sneaking players show no name
function OnPlayerStanceChange(pid, stance, previous)
SetPlayerNameplateHidden(pid, stance == STANCE_CROUCHING)
end

GetPlayerStance · IsPlayerCrouching · SetPlayerNameplateHidden · the Players group of the index