getGroundPosition | Multi Theft Auto: Wiki Skip to content

getGroundPosition

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function gets the Z level of the highest ground below a point.

Syntax

getGroundPosition ( )

Code Examples

client

This clientside function determines if a player is under a ceiling or not.

function isPlayerUnderCover ( thePlayer )
--we get the player's position
local px, py, pz = getElementPosition ( thePlayer )
--we'll check for ground level at the player's position, and also 500 units over him.
--if these ground levels match, it must mean there were no obstacles (such as a ceiling) over the player,
return getGroundPosition ( px, py, pz ) ~= getGroundPosition ( px, py, pz + 530 )
end

See Also

World Functions