GET_GROUND_Z_FOR_3D_COORD
Hash
0x24FA4267BB8D2431Runtime name
GetGroundZFor_3dCoordNamespaceMISC
SideClient
NameOfficial
Docs
Since build1207
GTA V hash
0xC906A7DAB05C8D2BSignature
BOOL GET_GROUND_Z_FOR_3D_COORD(float x, float y, float z, float* groundZ, BOOL p4);Parameters
| Name | Type | Description |
|---|---|---|
x | float | — |
y | float | — |
z | float | — |
groundZ | float* | — |
p4 | BOOL | — |
Returns BOOL
Usage
local retval, groundZ = GetGroundZFor_3dCoord(x, y, z, p4)
-- always works, by hash
local retval, groundZ = Citizen.InvokeNative(0x24FA4267BB8D2431, x, y, z, Citizen.PointerValueFloat(), p4, Citizen.ReturnResultAnyway())JavaScript and C#
const [retval, groundZ] = GetGroundZFor_3dCoord(x, y, z, p4);
// by hash
const [retval, groundZ] = Citizen.invokeNative('0x24FA4267BB8D2431', x + 0.0000001, y + 0.0000001, z + 0.0000001, Citizen.pointerValueFloat(), p4, Citizen.returnResultAnyway());var groundZ = new OutputArgument();
bool retval = Function.Call<bool>((Hash)0x24FA4267BB8D2431, x, y, z, groundZ, p4);
// groundZ.GetResult<float>()- Float parameters: Lua integers (
10, or whole numbers decoded from NUI/JSON) are sent as ints and read as garbage. Write10.0orvalue + 0.0. The generated JS wrappers add0.0000001to non-zero floats for the same reason. - Pointer (out) arguments are not passed in Lua/JS: their values are returned after the result, in order.
Sources
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.