SA-MP Forums Archive
How get player name from position of anything - 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: How get player name from position of anything (/showthread.php?tid=578848)



How get player name from position of anything - Banditukas - 22.06.2015

Hi,

What query i need procced that i could get name of player for exampe which XP TOP is 400 of 1000 registered players.


Re : How get player name from position of anything - KillerDVX - 22.06.2015

Do you have an Enum of TOP XP Players?


Re: How get player name from position of anything - Mauzen - 22.06.2015

This totally depends on how you store your stuff.
If its mysql/sqlite, with playernames and xp in a single table, then something like this would do it
SELECT your_name_field FROM your_player_table ORDER BY your_xp_field DESC LIMIT 400, 1
(sort players by xp descending, fetch 1 line at offset 400)

If youre using files for the data then its a lot more complicated.