siriusmd99
i think i found right way to do it :
PHP Code:
public plugin_init(){
RegisterHam(Ham_TakeDamage, "player", "UserTakeDamage")
}
public UserTakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
{
if (!is_user_alive(attacker))
return HAM_IGNORED;
if(damage_type != DMG_CLUB)
return HAM_IGNORED;
static Float:armor
pev(victim, pev_armorvalue, armor)
if (armor > 0.0)
{
if (armor - damage > 0.0)
{
set_pev(victim, pev_armorvalue, armor - 50.0) // 50.0 damage value
}else{
//SetHamParamFloat(4, damage)
hl_set_user_armor(victim, 0)
}
return HAM_SUPERCEDE;
}
return HAM_IGNORED;
}
How can cheak that the victim is under attack as well as not under attack or damage at the same time?
__________________