IsPedInWater
From Multi Theft Auto: Wiki
This function is deprecated. This means that its use is discouraged and that it might not exist in future versions. | |
Please use isElementInWater instead. |
Checks whether or not a ped is currently in water.
Syntax
bool isPedInWater ( ped thePed )
Required Arguments
- thePed: the ped you want to check
Returns
Returns true if the ped is in water, false if he is not or an invalid element was passed.
Example
Click to collapse [-]
ClientThis example shows all players that are in water in a list to the player who enters the 'playersInWater' command.
function showPlayersInWater ( sourcePlayer, command ) local players = getElementsByType ( "player" ) local list = "" for k,v in ipairs ( players ) do if isPedInWater ( v ) then list = list .. " " .. getPlayerName ( v ) end end outputChatBox("Players pretending to be trouts: " .. list, sourcePlayer) end addCommandHandler("playersInWater", showPlayersInWater)
See Also
- addPedClothes
- createPed
- getPedAmmoInClip
- getPedArmor
- getPedClothes
- getPedContactElement
- getPedFightingStyle
- getPedGravity
- getPedOccupiedVehicle
- getPedOccupiedVehicleSeat
- getPedStat
- getPedTarget
- getPedTotalAmmo
- getPedWalkingStyle
- getPedWeapon
- getPedWeaponSlot
- getValidPedModels
- isPedChoking
- isPedDead
- isPedDoingGangDriveby
- isPedDucked
- isPedHeadless
- isPedInVehicle
- isPedOnFire
- isPedOnGround
- isPedWearingJetpack
- killPed
- reloadPedWeapon
- removePedClothes
- removePedFromVehicle
- setPedAnimation
- setPedAnimationProgress
- setPedAnimationSpeed
- setPedArmor
- setPedChoking
- setPedDoingGangDriveby
- setPedFightingStyle
- setPedGravity
- setPedHeadless
- setPedOnFire
- setPedStat
- setPedWalkingStyle
- setPedWeaponSlot