OnPlayerScreenChange
A player opened one of the game’s player screens, switched to another or closed them.
Their own key or tab, the mode’s OpenPlayerScreen or ClosePlayerScreens, the screen’s own close. A screen the
mode refuses them never opens, so it never comes here. The answer is not read.
Syntax
Section titled “Syntax”function OnPlayerScreenChange(pid, screen, previous) -- ...end| Parameter | Type | |
|---|---|---|
pid |
number | the player |
screen |
string|nil | "inventory", "character", "map", "codex", "journal" or "other"; nil = closed |
previous |
string|nil | the one before (nil = none was open) |
Example
Section titled “Example”function OnPlayerScreenChange(pid, screen, previous) if screen == "map" and IsPlayerInZone(pid, DUNGEON) then SendClientMessage(pid, COLOR_WHITE, "You cannot read a map in the dark.") ClosePlayerScreens(pid) endendSee also
Section titled “See also”GetPlayerScreen · OpenPlayerScreen · SetPlayerScreenBlocked · the The game’s screens group of the index
