Raised This Month: $ Target: $400
 0% 

Server Shutdown When Checking Top Player Stats


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
shadow.hk
Senior Member
Join Date: Dec 2008
Location: WA, Australia
Old 06-12-2010 , 03:36   Server Shutdown When Checking Top Player Stats
Reply With Quote #1

I've been having trouble with this stuff for a while and i'm wondering what i'm doing wrong.

PHP Code:
check_top(index, class, xp
{
    static 
szName[32], posia;
    
    for(
0MAX_TOPi++)
    {
        
// if they have more xp than this ranked player then start calculating
        
if( xp g_iTopPlayerXP[class][i] )
        {
            
pos i;
            
            
// find out whether they're already in the top statistics and set pos to it
            
while( equal(g_szTopPlayerAuthID[class][pos], g_szAuthID[index]) && pos MAX_TOP )
            {
                if( ++
pos == MAX_TOP )
                {
                    
pos MAX_TOP 1;
                }
            }
            
            
// loop from player's position to player's new position, setting xp from the current position
            //  to the player below the current position
            
for(posia--)
            {
                
g_szTopPlayerName[class][a]        = g_szTopPlayerName[class][a-1];
                
g_szTopPlayerAuthID[class][a]        = g_szTopPlayerAuthID[class][a-1];
                
                
g_iTopPlayerXP[class][a]        = g_iTopPlayerXP[class][a-1];
                
g_iTopPlayerLevel[class][a]        = g_iTopPlayerLevel[class][a-1];
                
                
g_iTopPlayerUpgrade[class][a][0]    = g_iTopPlayerUpgrade[class][a-1][0];
                
g_iTopPlayerUpgrade[class][a][1]    = g_iTopPlayerUpgrade[class][a-1][1];
                
g_iTopPlayerUpgrade[class][a][2]    = g_iTopPlayerUpgrade[class][a-1][2];
                
g_iTopPlayerUpgrade[class][a][3]    = g_iTopPlayerUpgrade[class][a-1][3];
            }
            
            
// set player info to the new position
            
get_user_name(indexszName31);
            
            
g_szTopPlayerName[class][i]        = szName;
            
g_szTopPlayerAuthID[class][i]        = g_szAuthID[index];
            
            
g_iTopPlayerXP[class][i]        = xp;
            
g_iTopPlayerLevel[class][i]        = g_iPlayerLevel[index];
            
            
g_iTopPlayerUpgrade[class][i][0]    = g_iPlayerUpgrade[index][0];
            
g_iTopPlayerUpgrade[class][i][1]    = g_iPlayerUpgrade[index][1];
            
g_iTopPlayerUpgrade[class][i][2]    = g_iPlayerUpgrade[index][2];
            
g_iTopPlayerUpgrade[class][i][3]    = g_iPlayerUpgrade[index][3];
            
            
client_printc(0"%s Congratulations !t%s!n. You are ranked !g%i!n for the !g%s!n class!"PREFIXszNamepos 1, class);
            return;
        }
    }

All this does is make the server shut down once the function is called; without any errors as well. It's driving me insane so if anyone can tell me what i'm doing wrong it'd be GREATLY appreciated

Edit: I looked at the file that holds the top player info and it appears the function above works fine, yet it still crashes...

Code:
[Special Ops]

"v.fuct" "STEAM_0:1:20825055" "847" "4" "0" "0" "3" "5"
"" "" "0" "0" "0" "0" "0" "0"
"" "" "0" "0" "0" "0" "0" "0"
"" "" "0" "0" "0" "0" "0" "0"
"" "" "0" "0" "0" "0" "0" "0"
"" "" "0" "0" "0" "0" "0" "0"
"" "" "0" "0" "0" "0" "0" "0"
"" "" "0" "0" "0" "0" "0" "0"
"" "" "0" "0" "0" "0" "0" "0"
"" "" "0" "0" "0" "0" "0" "0"

Last edited by shadow.hk; 06-12-2010 at 23:31.
shadow.hk is offline
Send a message via MSN to shadow.hk
shadow.hk
Senior Member
Join Date: Dec 2008
Location: WA, Australia
Old 06-13-2010 , 03:01   Re: Server Shutdown When Checking Top Player Stats
Reply With Quote #2

Nevermind, got it. Trash please.
shadow.hk is offline
Send a message via MSN to shadow.hk
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:52.


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