Skip to content

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.

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)
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)
end
end

GetPlayerScreen · OpenPlayerScreen · SetPlayerScreenBlocked · the The game’s screens group of the index