IsElementOnFire

From Multi Theft Auto: Wiki
Jump to navigation Jump to search

ADDED/UPDATED IN VERSION 1.6.0 r22864:
This function checks if the specified element is on fire or not.

Syntax

bool isElementOnFire ( element theElement )

OOP Syntax Help! I don't understand this!

Method: element:isOnFire(...)
Variable: .onFire
Counterpart: setElementOnFire


Required Arguments

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 [-]
Server
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)

See Also