| Property | Value |
|---|---|
| Native Name | DRAW_MARKER |
| Hash | 0x28477EC23D892089 |
| Return Type | void |
| Parameters | type (int), posX (float), posY (float), posZ (float), dirX (float), dirY (float), dirZ (float), rotX (float), rotY (float), rotZ (float), scaleX (float), scaleY (float), scaleZ (float), red (int), green (int), blue (int), alpha (int), bobUpAndDown (BOOL), faceCamera (BOOL), rotationOrder (int), rotate (BOOL), textureDict (char*), textureName (char*), drawOnEnts (BOOL) |
Description: Draws a marker with the specified appearance at the target location. This has to be called every frame, e.g. in a Wait(0) loop.
There's a list of markers on the FiveM documentation site.
Parameters
type(int) — The marker type to draw.posX(float) — The X coordinate to draw the marker at.posY(float) — The Y coordinate to draw the marker at.posZ(float) — The Z coordinate to draw the marker at.dirX(float) — The X component of the direction vector for the marker, or 0.0 to use rotX/Y/Z.dirY(float) — The Y component of the direction vector for the marker, or 0.0 to use rotX/Y/Z.dirZ(float) — The Z component of the direction vector for the marker, or 0.0 to use rotX/Y/Z.rotX(float) — The X rotation for the marker. Only used if the direction vector is 0.0.rotY(float) — The Y rotation for the marker. Only used if the direction vector is 0.0.rotZ(float) — The Z rotation for the marker. Only used if the direction vector is 0.0.scaleX(float) — The scale for the marker on the X axis.scaleY(float) — The scale for the marker on the Y axis.scaleZ(float) — The scale for the marker on the Z axis.red(int) — The red component of the marker color, on a scale from 0-255.green(int) — The green component of the marker color, on a scale from 0-255.blue(int) — The blue component of the marker color, on a scale from 0-255.alpha(int) — The alpha component of the marker color, on a scale from 0-255.bobUpAndDown(BOOL) — Whether or not the marker should slowly animate up/down.faceCamera(BOOL) — Whether the marker should be a 'billboard', as in, should constantly face the camera.rotationOrder(int) — The order yaw, pitch and roll is applied. Usually2.rotate(BOOL) — Rotations only apply to the heading.textureDict(char*) — A texture dictionary to draw the marker with, or NULL. Example: 'GolfPutting'textureName(char*) — A texture name intextureDictto draw the marker with, or NULL. Example: 'PuttingMarker'drawOnEnts(BOOL) — Whether or not the marker should draw on intersecting entities.
Examples
CreateThread(function()
while true do
-- draw every frame
Wait(0)
local pedCoords = GetEntityCoords(PlayerPedId())
DrawMarker(2, pedCoords.x, pedCoords.y, pedCoords.z + 2, 0.0, 0.0, 0.0, 0.0, 180.0, 0.0, 2.0, 2.0, 2.0, 255, 128, 0, 50, false, true, 2, nil, nil, false)
end
end)