GetPlayerSeat
The bench, chair or bed of the level a player sits or lies on.
As their game last reported it - the game’s own “Sit” and “Lie down”. Two values: what they sit or lie on and where
they are in it, the names OnPlayerSeatChange uses. GetPlayerPos says where the seat is. A cart’s seat is not
one of these (that is STANCE_SEATED, GetPlayerStance).
Syntax
Section titled “Syntax”GetPlayerSeat(pid)| Parameter | Type | |
|---|---|---|
pid |
number | the player |
Returns
Section titled “Returns”string, string - the kind ("table", "bench", "bed", "ground", "on_table", "shelter", "tent", "bath" or "other") and the state ("sitting_down", "sitting", "standing_up", "lying_down", "lying" or "getting_up"); nil for a player on no seat or not connected
Example
Section titled “Example”local kind, state = GetPlayerSeat(pid)if kind == "bed" and state == "lying" then SendClientMessage(pid, COLOR_GOLD, "You rest your eyes.")endSee also
Section titled “See also”OnPlayerSeatChange · GetPlayerStance · the Players group of the index
