isElementWaitingForGroundToLoad | Multi Theft Auto: Wiki Skip to content

isElementWaitingForGroundToLoad

Client-side
Server-side
Shared

This function checks whether MTA has frozen an element because it is above map objects which are still loading or not. This can be a player, ped or vehicle.

Note

When vehicles are frozen waiting for collisions to load they do not overwrite the frozen status set by setElementFrozen.

OOP Syntax Help! I don't understand this!

  • Method:element:isWaitingForGroundToLoad(...)
  • Variable: .waitingForGroundToLoad

Syntax

bool isElementWaitingForGroundToLoad ( ​element theElement )
Required Arguments
  • theElement: The element to check its frozen waiting for custom map objects to load status.

Returns

  • bool: result

Returns true if the specified element is frozen waiting for collisions of custom map objects to load. Returns false if it's not or if the specified element is invalid.

Code Examples

client

The next code snippet outputs a message when a vehicle respawns far away from players, above an object.

local function notifyFarRespawnOnMap()
if isElementWaitingForGroundToLoad(source) then
outputChatBox("* A " .. getVehicleName(source) .. " respawned above an object which is far away! Find it quick!", 128, 255, 0)
end
end
addEventHandler("onClientVehicleRespawn", root, notifyFarRespawnOnMap)

See Also

Element Functions