-
I'm trying to calculate the ADR (average damage per round), and unfortunately, I couldn't find a way to get the health the player had before the damage was done. The reason why I need it is that the damage done calculation needs to be capped on the remaining health that the player had, i.e if a player has 27 HP and received an AK-47 headshot, the event.dmg_health will be over 100, and I should sum only 27 instead of 100. I tried to do this: const victim = demoFile.entities.getByUserId(event.userid);
const preDamageHealth = victim.health;
let damageDone = event.dmg_health;
const postDamageHealth = event.health; But the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
You can do this by keeping track of every player's last health value when it changes (listen on the entities With that said, are you sure you don't want to track |
Beta Was this translation helpful? Give feedback.
You can do this by keeping track of every player's last health value when it changes (listen on the entities
change
event). Let me know if you need a hand with the code.With that said, are you sure you don't want to track
dmg_health
? If you have 1hp and I headshot you, it feels wrong to track that as a 1hp hit.