IsElementOnFire: Difference between revisions
Jump to navigation
Jump to search
m (→Example) |
|||
Line 16: | Line 16: | ||
==Example== | ==Example== | ||
Creates a command that checks if the player is on fire or not. | |||
<section name="Server" class="server" show="true"> | |||
<syntaxhighlight lang="lua"> | |||
function checkPlayerFire(thePlayer) | |||
if isElementOnFire(thePlayer) then | |||
outputChatBox("So hot!", thePlayer, 255, 50, 0) | |||
else | |||
outputChatBox("You're cool. No flames detected.", thePlayer, 0, 255, 0) | |||
end | |||
end | |||
addCommandHandler("checkfire", checkPlayerFire) | |||
</syntaxhighlight> | |||
</section> | |||
==See Also== | ==See Also== | ||
{{Element functions}} | {{Element functions}} |
Latest revision as of 11:13, 30 June 2025
Syntax
bool isElementOnFire ( element theElement )
OOP Syntax Help! I don't understand this!
- Method: element:isOnFire(...)
- Variable: .onFire
- Counterpart: setElementOnFire
Required Arguments
- theElement: The element to check.
Returns
Returns true if the element is on fire, false otherwise.
Example
Creates a command that checks if the player is on fire or not.
Click to collapse [-]
Serverfunction checkPlayerFire(thePlayer) if isElementOnFire(thePlayer) then outputChatBox("So hot!", thePlayer, 255, 50, 0) else outputChatBox("You're cool. No flames detected.", thePlayer, 0, 255, 0) end end addCommandHandler("checkfire", checkPlayerFire)
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