How to Create Top Death and Drift?
#1

Bro how to create top death and drift Use Y_Ini Or Dini No Mysql
Reply
#2

If there's a way, it will definitely lag your server.
Reply
#3

Quote:
Originally Posted by OnelifeGaming
Посмотреть сообщение
Bro how to create top death and drift Use Y_Ini Or Dini No Mysql
The best way would be MySQL, bro?
Reply
#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
#5

Quote:
Originally Posted by dominik523
Посмотреть сообщение
The best way would be MySQL, bro?
I do not understand using mysql
Reply
#6

Quote:
Originally Posted by PowerPC603
Посмотреть сообщение
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.
How to create?
Reply
#7

Quote:
Originally Posted by OnelifeGaming
Посмотреть сообщение
I do not understand using mysql
if you not use mysql or sqlite is some hard to create top scores system.
if you use id's for accounts (id 1 (name = gase,password = xxx,money...etc))
use one loop for,while..etc for get all accounts stats for update top scores.
Reply
#8

If you use MySQL, you can find the top 10 in just one query.

Do not use Dini, it is insanely slow.Also one mustn't use INI as a player database.

https://sampforum.blast.hk/showthread.php?tid=574754
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)