DrawMarker
DocsDrawMarker(type, posX, posY, posZ, dirX, dirY, dirZ, rotX, rotY, rotZ, scaleX, scaleY, scaleZ, red, green, blue, alpha, bobUpAndDown, faceCamera, p19, rotate, textureDict, textureName, drawOnEnts)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
| Name | Type | Description |
|---|---|---|
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. |
p19 | int | Typically set to `2`. Does not seem to matter directly. |
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 in `textureDict` to draw the marker with, or NULL. Example: 'PuttingMarker' |
drawOnEnts | BOOL | Whether or not the marker should draw on intersecting entities. |
Quick Snippet: Get CoordinatesposXposYposZdirX
posXposYposZdirXAdd this command to your client script to retrieve precise locations in-game.
-- Add this to your client.lua. Type /pos in-game to copy coords.
RegisterCommand('pos', function()
local ped = PlayerPedId()
local coords = GetEntityCoords(ped)
local heading = GetEntityHeading(ped)
local output = string.format("vector4(%.2f, %.2f, %.2f, %.2f)", coords.x, coords.y, coords.z, heading)
print(output)
TriggerEvent('chat:addMessage', { args = { '^4[COORD]^0', output } })
end)Returns
voidThis native does not return a value.
Examples
Official
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)