Gameplay::getGroundZFor3dCoord

From RAGE Multiplayer Wiki
Revision as of 21:36, 24 June 2019 by MrPancakers (talk | contribs) (Removed example, incomplete and wrong language)

Returns the first surface beneath the specified elevation (at the given location).
This can be a roof, an elevated road, or the ground.
(If no surface can be found beneath, then the returned boolean will be false, and the float will contain 0.)
For water positions the sea floor will be returned (negative value).

For the function to work reliably, the position tested should have been streamed already (i.e. close to the player); otherwise it might return 0.

Syntax

mp.game.gameplay.getGroundZFor3dCoord(x, y, z, groundZ, unk);

Required Arguments

  • x: float - X-coordinate of location to test
  • y: float - Y-coordinate of location to test
  • z: float - Z-coordinate, beneath which to test
  • unk: boolean - unknown (normally 0)

Return value

  • found: Boolean - true if surface is found, false if not
  • groundZ: float - Elevation of surface found

Example

// todo

See also

Template:Gameplay s function c