SA-MP Forums Archive
Ranking/Top - 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)
+--- Thread: Ranking/Top (/showthread.php?tid=383527)



Ranking/Top - .v - 07.10.2012

I wan't to make a server top killers, score and so on. But I don't know how. Is it possible to get their score or kills in a file? Coz we all know that we have a saving system right?

Lets say. I have a folder in Scripfiles/Account/ExampleName.ini inside that file is the list of specified player stats.

AdminLevel=0
VIPLevel=0
Score=0
Kills=32
Deaths=9
Money=232
WantedLevel=0


If I do /ranks, I want to show the list of players that has the highest in Score, Kills, Money.

Could anyone make a demo or idea?


Re: Ranking/Top - PrawkC - 07.10.2012

Create a variable such as 'kills', then loop through all the player files and do this

Код:
if(playerkills > kills)
    kills = playerkills;
in the loop, you'd also want to store the players name I guess.


Re: Ranking/Top - .v - 07.10.2012

Quote:
Originally Posted by PrawkC
Посмотреть сообщение
Create a variable such as 'kills', then loop through all the player files and do this

Код:
if(playerkills > kills)
    kills = playerkills;
in the loop, you'd also want to store the players name I guess.
I'm sorry but how can I loop all the player files? Thanks for the reply!


Re: Ranking/Top - SumX - 07.10.2012

use foreach or a simple loop,search on wiki and learn the basics.


Re: Ranking/Top - .v - 07.10.2012

Yes thanks, But there are any other includes that is built-in for this?


Re: Ranking/Top - .v - 08.10.2012

Anyone have more idea?