OnPedWasted: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Undo revision 71906 by ERAGON (talk))
Tag: Undo
(Killer element type)
Line 8: Line 8:


*'''totalAmmo''': an [[int]] representing the total ammo the victim had when he died.
*'''totalAmmo''': an [[int]] representing the total ammo the victim had when he died.
*'''killer''': an [[element]] representing the player or vehicle who was the killer.  If there was no killer this is ''false''.
*'''killer''': an [[element]] representing the [[player]], [[ped]] or [[vehicle]] who was the killer.  If there was no killer this is ''false''.
*'''killerWeapon''': an [[int]] representing the [[Weapons|killer weapon]] or the [[Damage Types|damage types]].
*'''killerWeapon''': an [[int]] representing the [[Weapons|killer weapon]] or the [[Damage Types|damage types]].
*'''bodypart''': an [[int]] representing the bodypart ID the victim was hit on when he died.
*'''bodypart''': an [[int]] representing the bodypart ID the victim was hit on when he died.

Revision as of 21:46, 14 November 2022

This event is triggered when a ped is killed or dies. It is not triggered for players.

Parameters

int totalAmmo, element killer, int killerWeapon, int bodypart, bool stealth
  • totalAmmo: an int representing the total ammo the victim had when he died.
  • killer: an element representing the player, ped or vehicle who was the killer. If there was no killer this is false.
  • killerWeapon: an int representing the killer weapon or the damage types.
  • bodypart: an int representing the bodypart ID the victim was hit on when he died.
  • 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 ped that died or got killed.

Example

This example outputs to the console that the ped is now dead.

ped1 = createPed(112, 0, 0, 0) --Create our Ped
function died()
    outputConsole("Your Ped is dead now!")
end
addEventHandler("onPedWasted", ped1, died) --Add the Event when ped1 dies

See Also

Ped events


Event functions