ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Markers

Catalogue

Markers

All five marker types with in-game pictures: a cylinder to step into, a checkpoint, a ring, an arrow and a corona.

Your first marker

A marker is a coloured sign in the world. createMarker creates it: on the server every player sees it, in a client script only that player does. When a player enters the marker, the server fires onMarkerHit, and onMarkerLeave on exit.

local job = createMarker(2495.3, -1680.0, 12.6, "cylinder", 1.5, 255, 122, 34, 170)

addEventHandler("onMarkerHit", job, function(element, sameDimension)
    if getElementType(element) == "player" and sameDimension then
        outputChatBox("You started the courier job.", element, 255, 122, 34)
    end
end)

Types

Pass the type as the fourth argument of createMarker and change it with setMarkerType. The size (setMarkerSize) is the diameter in metres, setMarkerColor sets the colour and alpha.

TypeLooks likeTypical use
cylindercylinder on the groundentrances, jobs, shops
checkpointcolumn of lightrace tracks
ringglowing ringplane and boat tracks
arrowdownward arrow above a spotdoors, places to visit
coronaglowing ring above the spota sign seen from far away

Who is inside

isElementWithinMarker checks one element and getElementsWithinMarker returns every element in the marker. The server checks entering, so it also works for vehicles and peds, not only players.

setTimer(function()
    for _, player in ipairs(getElementsWithinMarker(job)) do
        if getElementType(player) == "player" then givePlayerMoney(player, 10) end
    end
end, 5000, 0)