Skip to content

Repository files navigation

DamageEvents

This resource provides events for pretty much all entity related damage or death events by listening to the gameEventTriggered event, taking the data and triggering new events based on that game event data.


Download

You can download it here.


Debugging

There is an option in the fxmanifest.lua file that allows you to turn on debug prints. This will print all triggered events to the F8 console. Note that you should disable this on your live server because it does reduce performance, and it just spams the console and client log of your users.


Events reference

There are 8 events in total, all of which have been documented below.

All events are triggered on the CLIENT SIDE only, there is no server side events with network ID's.

Note, only one event will be triggered for every game event. Only the one that's most appropriate in any given situation will be used.

For example, if a player kills a ped, only the DamageEvents:PedKilledByPlayer event will be triggered, events like DamageEvents:PedDied or DamageEvents:EntityKilled will not be triggered in that case.


DamageEvents:VehicleDestroyed

Description

Event gets triggered whenever a vehicle is destroyed.

Parameters

TypeNameDescription
intvehicleThe vehicle that got destroyed.
intattackerThe attacker handle of what destroyed the vehicle.
uintweaponHashThe weapon hash that was used to destroy the vehicle.
boolisMeleeDamageTrue if the damage dealt was using any melee weapon (including unarmed).
intvehicleDamageTypeFlagVehicle damage type flag, 93 is vehicle tires damaged, others unknown.

DamageEvents:PedKilledByVehicle

Description

Event gets triggered whenever a ped was killed by a vehicle without a driver.

Parameters

TypeNameDescription
intpedPed that got killed.
intvehicleVehicle that was used to kill the ped.

DamageEvents:PedKilledByPlayer

Description

Event gets triggered whenever a ped is killed by a player.

Parameters

TypeNameDescription
intpedThe ped that got killed.
intplayerIdThe player that killed the ped.
uintweaponHashThe weapon hash used to kill the ped.
boolisMeleeDamageTrue if the ped was killed with a melee weapon (including unarmed).

DamageEvents:PedKilledByPed

Description

Event gets triggered whenever a ped is killed by another (non-player) ped.

Parameters

TypeNameDescription
intpedPed that got killed.
intattackerPedPed that killed the victim ped.
uintweaponHashWeapon hash used to kill the ped.
boolisMeleeDamageTrue if the ped was killed using a melee weapon (including unarmed).

DamageEvents:PedDied

Description

Event gets triggered whenever a ped died, but only if the other (more detailed) events weren't triggered.

Parameters

TypeNameDescription
intpedThe ped that died.
intattackerThe attacker (can be the same as the ped that died).
uintweaponHashWeapon hash used to kill the ped.
boolisMeleeDamageTrue whenever the ped was killed using a melee weapon (including unarmed).

DamageEvents:EntityKilled

Description

Gets triggered whenever an entity died, that's not a vehicle, nor a ped.

Parameters

TypeNameDescription
intentityEntity that was killed/destroyed.
intattackerThe attacker that destroyed/killed the entity.
uintweaponHashThe weapon hash used to kill/destroy the entity.
boolisMeleeDamageTrue whenever the ped was killed using a melee weapon (including unarmed).

DamageEvents:VehicleDamaged

Description

Event gets triggered whenever a vehicle is damaged, but not destroyed.

Parameters

TypeNameDescription
intvehicleVehicle that got damaged.
intattackerAttacker that damaged the vehicle.
uintweaponHashWeapon hash used to damage the vehicle.
boolisMeleeDamageTrue whenever the ped was killed using a melee weapon (including unarmed).
intvehicleDamageTypeFlagVehicle damage type flag, 93 is vehicle tire damage, others are unknown.

DamageEvents:EntityDamaged

Description

Event gets triggered whenever an entity is damaged but hasn't died from the damage.

Parameters

TypeNameDescription
intentityEntity that got damaged.
intattackerThe attacker that damaged the entity.
uintweaponHashThe weapon hash used to damage the entity.
boolisMeleeDamageTrue whenever the ped was killed using a melee weapon (including unarmed).

About

No description, website, or topics provided.

Resources

Stars

13 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages