Skip to main content

Gameplay::getGroundZFor3DCoord2

Not available on SYNC MP yet

This member is part of the RAGE:MP API but SYNC MP does not implement it yet (Client-side JavaScript). Calling it does nothing or throws.

Client-side function

JavaScript​

Similar to Gameplay::getGroundZFor3dCoord but excludes objects that are on the floor.

Required Params​

  • x: float
  • y: float
  • z: float
  • waterAsGround: boolean
  • ignoreWaterLevelCheck: boolean

Return value​

  • float

Syntax​

mp.game.gameplay.getGroundZFor3DCoord2(x, y, z, waterAsGround, ignoreWaterLevelCheck);

Example​

const {x, y, z} = mp.players.local.position;
const groundZ = mp.game.gameplay.getGroundZFor3DCoord2(x, y, z, false, false);
mp.console.logInfo(`groundZ is ${groundZ}`);