Raised This Month: $ Target: $400
 0% 

Rank, possibility lag?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
spamipolito
Junior Member
Join Date: Jun 2018
Old 06-15-2020 , 12:48   Rank, possibility lag?
Reply With Quote #1

Hi guys. I wanted to know if this way of obtaining rank can cause server lag. Sorry for my english :c

PHP Code:
public clcmd__Rank(id)
{                    
    static 
iData[1
     
    
formatex(g_szQuerycharsmaxg_szQuery ), "SELECT * FROM %s ORDER BY `Level` DESC, `KILLS` DESC"szTableData

    
iData[0] = id 
    mysql_query
(g_Connection"rankMe"g_szQueryiData1


public 
rankMe(failstateerror[], errnumdata[], sizeFloat:queuetime) {  
    if(
failstate == TQUERY_CONNECT_FAILED || failstate == TQUERY_QUERY_FAILED) {  
        
log_to_file"SQL_LOG_TQ.txt""Error en la consulta al MySQL [%i]: %s"errnumerror );
        return 
    } 
    else { 
        static 
idid data[0]

        if(
mysql_num_results())
        { 
            static 
CountCharacter[33]

            
Count 0
             
            WPN_MAXTOP 
mysql_num_results()
             
            for(new 
0;Count;i++)
                
mysql_next_row()
             
            while(
mysql_more_results())
            { 
                if(
Count WPN_MAXTOP)
                {             
                    
mysql_read_result(mysql_fieldnametonum("Character"), Character32)
                    
                    if (
equal(Characterg_playername[id]))
                    {
                        
colorChat(id_"!g[%s]!y Rank position:!g %d / %d"COMMUNITYCount+1WPN_MAXTOP)
                        
mysql_next_row()
                        break;
                    }
                    
                    
Count++ 
                         
                    
mysql_next_row() 

                } 
                else 
                    break; 
            }
        }
    } 


Last edited by spamipolito; 06-15-2020 at 12:48.
spamipolito is offline
 



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 17:09.


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