• TibiaFace

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

    .
    demo menumenu

    Afiliados



    Votar:

    Error consola mod vip

    Compartir:

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

    1Error consola mod vip Empty Error consola mod vip Mar Abr 12, 2022 6:16 am

    ioke

    ioke
    Miembro
    Miembro
    Descripcion escribió:hola, me aparece un fallo enla consola que no se que es, el mod me funciona bien.

    Código:
    [12:13:22.124] [Error - MoveEvents Interface]
    [12:13:22.124]          domodlib('VipFunctions')
    [12:13:22.124]
    [12:13:22.124]          function onStepIn(cid, item, position, fromPosition)
    [12:13:22.140] local config = {
    [12:13:22.140] msgDenied = "You cannot enter to VIP area! To buy access visite website: http://www.tibiarl.com/index.php?subtopic=buypoints",
    [12:13:22.140] msgWelcome = "Welcome " .. getCreatureName(cid) .. "!"
    [12:13:22.155] }

    [12:13:22.155]          if getPlayerVipDays(cid) == 0 then
    [12:13:22.155] doTeleportThing(cid, fromPosition, true)
    [12:13:22.155] doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, config.msgDenied)
    [12:13:22.171] doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
    [12:13:22.171] return TRUE
    [12:13:22.171] end
    [12:13:22.171] doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, config.msgWelcome)
    [12:13:22.171] return TRUE
    [12:13:22.171] end
    [12:13:22.186] :onStepIn
    [12:13:22.186] Description:
    [12:13:22.186] [string "function getPlayerVipDays(cid)..."]:2: attempt to concatenate a boolean value
    [12:13:22.186] stack traceback:
    [12:13:22.186]  [string "function getPlayerVipDays(cid)..."]:2: in function 'getPlayerVipDays'
    [12:13:22.202]  [string "LuaInterface::loadBuffer"]:9: in function <[string "LuaInterface::loadBuffer"]:3>



    mod vip

    Código:
    <?xml version="1.0" encoding="UTF-8"?>
    <mod name="Vipsystem" version="1.0"

    author="Ioke" contact="http://tibiarl.com" enabled="yes">

    <!--- Information
    Vip Item = 10135
    Vip Item = 10134
    Vip Item = 10133
    set action id 11223 to the tile you want to be vip tile
    set action id 2112 to the door you want to be vip door


             MYSQL TABLE
    ........................................................
    ALTER TABLE `accounts` ADD
    `vipdays` int(11) NOT NULL DEFAULT 0;
    ........................................................

    -->

    <config name="VipFunctions"><![CDATA[
    function getPlayerVipDays(cid)
        local Info = db.getResult("SELECT `vipdays` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. " LIMIT 1")
            if Info:getID() ~= LUA_ERROR then
            local days= Info:getDataInt("vipdays")
            Info:free()
            return days
        end
        return LUA_ERROR
    end

    function doAddVipDays(cid, days)
        db.query("UPDATE `accounts` SET `vipdays` = `vipdays` + " .. days .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
    end

    function doRemoveVipDays(cid, days)
        db.query("UPDATE `accounts` SET `vipdays` = `vipdays` - " .. days .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
    end
    ]]></config>

    <globalevent name="VipDaysRemover" time="00:01" event="script"><![CDATA[
          
          function onTime()
                    db.query("UPDATE accounts SET vipdays = vipdays - 1 WHERE vipdays > 0;")
            return true
       end
       ]]></globalevent>
       
    <globalevent name="vipEffect" interval="18000" event="script"><![CDATA[
       domodlib('VipFunctions')
       
       function onThink(interval, lastExecution)
            for _, name in ipairs(getOnlinePlayers()) do
            local cid = getPlayerByName(name)
                  if getPlayerVipDays(cid) >= 1 then
                      doSendMagicEffect(getPlayerPosition(cid), 27)
                      doSendAnimatedText(getPlayerPosition(cid), "VIP!", TEXTCOLOR_RED)
                  end
            end
            return true
    end]]></globalevent>
       
    <event type="login" name="Vip" event="script"><![CDATA[
          
            function onLogin(cid)
        registerCreatureEvent(cid, "VipCheck")
            return true
    end]]></event>

    <event type="login" name="VipCheck" event="script"><![CDATA[
        domodlib('VipFunctions')
          
    function onLogin(cid)
            if getPlayerVipDays(cid) >= 1 then
                doPlayerSendTextMessage(cid, 19, "You have ".. getPlayerVipDays(cid) .." vip days left.")
            end
            return true
    end
    ]]></event>
       
    <movevent type="StepIn" actionid="13500" event="script"><![CDATA[
          domodlib('VipFunctions')
          
          function onStepIn(cid, item, position, fromPosition)
    local config = {
    msgDenied = "You cannot enter to VIP area! To buy access visite website: http://www.tibiarl.com/index.php?subtopic=buypoints",
    msgWelcome = "Welcome " .. getCreatureName(cid) .. "!"
    }

            if getPlayerVipDays(cid) == 0 then
    doTeleportThing(cid, fromPosition, true)
    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, config.msgDenied)
    doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
    return TRUE
    end
    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, config.msgWelcome)
    return TRUE
    end
    ]]></movevent>

    <action actionid="2112" event="script"><![CDATA[
       domodlib('VipFunctions')
       
       function onUse(cid, item, frompos, item2, topos)
            if getPlayerVipDays(cid) >= 1 then
                pos = getPlayerPosition(cid)
                if pos.x == topos.x then
                  if pos.y < topos.y then
                      pos.y = topos.y + 1
                  else
                      pos.y = topos.y - 1
                  end
                elseif pos.y == topos.y then
                      if pos.x < topos.x then
                          pos.x = topos.x + 1
                      else
                          pos.x = topos.x - 1
                      end
                else
                    doPlayerSendTextMessage(cid,22,"Stand in front of the door.")
                return true
                end
                doTeleportThing(cid,pos)
                doSendMagicEffect(topos,12)
            else
                doPlayerSendTextMessage(cid,22,'Only VIP Account can go there.')
            end
            return true
    end
    ]]></action>
    <action itemid="8981" event="script"><![CDATA[
       domodlib('VipFunctions')
       
          function onUse(cid, item, fromPosition, itemEx, toPosition)
            if getPlayerVipDays(cid) > 365 then
                doPlayerSendCancel(cid, "You can only have 1 year of vip account or less.")
              else
                doAddVipDays(cid, 3)
             doCreatureSay(cid, "Vip", TALKTYPE_ORANGE_1)
             doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "We have added 3 vip days to your account.")
                doRemoveItem(item.uid)
           end
            return true
       end
    ]]></action>   
    <action itemid="10135" event="script"><![CDATA[
       domodlib('VipFunctions')
       
          function onUse(cid, item, fromPosition, itemEx, toPosition)
            if getPlayerVipDays(cid) > 365 then
                doPlayerSendCancel(cid, "You can only have 1 year of vip account or less.")
              else
                doAddVipDays(cid, 15)
             doCreatureSay(cid, "Vip", TALKTYPE_ORANGE_1)
             doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "We have added 15 vip days to your account.")
                doRemoveItem(item.uid)
           end
            return true
       end
    ]]></action>
    <action itemid="10134" event="script"><![CDATA[
       domodlib('VipFunctions')
       
          function onUse(cid, item, fromPosition, itemEx, toPosition)
            if getPlayerVipDays(cid) > 365 then
                doPlayerSendCancel(cid, "You can only have 1 year of vip account or less.")
              else
                doAddVipDays(cid, 30)
             doCreatureSay(cid, "Vip", TALKTYPE_ORANGE_1)
             doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "We have added 30 vip days to your account.")
                doRemoveItem(item.uid)
           end
            return true
       end
    ]]></action>
    <action itemid="10133" event="script"><![CDATA[
       domodlib('VipFunctions')
       
          function onUse(cid, item, fromPosition, itemEx, toPosition)
            if getPlayerVipDays(cid) > 365 then
                doPlayerSendCancel(cid, "You can only have 1 year of vip account or less.")
              else
                doAddVipDays(cid, 90)
             doCreatureSay(cid, "Vip", TALKTYPE_ORANGE_1)
             doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "We have added 90 vip days to your account.")
                doRemoveItem(item.uid)
           end
            return true
       end
    ]]></action>

    </mod>
    Captura del Error escribió:Imagen del error: Error consola mod vip Empty
    El error radica en: Consola

    4 participantes
    http://baiakciteron.sytes.net

    2Error consola mod vip Empty Re: Error consola mod vip Mar Abr 12, 2022 1:10 pm

    akane

    akane
    Miembro
    Miembro
    Y cual es el error?

    4 participantes

    3Error consola mod vip Empty Re: Error consola mod vip Mar Abr 12, 2022 5:30 pm

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    En que consola estas usando este mod nos podrias mostrar una imagen de tu consola



    Error consola mod vip YNU5B25
    4 participantes
    http://www.tibiaface.com

    4Error consola mod vip Empty Re: Error consola mod vip Mar Abr 12, 2022 7:20 pm

    ioke

    ioke
    Miembro
    Miembro
    Error consola mod vip Screen17

    Poncex el error no sé cuál es solo sé que me sale eso aveces en la consola y no para de salir

    4 participantes
    http://baiakciteron.sytes.net

    5Error consola mod vip Empty Re: Error consola mod vip Jue Abr 14, 2022 3:06 pm

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    creo que el problema aqui es que no se esta removiendo el los vip days



    Error consola mod vip YNU5B25
    4 participantes
    http://www.tibiaface.com

    6Error consola mod vip Empty Re: Error consola mod vip Sáb Abr 16, 2022 7:44 am

    ioke

    ioke
    Miembro
    Miembro
    Si los elimina esque el mod funciona bien pero aveces sale ese error :S

    4 participantes
    http://baiakciteron.sytes.net

    7Error consola mod vip Empty Re: Error consola mod vip Vie Abr 22, 2022 8:25 pm

    Josens

    Josens
    Miembro
    Miembro
    El error lo dice todo, intenta con esto:

    Código:
    <?xml version="1.0" encoding="UTF-8"?>
    <mod name="Vipsystem" version="1.0"

    author="Ioke" contact="http://tibiarl.com" enabled="yes">

    <!--- Information
    Vip Item = 10135
    Vip Item = 10134
    Vip Item = 10133
    set action id 11223 to the tile you want to be vip tile
    set action id 2112 to the door you want to be vip door


            MYSQL TABLE
    ........................................................
    ALTER TABLE `accounts` ADD
    `vipdays` int(11) NOT NULL DEFAULT 0;
    ........................................................

    -->

    <config name="VipFunctions"><![CDATA[
    function getPlayerVipDays(cid)
        local Info = db.getResult("SELECT `vipdays` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. " LIMIT 1")
            if Info:getID() ~= LUA_ERROR then
            local days= Info:getDataInt("vipdays")
            Info:free()
            return days
        end
        return LUA_ERROR
    end

    function doAddVipDays(cid, days)
        db.query("UPDATE `accounts` SET `vipdays` = `vipdays` + " .. days .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
    end

    function doRemoveVipDays(cid, days)
        db.query("UPDATE `accounts` SET `vipdays` = `vipdays` - " .. days .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
    end
    ]]></config>

    <globalevent name="VipDaysRemover" time="00:01" event="script"><![CDATA[
         
          function onTime()
                    db.query("UPDATE accounts SET vipdays = vipdays - 1 WHERE vipdays > 0;")
            return true
      end
      ]]></globalevent>
     
    <globalevent name="vipEffect" interval="18000" event="script"><![CDATA[
      domodlib('VipFunctions')
     
      function onThink(interval, lastExecution)
            for _, name in ipairs(getOnlinePlayers()) do
            local cid = getPlayerByName(name)
                  if getPlayerVipDays(cid) >= 1 then
                      doSendMagicEffect(getPlayerPosition(cid), 27)
                      doSendAnimatedText(getPlayerPosition(cid), "VIP!", TEXTCOLOR_RED)
                  end
            end
            return true
    end]]></globalevent>
     
    <event type="login" name="Vip" event="script"><![CDATA[
         
            function onLogin(cid)
        registerCreatureEvent(cid, "VipCheck")
            return true
    end]]></event>

    <event type="login" name="VipCheck" event="script"><![CDATA[
        domodlib('VipFunctions')
         
    function onLogin(cid)
            if getPlayerVipDays(cid) >= 1 then
                doPlayerSendTextMessage(cid, 19, "You have ".. getPlayerVipDays(cid) .." vip days left.")
            end
            return true
    end
    ]]></event>
     
    <movevent type="StepIn" actionid="13500" event="script"><![CDATA[
          domodlib('VipFunctions')
         
          function onStepIn(cid, item, position, fromPosition)
           if(not isPlayer(cid))then
             return true
          end
          
          local config = {
          msgDenied = "You cannot enter to VIP area! To buy access visite website: http://www.tibiarl.com/index.php?subtopic=buypoints",
          msgWelcome = "Welcome " .. getCreatureName(cid) .. "!"
          }

            if getPlayerVipDays(cid) == 0 then
    doTeleportThing(cid, fromPosition, true)
    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, config.msgDenied)
    doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
    return TRUE
    end
    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, config.msgWelcome)
    return TRUE
    end
    ]]></movevent>

    <action actionid="2112" event="script"><![CDATA[
      domodlib('VipFunctions')
     
      function onUse(cid, item, frompos, item2, topos)
            if getPlayerVipDays(cid) >= 1 then
                pos = getPlayerPosition(cid)
                if pos.x == topos.x then
                  if pos.y < topos.y then
                      pos.y = topos.y + 1
                  else
                      pos.y = topos.y - 1
                  end
                elseif pos.y == topos.y then
                      if pos.x < topos.x then
                          pos.x = topos.x + 1
                      else
                          pos.x = topos.x - 1
                      end
                else
                    doPlayerSendTextMessage(cid,22,"Stand in front of the door.")
                return true
                end
                doTeleportThing(cid,pos)
                doSendMagicEffect(topos,12)
            else
                doPlayerSendTextMessage(cid,22,'Only VIP Account can go there.')
            end
            return true
    end
    ]]></action>
    <action itemid="8981" event="script"><![CDATA[
      domodlib('VipFunctions')
     
          function onUse(cid, item, fromPosition, itemEx, toPosition)
            if getPlayerVipDays(cid) > 365 then
                doPlayerSendCancel(cid, "You can only have 1 year of vip account or less.")
              else
                doAddVipDays(cid, 3)
            doCreatureSay(cid, "Vip", TALKTYPE_ORANGE_1)
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "We have added 3 vip days to your account.")
                doRemoveItem(item.uid)
            end
            return true
      end
    ]]></action> 
    <action itemid="10135" event="script"><![CDATA[
      domodlib('VipFunctions')
     
          function onUse(cid, item, fromPosition, itemEx, toPosition)
            if getPlayerVipDays(cid) > 365 then
                doPlayerSendCancel(cid, "You can only have 1 year of vip account or less.")
              else
                doAddVipDays(cid, 15)
            doCreatureSay(cid, "Vip", TALKTYPE_ORANGE_1)
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "We have added 15 vip days to your account.")
                doRemoveItem(item.uid)
            end
            return true
      end
    ]]></action>
    <action itemid="10134" event="script"><![CDATA[
      domodlib('VipFunctions')
     
          function onUse(cid, item, fromPosition, itemEx, toPosition)
            if getPlayerVipDays(cid) > 365 then
                doPlayerSendCancel(cid, "You can only have 1 year of vip account or less.")
              else
                doAddVipDays(cid, 30)
            doCreatureSay(cid, "Vip", TALKTYPE_ORANGE_1)
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "We have added 30 vip days to your account.")
                doRemoveItem(item.uid)
            end
            return true
      end
    ]]></action>
    <action itemid="10133" event="script"><![CDATA[
      domodlib('VipFunctions')
     
          function onUse(cid, item, fromPosition, itemEx, toPosition)
            if getPlayerVipDays(cid) > 365 then
                doPlayerSendCancel(cid, "You can only have 1 year of vip account or less.")
              else
                doAddVipDays(cid, 90)
            doCreatureSay(cid, "Vip", TALKTYPE_ORANGE_1)
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "We have added 90 vip days to your account.")
                doRemoveItem(item.uid)
            end
            return true
      end
    ]]></action>

    </mod>



    Very Happy Que te sirva Error consola mod vip 2764
    4 participantes

    8Error consola mod vip Empty Re: Error consola mod vip Vie Abr 22, 2022 8:30 pm

    ioke

    ioke
    Miembro
    Miembro
    eres un maestro bro ahi te va tu like



    Very Happy Resuelto Gracias Very Happy

    4 participantes
    http://baiakciteron.sytes.net

    Contenido patrocinado


    4 participantes

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