OnClientPlayerChoke: Difference between revisions
Jump to navigation
Jump to search
(New page: {{Client event}} __NOTOC__ This event is fired when a player chokes due to the effect of a weapon such as tear gas grenades, fire extinguishers and spray cans. ==Parameters== <syntaxhighlight lang="lua">...) |
No edit summary |
||
Line 4: | Line 4: | ||
==Parameters== | ==Parameters== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
int weaponID | int weaponID, ped responsiblePed | ||
</syntaxhighlight> | </syntaxhighlight> | ||
*'''weapon:''' an [[int]] representing the ID of the weapon which caused the choking. | *'''weapon:''' an [[int]] representing the ID of the weapon which caused the choking. | ||
*'''responsiblePed:''' the ped responsible for causing the choking, possiblly nil. | |||
==Source== | ==Source== | ||
Line 18: | Line 19: | ||
This example disables choking effects from the tear gas grenades. | This example disables choking effects from the tear gas grenades. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function cancelTearGasChoking(weaponID) | function cancelTearGasChoking(weaponID, responsiblePed) | ||
if (weaponID==17) then | if (weaponID==17) then | ||
cancelEvent() | cancelEvent() |
Revision as of 15:47, 8 June 2009
This event is fired when a player chokes due to the effect of a weapon such as tear gas grenades, fire extinguishers and spray cans.
Parameters
int weaponID, ped responsiblePed
- weapon: an int representing the ID of the weapon which caused the choking.
- responsiblePed: the ped responsible for causing the choking, possiblly nil.
Source
The source of this event is the player who is choking.
Cancel effect
If this event is canceled, the player will not be choked.
Example
Click to collapse [-]
ClientThis example disables choking effects from the tear gas grenades.
function cancelTearGasChoking(weaponID, responsiblePed) if (weaponID==17) then cancelEvent() end end addEventHandler("onClientPlayerChoke", getLocalPlayer(), cancelTearGasChoking)
See Also
Client player events
- onClientPlayerChangeNick
- onClientPlayerChoke
- onClientPlayerDamage
- onClientPlayerHeliKilled
- onClientPlayerHitByWaterCannon
- onClientPlayerJoin
- onClientPlayerPickupHit
- onClientPlayerPickupLeave
- onClientPlayerQuit
- onClientPlayerRadioSwitch
- onClientPlayerSpawn
- onClientPlayerStealthKill
- onClientPlayerStuntFinish
- onClientPlayerStuntStart
- onClientPlayerTarget
- onClientPlayerVehicleEnter
- onClientPlayerVehicleExit
- onClientPlayerVoicePause
- onClientPlayerVoiceResumed
- onClientPlayerVoiceStart
- onClientPlayerVoiceStop
- onClientPlayerWasted
- onClientPlayerWeaponFire
- onClientPlayerWeaponSwitch
Client event functions
- triggerLatentServerEvent
- triggerServerEvent
- Shared
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled