IsPedDucked: Difference between revisions
Jump to navigation
Jump to search
(New page: __NOTOC__ {{Client function}} This function checks if the specified ped is ducked (crouched) or not. ==Syntax== <syntaxhighlight lang="lua">bool isPedDucked ( ped thePed )</syntaxhighlight> ===Required Argume...) |
mNo edit summary |
||
Line 13: | Line 13: | ||
==Example== | ==Example== | ||
<section class="client" name="Client" show="true"> | |||
This example checks if a random player is ducked or not, and if so displays a message in the chat box. | This example checks if a random player is ducked or not, and if so displays a message in the chat box. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
local players = getElementsByType ( "player" ) | local players = getElementsByType ( "player" ) | ||
local randomPlayer = players[math.random(#players)] | local randomPlayer = players[math.random(#players)] | ||
if | if isPedDucked ( randomPlayer ) then | ||
outputChatBox ( getPlayerName ( randomPlayer ) .. " is currently crouching." ) | outputChatBox ( getPlayerName ( randomPlayer ) .. " is currently crouching." ) | ||
end | end | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | |||
==See Also== | ==See Also== | ||
{{ | {{Ped functions}} |
Revision as of 20:19, 25 May 2008
This function checks if the specified ped is ducked (crouched) or not.
Syntax
bool isPedDucked ( ped thePed )
Required Arguments
- thePed: The ped to check.
Returns
Returns true if the ped is ducked, false otherwise.
Example
Click to collapse [-]
ClientThis example checks if a random player is ducked or not, and if so displays a message in the chat box.
local players = getElementsByType ( "player" ) local randomPlayer = players[math.random(#players)] if isPedDucked ( randomPlayer ) then outputChatBox ( getPlayerName ( randomPlayer ) .. " is currently crouching." ) end
See Also
- 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