Skip to content

GetMapMarkers

The map’s markers of a tag.

GetMapMarkers([tag])
Parameter Type
tag string the tag (nil or "" = every marker) (optional)

table - a list of GetMapObject’s tables, by id (params is the tag, yaw the way it faces)

-- a newcomer spawns at one of the markers the admins placed
function OnPlayerSpawn(pid)
local spots = GetMapMarkers("spawn")
if #spots > 0 then
local s = spots[math.random(#spots)]
SetPlayerPos(pid, s.x, s.y, s.z)
end
end

CreateMapMarker · GetMapObject · the The server’s map group of the index