IsElementWaitingForGroundToLoad: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (Improved a bit the page) |
||
Line 1: | Line 1: | ||
{{Server client function}} | {{Server client function}} | ||
__NOTOC__ | __NOTOC__ | ||
{{New feature/item|3.0140|1.4.0|6715|This function returns true if MTA has frozen the element because it is above map objects which are still loading.}} | {{New feature/item|3.0140|1.4.0|6715|This function returns ''true'' if MTA has frozen the element because it is above map objects which are still loading.}} | ||
{{Note|When vehicles are frozen waiting for collisions to load they '''do not''' overwrite the frozen status set by [[setElementFrozen]].}} | {{Note|When vehicles are frozen waiting for collisions to load they '''do not''' overwrite the frozen status set by [[setElementFrozen]].}} | ||
Line 10: | Line 10: | ||
===Required arguments=== | ===Required arguments=== | ||
* '''theElement:''' the element to check its frozen waiting for | * '''theElement:''' the element to check its frozen waiting for custom map objects to load status. It can be a [[vehicle]], [[ped]] or [[player]]. | ||
===Returns=== | ===Returns=== | ||
Returns ''true'' if the specified [[element]] is frozen waiting for collisions of | 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. | ||
==Example== | ==Example== | ||
<section name="Serverside example" class="server" show="true"> | <section name="Serverside example" class="server" show="true"> | ||
The next code snippet outputs a message when a vehicle respawns far away from players. | The next code snippet outputs a message when a vehicle respawns far away from players, above an [[object]]. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function | function notifyFarRespawnOnMap() | ||
if isElementWaitingForGroundToLoad(source) then | if isElementWaitingForGroundToLoad(source) then | ||
outputChatBox("* A " .. getVehicleName(source) .. " respawned far away! Find it quick!", root, 128, 255, 0) | outputChatBox("* A " .. getVehicleName(source) .. " respawned above an object which is far away! Find it quick!", root, 128, 255, 0) | ||
end | end | ||
end | end | ||
addEventHandler("onVehicleRespawn", root, | addEventHandler("onVehicleRespawn", root, notifyFarRespawnOnMap) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | </section> |
Revision as of 10:19, 11 October 2014
This function returns true if MTA has frozen the element because it is above map objects which are still loading.
Syntax
bool isElementWaitingForGroundToLoad ( element theElement )
Required arguments
- theElement: the element to check its frozen waiting for custom map objects to load status. It can be a vehicle, ped or player.
Returns
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.
Example
Click to collapse [-]
Serverside exampleThe next code snippet outputs a message when a vehicle respawns far away from players, above an object.
function notifyFarRespawnOnMap() if isElementWaitingForGroundToLoad(source) then outputChatBox("* A " .. getVehicleName(source) .. " respawned above an object which is far away! Find it quick!", root, 128, 255, 0) end end addEventHandler("onVehicleRespawn", root, notifyFarRespawnOnMap)
See also
- attachElements
- createElement
- destroyElement
- detachElements
- getAttachedElements
- getElementAlpha
- getElementAttachedOffsets
- getElementAttachedTo
- getElementByIndex
- getElementByID
- getElementChild
- getElementChildren
- getElementChildrenCount
- getElementCollisionsEnabled
- getElementColShape
- getElementData
- getAllElementData
- hasElementData
- getElementDimension
- getElementHealth
- getElementID
- getElementInterior
- getElementMatrix
- getElementModel
- getElementParent
- getElementPosition
- getElementRotation
- getElementsByType
- getElementsWithinColShape
- getElementsWithinRange
- getElementType
- getElementVelocity
- getLowLODElement
- getRootElement
- isElement
- isElementAttached
- isElementCallPropagationEnabled
- isElementDoubleSided
- isElementFrozen
- isElementInWater
- isElementLowLOD
- isElementWithinColShape
- isElementWithinMarker
- setElementAlpha
- setElementAngularVelocity
- getElementAngularVelocity
- setElementAttachedOffsets
- setElementCallPropagationEnabled
- setElementCollisionsEnabled
- setElementData
- setElementDimension
- setElementDoubleSided
- setElementFrozen
- setElementHealth
- setElementID
- setElementInterior
- setElementModel
- setElementParent
- setElementPosition
- setElementRotation
- setElementVelocity
- setLowLODElement
- getPedContactElement
- getResourceDynamicElementRoot
- getResourceRootElement