• TibiaFace

    Tibiaface | Una comunidad Open Tibia donde encontras : mapas, scripts, Otserver, npc y amigos etc ...

    .
    demo menumenu

    Afiliados



    Votar:

    [Actions] Ranking Highcore In-Game

    Compartir:

    Ver el tema anterior Ver el tema siguiente Ir abajo  Mensaje (Página 1 de 1.)

    1default [Actions] Ranking Highcore In-Game el Lun Mar 05, 2018 9:47 am

    Cerebro

    avatar
    Miembro
    Miembro
    Para los servidores con account manager y no cuenta con pagina web aqui tienen un Ranking Ingame para que vean sus mejores player
    data/talkactions/scripts/highscore.lua

    Código:
    function onSay(cid, words, param)
     
        -- max players on the highscore
        local players = 20 -- The amount of players that is shown in the list
     
        -- don't touch --
        local str = ""
        local value = ""
        local name = ""
        local player_id = 0
        local result = nil
        if param == "level" or param == "exp" or param == "lvl" then
            str = "# [Level] - Name\n"
            value = "level"
            name = "name"
            result = db.getResult("SELECT `level`, `name` FROM `players` ORDER BY `level` DESC, `name` ASC;")
        elseif param == "magiclevel" or param == "magic" or param == "mlevel" or param == "ml" then
            str = "# [Magic Level] - Name\n"
            value = "maglevel"
            name = "name"
            result = db.getResult("SELECT `name`, `maglevel` FROM `players` ORDER BY `maglevel` DESC, `name` ASC;")
        elseif param == "fist" then
            str = "# [Fist] - Name\n"
            value = "value"
            player_id = "player_id"
            result = db.getResult("SELECT `player_id`, `value` FROM `player_skills`  WHERE `skillid` = 0 ORDER BY `value` DESC, `player_id` ASC;")
        elseif param == "club" then
            str = "# [Club] - Name\n"
            value = "value"
            player_id = "player_id"
            result = db.getResult("SELECT `player_id`, `value` FROM `player_skills`  WHERE `skillid` = 1 ORDER BY `value` DESC, `player_id` ASC;")
        elseif param == "sword" then
            str = "# [Sword] - Name\n"
            value = "value"
            player_id = "player_id"
            result = db.getResult("SELECT `player_id`, `value` FROM `player_skills`  WHERE `skillid` = 2 ORDER BY `value` DESC, `player_id` ASC;")
        elseif param == "axe" then
            str = "# [Axe] - Name\n"
            value = "value"
            player_id = "player_id"
            result = db.getResult("SELECT `player_id`, `value` FROM `player_skills`  WHERE `skillid` = 3 ORDER BY `value` DESC, `player_id` ASC;")
        elseif param == "dist" or param == "distance" then
            str = "# [Distance] - Name\n"
            value = "value"
            player_id = "player_id"
            result = db.getResult("SELECT `player_id`, `value` FROM `player_skills`  WHERE `skillid` = 4 ORDER BY `value` DESC, `player_id` ASC;")
        elseif param == "shield" or param == "shielding" then
            str = "# [Shield] - Name\n"
            value = "value"
            player_id = "player_id"
            result = db.getResult("SELECT `player_id`, `value` FROM `player_skills`  WHERE `skillid` = 5 ORDER BY `value` DESC, `player_id` ASC;")
        elseif param == "fish" or param == "fishing" then
            str = "# [Fishing] - Name\n"
            value = "value"
            player_id = "player_id"
            result = db.getResult("SELECT `player_id`, `value` FROM `player_skills`  WHERE `skillid` = 6 ORDER BY `value` DESC, `player_id` 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
                if not(result:next()) or i > players then
                    break
                end
                str = str .. "\n " .. i .. ". [" .. result:getDataInt(value) .. "] - " .. (name ~= "" and result:getDataString("name") or getPlayerNameByGUID(result:getDataInt(player_id)))
                i = i+1
            end
            result:free()
        end
        if str ~= "" then
            doPlayerPopupFYI(cid, str)
        end
        return TRUE
    end

    data/talkactions/talkactions.xml

    Código:
    <talkaction words="!highscore" event="script" value="highscore.lua"/>

    Commands:
    •!highscore level
    -> shows level highscore
    •!highscore magiclevel
    -> shows magiclevel highscore
    •!highscore fist
    -> shows fist highscore
    •!highscore club
    -> shows club highscore
    •!highscore sword
    -> shows sword highscore
    •!highscore axe
    -> shows axe highscore
    •!highscore distance
    -> shows distance highscore
    •!highscore shielding
    -> shows shielding highscore
    •!highscore fishing
    -> shows fishing highscore

    Ver perfil de usuario

    2default Re: [Actions] Ranking Highcore In-Game el Lun Mar 05, 2018 9:48 am

    [Admin] God Maya

    avatar
    Administrador
    Administrador
    buen aporte +1 (y)



    Ver perfil de usuario http://www.tibiaface.com

    Ver el tema anterior Ver el tema siguiente Volver arriba  Mensaje (Página 1 de 1.)

    Permisos de este foro:
    No puedes responder a temas en este foro.

     

    BienvenidosTibiaFace es una comunidad de Open Tibia. Para participar debes estar registrado (click para Regístrate).