SetPlayerSleepWheel
Leaves the game’s sleep wheel out for a player - or gives it back.
With shown false a bed lays the player down with the game’s own animation and they stay lying, the world and the HUD
in view, with no wheel and no black screen, until EndPlayerSleep gets them up - or their own forward key (W), unless
getUp is false. The mode gives the Rest itself (SetPlayerEnergy). true gives them the game’s wheel back for their
next sleep. Set in OnPlayerConnect it holds from their first step; for their visit, a reload clears it.
Syntax
Section titled “Syntax”SetPlayerSleepWheel(pid, shown [, getUp])| Parameter | Type | |
|---|---|---|
pid |
number | the player |
shown |
boolean | false leaves the wheel out, true gives it back |
getUp |
boolean | with shown false: true (the default) - the player’s forward key gets them up; false - only EndPlayerSleep does (optional) |
Returns
Section titled “Returns”boolean - false for an unknown player
Example
Section titled “Example”function OnPlayerConnect(pid) SetPlayerSleepWheel(pid, false) -- every bed is the mode's sleependSee also
Section titled “See also”EndPlayerSleep · OnPlayerSleep · IsPlayerSleeping · the Beds and sleep group of the index
