GET_GROUND_Z_FOR_3D_COORD
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
BOOL GET_GROUND_Z_FOR_3D_COORD(float x, float y, float z, float* groundZ, BOOL p4); // 0x24FA4267BB8D2431 b1207Parameters
| # | Name | Type |
|---|---|---|
| 1 | x | float |
| 2 | y | float |
| 3 | z | float |
| 4 | groundZ | float* (out pointer) |
| 5 | p4 | BOOL |
Facts
| 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.
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// 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) {
// ...
}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>();Related MISC natives
- GET_GROUND_Z_AND_NORMAL_FOR_3D_COORD
- _GET_GROUND_Z_AND_MATERIAL_FOR_3D_COORD
- GET_GAME_TIMER
- GET_ANGLE_BETWEEN_2D_VECTORS
- GET_BENCHMARK_ITERATIONS
- GET_BENCHMARK_PASS
- GET_BITS_IN_RANGE
- GET_CLOSEST_POINT_ON_LINE
- GET_COORDS_OF_PROJECTILE_TYPE_WITHIN_DISTANCE
- GET_CURR_WEATHER_STATE
- GET_DISTANCE_BETWEEN_COORDS
- GET_FRAME_COUNT
Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.