| Property | Value |
|---|---|
| Native Name | GET_GROUND_Z_FOR_3D_COORD |
| Hash | 0xC906A7DAB05C8D2B |
| Return Type | BOOL |
| Parameters | x (float), y (float), z (float), groundZ (float*), includeWater (BOOL) |
Description: This native gets the ground level (ground elevation) and returns the Z coordinate that represents it. Note: This native can only calculate the elevation when the coordinates are within the render distance of the client.
NativeDB Added Parameter 6: BOOL p5
Parameters
x(float) — Position on the X-axis to get ground elevation.y(float) — Position on the Y-axis to get ground elevation.z(float) — Position on the Z-axis to get ground elevation.groundZ(float*) — The Z coordinate for the ground.includeWater(BOOL) — Determines if the top water level at the specified position should be considered the ground elevation. (It would only matter if the specified position is located above or under the water)
Examples
local ped = PlayerPedId()
local pedCoords = GetEntityCoords(ped)
local retval, groundZ = GetGroundZFor_3dCoord(pedCoords.x, pedCoords.y, pedCoords.z, true)
if retval then
-- Do stuff with groundZ
end