SA-MP Forums Archive
Ranking System - 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: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Ranking System (/showthread.php?tid=260027)



Ranking System - Skylar Paul - 07.06.2011

Yeah, I'm pretty friggen stumped on how to do this, originally I was trying something like this:

pawn Код:
new
TopPlayers[6]; //5 top players

for(new i = 0; i < global_ConnectedPlayers; i++) {

if(PVar[i][Kills] > PVar[i][Kills]) {
TopPlayers[0] = i; }
else if(PVar[i][Kills] > PVar[i][Kills] && PVar[i][Kills] < TopPlayers[0]) {
TopPlayers[1] = i; }

}
Excuse the indentation, wrote it in Opera. Now, of course, this did not work whatsoever, so I'm wondering how I would go about doing it in the simplest way possible.


Re: Ranking System - Gamer_Z - 07.06.2011

you can use QuickSort (somewhere on this forum).
the name says it all..
But maybe I'm wrong xD