[FilterScript] Top 5 Player Score's List
#1

Removed.
Just go to this or something: http://forum.sa-mp.com/showpost.php?...2&postcount=44
Reply
#2

NIce.. Keep going
Reply
#3

Nice
Reply
#4

really nice
Reply
#5

screenshot plz
Reply
#6

Quote:
Originally Posted by Red_Devils
Посмотреть сообщение
screenshot plz
As I said in the main post, I would made that tomorrow.
However, watching the movie I wanted to watch (Wrong Turn 3) has been cancelled, so I'll do it now.

EDIT:
Screens added
Reply
#7

Scripted very inefficient. Take a look at the example with quickSort or with bubblesort in just one command (slower than quickSort).
Written over a month ago without real testing:
pawn Код:
if(!strcmp(cmdtext, "/top5", true))
{
    new
        players_Data[MAX_PLAYERS][2],
        tempString[128],
        tempVar,
        i,
        j,
        k
    ;
    for(i = 0, j = GetMaxPlayers(); i < j; ++i)
    {
        if(IsPlayerConnected(i) && !IsPlayerNPC(i))
        {
            players_Data[tempVar][0] = GetPlayerScore(i);
            players_Data[tempVar++][1] = i;
        }
    }
    for(i = 0, j = 0; i < tempVar; ++i)
    {
        j = players_Data[i][0];
               
        for(k = i - 1; k > -1; --k)
        {
            if(j > players_Data[k][0])
            {
                players_Data[k][0] ^= players_Data[k + 1][0], players_Data[k + 1][0] ^= players_Data[k][0], players_Data[k][0] ^= players_Data[k + 1][0];
                players_Data[k][1] ^= players_Data[k + 1][1], players_Data[k + 1][1] ^= players_Data[k][1], players_Data[k][1] ^= players_Data[k + 1][1];
            }
        }
    }
   
    SendClientMessage(playerid, 0xFF0000FF, "» Top 5 players:");
           
    for(i = 0; i < 5; ++i)
    {
        if(tempVar < i)
            break;
               
        GetPlayerName(players_Data[i][1], tempString, 20);
           
        format(tempString, sizeof(tempString), "» %d. Player: %s [%d] - Score: %d", i, tempString, players_Data[i][1], players_Data[i][0]);
        SendClientMessage(playerid, 0xFFFFFFFF, tempString);
    }
    return 1;
}
NOTE: Tell me if you want me to delete this piece of code, I'm just trying to help.

Thanks for the effort though.
Reply
#8

I know that's inefficient. I just saw some people who needed it, so I made it fast.
I'll take a look at it tomorrow, because I'm gonna watch The IT crowd now, and then I'm gonna sleep (unuseless information)
Reply
#9

make it as "None" as name instead of Kwarde2 for all other place and instead of some " -./,),(-&,(" make it as "0".. dont say u cant do it... ! ofc, that may help d newbies and prefect FS ofc
Reply
#10

Quote:

I'll fix it as soon as possible. (tomorrow)

Already planning it. As I said before, this was quite fast made, first only for one person, but then I thought: Why not for everyone?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)