get top player +rep for helper

hi, so guys i want to make something like top players, so i want to get who has highst score,money and some items like drug , i mean everyone can have drug item , so i should have the name of who has highst drugs and show him at a list can you give an example for this? if you can give an exp for score and one for other things like that drug (drug(playerid) = X and this list should has only online playeres name and search trouth them.
i just want 1 who is the top plyer but after this please give exp to create a list of top players for exp show the 3 top player on drug item :

1. Playerone drug:500
2. playertwo drug :350
3.playerthree drug 50
up to 15

sorry for my bad eng guys

Without any context it's hard to say.
Does your server use MySQL to save player drug counts? If so you could use a query like this
SELECT `Username`, `Drugs` FROM `users` ORDER BY `Drugs` DESC LIMIT 15;

Originally Posted by ******
Посмотреть сообщение
Look up md-sort.
can you give an example for get players who has top score , server should get them and place them like this (show in chat)

Top Players:
Test(1) : 5000 scores
Test(2) : 4500 scores
Test(3) : 3000 scores
Test(4) : 500 scores

Fill a dummy array with all of the currently connected players' id and score, sort that array based on highest to lowest score (descending) = profit.

PHP код:
#include <md_sort>
SortDeepArray(dummyArraydummyArrayScoreKey, .order SORT_DESC); 

Forum Jump:

Users browsing this thread: 1 Guest(s)