- Documentation
- Shared functions
- createMarker
Function
createMarker
Creates a marker in the world: a coloured cylinder to step into (e.g. a job entrance), an arrow above a spot, a corona or a ring. When a player enters it, the server fires onMarkerHit with the player as the first argument, and onMarkerLeave on exit. Types: "cylinder", "checkpoint", "arrow", "corona" (a soft ball of light facing the camera), "ring". The size is the diameter in metres.
Syntax
marker createMarker(float x, float y, float z [, string markerType = "checkpoint", float size = 4, int r = 0, int g = 0, int b = 255, int a = 180])Arguments
xfloat- X position.
yfloat- Y position.
zfloat- Z position (for a cylinder - ground level).
markerTypestring, optional = "checkpoint"- Marker type (see above).
sizefloat, optional = 4- Diameter in metres.Not in MTA:SA
rint, optional = 0- Red 0-255, or a whole colour from
tocolor(then without g, b, a).Not in MTA:SA gint, optional = 0- Green 0-255.Not in MTA:SA
bint, optional = 255- Blue 0-255.Not in MTA:SA
aint, optional = 180- Alpha 0-255.Not in MTA:SA
Differences from MTA:SA
- Arguments in a different colour differ from MTA:SA.
In MTA:SA
createMarker(float x, float y, float z, string theType = "checkpoint")Returns
The new marker, or false.
Example
local job = createMarker(2495, -1670, 12.5, "cylinder", 1.5, 255, 200, 0, 150)
addEventHandler("onMarkerHit", job, function(hitElement, matchingDimension)
if getElementType(hitElement) == "player" and matchingDimension then
outputChatBox("Praca kuriera: wpisz /praca", hitElement)
end
end)
Notes
Cylinders and checkpoints use the same models as the game's story markers; a corona is a soft glow about size across, in the colour and alpha from the arguments, hidden behind buildings; a ring is drawn as the game's glow.
A tocolor colour. Instead of four numbers you can pass one colour: createMarker(x, y, z, "cylinder", 1, tocolor(255, 0, 0, 150)).