So i want that if the human got armor, zombies need to reduce the armor to infect the player, but i don't know correct the method for it. if somebody could teach me, or simply correct the code.
i will not post full code, you do not need it and its private.
i want it pretty much like zp 4.3.
PHP Code:
public fw_TakeDamage(Victim, Inflictor, Attacker, Float:Damage, DamageType)
{
if(!g_Game_Start)
return HAM_SUPERCEDE
if(Victim == Attacker)
return HAM_IGNORED
if(!is_user_alive(Attacker))
return HAM_IGNORED
if(Get_BitVar(g_IsZombie, Victim) && !Get_BitVar(g_IsZombie, Attacker)) // Human -> Zombie
{
if(DamageType & DMG_HEGRENADE) SetHamParamFloat(4, Damage * float(D_GrenadePower))
else {
Damage *= g_fDamageMulti[g_Level[Attacker]]
// Zombie Victim Evolution Code Here!!!
if(g_Level[Victim] < 3)
{
g_Evolution[Victim] += (g_Level[Victim] < 2) ? Damage / 2000.0 : Damage / 1000.0
UpdateLevelZombie(Victim, 0)
}
// Set Damage
SetHamParamFloat(4, Damage)
}
} else if(!Get_BitVar(g_IsZombie, Victim) && Get_BitVar(g_IsZombie, Attacker) { // Zombie -> Human
if(DamageType & DMG_HEGRENADE)
return HAM_SUPERCEDE
if(Damage <= 0.0)
// Set Zombie
set_user_zombie(Victim, Attacker, 0, 0)
return HAM_SUPERCEDE
}
return HAM_HANDLED
}
So i need something like get_user_armor. but more advanced.
the user cannot get infected if the user have any sort of armor, but zombies can reduce the armor, but not the health.
hope you understand, got any questions post them below
Thank you.
__________________