isElementInWater | Multi Theft Auto: Wiki Skip to content

isElementInWater

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function checks whether an element is submerged in water.

OOP Syntax Help! I don't understand this!

  • Method:element:isInWater(...)
  • Variable: .inWater

Syntax

bool isElementInWater ( element theElement )
Required Arguments
  • theElement: The element to check.

Returns

  • bool: value

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

Code Examples

shared
function waterCheck(thePlayer)
if isElementInWater(thePlayer) then
outputChatBox("Wet.", thePlayer)
else
outputChatBox("Dry.", thePlayer)
end
end
addCommandHandler("check", waterCheck)

See Also

Element Functions