Hi
my idea . i want make anti-infection if human has armor dos not infected
i try to set human his hp when tok dmg from zombie :
PHP Code:
public plugin_init(){
RegisterHam(Ham_TraceAttack,"player","fw_TraceAttack")
}
public fw_TraceAttack(victim, inflictor, Float:damage, Float:direction[3], traceresult, damagebits){
if(damagebits == DMG_CLUB){ // crowbar dmg
if(floatround(damage) && get_user_armor(victim))
{
set_user_armor(victim, get_user_armor(victim) - 35) // here i want victim losing 50 armor old dmg = 15 + 35 = 50 :P
set_user_health(victim, get_user_health(victim) + 5) // give the victim hp is losing (5) when has armor
}/*else if(floatround(damage) > get_user_armor(victim) ) {
//set_user_armor(victim, 0)
//set_user_health(victim, 100)
//return //HAM_IGNORED
}*/
//if(!is_user_alive(victim) || get_user_armor(victim)) return HAM_IGNORED
}
}
But I think it's a bad way and it does not work well in all cases
Is it correct or better pleas ?
__________________