_DRAW_SPHERE
DocsDrawSphere(x, y, z, radius, r, g, b, opacity)Description
Draws a 3D sphere, typically seen in the GTA:O freemode event "Penned In".
Example image:
DrawSphere(35.45, 172.66, 126.22, 1.0, 0, 0, 255, 0.2)Parameters
| Name | Type | Description |
|---|---|---|
x | float | X coordinate of the sphere |
y | float | Y coordinate of the sphere |
z | float | Z coordinate of the sphere |
radius | float | Size of the sphere, `1.0` = 1 meter |
r | int | Color red `0`-`255` |
g | int | Color green `0`-`255` |
b | int | Color blue `0`-`255` |
opacity | float | Opacity from `0.0`-`1.0` |
Quick Snippet: Get Coordinatesxyz
xyzAdd 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.