Skip to content

SetPlayerMapLayer

Shows (or hides) a map layer to one player alone.

The player’s game draws the layer on or off whatever the map’s own switch is (SetMapLayer) - a quest’s camp only its hero sees, a house’s furnished rooms for its owner. Their game alone: the server’s own world keeps the map’s switch - a layer shown to one player is not solid on the server (nothing holds back a walker there), one hidden from them still holds them back - and so do the areas. nil gives the player the map’s own switch again; a rejoin starts from the map’s.

SetPlayerMapLayer(pid, layer [, on])
Parameter Type
pid number the player
layer string a map layer
on boolean true shown, false hidden, nil the map’s own switch (optional)

boolean - false when the map has no such layer

-- the camp is off for everyone; the hero sees it
SetMapLayer("bandit_camp", false)
SetPlayerMapLayer(hero, "bandit_camp", true)

GetPlayerMapLayers · SetMapLayer · the The server’s map group of the index