ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server events
  3. onPedWasted

Event

onPedWasted

A ped (NPC) died.

Handler

addEventHandler("onPedWasted", root, function(totalAmmo, killer, killerWeapon, bodypart, stealth) ... end)

Parameters

totalAmmoint
Ammo.
killerelement
The killer or false.
killerWeaponint
Weapon.
bodypartint
Body part.
stealthbool
Stealth kill.

Differences from MTA:SA

  • These MTA:SA parameters are not here: int animGroup, int animID

In MTA:SA

function(int totalAmmo, element killer, int killerWeapon, int bodypart, bool stealth, int animGroup, int animID)

Source

source is the ped.

Example

addEventHandler("onPedWasted", root, function(_, killer)
    if killer and getElementType(killer) == "player" then givePlayerMoney(killer, 25) end
    setTimer(destroyElement, 5000, 1, source)
end)

See also