Skip to content

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.

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)

boolean - false for an unknown player

function OnPlayerConnect(pid)
SetPlayerSleepWheel(pid, false) -- every bed is the mode's sleep
end

EndPlayerSleep · OnPlayerSleep · IsPlayerSleeping · the Beds and sleep group of the index