DrawRect
DocsDrawRect(x, y, width, height, r, g, b, a)Description
Draws a rectangle on the screen.
-x: The relative X point of the center of the rectangle. (0.0-1.0, 0.0 is the left edge of the screen, 1.0 is the right edge of the screen)
-y: The relative Y point of the center of the rectangle. (0.0-1.0, 0.0 is the top edge of the screen, 1.0 is the bottom edge of the screen)
-width: The relative width of the rectangle. (0.0-1.0, 1.0 means the whole screen width)
-height: The relative height of the rectangle. (0.0-1.0, 1.0 means the whole screen height)
-R: Red part of the color. (0-255)
-G: Green part of the color. (0-255)
-B: Blue part of the color. (0-255)
-A: Alpha part of the color. (0-255, 0 means totally transparent, 255 means totally opaque)
The total number of rectangles to be drawn in one frame is apparently limited to 399.
NativeDB Added Parameter 9: BOOL p8
Parameters
| Name | Type | Description |
|---|---|---|
x | float | — |
y | float | — |
width | float | — |
height | float | — |
r | int | — |
g | int | — |
b | int | — |
a | int | — |
Quick Snippet: Get Coordinatesxy
xyAdd 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.