GetEntityHeightAboveGround
Docslocal retval = GetEntityHeightAboveGround(entity)Description
Return height (z-dimension) above ground.
Example: The pilot in a titan plane is 1.844176 above ground.
How can i convert it to meters?
Everything seems to be in meters, probably this too.
Parameters
| Name | Type | Description |
|---|---|---|
entity | Entity | — |
Quick Snippet: Get Entityentity
entityUse this to obtain an entity handle from the player's aim or crosshair.
-- Get the entity the player is aiming at
local ped = PlayerPedId()
local hit, entity = GetEntityPlayerIsFreeAimingAt(PlayerId())
if hit and entity ~= 0 then
print("Entity: " .. entity)
print("Model: " .. GetEntityModel(entity))
print("Type: " .. GetEntityType(entity)) -- 1=Ped, 2=Vehicle, 3=Object
endReturns
floatReturns a floating-point number.