IsElementInWater

From Multi Theft Auto: Wiki
Revision as of 17:37, 20 April 2009 by Robhol (talk | contribs) (Let there be light?)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function checks whether an element is submerged in water.

Syntax

Click to collapse [-]
Server and client
bool isElementInWater ( element theElement )

Required Arguments

  • theElement: The element to check.

Returns

Returns true if the passed element is in water, false if it isn't, or if the element is invalid.

Example

Creates a command that checks if the player is in water or not.


function waterCheck(player)
    if isElementInWater(player) then
        outputChatBox("Wet.", player)
    else
        outputChatBox("Dry.", player)
    end
end

addCommandHandler("check", waterCheck)

See Also