MiscClient1 output

getGroundZExcludingObjectsFor3dCoord

GET_GROUND_Z_EXCLUDING_OBJECTS_FOR_3D_COORD0x9E82F0F362881B29

The GTA V native GET_GROUND_Z_EXCLUDING_OBJECTS_FOR_3D_COORD of the MISC namespace, as LS:MP client scripts call it: the global function getGroundZExcludingObjectsFor3dCoord, in JavaScript and in Lua.

SignatureJavaScript
getGroundZExcludingObjectsFor3dCoord(
  x: number,
  y: number,
  z: number,
  p4: boolean,
  p5: boolean
): [ok: boolean, groundZ: number]
SignatureLua
getGroundZExcludingObjectsFor3dCoord(
  x: number,
  y: number,
  z: number,
  p4: boolean,
  p5: boolean
): boolean, number

Usage

JavaScript
const [ok, groundZ] = getGroundZExcludingObjectsFor3dCoord(x, y, z, p4, p5);
Lua
local ok, groundZ = getGroundZExcludingObjectsFor3dCoord(x, y, z, p4, p5)

Three consecutive numbers can be given as one vector: { x, y, z } (or [x, y, z]) in JavaScript, a Vector3 in Lua.

JavaScript · with vectors
const [ok, groundZ] = getGroundZExcludingObjectsFor3dCoord(pos, p4, p5);
Lua · with vectors
local ok, groundZ = getGroundZExcludingObjectsFor3dCoord(pos, p4, p5)

Parameters

ParameterTypeJavaScriptLua
xfloatnumbernumber
yfloatnumbernumber
zfloatnumbernumber
p4BOOLbooleanboolean
p5BOOLbooleanboolean

Returns

2 values, in this order: an array in JavaScript, multiple return values in Lua.

#ValueTypeJavaScriptLuaDescription
1okBOOLbooleanbooleanThe native’s own return value.
2groundZfloatnumbernumberoutput

Reference

Namespace
Misc MISC
In the game
BOOL GET_GROUND_Z_EXCLUDING_OBJECTS_FOR_3D_COORD(float x, float y, float z, float* groundZ, BOOL p4, BOOL p5)
Hash
0x9E82F0F362881B29
Introduced
Game build 505 legacy numbering
Formerly
_GET_GROUND_Z_FOR_3D_COORD_2

Open in the interactive natives reference