GetWaterHeight
Docslocal retval, height = GetWaterHeight(x, y, z)Description
Retrieves the depth of the water beneath the specified position, accounting for the waves.
Note: The result might vary depending on the specific frame when this command is executed due to wave fluctuations.
Parameters
| Name | Type | Description |
|---|---|---|
x | float | The coordinate at which to test at for water. |
y | float | The coordinate at which to test at for water. |
z | float | The coordinate at which to test at for water. |
height | float* | The height at which to test at for water. |
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
BOOLReturns TRUE (1) or FALSE (0).