isElementInWater
Client
Tells whether a ped, player or vehicle is in the water.
bool isElementInWater(element element)
Parameters
| Name | Type | Description |
|---|---|---|
| element | element | The ped, player or vehicle. |
Returns
true if it is in the water, false if not or if the element is not a ped, player or vehicle.
A ped inside a vehicle is in the water when its vehicle is.
Example
addEventHandler("onClientRender", root, function()
if isElementInWater(localPlayer) then
dxDrawText("You are in the water", 20, 20)
end
end)