IsPedInWater: Difference between revisions
Jump to navigation
Jump to search
(New page: __NOTOC__ {{Client function}} Checks whether or not a ped is currently in water. ==Syntax== <syntaxhighlight lang="lua"> bool isPedInWater ( ped thePed ) </syntaxhighlight> ===Required Arguments=== *'''thePed:''' ...) |
mNo edit summary |
||
Line 22: | Line 22: | ||
local list = "" | local list = "" | ||
for k,v in ipairs(players) do | for k,v in ipairs(players) do | ||
if | if isPedInWater(v) then | ||
list = list .. " " .. getPlayerName(v) | list = list .. " " .. getPlayerName(v) | ||
end | end |
Revision as of 17:21, 30 March 2008
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
This 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
- canPedBeKnockedOffBike
- getPedAnalogControlState
- getPedAnimation
- getPedBonePosition
- getPedCameraRotation
- getPedControlState
- getPedMoveState
- getPedOxygenLevel
- getPedSimplestTask
- getPedTargetCollision
- getPedTargetEnd
- getPedTargetStart
- getPedTask
- getPedVoice
- getPedWeaponMuzzlePosition
- givePedWeapon
- isPedBleeding
- isPedDoingTask
- isPedReloadingWeapon
- isPedTargetingMarkerEnabled
- setAnalogControlState
- setPedAimTarget
- setPedAnalogControlState
- setPedBleeding
- setPedCameraRotation
- setPedCanBeKnockedOffBike
- setPedControlState
- setPedEnterVehicle
- setPedExitVehicle
- IsPedFootBloodEnabled
- setPedFootBloodEnabled
- setPedLookAt
- setPedOxygenLevel
- setPedTargetingMarkerEnabled
- setPedVoice
- Shared
- addPedClothes
- getPedClothes
- removePedClothes
- createPed
- getPedAmmoInClip
- getPedArmor
- getPedFightingStyle
- getPedOccupiedVehicle
- getPedOccupiedVehicleSeat
- getPedStat
- getPedTarget
- getPedTotalAmmo
- getPedWalkingStyle
- getPedWeapon
- getPedWeaponSlot
- getPedContactElement
- getValidPedModels
- isPedChoking
- isPedDead
- isPedDoingGangDriveby
- isPedDucked
- isPedHeadless
- isPedInVehicle
- isPedOnFire
- isPedOnGround
- isPedWearingJetpack
- killPed
- removePedFromVehicle
- setPedAnimation
- setPedAnimationProgress
- setPedAnimationSpeed
- setPedArmor
- setPedDoingGangDriveby
- setPedFightingStyle
- setPedHeadless
- setPedOnFire
- setPedStat
- setPedWalkingStyle
- setPedWeaponSlot
- warpPedIntoVehicle