SA-MP Forums Archive
[FilterScript] Top 5 Player Score's List - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Top 5 Player Score's List (/showthread.php?tid=250595)



- Remove Please - - Kwarde - 23.04.2011

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


Re: Top 5 Player Score's List - IvanCroatiaCopy - 23.04.2011

NIce.. Keep going


Respuesta: Top 5 Player Score's List - Host-samp - 23.04.2011

Nice


Re: Top 5 Player Score's List - Leroytjuh - 23.04.2011

really nice


Re: Top 5 Player Score's List - Red_Devils - 23.04.2011

screenshot plz


Re: Top 5 Player Score's List - Kwarde - 23.04.2011

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


Re: Top 5 Player Score's List - RyDeR` - 23.04.2011

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.


Re: Top 5 Player Score's List - Kwarde - 23.04.2011

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)


Re: Top 5 Player Score's List - Unknown1234 - 23.04.2011

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


Re: Top 5 Player Score's List - Kwarde - 23.04.2011

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?