• TibiaFace

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

    .
    demo menumenu

    Afiliados



    Votar:

    error en consola con rush event

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

    1Resuelto error en consola con rush event el Lun Jul 03, 2017 6:57 pm

    joseolaizo

    avatar
    Miembro
    Miembro
    Mi Problema:
    primero que nada gracias de antemano, el problema que tengo es con el mod rush event, que todo parece muy bien pero al utilizar el comando "!rush join" para entrar al evento, no se reconoce el comando y envia dicho error en la consola. aqui esta el codigo del mod si es de ayuda.

    Código:
     <?xml version="1.0" encoding="UTF-8"?>
    <mod name="Rush Event" version="1.0.0" author="Dr Slump" enabled="yes">
        <config name="config_rush_event">
     <![CDATA[
     configRushEvent = {
     storages = {
     main = 'rushEventMain', -- set free storage
     player = 'rushEventPlayer', -- set free storage
     joining = 'rushEventJoining', -- set free storage
     b_score = 'rushEventBlueScore', -- set free storage
     r_score = 'rushEventRedScore', -- set free storage
     exhaust = 'rushEventExhaust',
     countEvent = 'rushEventCountEvent'
     },

     position = {
     blue = {x=31914, y=32484, z=7}, -- posiotion to which player is teleporting
     red = {x=31925, y=32484, z=7} -- posiotion to which player is teleporting
     },

     room = {
     from = {x=31836,y=32453,z=6}, -- left top corner of event room
     to = {x=31895,y=32504,z=7} -- right bottom corner of event room
     },

     rewards = {2160,10}, -- reward id which player can win (reward is random)
     players = {
     max = 40,
     min = 2,
     minLevel = 8
     },

     days = {
     ['Monday'] = {'21:00:00'},
     ['Tuesday'] = {'17:00:00'},
     ['Thursday'] = {'17:00:20'}
     },

     fragLimit = 50, -- frag limit
     
     waitTime = 5, -- sekundy [ile gracz ma czekac jak padnie]

     delayTime = 5.0, -- time in which players who joined to event are teleporting to teleport position [miuntes]
     startEvent = 1, -- time from teleport to start event [seconds]
     stopEvent = 600, -- [seconds]
     text = 'Enjoy Batlefield, the event will take 10min, team with 50 frags will win.'
     }

     ]]>
     </config>

     <lib name="lib_rush_event">
     <![CDATA[
     domodlib('config_rush_event')

     local conditionBlue = createConditionObject(CONDITION_OUTFIT)
     setConditionParam(conditionBlue, CONDITION_PARAM_TICKS, -1)
     addOutfitCondition(conditionBlue, {lookType = 130, lookHead = 87, lookBody = 87, lookLegs = 87, lookFeet = 87})

     local conditionRed = createConditionObject(CONDITION_OUTFIT)
     setConditionParam(conditionRed, CONDITION_PARAM_TICKS, -1)
     addOutfitCondition(conditionRed, {lookType = 130, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94})

     function doStartRushEvent()
     doSetStorage(configRushEvent.storages.joining, -1)

     if configRushEvent.players.min <= doCountPlayersRushEvent()[1] then
     for _, cid in ipairs(getPlayersOnline()) do
     local p = tostring(getCreatureStorage(cid, configRushEvent.storages.player))
     if p ~= '' then
     doTeleportThing(cid, p ~= 'blue' and configRushEvent.position.red or configRushEvent.position.blue)
     doCreatureSetNoMove(cid, false)
     doRemoveCondition(cid, CONDITION_INFIGHT)
     doAddCondition(cid, p ~= 'blue' and conditionRed or conditionBlue)
     doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'Get ready. Rush Event starts in '..configRushEvent.startEvent..' seconds.')
     end
     end

     addEvent(doSetStorage, configRushEvent.startEvent * 1000, configRushEvent.storages.main, 1)
     addEvent(doStopRushEvent, configRushEvent.stopEvent * 1000)
     doBroadcastMessage('Rush Event has started. LET\'S GO!')
     else
     for _, cid in ipairs(getPlayersOnline()) do
     if tostring(getCreatureStorage(cid, configRushEvent.storages.player)) ~= '' then
     doCreatureSetNoMove(cid, false)
     doRemoveCondition(cid, CONDITION_INFIGHT)
     doCreatureSetStorage(cid, configRushEvent.storages.player, '')
     end
     end

     doBroadcastMessage('Rush Event hasn\'t started beacuse there not were enough players.')
     end
     end

     function doStopRushEvent()
     if getStorage(configRushEvent.storages.main) > 0 then
     local team = nil
     if getStorage(configRushEvent.storages.b_score) == configRushEvent.fragLimit then
     team = 'blue'
     elseif getStorage(configRushEvent.storages.r_score) == configRushEvent.fragLimit then
     team = 'red'
     else
     if getStorage(configRushEvent.storages.r_score) >= getStorage(configRushEvent.storages.b_score) then
     team = 'red'
     else
     team = 'blue'
     end
     end

     local prize = math.random(#configRushEvent.rewards)
     for _, cid in ipairs(getPlayersOnline()) do
     if isInRange(getThingPos(cid), configRushEvent.room.from, configRushEvent.room.to) then
     if team == tostring(getCreatureStorage(cid, configRushEvent.storages.player)) then
     doPlayerAddItem(cid, configRushEvent.rewards[prize], 1)
     doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'Your team won! You have received '.. getItemNameById(configRushEvent.rewards[prize]) ..' as reward.')
     end

     doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid))
     doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid))
     doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
     doCreatureSetStorage(cid, configRushEvent.storages.player, '')
     doRemoveCondition(cid, CONDITION_OUTFIT)
     end
     end

     doBroadcastMessage('Rush Event has finished. The winner is '..team..' team ('..getStorage(configRushEvent.storages.r_score)..':'..getStorage(configRushEvent.storages.b_score)..'). Congratulations!')
     db.query("INSERT INTO `events` (`event_name`, `winner_name`, `won_item`, `time_win`) VALUES ("Rush", ""..team.."", ""..prize.."", "..getStorage(configRushEvent.storages.countEvent)..");")
     doSetStorage(configRushEvent.storages.main, -1)
     doSetStorage(configRushEvent.storages.countEvent, getStorage(configRushEvent.storages.countEvent) + 1)
     doSetStorage(configRushEvent.storages.r_score, 0)
     doSetStorage(configRushEvent.storages.b_score, 0)
     end
     end

     function doCountPlayersRushEvent()
     local x, blue, red = 0,0,0
     for _, cid in ipairs(getPlayersOnline()) do
     local p = tostring(getCreatureStorage(cid, configRushEvent.storages.player))
     if p ~= '' then
     if p ~= 'blue' then
     red = red + 1
     else
     blue = blue + 1
     end
     x = x + 1
     end
     end
     return {x, blue, red}
     end

     function doStartCountingRushEvent(x)
     if configRushEvent.delayTime-x > 0 then
     doBroadcastMessage('Event Rush will start in '..configRushEvent.delayTime-x..' minutes. To join use "!rush join".')
     addEvent(doStartCountingRushEvent, 60*1000, x+1)
     end
     end
     ]]>
     </lib>

     <talkaction words="!stoprush" access="5" event="script">
     <![CDATA[
     domodlib("lib_rush_event")

     function onSay(cid, words, param)
     if getStorage(configRushEvent.storages.main) < 1 then
     return doPlayerSendCancel(cid, 'You can not do it if Rush Event is not enabled.')
     end
     
     doStopRushEvent()
     return true
     end
     ]]>
     </talkaction>

     <talkaction words="!startrush" access="5" event="script">
     <![CDATA[
     domodlib("lib_rush_event")

     function onSay(cid, words, param)
     if getStorage(configRushEvent.storages.main) > 0 then
     return doPlayerSendCancel(cid, 'Rush Event is already running.')
     end

     for _, pid in ipairs(getPlayersOnline()) do
     if tostring(getCreatureStorage(pid, configRushEvent.storages.player)) ~= '' then
     doCreatureSetStorage(pid, configRushEvent.storages.player, '')
     doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)), true)
     doRemoveCondition(pid, CONDITION_OUTFIT)
     end
     end

     doStartCountingRushEvent(0)
     doSetStorage(configRushEvent.storages.joining, 1)
     addEvent(doStartRushEvent, configRushEvent.delayTime * 60 * 1000)
     return true
     end
     ]]>
     </talkaction>

     <talkaction words="!rush" event="script">
     <![CDATA[
     domodlib("lib_rush_event")

     function onSay(cid, words, param)
     if getStorage(configRushEvent.storages.joining) ~= 1 then
     return doPlayerSendCancel(cid, 'Rush Event hasn\'t started yet.')
     elseif param == '' then
     return doPlayerSendCancel(cid, 'Command param required (say: "!rush join" or "!rush leave.").')
     elseif getPlayerLevel(cid) < configRushEvent.players.minLevel then
     return doPlayerSendCancel(cid, 'You can\'t join to the event if you don\'t have a require '..configRushEvent.players.minLevel..' level.')
     elseif getTileInfo(getThingPos(cid)).protection ~= true then
     return doPlayerSendCancel(cid, 'You can\'t join to the event if you aren\'t in protection zone.')
     elseif exhaustion.check(cid, configRushEvent.storages.exhaust) ~= false then
     return doPlayerSendCancel(cid, 'You must wait '..exhaustion.get(cid, configRushEvent.storages.exhaust)..' seconds to use this command again.')
     end

     if param == 'join' then
     if tostring(getCreatureStorage(cid, configRushEvent.storages.player)) ~= '' then
     return doPlayerSendCancel(cid, 'You have arleady joined to event. Wait patiently for start.')
     elseif doCountPlayersRushEvent()[1] == configRushEvent.players.max then
     return doPlayerSendCancel(cid, 'Max players in the event have been reached.')
     end
     
     for _, v in ipairs(getPlayersOnline()) do
     if tostring(getCreatureStorage(v, configRushEvent.storages.player)) ~= '' then
     if getPlayerIp(cid) == getPlayerIp(v) then
     return doPlayerSendCancel(cid, 'In Rush event there is arleady player who have same ip like you.')
     end
     end
     end

     doCreatureSetNoMove(cid, true)
     if configRushEvent.text ~= '' then
     doPlayerPopupFYI(cid, configRushEvent.text)
     end

     doCreatureSetStorage(cid, configRushEvent.storages.player, doCountPlayersRushEvent()[3] >= doCountPlayersRushEvent()[2] and 'blue' or 'red')
     doAddCondition(cid, createConditionObject(CONDITION_INFIGHT, -1))
     doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You have joined to Rush Event. You can\'t move until event don\'t start. Wait patiently for the event start.')
     doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, 'You have joined to Rush Event.')
     elseif param == 'leave' then
     if tostring(getCreatureStorage(cid, configRushEvent.storages.player)) ~= '' then
     return doPlayerSendCancel(cid, 'You can\'t leave from the event if you don\'t join.')
     end

     doCreatureSetNoMove(cid, false)
     doRemoveCondition(cid, CONDITION_INFIGHT)
     doCreatureSetStorage(cid, configRushEvent.storages.player, '')
     doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, 'You have left from the Rush Event.')
     end

     exhaustion.set(cid, configRushEvent.storages.exhaust, 5)
     return true
     end
     ]]>
     </talkaction>


     <globalevent name="Rush_Event_Days" interval="10000" event="script">
     <![CDATA[
     domodlib("lib_rush_event")

     local daysOpen = {}
     for k, v in pairs(configRushEvent.days) do
     table.insert(daysOpen, k)
     end

     function onThink(cid, interval)
     if isInArray(daysOpen, os.date('%A')) then
     if isInArray(configRushEvent.days[os.date('%A')], os.date('%X', os.time())) then
     if getStorage(configRushEvent.storages.joining) ~= 1 then
     doStartCountingRushEvent(0)

     for _, pid in ipairs(getPlayersOnline()) do
     if tostring(getCreatureStorage(pid, configRushEvent.storages.player)) ~= '' then
     doCreatureSetStorage(pid, configRushEvent.storages.player, '')
     doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)), true)
     doRemoveCondition(pid, CONDITION_OUTFIT)
     end
     end

     doSetStorage(configRushEvent.storages.joining, 1)
     addEvent(doStartRushEvent, configRushEvent.delayTime * 60 * 1000)
     end
     end
     end

     return true
     end
     ]]>
     </globalevent>

     <event type="statschange" name="Rush_Event_Dead" event="script">
     <![CDATA[
     domodlib("lib_rush_event")

     function onStatsChange(cid, attacker, type, combat, value)
     if type == 1 and getCreatureHealth(cid) <= value then
     if isInRange(getThingPos(cid), configRushEvent.room.from, configRushEvent.room.to) then
     if isPlayer(cid) then
     local p = tostring(getCreatureStorage(cid, configRushEvent.storages.player))
     doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid))
     doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid))
     doTeleportThing(cid, p ~= 'blue' and configRushEvent.position.red or configRushEvent.position.blue)
     doCreatureSetNoMove(cid, true)
     addEvent(doCreatureSetNoMove, configRushEvent.waitTime * 1000, cid, false)

     if p ~= 'blue' then
     doSetStorage(configRushEvent.storages.b_score, math.max(getStorage(configRushEvent.storages.b_score), 0) + 1)
     if getStorage(configRushEvent.storages.b_score) == configRushEvent.fragLimit then
     doStopRushEvent()
     end
     else
     doSetStorage(configRushEvent.storages.r_score, math.max(getStorage(configRushEvent.storages.r_score), 0) + 1)
     if getStorage(configRushEvent.storages.r_score) == configRushEvent.fragLimit then
     doStopRushEvent()
     end
     end
     return false
     end
     end
     elseif isInArray({1,3}, type) and isPlayer(attacker) and isPlayer(cid) then
     if isInRange(getThingPos(cid), configRushEvent.room.from, configRushEvent.room.to) then
     if tostring(getCreatureStorage(cid, configRushEvent.storages.player)) == tostring(getCreatureStorage(attacker, configRushEvent.storages.player)) then
     return false
     end
     end
     end
     return true
     end
     ]]>
     </event>

     <event type="login" name="Rush_Event_Login" event="script">
     <![CDATA[
     domodlib("config_rush_event")

     function onLogin(cid)
     if tostring(getCreatureStorage(cid, configRushEvent.storages.player)) ~= '' then
     doCreatureSetStorage(cid, configRushEvent.storages.player, '')
     doRemoveCondition(cid, CONDITION_OUTFIT)
     end

     registerCreatureEvent(cid, 'Rush_Event_Dead')
     return true
     end
     ]]>
     </event>

     <globalevent name="Rush_Event_Start" type="startup" event="script">
     <![CDATA[
     domodlib("config_rush_event")

     function onStartup()
     doSetStorage(configRushEvent.storages.main, -1)
     doSetStorage(configRushEvent.storages.r_score, 0)
     doSetStorage(configRushEvent.storages.b_score, 0)
     doSetStorage(configRushEvent.storages.joining, -1)
     return true
     end
     ]]>
     </globalevent>
    </mod>


    Imagen de mi error:


    Esta en:
    Consola

    Ver perfil de usuario

    2Resuelto Re: error en consola con rush event el Lun Jul 03, 2017 8:08 pm

    [Admin] God Maya

    avatar
    Administrador
    Administrador
    auqi esta el error tienes que configurar esto

    Código:
    configRushEvent = {
                    storages = {
                        main = 1000, -- set free storage
                        player = 1001, -- set free storage
                        joining = 1002, -- set free storage
                        b_score = 1003, -- set free storage
                        r_score = 1004, -- set free storage
                        exhaust = 20, -- not sure if seconds or miliseconds ( if miliseconds due 20 * 1000)
                        countEvent = 1005
                    },




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

    3Resuelto Re: error en consola con rush event el Jue Jul 06, 2017 1:46 pm

    joseolaizo

    avatar
    Miembro
    Miembro
    Very Happy Resuelto Gracias Very Happy

    Ver perfil de usuario

    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.