The Lab
MISC native

GET_GROUND_Z_AND_NORMAL_FOR_3D_COORD

returns BOOL5 paramsbuild 1207

Finds the ground below (x, y, z), writing its height to groundZ and the surface normal to normal. Returns true if ground was found.

Signature

C
BOOL GET_GROUND_Z_AND_NORMAL_FOR_3D_COORD(float x, float y, float z, float* groundZ, Vector3* normal); // 0x2A29CA9A6319E6AB b1207

Parameters

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

Facts

Facts about GET_GROUND_Z_AND_NORMAL_FOR_3D_COORD
Name
GET_GROUND_Z_AND_NORMAL_FOR_3D_COORD
Hash
0x2A29CA9A6319E6AB
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, normal = Citizen.InvokeNative(0x2A29CA9A6319E6AB, -- GET_GROUND_Z_AND_NORMAL_FOR_3D_COORD
  0.0, -- float x
  0.0, -- float y
  0.0, -- float z
  Citizen.PointerValueFloat(), -- float* groundZ
  Citizen.PointerValueVector(), -- Vector3* normal
  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, normal] = Citizen.invokeNative("0x2A29CA9A6319E6AB", // GET_GROUND_Z_AND_NORMAL_FOR_3D_COORD
  0.0, // float x
  0.0, // float y
  0.0, // float z
  Citizen.pointerValueFloat(), // float* groundZ
  Citizen.pointerValueVector(), // Vector3* normal
  Citizen.returnResultAnyway()
);
if (result) {
  // ...
}
C#
var groundZArg = new OutputArgument();
var normalArg = new OutputArgument();
bool result = Function.Call<bool>((Hash)0x2A29CA9A6319E6AB, // GET_GROUND_Z_AND_NORMAL_FOR_3D_COORD
  0.0f, // float x
  0.0f, // float y
  0.0f, // float z
  groundZArg, // float* groundZ
  normalArg // Vector3* normal
);
float groundZ = groundZArg.GetResult<float>();
Vector3 normal = normalArg.GetResult<Vector3>();
All MISC natives

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