get top player +rep for helper - 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: get top player +rep for helper (
/showthread.php?tid=660826)
get top player +rep for helper -
PoniStar - 14.11.2018
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
4...
5...
...
up to 15
sorry for my bad eng guys
Re: get top player +rep for helper -
Boarden - 14.11.2018
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;
Re: get top player +rep for helper -
PoniStar - 15.11.2018
Quote:
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
Re: get top player +rep for helper -
d1git - 15.11.2018
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(dummyArray, dummyArrayScoreKey, .order = SORT_DESC);
Re: get top player +rep for helper -
TheToretto - 15.11.2018
https://github.com/GRGServer/SAMP/bl...es/md-sort.inc