AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Usually corpses stay all round, crash the server (https://forums.alliedmods.net/showthread.php?t=168276)

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(victiminflictorattackerFloat:damagedamage_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(4damage)
            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(4damage)
        
        
// Store damage dealt
        
g_damagedealt[attacker] += floatround(damage)
        
        
// Get damage required to get an ammo pack
        
static ammodamageasd1
        ammodamage 
1000
        
        
if (modified[attacker][0] && get_user_weapon(attacker) == CSW_AWP && !g_survivor[attacker] && is_user_alive(victim))
        {
            switch(
skintype[attacker])
            {
                case 
31trueno(victim)
                case 
30fire(victim)
                case 
29freeze(victim)
                case 
28veneno(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(attacker101)
            
g_damagedealt[attacker] -= ammodamage
        
}
        
        
g_dmg[attacker] += floatround(damage)
        
g_dmgfake[attacker] += floatround(damage)
        
        while (
g_dmgfake[attacker] >= ((((((100 + (g_combo[attacker])) + (30 * (Lvl[attacker] / 25))) / HV_MULTIPLIER) / g_admin[attacker]) * (g_reset[attacker] + 1)) / ganancia))
        {
            if (
g_dmgfake[attacker] >= (((((((100 + (g_combo[attacker])) + (30 * (Lvl[attacker] / 25))) * 50) / HV_MULTIPLIER) / g_admin[attacker]) * (g_reset[attacker] + 1)) / ganancia))
            {
                
g_dmgfake[attacker] -= (((((((100 + (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 + (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) ? 1,0.012.01.01.0, -1)
        
ShowSyncHudMsg(attackerg_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(4250.0)
        
SetHamParamFloat(4250.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
(victimpev_armorvaluearmor)
        
        
// Block the attack if he has some
        
if (armor 0.0)
        {
            
engfunc(EngFunc_EmitSoundvictimCHAN_BODYsound_armorhit1.0ATTN_NORM0PITCH_NORM)
            
set_pev(victimpev_armorvaluefloatmax(0.0armor damage))
            return 
HAM_SUPERCEDE;
        }
    }
    
    
// Infection allowed
    
SendDeathMsg(attackervictim// send death notice
    
FixDeadAttrib(victim// fix the "dead" attrib on scoreboard
    
UpdateFrags(attackervictim110// add corresponding frags and deaths
    
    
zombieme(victimattacker00// turn into zombie
    
check_player_level(attacker, ((Lvl[victim]) * HV_MULTIPLIER) * ganancia01)
    
    
set_hudmessage(25512864, -1.0g_hudcombof[attacker], 00.012.01.01.0, -1)
    
ShowSyncHudMsg(attackerg_hudcombo"Ganaste %d ammopacks por infectar", ((Lvl[victim]) * HV_MULTIPLIER) * ganancia)
    return 
HAM_IGNORED



Hunter-Digital 09-27-2011 00:53

Re: Usually corpses stay all round, crash the server
 
Corpses are messages sent to clients after someone died, they aren't handled serverside so they shouldn't crash the server.

Unless the plugin blocks that message and creates it's own entity corpses... you have another thing that crashes the server... or you might be refering to crashing CLIENTS.

Anyway, if you want to block the default corpses, just set_msg_block() on ClCorpse message.

elchrissr 09-27-2011 19:11

Re: Usually corpses stay all round, crash the server
 
ok, thanks :)


All times are GMT -4. The time now is 19:32.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.