SetPedChoking: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
mNo edit summary |
||
Line 40: | Line 40: | ||
==See Also== | ==See Also== | ||
{{Ped functions}} | {{Ped functions}} | ||
[[ru:setPedChoking]] |
Revision as of 18:16, 8 July 2010
This function can be used to force the ped to do the choking animation (teargas etc...) until he respawns or toggled off using this function. The animation can not be cancelled by a player it's applied to, and he will not loose health.
Syntax
bool setPedChoking ( ped thePed, bool choking )
Required Arguments
- thePed: The ped whose choking status to toggle
- choking: true to make the ped choke, false to no longer force his choking animation
Returns
Returns true if successful, false otherwise (e.g. player handle is invalid)
Example
This script will make all players choke on resource start
-- Choke all the players when the resource starts function ResourceStart () setPedChoking ( root, true ) end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), ResourceStart, true ) -- Unchoke all the players when the resource stops function ResourceStop () setPedChoking ( root, false ) end addEventHandler ( "onResourceStop", getResourceRootElement ( getThisResource () ), ResourceStop, true ) -- Choke players spawning function PlayerSpawn () setPedChoking ( source, true ) end addEventHandler ( "onPlayerSpawn", root, PlayerSpawn )
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