The Lab
MISC native

_GET_GROUND_Z_AND_MATERIAL_FOR_3D_COORD

returns BOOL7 paramsbuild 1207

Finds the ground below (x, y, z) and writes its height to outGroundZ and the surface material hash to outMaterialHash. Returns true if ground was found.

Signature

C
BOOL _GET_GROUND_Z_AND_MATERIAL_FOR_3D_COORD(float x, float y, float z, int flags, float* outGroundZ, Hash* outMaterialHash, int* outFlags); // 0xBBE5B63EFFB08E68 b1207

Parameters

#NameType
1xfloat
2yfloat
3zfloat
4flagsint
5outGroundZfloat* (out pointer)
6outMaterialHashHash* (out pointer)
7outFlagsint* (out pointer)

Facts

Facts about _GET_GROUND_Z_AND_MATERIAL_FOR_3D_COORD
Name
_GET_GROUND_Z_AND_MATERIAL_FOR_3D_COORD
Hash
0xBBE5B63EFFB08E68
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, outGroundZ, outMaterialHash, outFlags = Citizen.InvokeNative(0xBBE5B63EFFB08E68, -- _GET_GROUND_Z_AND_MATERIAL_FOR_3D_COORD
  0.0, -- float x
  0.0, -- float y
  0.0, -- float z
  0, -- int flags
  Citizen.PointerValueFloat(), -- float* outGroundZ
  Citizen.PointerValueInt(), -- Hash* outMaterialHash
  Citizen.PointerValueInt(), -- int* outFlags
  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, outGroundZ, outMaterialHash, outFlags] = Citizen.invokeNative("0xBBE5B63EFFB08E68", // _GET_GROUND_Z_AND_MATERIAL_FOR_3D_COORD
  0.0, // float x
  0.0, // float y
  0.0, // float z
  0, // int flags
  Citizen.pointerValueFloat(), // float* outGroundZ
  Citizen.pointerValueInt(), // Hash* outMaterialHash
  Citizen.pointerValueInt(), // int* outFlags
  Citizen.returnResultAnyway()
);
if (result) {
  // ...
}
C#
var outGroundZArg = new OutputArgument();
var outMaterialHashArg = new OutputArgument();
var outFlagsArg = new OutputArgument();
bool result = Function.Call<bool>((Hash)0xBBE5B63EFFB08E68, // _GET_GROUND_Z_AND_MATERIAL_FOR_3D_COORD
  0.0f, // float x
  0.0f, // float y
  0.0f, // float z
  0, // int flags
  outGroundZArg, // float* outGroundZ
  outMaterialHashArg, // Hash* outMaterialHash
  outFlagsArg // int* outFlags
);
float outGroundZ = outGroundZArg.GetResult<float>();
int outMaterialHash = outMaterialHashArg.GetResult<int>();
int outFlags = outFlagsArg.GetResult<int>();
All MISC natives

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