Hi. I have this mirror damage plugin:
PHP Code:
#include <amxmodx>
#include <fun>
public plugin_init()
{
register_plugin("Mirror Damage", "1.0.0", "EKS")
register_event("Damage", "Event_Damage", "b", "2!0", "3=0", "4!0")
}
public Event_Damage()
{
new damage = read_data(2)
new victim = read_data(0)
new attacker = get_user_attacker(victim)
if(get_user_team(victim) == get_user_team(attacker) && victim != attacker)
{
if (is_user_alive(attacker))
{
new HP = get_user_health(attacker) - damage
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, damage)
}
if (is_user_alive(victim))
{
new HP = get_user_health(victim) + damage
set_user_health(victim, HP)
}
}
}
My question: is it possible to block victim's death if the damage inflicted to the victim is greater then the victim's hp?