DrawLine
DocsDrawLine(x1, y1, z1, x2, y2, z2, red, green, blue, alpha)Description
Introduced in build 323
This native draws a line between two vectors in the game world. It is typically used for visualizing paths or connections between points. The color of the line is specified by the red, green, and blue parameters, with alpha determining its opacity. This native should be called every frame for continuous rendering.
Parameters
| Name | Type | Description |
|---|---|---|
x1 | float | The x-coordinate of the starting point of the line. |
y1 | float | The y-coordinate of the starting point of the line. |
z1 | float | The z-coordinate of the starting point of the line. |
x2 | float | The x-coordinate of the ending point of the line. |
y2 | float | The y-coordinate of the ending point of the line. |
z2 | float | The z-coordinate of the ending point of the line. |
red | int | The red color component of the line (0 - 255). |
green | int | The green color component of the line (0 - 255). |
blue | int | The blue color component of the line (0 - 255). |
alpha | int | The alpha value of the line (0 - 255). |
Quick Snippet: Get Coordinatesx1y1z1x2
x1y1z1x2Add 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.