• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Top ranks storage

llamavani

Trinitium Rubidia Style!
Joined
Sep 17, 2009
Messages
173
Reaction score
3
Location
Guadalajara, Mexico
Im searching a script that check offline storage value players like PLAYER1, PLAYER2, AND PLAYER3, and get the storage value (XXXX) and show only the first 10 players with the most points....

LIKE:

STORAGE RANK----
1 -PLAYER1 -- 140 points
2 -PLAYER2 -- 110 points
3- PLAYER3 -- 80 points

Rep ++

:)

It could be a version with player Storage values and other version of Global Storage Values Ranges? like Storage 12000 - 12200 and get the highters Storages to make a list of Ranks?
 
lib/functions
Code:
function getRankStorage(cid, value, max, RankName) -- by vodka
local str =""
str = "--[".. (RankName == nil and "RANK STORAGE" or ""..RankName.."") .."]--\n\n"
local query = db.getResult("SELECT `player_id`, `value` FROM `player_storage` WHERE `key` = "..value.." ORDER BY cast(value as INTEGER) DESC;")
if (query:getID() ~= -1) then k = 1 repeat if k > max then break end
str = str .. "\n " .. k .. ". "..getPlayerNameByGUID(query:getDataString("player_id")).." - [" .. query:getDataInt("value") .. "]"
k = k + 1 until not query:next() end return doShowTextDialog(cid, 2529, str)
end

getRankStorage(cid, value, max, RankName)

value -- your storage
max -- max player show rank
RankName-- name your rank

exemple with diferent storages

Code:
local table = {
["first"] = {storage = 48754, name= "Death"},
["second"] = {storage = 48755, name= "Kill"},
["third"] = {storage = 48756, name= "nothing"}
}
function onSay(cid, words, param)
local param = string.lower(param)
if not table[param] then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"param invalido")
end
return getRankStorage(cid, table[param].storage, 10, "Rank Of "..table[param].name)
end
 
Last edited:
Back
Top