How to Create Top Death and Drift?
#4

You only need the player with the highest deaths?
Or the highest 10?

You could have a file that holds that information and an array to hold them on the server.

When someone dies, add 1 to their deaths.
Then compare it against the values in that new array and if they have a higher death value compared to another player, put his name in that array and remove the player with the lowest death value.
Then re-save the file which holds these 10 players.

Example:
A 10
B 15
C 7
D 2
E 100
F 16
G 24
H 37
I 45
J 9

These could be the top players on your server and this data should be in that file.
Then your player dies and reaches a death value of 3.
Then you should remove player D and put your player in it's place.
Then re-save the file with the new playerlist.

You may also sort the list in a descending order before saving.

It can be done, but if you want to record all your players (over 1000), it's not that efficient.
Better use MySQL for longer lists.
Reply


Messages In This Thread
How to Create Top Death and Drift? - by OnelifeGaming - 21.05.2015, 05:31
Re: How to Create Top Death and Drift? - by Deathlane - 21.05.2015, 07:31
Re: How to Create Top Death and Drift? - by dominik523 - 21.05.2015, 08:23
Re: How to Create Top Death and Drift? - by PowerPC603 - 21.05.2015, 10:22
Re: How to Create Top Death and Drift? - by OnelifeGaming - 24.05.2015, 08:50
Re: How to Create Top Death and Drift? - by OnelifeGaming - 24.05.2015, 08:53
Re: How to Create Top Death and Drift? - by FplayerGR - 24.05.2015, 09:05
Re: How to Create Top Death and Drift? - by Yashas - 24.05.2015, 10:13

Forum Jump:


Users browsing this thread: 1 Guest(s)