Ir para conteúdo

bielredblood

Membro
  • Registro em

  • Última visita

Tudo que bielredblood postou

  1. Tfs 0.4.0 Você tem o código disponível? Se tiver publique-o aqui: <?xml version="1.0" encoding="UTF-8"?> <mod name="Run_Event" version="3.0" author="CollocorpuseK" contact="otland.net" enabled="yes"> <config name="config_run_event"> <![CDATA[ configRunEvent = { storages = { player = 'runEventPlayer', -- set free storage joining = 'runEventJoining', -- set free storage group = 'runEventGroup', -- set free storage exhaust = 'runEventExhaust', -- set free storage countEvent = 'runEventCountEvent' -- set free storage }, position = {x=2999, y=3009, z=7}, -- Posicao que vai ser teleportado os players rewards = {9931, 7697, 2346, 8880}, -- Itens pro vencedor ( Sera sortido) players = { max = 45, -- Maximo de player min = 1, -- Minimo de player minLevel = 100, -- Level minimo pra entrar no evento speed = 200 -- Velocidade que todos ficaram }, days = { ['Monday'] = {'16:00:20'}, ['Tuesday'] = {'16:00:20'}, ['Wednesday'] = {'16:00:20'}, ['Thursday'] = {'16:00:20'}, ['Friday'] = {'16:00:20'}, ['Saturday'] = {'16:00:20'}, ['Sunday'] = {'12:44:20'} }, delayTime = 5.0, -- Tempo pros players dizer o comando [minutos] startEvent = 2, -- Tempo pra começar o evento quando todos players tiverem no local [ segundos ] text = 'Vai comecar o Run Evento, se preparem' } ]]> </config> <lib name="lib_run_event"> <![CDATA[ function doStartEventRun() if configRunEvent.players.min <= doCountPlayersRunEvent() then for _, cid in ipairs(getPlayersOnline()) do if getCreatureStorage(cid, configRunEvent.storages.player) > 0 then doRemoveCondition(cid, CONDITION_INFIGHT) -- fight doTeleportThing(cid, configRunEvent.position) -- teleport pos doChangeSpeed(cid, configRunEvent.players.speed - getCreatureBaseSpeed(cid)) -- predkosc doCreatureSetStorage(cid, configRunEvent.storages.group, getPlayerGroupId(cid)) -- storage doPlayerSetGroupId(cid, 7) -- grupa addEvent(doCreatureSetNoMove, configRunEvent.startEvent * 1000, cid, false) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'Get ready. Run Event start in '..configRunEvent.startEvent..' seconds.') end end addEvent(doCheckSpeedRunEvent, configRunEvent.startEvent * 1000) doBroadcastMessage('Run Event has started. LET\'S GO!') else for _, cid in ipairs(getPlayersOnline()) do if getCreatureStorage(cid, configRunEvent.storages.player) > 0 then doCreatureSetStorage(cid, configRunEvent.storages.player, -1) doCreatureSetNoMove(cid, false) doRemoveCondition(cid, CONDITION_INFIGHT) end end doBroadcastMessage('Run Event hasn\'t started beacuse there were not enough players.') end doSetStorage(configRunEvent.storages.joining, -1) end function doCountPlayersRunEvent() local x = 0 for _, cid in ipairs(getPlayersOnline()) do if getCreatureStorage(cid, configRunEvent.storages.player) > 0 then x = x + 1 end end return x end function doStartCountingRunEvent(x) if configRunEvent.delayTime-x > 0 then doBroadcastMessage('Run Event is going to start in '..configRunEvent.delayTime-x..' minutes. You can join to the event by saying "!run join".') addEvent(doStartCountingRunEvent, 60*1000, x+1) end end function doCheckSpeedRunEvent() if doCountPlayersRunEvent() > 0 then addEvent(doCheckSpeedRunEvent, 1000) end for _, cid in ipairs(getPlayersOnline()) do if getCreatureStorage(cid, configRunEvent.storages.player) > 0 then if getCreatureSpeed(cid) ~= configRunEvent.players.speed then doChangeSpeed(cid, (getCreatureSpeed(cid) < configRunEvent.players.speed and configRunEvent.players.speed - getCreatureSpeed(cid) or getCreatureSpeed(cid) > configRunEvent.players.speed and - (getCreatureSpeed(cid) - configRunEvent.players.speed))) end end end end ]]> </lib> <talkaction words="!run" event="script"> <![CDATA[ domodlib("config_run_event") function onSay(cid, words, param) if getStorage(configRunEvent.storages.joining) ~= 1 then return doPlayerSendCancel(cid, 'The Run Event hasn\'t started yet.') elseif param == '' then return doPlayerSendCancel(cid, 'Command param required (say: "!run join" or "!run leave.").') elseif getPlayerLevel(cid) < configRunEvent.players.minLevel then return doPlayerSendCancel(cid, 'You can\'t join to the event if you don\'t have a require '..configRunEvent.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, configRunEvent.storages.exhaust) ~= false then return doPlayerSendCancel(cid, 'You must wait '..exhaustion.get(cid, configRunEvent.storages.exhaust)..' seconds to use this command again.') end if param == 'join' then if getCreatureStorage(cid, configRunEvent.storages.player) > 0 then return doPlayerSendCancel(cid, 'You have arleady joined to event. Wait patiently for start.') elseif doCountPlayersRunEvent() == configRunEvent.players.max then return doPlayerSendCancel(cid, 'Max players in the event have been reached.') end doCreatureSetNoMove(cid, true) doPlayerPopupFYI(cid, configRunEvent.text) doCreatureSetStorage(cid, configRunEvent.storages.player, 1) doAddCondition(cid, createConditionObject(CONDITION_INFIGHT, -1)) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You have joined to Run 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 Run Event.') elseif param == 'leave' then if getCreatureStorage(cid, configRunEvent.storages.player) <= 0 then return doPlayerSendCancel(cid, 'You can\'t leave from the event if you don\'t join.') end doCreatureSetNoMove(cid, false) doCreatureSetStorage(cid, configRunEvent.storages.player, -1) doRemoveCondition(cid, CONDITION_INFIGHT) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, 'You have left from the Run Event.') end exhaustion.set(cid, configRunEvent.storages.exhaust, 5) return true end ]]> </talkaction> <talkaction words="!startrun" access="5" event="script"> <![CDATA[ domodlib("config_run_event") domodlib("lib_run_event") function onSay(cid, words, param) doSetStorage(configRunEvent.storages.joining, 1) addEvent(doStartEventRun, configRunEvent.delayTime * 60 * 1000) doStartCountingRunEvent(0) for _, pid in ipairs(getPlayersOnline()) do if getCreatureStorage(pid, configRunEvent.storages.player) > 0 then doCreatureSetStorage(pid, configRunEvent.storages.player, -1) doPlayerSetGroupId(pid, getCreatureStorage(pid, configRunEvent.storages.group)) doChangeSpeed(pid, getCreatureBaseSpeed(pid) - configRunEvent.players.speed) doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)), true) end end return true end ]]> </talkaction> <movement type="StepIn" actionid="5467" event="script"> <![CDATA[ domodlib("config_run_event") function onStepIn(cid, item, position) if getCreatureStorage(cid, configRunEvent.storages.player) > 0 then local prize = math.random(#configRunEvent.rewards) doCreatureSetStorage(cid, configRunEvent.storages.player, -1) doPlayerAddItem(cid, configRunEvent.rewards[prize], 1) doChangeSpeed(cid, getCreatureBaseSpeed(cid) - configRunEvent.players.speed) doPlayerSetGroupId(cid, math.max(1, getCreatureStorage(cid, configRunEvent.storages.group))) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), true) doBroadcastMessage('Run Event has finished. The winner is '..getCreatureName(cid)..'.') doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You are winner. You have won '..getItemNameById(configRunEvent.rewards[prize])..'.') db.query("INSERT INTO `events` (`event_name`, `winner_name`, `won_item`, `time_win`) VALUES (\"Run\", \"" .. getCreatureName(cid) .. "\", \"" .. getItemNameById(configRunEvent.rewards[prize]) .. "\", " .. getStorage(configRunEvent.storages.countEvent) ..");") doSetStorage(configRunEvent.storages.countEvent, getStorage(configRunEvent.storages.countEvent) + 1) for _, pid in ipairs(getPlayersOnline()) do if getCreatureStorage(pid, configRunEvent.storages.player) > 0 then doCreatureSetStorage(pid, configRunEvent.storages.player, -1) doPlayerSetGroupId(pid, math.max(1, getCreatureStorage(pid, configRunEvent.storages.group))) doChangeSpeed(pid, getCreatureBaseSpeed(pid) - configRunEvent.players.speed) doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)), true) doPlayerSendTextMessage(pid, MESSAGE_EVENT_ADVANCE, 'You loss.') end end end return true end ]]> </movement> <globalevent name="Run_Event_Days" interval="1000" event="script"> <![CDATA[ domodlib("config_run_event") domodlib("lib_run_event") local daysOpen = {} for k, v in pairs(configRunEvent.days) do table.insert(daysOpen, k) end function onThink(interval) if isInArray(daysOpen, os.date("%A")) then if isInArray(configRunEvent.days[os.date("%A")], os.date("%X", os.time())) then if getStorage(configRunEvent.storages.joining) ~= 1 then doSetStorage(configRunEvent.storages.joining, 1) addEvent(doStartEventRun, configRunEvent.delayTime * 60 * 1000) doStartCountingRunEvent(0) for _, pid in ipairs(getPlayersOnline()) do if getCreatureStorage(pid, configRunEvent.storages.player) > 0 then doCreatureSetStorage(pid, configRunEvent.storages.player, -1) doPlayerSetGroupId(pid, math.max(1, getCreatureStorage(pid, configRunEvent.storages.group))) doChangeSpeed(pid, getCreatureBaseSpeed(pid) - configRunEvent.players.speed) doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)), true) end end end end end return true end ]]> </globalevent> <event type="login" name="Run_Event_Login" event="script"> <![CDATA[ domodlib("config_run_event") function onLogin(cid) if getCreatureStorage(cid, configRunEvent.storages.player) > 0 then doCreatureSetStorage(cid, configRunEvent.storages.player, -1) doPlayerSetGroupId(cid, math.max(1, getCreatureStorage(cid, configRunEvent.storages.group))) doCreatureSetNoMove(cid, false) doRemoveCondition(cid, CONDITION_INFIGHT) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), true) end return true end ]]> </event> <globalevent name="Run_Event_Start" type="startup" event="script"> <![CDATA[ domodlib("config_run_event") function onStartup() doSetStorage(configRunEvent.storages.joining, -1) return true end ]]> </globalevent> </mod> Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. @Vodkart
  2. TFS 0.4.0 Base rox editada por deathrocks Player morre porém não desloga nem perde nada apenas renasce no mesmo lugar com vida cheia -- aparece corpse -- Você tem o código disponível? Se tiver publique-o aqui: [10:59:08.154] [Error - CreatureScript Interface][10:59:08.154] domodlib('re')[10:59:08.154] function onPrepareDeath(cid, deathList)[10:59:08.154] if(not isPlayer(cid)) then[10:59:08.164] return true[10:59:08.164] end[10:59:08.164] if getGlobalStorageValue(t.a) == 1 then[10:59:08.164] local strings = {""}[10:59:08.164] local j, position, corpse = 1, 1, 0[10:59:08.164] for _, pid in ipairs(deathList) do[10:59:08.164] if isCreature(pid) == true then[10:59:08.164] strings[position] = j == 1 and "" or strings[position] .. ", "[10:59:08.164] strings[position] = strings[position] .. getCreatureName(pid) ..""[10:59:08.174] j = j + 1[10:59:08.174] else[10:59:08.174] strings[position] = j == 1 and "" or strings[position] .. ", "[10:59:08.174] strings[position] = strings[position] .."a field item"[10:59:08.174] j = j + 1[10:59:08.174] end[10:59:08.174] end[10:59:08.174] for i, str in ipairs(strings) do[10:59:08.174] if(str:sub(str:len()) ~= ",") then[10:59:08.174] str = str .. "."[10:59:08.184] end[10:59:08.184] desc = "You recognize "[10:59:08.184] desc = desc .. "" .. getCreatureName(cid) .. ". He was killed by" .. str[10:59:08.184] end[10:59:08.184] if(getPlayerSex(cid) == 1) then[10:59:08.184] corpse = doCreateItem(3058, getCreaturePosition(cid))[10:59:08.184] else[10:59:08.184] corpse = doCreateItem(3065, getCreaturePosition(cid))[10:59:08.184] end[10:59:08.194] doItemSetAttribute(corpse, "description", desc)[10:59:08.194] if((getPlayerStorageValue(cid, t.g) % 2) == 1) then[10:59:08.194] setGlobalStorageValue(t.u, getGlobalStorageValue(t.u)+1)[10:59:08.194] else[10:59:08.194] setGlobalStorageValue(t.l, getGlobalStorageValue(t.l)+1)[10:59:08.194] end[10:59:08.194] local red = getGlobalStorageValue(t.l)[10:59:08.194] local blue = getGlobalStorageValue(t.u)[10:59:08.194] if blue < t.v or red < t.v then[10:59:08.194] if(isPlayer(cid) == false) then[10:59:08.204] return true[10:59:08.204] end[10:59:08.204] if((getPlayerStorageValue(cid, t.g) % 2) == 1) then[10:59:08.204] doTeleportThing(cid, t.d_1)[10:59:08.204] doSendMagicEffect(getCreaturePosition(cid), 10)[10:59:08.204] doCreatureAddHealth(cid, getCreatureMaxHealth(cid), MAGIC_EFFECT_UNKNOWN, COLOR_UNKNOWN, true)[10:59:08.204] doCreatureAddMana(cid, getCreatureMaxMana(cid))[10:59:08.204] doPlayerRemoveLethalConditions(cid)[10:59:08.204] if getCreatureSkullType(cid) == SKULL_WHITE then[10:59:08.204] doCreatureSetSkullType(cid, 0)[10:59:08.215] end[10:59:08.216] else[10:59:08.217] doTeleportThing(cid, t.d_2)[10:59:08.218] doSendMagicEffect(getCreaturePosition(cid), 10)[10:59:08.219] doCreatureAddHealth(cid, getCreatureMaxHealth(cid), MAGIC_EFFECT_UNKNOWN, COLOR_UNKNOWN, true)[10:59:08.220] doCreatureAddMana(cid, getCreatureMaxMana(cid))[10:59:08.221] doPlayerRemoveLethalConditions(cid)[10:59:08.222] if getCreatureSkullType(cid) == SKULL_WHITE then[10:59:08.223] doCreatureSetSkullType(cid, 0)[10:59:08.224] end[10:59:08.225] end[10:59:08.228] end[10:59:08.229] if blue >= t.v then[10:59:08.230] doBroadcastMessage(t.y, MESSAGE_STATUS_WARNING)[10:59:08.231] setGlobalStorageValue(t.h, 1)[10:59:08.232] for _, pid in ipairs(getPlayersOnline()) do[10:59:08.234] if(getPlayerStorageValue(pid, t.f_1) == 1) then[10:59:08.235] doPlayerAddItem(cid, 2160, 30)[10:59:08.236] end[10:59:08.237] end[10:59:08.238] elseif red >= t.v then[10:59:08.239] doBroadcastMessage(t.o, MESSAGE_STATUS_WARNING)[10:59:08.240] setGlobalStorageValue(t.h, 1)[10:59:08.241] for _, pid in ipairs(getPlayersOnline()) do[10:59:08.242] if(getPlayerStorageValue(pid, t.f_2) == 1) then[10:59:08.243] doPlayerAddItem(cid, 2160, 30)[10:59:08.244] end[10:59:08.245] end[10:59:08.246] end[10:59:08.247] if getGlobalStorageValue(t.h) == 1 then[10:59:08.248] setGlobalStorageValue(t.a, 0)[10:59:08.249] setGlobalStorageValue(t.h, 0)[10:59:08.250] setGlobalStorageValue(t.wv, -1)[10:59:08.251] setPlayerStorageValue(cid, t.f, -1)[10:59:08.252] setPlayerStorageValue(cid, t.g, 0)[10:59:08.253] setPlayerStorageValue(cid, t.l, 0)[10:59:08.254] setPlayerStorageValue(cid, t.u, 0)[10:59:08.255] setPlayerStorageValue(cid, t.f_1, -1)[10:59:08.256] setPlayerStorageValue(cid, t.f_2, -1)[10:59:08.257] setPlayerStorageValue(cid, t.h, -1)[10:59:08.258] doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), true)[10:59:08.259] doSendMagicEffect(getCreaturePosition(cid), 10)[10:59:08.260] doCreatureAddHealth(cid, getCreatureMaxHealth(cid), MAGIC_EFFECT_UNKNOWN, COLOR_UNKNOWN, true)[10:59:08.261] doCreatureAddMana(cid, getCreatureMaxMana(cid))[10:59:08.262] doPlayerRemoveLethalConditions(cid)[10:59:08.263] for _, pid in ipairs(getPlayersOnline()) do[10:59:08.265] if(getPlayerStorageValue(pid, t.f_1) == 1 or getPlayerStorageValue(pid, t.f_2) == 1) then[10:59:08.266] setPlayerStorageValue(pid, t.f, -1)[10:59:08.267] doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))[10:59:08.268] doSendMagicEffect(getCreaturePosition(pid), CONST_ME_TELEPORT)[10:59:08.269] setPlayerStorageValue(pid, t.g, 0)[10:59:08.270] setPlayerStorageValue(pid, t.l, 0)[10:59:08.271] setPlayerStorageValue(pid, t.u, 0)[10:59:08.272] setPlayerStorageValue(pid, t.f_1, -1)[10:59:08.275] setPlayerStorageValue(pid, t.f_2, -1)[10:59:08.276] setPlayerStorageValue(pid, t.h, -1)[10:59:08.277] doCreatureAddHealth(pid, getCreatureMaxHealth(pid), MAGIC_EFFECT_UNKNOWN, COLOR_UNKNOWN, true)[10:59:08.278] doCreatureAddMana(pid, getCreatureMaxMana(pid))[10:59:08.280] doPlayerRemoveLethalConditions(pid)[10:59:08.281] end[10:59:08.282] end[10:59:08.283] return false[10:59:08.284] end[10:59:08.285] return false[10:59:08.287] end[10:59:08.288] return true[10:59:08.289] end[10:59:08.290] :onPrepareDeath[10:59:08.291] Description:[10:59:08.292] [string "LuaInterface::loadBuffer"]:49: attempt to call global 'doPlayerRemoveLethalConditions' (a nil value)[10:59:08.293] stack traceback:[10:59:08.294] [string "LuaInterface::loadBuffer"]:49: in function <[string "LuaInterface::loadBuffer"]:2> Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. up

Informação Importante

Confirmação de Termo