The Lab
MISC native

GET_GROUND_Z_FOR_3D_COORD

returns BOOL5 paramsbuild 1207

Finds the ground height below (x, y, z) and writes it to groundZ. Returns true if ground was found.

The area must be loaded; collision far from the player may not be present.

Signature

C
BOOL GET_GROUND_Z_FOR_3D_COORD(float x, float y, float z, float* groundZ, BOOL p4); // 0x24FA4267BB8D2431 b1207

Parameters

#NameType
1xfloat
2yfloat
3zfloat
4groundZfloat* (out pointer)
5p4BOOL

Facts

Facts about GET_GROUND_Z_FOR_3D_COORD
Name
GET_GROUND_Z_FOR_3D_COORD
Hash
0x24FA4267BB8D2431
Namespace
Returns
BOOL
Game build
1207

Examples

Calls by hash work in every RedM runtime. Replace the placeholder arguments with your own values.

Lua
local result, groundZ = Citizen.InvokeNative(0x24FA4267BB8D2431, -- GET_GROUND_Z_FOR_3D_COORD
  0.0, -- float x
  0.0, -- float y
  0.0, -- float z
  Citizen.PointerValueFloat(), -- float* groundZ
  false, -- BOOL p4
  Citizen.ReturnResultAnyway()
)
if result then
  -- ...
end
JavaScript
// Whole JS numbers are sent as integers: pass floats like 1.5 (or n + 0.0000001), never 1.
const [result, groundZ] = Citizen.invokeNative("0x24FA4267BB8D2431", // GET_GROUND_Z_FOR_3D_COORD
  0.0, // float x
  0.0, // float y
  0.0, // float z
  Citizen.pointerValueFloat(), // float* groundZ
  false, // BOOL p4
  Citizen.returnResultAnyway()
);
if (result) {
  // ...
}
C#
var groundZArg = new OutputArgument();
bool result = Function.Call<bool>((Hash)0x24FA4267BB8D2431, // GET_GROUND_Z_FOR_3D_COORD
  0.0f, // float x
  0.0f, // float y
  0.0f, // float z
  groundZArg, // float* groundZ
  false // BOOL p4
);
float groundZ = groundZArg.GetResult<float>();
All MISC natives

Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.