This helper is mostly to easily allow the caller to destroy an entity zone when the entity dies or is destroyed. But might as well generalize it to all damage.
This is really efficient because it can piggyback off of the CEvent "game events" that are triggered (meaning no on-frame check). Specifically, the event is "CEventNetworkEntityDamage", which includes "victim" at arg[1], "attacker" at arg[2], "victimDied" at arg[4], "weaponHash" at arg[5], "isMelee" at arg[10], and "vehicleDamageTypeFlag" at arg[11].
This helper is mostly to easily allow the caller to destroy an entity zone when the entity dies or is destroyed. But might as well generalize it to all damage.
This is really efficient because it can piggyback off of the CEvent "game events" that are triggered (meaning no on-frame check). Specifically, the event is "CEventNetworkEntityDamage", which includes "victim" at arg[1], "attacker" at arg[2], "victimDied" at arg[4], "weaponHash" at arg[5], "isMelee" at arg[10], and "vehicleDamageTypeFlag" at arg[11].
My thoughts on an api is:
and the main use would be:
Honestly, given the lack of anyone upgrading yet, might be a good idea to just slot this into 1.2.
Sources: https://vespura.com/fivem/damageevents/ https://github.com/DevTestingPizza/DamageEvents/blob/v1.0.0/DamageEvents/DamageEvents.cs#L188