TerraingridSetParams
DocsTerraingridSetParams(x, y, z, p3, rotation, p5, width, height, p8, scale, glowIntensity, normalHeight, heightDiff)Description
This native is used along with these two natives: <code>TERRAINGRID_ACTIVATE</code> and <code>TERRAINGRID_SET_COLOURS</code>.
This native configures the location, size, rotation, normal height, and the difference ratio between min, normal and max.
All those natives combined they will output something like this: https://i.imgur.com/TC6cku6.png
Parameters
| Name | Type | Description |
|---|---|---|
x | float | Grid center x coord. |
y | float | Grid center y coord. |
z | float | Grid center z coord. |
p3 | float | Not sure, but seems to be the amount of lines top/bottom there are in the grid. -1.0 works best. |
rotation | float | Grid rotation (keep between 0.0 and 1.0). |
p5 | float | Offset top/bottom (? not sure about this one, seems weird). |
width | float | Grid width (usually 15.0). |
height | float | Grid height (usually 15.0). |
p8 | float | Not sure, but seems to be the amount of lines left/right there are in the grid. -1.0 works best. |
scale | float | Zoom / scale (higher values = smaller (more) squares) (lower values = bigger (less) squares). |
glowIntensity | float | glow intensity / opacity (40.0 is fine for daylight, 15.0 is fine for night time). |
normalHeight | float | The z coord for 'normal' height (white grid lines level). |
heightDiff | float | This is the height difference/margin used for line color changes. 0.2 works fine (normalHeight + 0.2 = yellow, normalHeight - 0.2 = red). |
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.
Examples
Official
N_0xa356990e161c9e65(true); // toggle on/off
// this native configures the location, size, rotation, normal height, and the difference ratio between min, normal and max.
N_0x1c4fc5752bcd8e48(-1114.121f, 220.789f, 63.78f, -1f, 0.85f, 0f, 15f, 15f, -1f, 20f, 40f, 63.78f, 0.2f);
// This native defines the colors (and alpha/opacity levels) for min, normal and max heights.
// (in this case: red for lower, white for normal, yellow for higher)
N_0x5ce62918f8d703c7(255, 0, 0, 64, 255, 255, 255, 5, 255, 255, 0, 64);