• TibiaFace

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

    .
    demo menumenu

    Afiliados



    Votar:

    [Talkactions] Alguna script??

    Compartir:

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

    1default [Talkactions] Alguna script?? el Vie Dic 22, 2017 8:47 pm

    kgjunior91

    kgjunior91
    Nuevo Miembro
    Nuevo Miembro
    Como hago para poner en la talkaction !rank
    para que se vea los rebirths que llevan los players???

    igual que el level, el magic, y las skills??

    2default Re: [Talkactions] Alguna script?? el Vie Dic 22, 2017 8:49 pm

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    Código:
    function onSay(cid, words, param)

        local players = 20 -- How many players will be showed in the highscore

        local str = ""
        local name = ""
        local player_id = 0
        local result = nil
        local result2 = nil
        local first_val = ""
        local first_nam = ""
       
       str = "# [Rebirths] - Name\n"
       name = "name"
       result = db.getResult("SELECT `player_id`, (`value` * 1) AS `value` FROM `player_storage` WHERE `key` = 85987 ORDER BY `value` DESC;")
       result2 = db.getResult("SELECT `name` FROM `players` WHERE id = "..result:getDataString("player_id")..";")
       first_val = result:getDataString("value")
       first_nam = result2:getDataString("name")
       str = str.."\n ".."1. ["..first_val.."] - "..first_nam
        if (result:getID() ~= -1) then
           local i = 2
           while TRUE do
              if not(result:next()) or i > players then
                 break
              end
              result2 = db.getResult("SELECT `name` FROM `players` WHERE id = "..result:getDataString("player_id")..";")
              str = str .. "\n " .. i .. ". [" .. result:getDataString("value") .. "] - " .. (name ~= "" and result2:getDataString("name") or getPlayerNameByGUID(result:getDataInt(player_id)))
              i = i+1
              result2:free()
           end
           result:free()
        end

        if str ~= "" then
           doPlayerPopupFYI(cid, str)
        end

        return TRUE
    end

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

    prueba ahi esta



    [Talkactions] Alguna script?? YNU5B25
    https://www.tibiaface.com

    3default Re: [Talkactions] Alguna script?? el Vie Dic 22, 2017 8:58 pm

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    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;")
                elseif param == "Rebirth" or param == "reb" then
            str = "# [Rebirths] - Name\n"
            value = "Rebirths"
            name = "name"
            result = db.getResult("SELECT `Rebirths`, `name` FROM `players` ORDER BY `Rebirths` 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
                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

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

    medio de uso

    !highscore Rebirth
    or
    !highscore reb
    or
    !top rebirth



    [Talkactions] Alguna script?? YNU5B25
    https://www.tibiaface.com

    4default Re: [Talkactions] Alguna script?? el Vie Dic 22, 2017 9:14 pm

    kgjunior91

    kgjunior91
    Nuevo Miembro
    Nuevo Miembro
    Me salen todos menos el del Rebirth TT

    me sale este mensaje:

    02:13 Unbekannter skill: 'rebirth'

    5default Re: [Talkactions] Alguna script?? el Vie Dic 22, 2017 9:28 pm

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    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;")
                elseif param == "Rebirth" or param == "reb" then
            str = "# [Rebirths] - Name\n"
            value = "Rebirths"
            name = "name"
            result = db.getResult("SELECT `player_id`, `value` FROM `player_storage` WHERE `key` = 85987 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


    aver prueba con este



    [Talkactions] Alguna script?? YNU5B25
    https://www.tibiaface.com

    6default [Talkactions] ahora este error el Sáb Dic 23, 2017 7:41 am

    kgjunior91

    kgjunior91
    Nuevo Miembro
    Nuevo Miembro
    [23/12/2017 12:39:26] Error during getDataInt(Rebirths).
    [23/12/2017 12:39:26] Error during getDataString(name).
    [23/12/2017 12:39:26] Error during getDataInt(Rebirths).
    [23/12/2017 12:39:26] Error during getDataString(name).
    [23/12/2017 12:39:30] Error during getDataInt(Rebirths).
    [23/12/2017 12:39:30] Error during getDataString(name).
    [23/12/2017 12:39:30] Error during getDataInt(Rebirths).
    [23/12/2017 12:39:30] Error during getDataString(name).

    7default Re: [Talkactions] Alguna script?? el Sáb Dic 23, 2017 12:38 pm

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    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;")
                elseif param == "Rebirth" or param == "reb" then
            str = "# [Rebirths] - Name\n"
            value = "Rebirths"
            name = "name"
            result = db.getResult("SELECT `player_id`, `value` FROM `player_storage` WHERE `key` = 85987 ORDER BY cast(value as INTEGER) DESC;")
           
           
     
           
        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


    prueba



    [Talkactions] Alguna script?? YNU5B25
    https://www.tibiaface.com

    8default Re: [Talkactions] Alguna script?? el Sáb Dic 23, 2017 7:27 pm

    kgjunior91

    kgjunior91
    Nuevo Miembro
    Nuevo Miembro
    Mismo error =(


    9default teste el Sáb Dic 23, 2017 9:10 pm

    kgjunior91

    kgjunior91
    Nuevo Miembro
    Nuevo Miembro
    Código:
    function onSay(cid, words, param)

        local players = 20 -- How many players will be showed in the highscore

        local str = ""
        local name = ""
        local player_id = 0
        local result = nil
        local result2 = nil
        local first_val = ""
        local first_nam = ""
       
       str = "# [Rebirths] - Name\n"
       name = "name"
       result = db.getResult("SELECT `player_id`, (`value` * 1) AS `value` FROM `player_storage` WHERE `key` = 85987 ORDER BY `value` DESC;")
       result2 = db.getResult("SELECT `name` FROM `players` WHERE id = "..result:getDataString("player_id")..";")
       first_val = result:getDataString("value")
       first_nam = result2:getDataString("name")
       str = str.."\n ".."1. ["..first_val.."] - "..first_nam
        if (result:getID() ~= -1) then
           local i = 2
           while TRUE do
              if not(result:next()) or i > players then
                 break
              end
              result2 = db.getResult("SELECT `name` FROM `players` WHERE id = "..result:getDataString("player_id")..";")
              str = str .. "\n " .. i .. ". [" .. result:getDataString("value") .. "] - " .. (name ~= "" and result2:getDataString("name") or getPlayerNameByGUID(result:getDataInt(player_id)))
              i = i+1
              result2:free()
           end
           result:free()
        end

        if str ~= "" then
           doPlayerPopupFYI(cid, str)
        end

        return TRUE
    end

    Very Happy Resuelto Gracias Very Happy

    Contenido patrocinado


    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).