Im trying to store players damage to entity with sdkhook ontakedamagepost, and when entity destroyed print to chat amount of damage dealed by player, but it prints random numbers like 1mil.
PHP Code:
public void OnTakeDamagePost(int entity, int attacker, int inflictor, float damage, int damagetype) {
if (attacker) {
Damage[attacker] += damage;
}
}
public void OnEntityDestroyed(int entity) {
.....
for (int client = 1; client <= MaxClients; client++) {
PrintToChat(client, "dmg %i", Damage[test]
}
}