Entity::getHeightAboveGround

From RAGE Multiplayer Wiki
Revision as of 10:55, 2 November 2024 by Shr0x (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Client-Side
Function

 JavaScript



JavaScript Syntax


The `getHeightAboveGround` function returns the entity’s height above the ground level in meters, making it straightforward to interpret the result as a metric measurement. This function can be useful for determining altitude in various gameplay scenarios, such as checking if a player or vehicle is flying above a certain threshold.

Required Params

  • None

Return Value

  • float – Height in meters above ground level.

Syntax

entity.getHeightAboveGround();

Example

// Example usage of getHeightAboveGround

let heightAboveGround = mp.players.local.getHeightAboveGround();
mp.gui.chat.push("Height above ground: " + heightAboveGround.toFixed(2) + " meters");

See Also