getRoofPosition | Multi Theft Auto: Wiki Skip to content

getRoofPosition

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 lowest roof above a point. It is required that the point is near enough to the local player so that it's within the area where collision data is loaded.

Syntax

getRoofPosition ( )

Code Examples

client

This example starts to shake the player's camera if there is no roof over him:

setTimer (
function ()
local playerX, playerY, playerZ = getElementPosition (localPlayer)
local roofZ = getRoofPosition (playerX, playerY, playerZ)
setCameraShakeLevel ((roofZ) and 0 or 255 )
end, 100, 0
)

See Also

World Functions