Quote:
Originally Posted by Compidence
You need to reword your question. What do you need help with exactly?
PHP Code:
// Get victim armor static Float:armor pev(Victim, pev_armorvalue, armor) // If he has some, block the infection and reduce armor instead if (armor > 0.0) { if (armor - damage > 0.0) set_pev(victim, pev_armorvalue, armor - damage) else cs_set_user_armor(victim, 0, CS_ARMOR_NONE) return HAM_SUPERCEDE; } // Set Zombie set_user_zombie(Victim, Attacker, 0, 0)
Is that part not working? It looks fine to me.
|
I did it wrong, so i get errors...
Edit: I was tired, and fixed the code, but now i get loose intendtion, even though i have intended it.
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
// Get victim armor
static Float:armor
pev(Victim, pev_armorvalue, armor)
// If he has some, block the infection and reduce armor instead
if (armor > 0.0)
{
if (armor - Damage > 0.0)
set_pev(Victim, pev_armorvalue, armor - Damage)
else
cs_set_user_armor(Victim, 0, CS_ARMOR_NONE)
return HAM_SUPERCEDE;
}
// Set Zombie
set_user_zombie(Victim, Attacker, 0, 0)
return HAM_SUPERCEDE
}
return HAM_HANDLED
}
Edit: It works now!, don't know why i get loose intendtion though. but atleast it works.
__________________