eu já tinha feito um script desse no TK, acho que é até o mesmo...
function onSay(cid, words, param)
local param,max,t = string.lower(param),20,{
["sorcerer"] = {1,5},
["druid"] = {2,6},
["paladin"] = {3,7},
["knight"] = {4,8}
}
if param == "" or not t[param] then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"this vocation does exist.") return true
end
str = "--[RANK "..string.upper(param).."]--\n\n"
local query = db.getResult("SELECT `name`, `level` FROM `players` WHERE `group_id` <= 2 AND `vocation` = "..t[param][1].." or `vocation` = "..t[param][2].." ORDER BY `level` DESC;")
if (query:getID() ~= -1) then k = 1 repeat if k > max then break end
str = str .. "\n " .. k .. ". "..query:getDataString("name").." - [" .. query:getDataInt("level") .. "]"
k = k + 1 until not query:next() end
doShowTextDialog(cid, 2529, str)
return true
end






info
Grupo: Lorde
Registrado: 17/01/09
Posts: 2.1k
Reputação: +395
Char no Tibia: Adra Sata
Tenha um novo tipo de highscore em seu servidor, ele é bem útil.
Ele mostra os leveis mais alto das vocações seja ela normal e promoted.
Está bem simples mesmo, poderia deixa-lo mais fácil de modificar.
Source:
function onSay(cid, words, param) local players = 20 local str = "" local value = "" local name = "" if param == "sorcerer" then str = "# [sorcerer Best Level] - Name\n" value = "level" name = "name" result = db.getResult("SELECT `level`,`name` FROM `players` WHERE `vocation` = 1 OR `vocation` = 5 ORDER BY `level` DESC, `name` ASC;") elseif param == "druid" then str = "# [Druid Best Level] - Name\n" value = "level" name = "name" result = db.getResult("SELECT `level`,`name` FROM `players` WHERE `vocation` = 2 OR `vocation` = 6 ORDER BY `level` DESC, `name` ASC;") elseif param == "paladin" then str = "# [Paladin Best Level] - Name\n" value = "level" name = "name" result = db.getResult("SELECT `level`,`name` FROM `players` WHERE `vocation` = 3 OR `vocation` = 7 ORDER BY `level` DESC, `name` ASC;") elseif param == "knight" then str = "# [Knight Best Level] - Name\n" value = "level" name = "name" result = db.getResult("SELECT `level`,`name` FROM `players` WHERE `vocation` = 2 OR `vocation` = 8 ORDER BY `level` DESC, `name` ASC;") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Unbekannter skill: '" .. param .. "'") return TRUE end if (result:getID() ~= -1) then local i = 1 while TRUE do str = str .. "\n " .. i .. ". [" .. result:getDataInt(value) .. "] - " .. (name ~= "" and result:getDataString("name") or getPlayerNameByGUID(result:getDataInt(player_id))) i = i+1 if not(result:next()) or i > players then break end end result:free() end if str ~= "" then doPlayerPopupFYI(cid, str) end return TRUE endAdicionando Novas Vocações:
Exemplo:
Basta por um OR e em seguida `vocation` = id dela.
Espero que gostem.
Até ;D
Editado Agosto 8 por SkyDangerous