OnPlayerTrespassChange
The trespass level a player’s game shows changed.
They walked into a house or a keep of the level (its own trespass areas, as their game reports them), into or out of an area with a
trespass level (SetAreaTrespass), or the mode changed one of the rules. level is what they see now: "personal" shows the
game’s blue icon (someone’s home), "prohibited" the red one (no entry), "public" none; "semipublic" and "semipersonal" are
trespass the game shows no icon for. Nobody reacts on their own in multiplayer - what follows is the mode’s. Not when they leave the
server.
Syntax
Section titled “Syntax”function OnPlayerTrespassChange(pid, level, was, source, area) -- ...end| Parameter | Type | |
|---|---|---|
pid |
number | the player |
level |
string | the level now: "public", "semipublic", "semipersonal", "personal" or "prohibited" |
was |
string | the level before |
source |
string | what set it: "level" (the level’s own areas), "area" (one of the map’s areas) or "player" (SetPlayerTrespass) |
area |
string|nil | the map’s area that set it (with "area") |
Example
Section titled “Example”function OnPlayerTrespassChange(pid, level, was, source, area) if level == "prohibited" then SendClientMessage(pid, COLOR_RED, "Leave at once, or the guards will be called.") endendSee also
Section titled “See also”GetPlayerTrespass · SetAreaTrespass · the The map’s areas group of the index
