Skip to content

RevealPlayerMap

Shows one player the whole world map, without the fog of war.

For a server that keeps the game’s fog of war over the parts of the map a player has not walked (map_fog = true under [ui] in server.toml) and lifts it for someone - a map bought, a quest done. Without the fog (the default) every player’s map shows everything from the start and this changes nothing. It works one way: a revealed map cannot be clouded again, and a player who comes back in a new game has the fog again, so call it again (from OnPlayerSpawn, say). A player still loading gets the whole map as soon as they are in the world.

RevealPlayerMap(pid)
Parameter Type
pid number the player

boolean - false when there is no such player

-- a map from the cartographer for 20 Groschen
if cmd == "/buymap" and GetPlayerMoney(pid) >= 20 then
GivePlayerMoney(pid, -20)
RevealPlayerMap(pid)
SendClientMessage(pid, COLOR_WHITE, "The map shows the whole land now.")
return true
end

OnPlayerSpawn · CreateMarker · the Compass markers group of the index