AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   TOP 15 Function [Remove SQL] (https://forums.alliedmods.net/showthread.php?t=262965)

BaD CopY 05-16-2015 06:20

TOP 15 Function [Remove SQL]
 
Can anyone remove SQL from this code:

PHP Code:

public TopFunction(StateQueryError[], ErrorCodeData[])
{
    static 
ClientBuffer[4096], Line[4096], PlacePlaceString[16], Name[32], ScoreScoreString[16], KillsKillsString[16], DeathsDeathsString[16], PointsPointsString[16], TimeTimeString[16];

    
Buffer[0] = '^0';

    
Client str_to_num(Data);

    
Place 0;

    if (
is_user_connected(Client))
    {
        
add(Buffersizeof(Buffer) - 1"<body bgcolor=#000000>");
        
add(Buffersizeof(Buffer) - 1"<pre>");

        
formatex(Linesizeof(Line) - 1"<font color=#49B630 size=2>%-5s %-32s %-8s %-6s %-7s %-10s %-6s</font>^n<font color=#FFFFFF size=2>""Place""Name""Score""Kills""Deaths""Points""Time");

        
add(Buffersizeof(Buffer) - 1Line);

        while (
SQL_MoreResults(_:Query))
        {
            
SQL_ReadResult(_:Query0Namesizeof(Name) - 1);

            
replace_all(Namesizeof(Name) - 1"<""*");
            
replace_all(Namesizeof(Name) - 1"<""*");

            
Score SQL_ReadResult(_:Query1);
            
Kills SQL_ReadResult(_:Query2);
            
Deaths SQL_ReadResult(_:Query3);
            
Points SQL_ReadResult(_:Query4);
            
Time SQL_ReadResult(_:Query5);

            
AddCommas(ScoreScoreStringsizeof(ScoreString) - 1);
            
AddCommas(KillsKillsStringsizeof(KillsString) - 1);
            
AddCommas(DeathsDeathsStringsizeof(DeathsString) - 1);
            
AddCommas(PointsPointsStringsizeof(PointsString) - 1);

            
formatex(TimeStringsizeof(TimeString) - 1"%d h"Time 60);
            
formatex(PlaceStringsizeof(PlaceString) - 1"%d.", ++Place);

            
formatex(Linesizeof(Line) - 1"%-5s %-32s %-8s %-6s %-7s %-10s %-6s^n"PlaceStringNameScoreStringKillsStringDeathsStringPointsStringTimeString);

            
add(Buffersizeof(Buffer) - 1Line);

            
SQL_NextRow(_:Query);
        }

        
add(Buffersizeof(Buffer) - 1"</font></pre>");

        
show_motd(ClientBuffer"Ranking");
    }

    
SQL_FreeHandle(_:Query);


I want TOP 15 like this one just remove SQL and Points. THX in advance :)


All times are GMT -4. The time now is 20:09.

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