I hope this isn't interpreted as a bump, but I already stated in the post above that the problem was solved and just now realized that it's not, so nobody would'd noticed an edit.
So it's not possible to block the damage taken by the victim with HAM_SUPERCEDE and in the same time to get the correct damage (if victim has armor) so I could pass it to the attacker? Cause I tried something like this
PHP Code:
RegisterHam(Ham_TakeDamage, "player", "fw_Damage", 1)
}
public fw_Damage(victim, attacker)
{
if(get_user_team(victim) == get_user_team(attacker) && victim != attacker && is_user_alive(attacker))
{
new iDamage = pev(victim, pev_dmg_take)
new hp = get_user_health(attacker) - iDamage
if(hp > 0)
set_user_health(attacker, hp)
else
user_kill(attacker)
new vName[32]
get_user_name(victim, vName, 31)
client_print(attacker, print_chat, "[AMXX] You team attacked %s and lost %d hp", vName, iDamage)
}
return HAM_SUPERCEDE
}
and it's obviously that it won't work.
And what's the thing with the inflictor param? I've tested it and notice that is 0 when not attacked by a player, 1...2 (i can test it only with two players so I guess it's the attacker's id, and 116 or 128 or other values maybe if the damage was made by a he grenade. If I'm right it's a safe way to detect he damage?