IsElementWaitingForGroundToLoad

From Multi Theft Auto: Wiki
Revision as of 20:50, 10 October 2014 by Ccw (talk | contribs)
Jump to navigation Jump to search

This function returns true if MTA has frozen the element because it is above map objects which are still loading.

[[{{{image}}}|link=|]] Note: When vehicles are frozen waiting for collisions to load they do not overwrite the frozen status set by setElementFrozen.

Syntax

bool isElementWaitingForGroundToLoad ( element theElement )

Required arguments

  • theElement: the element to check its frozen waiting for collisions to load status. It can be a vehicle, ped or player.

Returns

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

Example

Click to collapse [-]
Serverside example

The next code snippet outputs a message when a vehicle respawns far away from players.

function notifyFarRespawn()
    if isElementWaitingForGroundToLoad(source) then
        outputChatBox("* A " .. getVehicleName(source) .. " respawned far away! Find it quick!", root, 128, 255, 0)
    end
end
addEventHandler("onVehicleRespawn", root, notifyFarRespawn)

See also