PHP Code:
public _Ham_TakeDamage(id,Inflictor,Attacker,Float:Damage,DamageBits)
{
if(get_pcvar_num(p_On) && is_user_alive(id) && is_user_alive(Attacker) && (g_Countdown[id] > 1 || (g_Dueling[id] != Attacker && g_Dueling[id]) || (!g_Dueling[id] && g_Dueling[Attacker]) || (get_pcvar_num(p_OnlyDuel) && !g_Dueling[id] && !g_Dueling[Attacker])))
SetHamParamFloat(4,0.0)
if(g_Dueling[id] && g_Dueling[Attacker])
{
new health = get_user_health( id )
if ( (health - Damage) < 1 )
{
set_user_health(id, 1)
new Other = g_Dueling[id]
g_Dueling[id] = 0
g_Dueling[Other] = 0
new NameAtt[32], NameVic[32]
get_user_name(Attacker, NameAtt, 31)
get_user_name(id, NameVic, 31)
Render(id,0,Float:{255.0,255.0,255.0})
ForwardPlayerPostThink(id)
new Health = get_user_health(Attacker)
client_print(id,print_chat,"[ARP] %s te porazil v duelu s %d zbyvajicimi zivoty.",NameAtt,Health)
client_print(Attacker,print_chat,"[ARP] Porazil jsi %s se %d zbyvajicimi zivoty.",NameVic,Health)
client_cmd(Attacker, "say /me porazil %s v duelu!", NameVic)
Render(Attacker,0,Float:{255.0,255.0,255.0})
}
}
return HAM_IGNORED
}
Why the code above always blocks any damage? I don't know how to work with returns in HamSandwich, but I think it's caused by them.