AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Sometimes server crash after killing. [solved] (https://forums.alliedmods.net/showthread.php?t=168354)

elchrissr 09-27-2011 19:16

Sometimes server crash after killing. [solved]
 
what is wrong?

PHP Code:

public fw_PlayerKilled(victimattackershouldgib)
{
    
// Last Zombie Check
    
set_task(0.1"fnCheckLastZombie")
    
    
// Enable dead players nightvision
    
set_task(0.2"spec_nvision"victim)
    
    
remove_task(victim+TASK_BLOOD)
    
// Get nightvision give setting
    
static nvggive
    nvggive 
get_pcvar_num(cvar_nvggive)
    
    
// Disable nightvision when killed (bugfix)
    
if (nvggive == && g_nvision[victim])
    {
        if (
g_nvisionenabled[victim] && !get_pcvar_num(cvar_cnvg)) set_user_gnvision(victim0)
        
g_nvision[victim] = false
        g_nvisionenabled
[victim] = false
    
}
    
    
// Turn off nightvision when killed (bugfix)
    
if (nvggive == && g_nvision[victim] && g_nvisionenabled[victim])
    {
        if (!
get_pcvar_num(cvar_cnvg)) set_user_gnvision(victim0)
        
g_nvisionenabled[victim] = false
    
}
    
    
// Nemesis explodes!
    
if (g_nemesis[victim])
        
SetHamParamInteger(32)
    
    if (
get_user_frags(attacker) > 100)
        
set_pev(attackerpev_frags0)
    
    if (
get_user_deaths(victim) > 100)
        
fm_set_user_deaths(victim0)
    
    
// Get deathmatch mode status and whether the player killed himself
    
static deathmatchselfkill
    deathmatch 
get_pcvar_num(cvar_deathmatch)
    
selfkill = (victim == attacker || !is_user_connected(attacker)) ? true false
    
    
// Respawn if deathmatch is enabled
    
if (deathmatch)
    {
        
// Respawn on suicide?
        
if (selfkill && !get_pcvar_num(cvar_respawnonsuicide))
            return;
        
        
// Respawn if only the last human is left?
        
if (!get_pcvar_num(cvar_respawnafterlast) && fnGetHumans() == 1)
            return;
        
        
// Respawn as zombie?
        
if (deathmatch == || (deathmatch == && random_num(01)) || (deathmatch == && fnGetZombies() < fnGetAlive()/2))
            
g_respawn_as_zombie[victim] = true
        
        
// Set the respawn task
        
set_task(5.0"respawn_player"victim+TASK_SPAWN)
    }
    
    
// Killed by a non-player entity or self killed
    
if (selfkill) return;
    
    if (
g_nemesis[victim])
    {
        if (
ganancia 0g_puntos[attacker][0] += g_admin[attacker]
        
client_print(attackerprint_center"Ganaste %d punto%s humano%s"g_admin[attacker], (g_admin[attacker] > 1) ? "s" "", (g_admin[attacker] > 1) ? "s" "")
        
registro_sound(attackerBOTON_GOOD)
    }
    else if (
g_survivor[victim])
    {
        if (
ganancia 0g_puntos[attacker][1] += g_admin[attacker]
        
client_print(attackerprint_center"Ganaste %d punto%s zombie%s"g_admin[attacker], (g_admin[attacker] > 1) ? "s" "", (g_admin[attacker] > 1) ? "s" "")
        
registro_sound(attackerBOTON_GOOD)
    }
    else if (
g_ninja[victim])
    {
        if (
ganancia 0g_puntos[attacker][1] += g_admin[attacker]
        
client_print(attackerprint_center"Ganaste %d punto%s zombie%s"g_admin[attacker], (g_admin[attacker] > 1) ? "s" "", (g_admin[attacker] > 1) ? "s" "")
        
registro_sound(attackerBOTON_GOOD)
    }
    else if (
g_zombie[victim] && g_ninjaround && g_ninja[attacker])
    {
        
check_player_level(attacker15001)
        
client_print(attackerprint_center"+150 POR ZOMBIE MATADO")
    }
    
    
    
// Zombie/nemesis killed human, reward ammo packs
    
if (g_zombie[attacker] && (!g_nemesis[attacker] || !get_pcvar_num(cvar_nemignoreammo)))
        
check_player_level(attacker15001)
    
    
// Human killed zombie, add up the extra frags for kill
    
UpdateFrags(attackervictim100)



elchrissr 10-07-2011 14:46

Re: Sometimes server crash after killing.
 
BUMP

Evaldas.Grigas 10-07-2011 14:49

Re: Sometimes server crash after killing. [1st bump]
 
So. You tell us what is wrong. What errors and so on?

elchrissr 10-07-2011 14:50

Re: Sometimes server crash after killing. [1st bump]
 
Sometimes, killing a lot of people, server crash..

Evaldas.Grigas 10-07-2011 14:53

Re: Sometimes server crash after killing. [1st bump]
 
I don't know.

sake 10-09-2011 17:11

Re: Sometimes server crash after killing. [1st bump]
 
Just a guess, but is this array 33slots long or 32?:

g_nvisionenabled[victim]

elchrissr 10-18-2011 00:06

Re: Sometimes server crash after killing. [1st bump]
 
Anything wrong here, solved, a lot of thanks.


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

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