roriscrave
Advanced OT User
- Joined
- Dec 7, 2011
- Messages
- 1,188
- Solutions
- 34
- Reaction score
- 201
I have this function
this function will return the value of the largest 123781 storage of the players.
For example the largest storage 123781 is from the Jokyz player, and it has a value of 1000.
This function will return 1000.
How do I get the function to get the fifth highest value of the 123781 storage?
for exemple:
Jokz have storage 123781 value 1000
Jevia have storage 123781 value 988
Newk have storage 123781 value 355
Plok have storage 123781 value 200
Newbi have storage 123781 value 122
as the fifth largest storage is from Newbie, I need to get back to me the value of 122
Code:
local query = db.getResult("SELECT `player_id`, `value` FROM `player_storage` WHERE `key` = 123781 and `value` >= 0 ORDER BY cast(value as SIGNED) DESC;")
this function will return the value of the largest 123781 storage of the players.
For example the largest storage 123781 is from the Jokyz player, and it has a value of 1000.
This function will return 1000.
How do I get the function to get the fifth highest value of the 123781 storage?
for exemple:
Jokz have storage 123781 value 1000
Jevia have storage 123781 value 988
Newk have storage 123781 value 355
Plok have storage 123781 value 200
Newbi have storage 123781 value 122
as the fifth largest storage is from Newbie, I need to get back to me the value of 122