Ranking/Top
#1

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?
Reply
#2

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.
Reply
#3

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!
Reply
#4

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

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

Anyone have more idea?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)