OnClientPlayerWasted: Difference between revisions
Jump to navigation
Jump to search
(Added stealth parameter) |
Zangomangu (talk | contribs) (Killer element type) |
||
Line 8: | Line 8: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
*'''killer''': A [[player]] [[element]] representing the killer. | *'''killer''': A [[player]], [[ped]] or [[vehicle]] [[element]] representing the killer. | ||
*'''weapon''': An [[int|integer]] representing the [[Weapons|killer weapon]] or the [[Damage Types|damage types]]. | *'''weapon''': An [[int|integer]] representing the [[Weapons|killer weapon]] or the [[Damage Types|damage types]]. | ||
*'''bodypart''': An [[int|integer]] representing the bodypart the player was damaged. | *'''bodypart''': An [[int|integer]] representing the bodypart the player was damaged. |
Revision as of 21:38, 14 November 2022
This event is triggered whenever a player, including those remote, dies.
Parameters
element killer, int weapon, int bodypart, bool stealth
- killer: A player, ped or vehicle element representing the killer.
- weapon: An integer representing the killer weapon or the damage types.
- bodypart: An integer representing the bodypart the player was damaged.
- 3: Torso
- 4: Ass
- 5: Left Arm
- 6: Right Arm
- 7: Left Leg
- 8: Right Leg
- 9: Head
- stealth: A boolean representing whether or not this was a stealth kill.
Source
The source of this event is the player that died.
Example
This example outputs a mocking message when the local player dies.
messages = { "Better luck next time", "Don't think you're so cool now, do you?", "Nice one, pal", "Your opinion is void" } function wastedMessage ( killer, weapon, bodypart ) local randomID = math.random ( 1, #messages ) --get a random ID from the table local randomMessage = messages[randomID] --use that to retrieve a message outputChatBox ( randomMessage, 255, 0, 0 ) --output the message end addEventHandler ( "onClientPlayerWasted", getLocalPlayer(), wastedMessage ) --add an event for the local player only
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