| elchrissr |
09-26-2011 14:47 |
Usually corpses stay all round, crash the server
Image:
[img]http://img849.**************/img849/272/zmanekinhousev20001.jpg[/img]
PHP Code:
// Ham Take Damage Forward (inflictor = weapon)
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
{
// 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])
return HAM_SUPERCEDE;
// Prevent friendly fire
if (g_zombie[attacker] == g_zombie[victim])
return HAM_SUPERCEDE;
// Attacker is human...
if (!g_zombie[attacker] && is_user_alive(attacker))
{
if (g_ninja[attacker])
{
damage = (1.0 + get_user_health(victim))
SetHamParamFloat(4, damage)
return HAM_IGNORED;
}
damage *= (1.0 + mejoria_damage(g_habilidades[attacker][1]))
if (!g_survivor[attacker]) damage *= (1.0 + 0.15 * g_hclass[attacker][0])
else damage *= 30.0
if (modified[attacker][0] == is_weapon(get_user_weapon(attacker))) damage *= weapondmg[attacker]
damage *= (1.0 + (g_reset[attacker] / 2))
SetHamParamFloat(4, damage)
// Store damage dealt
g_damagedealt[attacker] += floatround(damage)
// Get damage required to get an ammo pack
static ammodamage, asd1
ammodamage = 1000
if (modified[attacker][0] && get_user_weapon(attacker) == CSW_AWP && !g_survivor[attacker] && is_user_alive(victim))
{
switch(skintype[attacker])
{
case 31: trueno(victim)
case 30: fire(victim)
case 29: freeze(victim)
case 28: veneno(victim)
}
}
if (ganancia < 1) return HAM_IGNORED;
// Reward ammo packs for every [ammo damage] dealt
while (g_damagedealt[attacker] >= (ammodamage / HV_MULTIPLIER) / ganancia)
{
check_player_level(attacker, 1, 0, 1)
g_damagedealt[attacker] -= ammodamage
}
g_dmg[attacker] += floatround(damage)
g_dmgfake[attacker] += floatround(damage)
while (g_dmgfake[attacker] >= ((((((100 + (6 * g_combo[attacker])) + (30 * (Lvl[attacker] / 25))) / HV_MULTIPLIER) / g_admin[attacker]) * (g_reset[attacker] + 1)) / ganancia))
{
if (g_dmgfake[attacker] >= (((((((100 + (6 * g_combo[attacker])) + (30 * (Lvl[attacker] / 25))) * 50) / HV_MULTIPLIER) / g_admin[attacker]) * (g_reset[attacker] + 1)) / ganancia))
{
g_dmgfake[attacker] -= (((((((100 + (6 * g_combo[attacker])) + (30 * (Lvl[attacker] / 25))) * 50) / HV_MULTIPLIER) / g_admin[attacker]) * (g_reset[attacker] + 1)) / ganancia)
g_combo[attacker] += 50
}
else
{
g_dmgfake[attacker] -= ((((((100 + (6 * g_combo[attacker])) + (30 * (Lvl[attacker] / 25))) / HV_MULTIPLIER) / g_admin[attacker]) * (g_reset[attacker] + 1)) / ganancia)
g_combo[attacker] += 1
}
}
asd1 = combo_bonificacion(attacker)
asd1 -= 1
set_hudmessage(COLORES_COMBO[asd1][0], COLORES_COMBO[asd1][1], COLORES_COMBO[asd1][2], -1.0, (asd1 < 4) ? g_hudcombof[attacker] : random_float(g_hudcombof[attacker], g_hudcombof[attacker]+0.1), (asd1 < 4) ? 0 : 1,0.0, 12.0, 1.0, 1.0, -1)
ShowSyncHudMsg(attacker, g_hudcombo, "Combo %s ammo packs^n%s %s de Dañço^nHit %s de Dañço", puntuacion(g_combo[attacker]), stats[(combo_bonificacion(attacker) - 1)], puntuacion(g_dmg[attacker]), puntuacion(floatround(damage)))
remove_task(attacker+9999)
set_task(5.0, "bonificacion", attacker+9999)
return HAM_IGNORED;
}
// Prevent infection by HE grenade (bugfix)
if (damage_type & DMG_HEGRENADE || damage_type & DMG_FALL)
return HAM_SUPERCEDE;
// Nemesis?
if (g_nemesis[attacker])
{
// Set nemesis damage
SetHamParamFloat(4, 250.0)
SetHamParamFloat(4, 250.0)
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, 1, 1, 0) // add corresponding frags and deaths
zombieme(victim, attacker, 0, 0) // turn into zombie
check_player_level(attacker, ((2 * Lvl[victim]) * HV_MULTIPLIER) * ganancia, 0, 1)
set_hudmessage(255, 128, 64, -1.0, g_hudcombof[attacker], 0, 0.0, 12.0, 1.0, 1.0, -1)
ShowSyncHudMsg(attacker, g_hudcombo, "Ganaste %d ammopacks por infectar", ((2 * Lvl[victim]) * HV_MULTIPLIER) * ganancia)
return HAM_IGNORED
}
|