PHP Code:
// Ham Take Damage Forward (inflictor = weapon)
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
{
// Max ammopacks
if (g_ammopacks[attacker] > 100000)
return HAM_IGNORED
// Non-player damage or self damage
if (victim == attacker || !is_user_connected(attacker))
return HAM_IGNORED;
// New round starting or round ended
if (g_newround || g_endround)
return HAM_SUPERCEDE;
// Victim shouldn't take damage or victim is frozen
if (g_nodamage[victim] || g_frozen[victim])
return HAM_SUPERCEDE;
// Prevent friendly fire
if (g_zombie[attacker] == g_zombie[victim])
return HAM_SUPERCEDE;
// Attacker is human...
if (!g_zombie[attacker])
{
// Armor multiplier for the final damage on normal zombies
if (!g_nemesis[victim])
{
damage *= get_pcvar_float(cvar_zombiearmor)
SetHamParamFloat(4, damage)
}
// Reward ammo packs
if (!g_survivor[attacker] || !get_pcvar_num(cvar_survignoreammo))
{
// Store damage dealt
g_damagedealt[attacker] += floatround(damage)
// Get damage required to get an ammo pack
static ammodamage
ammodamage = get_pcvar_num(cvar_ammodamage)
// Reward ammo packs for every [ammo damage] dealt
while (g_damagedealt[attacker] >= ammodamage)
{
update_ap(attacker, 1, 0)
g_damagedealt[attacker] -= ammodamage
}
}
if (!g_zombie[attacker])
{
damage *= get_pcvar_float(cvar_zombiearmor)
switch (get_user_weapon(attacker))
{
case (CSW_KNIFE): damage *= 3.0
case (CSW_MP5NAVY):
{
if (Lvl[attacker] >= 1)
damage += 202
}
case (CSW_TMP):
{
if (Lvl[attacker] >= 0)
damage *= 2.0
}
case (CSW_UMP45):
{
if (Lvl[attacker] >= 5)
damage *= 4.5
}
case (CSW_M4A1):
{
if (Lvl[attacker] >= 15)
damage *= 2.0
}
case (CSW_ELITE):
{
if (Lvl[attacker] >= 60)
damage *= 10.0
}
case (CSW_AK47):
{
if (Lvl[attacker] >= 16)
damage *= 2.0
}
case (CSW_DEAGLE):
{
if (Lvl[attacker] >= 9)
damage *= 3.0
}
case (CSW_SCOUT):
{
if (Lvl[attacker] >= 19)
damage *= 7.0
}
case (CSW_M3):
{
if (Lvl[attacker] >= 25)
damage *= 2.0
}
case (CSW_P90):
{
if (Lvl[attacker] >= 34)
damage *= 9.0
}
case (CSW_SG552):
{
if (Lvl[attacker] >= 46)
damage *= 10.0
}
case (CSW_GALIL):
{
if (Lvl[attacker] >= 51)
damage *= 11.0
}
case (CSW_XM1014):
{
if (Lvl[attacker] >= 69)
damage *= 1.0
}
case (CSW_MAC10):
{
if (Lvl[attacker] >= 74)
damage *= 7.0
}
case (CSW_M249):
{
if (Lvl[attacker] >= 85)
damage *= 14.0
}
case (CSW_FAMAS):
{
if (Lvl[attacker] >= 111)
damage *= 15.0
}
case (CSW_AWP):
{
if (Lvl[attacker] >= 125)
damage *= 16.0
}
case (CSW_SG550):
{
if (Lvl[attacker] >= 125)
damage *= 17.0
}
case (CSW_AUG):
{
if (Lvl[attacker] >= 130)
damage *= 25.0
}
}
g_ammopacks[attacker]++
SetHamParamFloat(4, damage)
}
if (g_survivor[attacker])
{
SetHamParamFloat(4, damage * 2.5)
}
return HAM_IGNORED;
}
// Attacker is zombie...
// Prevent infection by HE grenade (bugfix)
if (damage_type & DMG_HEGRENADE)
return HAM_SUPERCEDE;
// Nemesis?
if (g_nemesis[attacker])
{
// Set nemesis damage
SetHamParamFloat(4, get_pcvar_float(cvar_nemdamage))
return HAM_IGNORED;
}
// Last human or swarm round or plague round
if (g_swarmround || g_plagueround || fnGetHumans() == 1)
return HAM_IGNORED; // human is killed
// Does human armor need to be reduced before infecting?
if (get_pcvar_num(cvar_humanarmor))
{
// Get victim armor
static Float:armor
pev(victim, pev_armorvalue, armor)
// Block the attack if he has some
if (armor > 0.0)
{
engfunc(EngFunc_EmitSound, victim, CHAN_BODY, sound_armorhit, 1.0, ATTN_NORM, 0, PITCH_NORM)
set_pev(victim, pev_armorvalue, floatmax(0.0, armor - damage))
return HAM_SUPERCEDE;
}
}
// Infection allowed
SendDeathMsg(attacker, victim) // send death notice
FixDeadAttrib(victim) // fix the "dead" attrib on scoreboard
UpdateFrags(attacker, victim, get_pcvar_num(cvar_fragsinfect), 1, 1) // add corresponding frags and deaths
zombieme(victim, attacker, 0, 0) // turn into zombie
update_ap(attacker, get_pcvar_num(cvar_ammoinfect), 0) // ammo packs given to zombie for infection
fm_set_user_health(attacker, pev(attacker, pev_health)+get_pcvar_num(cvar_zombiebonushp)) // attacker gets bonus HP for the infection
return HAM_SUPERCEDE;
}
Completito u.u