KennyConrad 5 Postado Junho 29, 2012 Share Postado Junho 29, 2012 (editado) Galera queria um script de porta ou tile que so passa-se com uma X quantidade de resets já procurei no forum e não achei então ajuda ae o sistema de reset que eu uso não tem storage olha ele ae [quote --[[ <(Advanced Reset System 2.0)> Autor: MarcelloMkez. Contato: (marcello_dirt@hotmail.com) Versão: 2.0 Testado em: 8.50 e 8.60 TFS: 0.3.6 and 0.4.0 Fórum: http://www.xtibia.com/forum/topic/142463-advanced-reset-system-20/ -=[Características]=- ~( Versão 2.0 )~ - Resets agora Armazenados na DataBase; (Sem Valor de Storage) - Instala o System e cria a Tabela de Resets com o comando "/installreset"; - Resets no Look do jogador ex: 22:10 You see Marcello [Reset 2] (Level 8). He is an elder druid.; - [sTAGES] para "Premium Account" e "Free Account"; ]] --=[Functions]=-- -- installReset()' [instala o Sistema.] -- tableResetInstall()' [Verifica Se o Sistema ja foi instaladao.] -- nowReseting()' [Verifica, retorna o erro ou reseta.] -- getPlayerReset(cid)' [Pega numero de resets do player.] -- checLevelStageReset(cid)' [Verifica o Level para Resetar.] -- newReset(cid)' [Verifica todas as Condições de Reset.] -- addValue(value)' [Adiciona numero de resets.] -- storage = 1020, [storage.] --=[Comandos de Jogadores]=-- -- "/installreset" -- Só será usado uma vez, para instalar o sistema. -- "!resetar" -- Para Resetar. function onSay(cid, words, param) if words =="!resetar" then --[ Condições de Reset ] -- local coNdConf = { needPz = true, -- Precisa estar em Pz pra resetar? [true, false] needPa = false, -- Precisa ser Premium Account Pra resetar? [true, false] withe = false, -- Players com Pk Withe podem resetar? [true, false] red = true, -- Players com Pk Red pode resetar? [true, false] battle = false, -- Players precisão estar sem battle pra resetar? [true, false] teleport = false, -- Teleportar Player para o templo após resetar? [true, false] look = true, -- Aparecer Resets no Look do Player? [true, false] pid = getPlayerGUID(cid), -- Não Mexer. --[ Configurações do Reset ] -- resetConf = { Level = 350, -- Level Necessário para Resetar. [Valor] backLvl = 8, -- Level que voltará após o Reset. [Valor] time = 3, -- Tempo para o Player deslogar ao resetar, em segundos. [Valor] }, } --[[>> STAGES <<]]-- x=true;X=true -- Não Mexer. local stage = {Abilitar = {x}, Desabilitar = {}, --<< Abilitar Stages?? >>-- [{x};{}] -- [RESETS] | [PREMMY] | [FREE] stage1= {resets= 4, premmy= 330, free= 350}, stage2= {resets= 10, premmy= 340, free= 355}, -- EXPLICANDO e Configurando stages. (Se estiver Abilitado [Abilitar = {x}]) stage3= {resets= 15, premmy= 355, free= 360}, -- resets = Número de resets para o Stage; stage4= {resets= 20, premmy= 360, free= 365}, -- premmy = Level necessário para Premium Accounts; stage5= {resets= 25, premmy= 370, free= 380}, -- free = Level necessário para Free Accounts; stage6= {resets= 30, premmy= 380, free= 390}, -- Coloque em Ordem... stage7= {resets= 35, premmy= 400, free= 410}, -- [OBS: MARQUE UM "X" PARA ABILITAR OU DESABILITAR OS STAGES] stage8= {resets= 40, premmy= 420, free= 430}, -- EX: para desabilitar mude: Abilitar = {}, Desabilitar = {x} stage9= {resets= 45, premmy= 440, free= 450}, stage10={resets= 49, premmy= 470, free= 480}, stage11= {resets= 54, premmy= 500, free= 510}, stage12= {resets= 59, premmy= 540, free= 550}, stage13= {resets= 64, premmy= 580, free= 590}, stage14= {resets= 69, premmy= 620, free= 630}, stage15= {resets= 74, premmy= 670, free= 680}, stage16= {resets= 79, premmy= 720, free= 730}, stage17= {resets= 84, premmy= 770, free= 780}, stage18= {resets= 89, premmy= 820, free= 830}, stage19= {resets= 94, premmy= 870, free= 880}, stage20= {resets= 100, premmy= 920, free= 930}, stage21= {resets= 105, premmy= 970, free= 980}, stage22= {resets= 115, premmy= 1030, free= 1040}, stage23= {resets= 120, premmy= 1090, free= 1100}, stage24= {resets= 120, premmy= 1190, free= 1200}, stage25= {resets= 125, premmy= 1290, free= 1300}, stage26= {resets= 130, premmy= 1390, free= 1400}, stage27= {resets= 135, premmy= 1490, free= 1500}, stage28= {resets= 140, premmy= 1590, free= 1600}, stage29= {resets= 145, premmy= 1690, free= 1700}, stage30= {resets= 150, premmy= 17890, free= 1800}, } --[[>> FIM STAGES <<]]-- --=[Pega Valor de Resets]=-- function getPlayerReset(cid) local qr = db.getResult("SELECT `reset` FROM `players` WHERE `id`= "..coNdConf.pid..";") rss = qr:getDataInt("reset", coNdConf.pid) if rss < 0 then rss = 0 end return rss end local success = " ~~ Sucesso! ~~ \nVocê tem agora "..(getPlayerReset(cid)+1).." resets. \nVocê será deslogado em "..coNdConf.resetConf.time.." segundos." ;err = doPlayerSendTextMessage local qrt = db.getResult("SELECT `reset` FROM `players` WHERE `id`= "..coNdConf.pid..";");rss_db = qrt:getDataInt("reset", coNdConf.pid) local lvl_query = "UPDATE `players` SET `level` = "..(coNdConf.resetConf.backLvl)..", `experience` = 0 WHERE `id`= " .. coNdConf.pid .. ";" local reset_query = "UPDATE `players` SET `reset` = "..(getPlayerReset(cid)+(1)).." WHERE `id`= " .. coNdConf.pid .. ";" local nolook_query = "UPDATE `players` SET `description` = '' WHERE `players`.`id`= " .. coNdConf.pid .. ";" local look_query = "UPDATE `players` SET `description` = ' [Reset "..(getPlayerReset(cid)+(1)).."]' WHERE `players`.`id`= " .. coNdConf.pid .. ";" --=[Reseta]=-- function addValue(value) if coNdConf.look == false then doRemoveCreature(cid) db.executeQuery(lvl_query);db.executeQuery(reset_query);db.executeQuery(nolook_query) else doRemoveCreature(cid) db.executeQuery(lvl_query);db.executeQuery(reset_query);db.executeQuery(look_query) return LUA_NO_ERROR end end function nowReseting() if (getPlayerLevel(cid) < coNdConf.resetConf.Level) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "- Level Necessário Para o Reset ["..coNdConf.resetConf.Level.."]. Faltam "..coNdConf.resetConf.Level-getPlayerLevel(cid).." level's para você Resetar. -") return true end if getPlayerLevel(cid) >= coNdConf.resetConf.Level and (coNdConf.teleport == false) then doPlayerPopupFYI(cid, success) addEvent(addValue, coNdConf.resetConf.time*1000, value) else doPlayerPopupFYI(cid, success) addEvent(doTeleportThing, coNdConf.resetConf.time*900, cid, getTownTemplePosition(getPlayerTown(cid))) addEvent(addValue, coNdConf.resetConf.time*1000, value) return true end end --[sTAGES Nao mexer em nada.]-- function checkLevelStageReset(cid) local stages = { {resets= stage.stage1.resets, premmy= stage.stage1.premmy, free= stage.stage1.free}, {resets= stage.stage2.resets, premmy= stage.stage2.premmy, free= stage.stage2.free}, {resets= stage.stage3.resets, premmy= stage.stage3.premmy, free= stage.stage3.free}, {resets= stage.stage4.resets, premmy= stage.stage4.premmy, free= stage.stage4.free}, {resets= stage.stage5.resets, premmy= stage.stage5.premmy, free= stage.stage5.free}, {resets= stage.stage6.resets, premmy= stage.stage6.premmy, free= stage.stage6.free}, {resets= stage.stage7.resets, premmy= stage.stage7.premmy, free= stage.stage7.free}, {resets= stage.stage8.resets, premmy= stage.stage8.premmy, free= stage.stage8.free}, {resets= stage.stage9.resets, premmy= stage.stage9.premmy, free= stage.stage9.free}, {resets=stage.stage10.resets, premmy=stage.stage10.premmy, free=stage.stage10.free}, {resets=stage.stage11.resets, premmy=stage.stage11.premmy, free=stage.stage11.free}, {resets=stage.stage12.resets, premmy=stage.stage12.premmy, free=stage.stage12.free}, {resets=stage.stage13.resets, premmy=stage.stage13.premmy, free=stage.stage13.free}, {resets=stage.stage14.resets, premmy=stage.stage14.premmy, free=stage.stage14.free}, {resets=stage.stage15.resets, premmy=stage.stage15.premmy, free=stage.stage15.free}, {resets=stage.stage16.resets, premmy=stage.stage16.premmy, free=stage.stage16.free}, {resets=stage.stage17.resets, premmy=stage.stage17.premmy, free=stage.stage17.free}, {resets=stage.stage18.resets, premmy=stage.stage18.premmy, free=stage.stage18.free}, {resets=stage.stage19.resets, premmy=stage.stage19.premmy, free=stage.stage19.free}, {resets=stage.stage20.resets, premmy=stage.stage20.premmy, free=stage.stage20.free}, {resets=stage.stage21.resets, premmy=stage.stage21.premmy, free=stage.stage21.free}, {resets=stage.stage22.resets, premmy=stage.stage22.premmy, free=stage.stage22.free}, {resets=stage.stage23.resets, premmy=stage.stage23.premmy, free=stage.stage23.free}, {resets=stage.stage24.resets, premmy=stage.stage24.premmy, free=stage.stage24.free}, {resets=stage.stage25.resets, premmy=stage.stage25.premmy, free=stage.stage25.free}, {resets=stage.stage26.resets, premmy=stage.stage26.premmy, free=stage.stage26.free}, {resets=stage.stage27.resets, premmy=stage.stage27.premmy, free=stage.stage27.free}, {resets=stage.stage28.resets, premmy=stage.stage28.premmy, free=stage.stage28.free}, {resets=stage.stage29.resets, premmy=stage.stage29.premmy, free=stage.stage29.free}, {resets=stage.stage30.resets, premmy=stage.stage30.premmy, free=stage.stage30.free}, } local resets = getPlayerReset(cid) for i, tab in ipairs(stages) do if resets <= tab.resets then coNdConf.resetConf.Level = isPremium(cid) and tab.premmy or tab.free break end end if (getPlayerLevel(cid) < coNdConf.resetConf.Level) then err(cid, MESSAGE_STATUS_CONSOLE_BLUE, "- Level Necessário Para o Reset ["..coNdConf.resetConf.Level.."]. Faltam "..coNdConf.resetConf.Level-getPlayerLevel(cid).." level's para você Resetar. -") return TRUE end if getPlayerLevel(cid) >= coNdConf.resetConf.Level and (coNdConf.teleport == false) then doPlayerPopupFYI(cid, success) addEvent(addValue, coNdConf.resetConf.time*1000, value) else doPlayerPopupFYI(cid, success) addEvent(addValue, coNdConf.resetConf.time*1000, value) addEvent(doTeleportThing, coNdConf.resetConf.time*900, cid, getTownTemplePosition(getPlayerTown(cid))) return true end end function newReset(cid) if(coNdConf.needPz == true) and (getTilePzInfo(getCreaturePosition(cid)) == LUA_ERROR) then err(cid,MESSAGE_STATUS_CONSOLE_BLUE,"- Você Precisa estar em Protection Zone Para Resetar. -") return TRUE end if(coNdConf.needPa == true) and not isPremium(cid) then err(cid,MESSAGE_STATUS_CONSOLE_BLUE,"- Você Precisa ser Premium Account para Resetar. -") return TRUE end if(coNdConf.withe == false) and (getCreatureSkullType(cid) == 3) then err(cid,MESSAGE_STATUS_CONSOLE_BLUE,"- Você não pode resetar em condições de PK Withe. -") return TRUE end if(coNdConf.red == false) and (getCreatureSkullType(cid) == 4) then err(cid,MESSAGE_STATUS_CONSOLE_BLUE,"- Você não pode resetar em condições de PK Red. -") return TRUE end if(coNdConf.battle == true) and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then err(cid,MESSAGE_STATUS_CONSOLE_BLUE,"- Você Precisa estar sem Battle para Resetar. -") return TRUE end local xy = {true,false} table.insert(stage.Abilitar, false) table.insert(stage.Desabilitar, false) if stage.Abilitar[1] == xy[1] and stage.Desabilitar[1] == xy[2] then checkLevelStageReset(cid) elseif stage.Abilitar[1] == xy[2] and stage.Desabilitar[1] == xy[1] then nowReseting() else doPlayerPopupFYI(cid, "LUA_ERROR; Configure corretamente o Sistema de STAGES!") end return true end function tableResetInstall() addEvent(newReset, 1, cid) return false end if tableResetInstall() then end end --=[install System]=-- function installReset() if db.executeQuery("ALTER TABLE `players` ADD reset INT(11) NOT NULL DEFAULT 0;") then print("[MarcelloMkez] -= Advanced Reset System 2.0 por DataBase =- Instalado com sucesso!") return TRUE end print('[Advanced Reset System/MarcelloMkez] Não foi possível instalar o Sistema.') return FALSE end local tt = { "Preparando Instalação...", "Instalando: TableReset Db...", "Instalando: getPlayerReset()...", "Instalando: addValue()...", "Instalando: checkLevelStageReset()...", "Instalando: newReset() and nowReseting()...", "Finalizando Instalação...", "...", success = { "Iniciando...", "function: TableReset Db... [success]", "function: getPlayerReset()... [success]", "function: addValue(value)... [success]", "function: checkLevelStageReset()... [success]", "function: newReset() and nowReseting()... [success]", "Fim da Instalação. ", "by: ~~ MarcelloMkez ~~ \nContato: marcello_dirt@hotmail.com", inst = {"MarcelloMkez","Advanced Reset System 2.0 por DataBase" }, }, } if words == "/installreset" and getPlayerAccess(cid) >= 3 then function install() if installReset() then print(""..tt.success[7].."") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,""..tt.success[8].."") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "["..tt.success.inst[1].."] -="..tt.success.inst[2].."=- Instalado com sucesso!") else print("["..tt.success.inst[1].."] FALHA NA INSTALAçãO! [O sistema ja foi instalado].") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "["..tt.success.inst[1].."] FALHA NA INSTALAçãO! [O sistema ja foi instalado].") end return 1 end function concl(cid) local typetx = MESSAGE_STATUS_CONSOLE_BLUE print(""..tt.success[7].."") print(""..tt[8].."") doPlayerSendTextMessage(cid, typetx,""..tt.success[7].."") doPlayerSendTextMessage(cid, typetx,""..tt[8].."") addEvent(install, 1000,cid) end function finall(cid) local typetx = MESSAGE_STATUS_CONSOLE_BLUE print(""..tt.success[6].."") print(""..tt[7].."") doPlayerSendTextMessage(cid, typetx,""..tt.success[6].."") doPlayerSendTextMessage(cid, typetx,""..tt[7].."") addEvent(concl, 3000,cid) end function installDd(cid) local typetx = MESSAGE_STATUS_CONSOLE_BLUE print(""..tt.success[5].."") print(""..tt[6].."") doPlayerSendTextMessage(cid, typetx,""..tt.success[5].."") doPlayerSendTextMessage(cid, typetx,""..tt[6].."") addEvent(finall, 1000,cid) end function installCc(cid) local typetx = MESSAGE_STATUS_CONSOLE_BLUE print(""..tt.success[4].."") print(""..tt[5].."") doPlayerSendTextMessage(cid, typetx,""..tt.success[4].."") doPlayerSendTextMessage(cid, typetx,""..tt[5].."") addEvent(installDd, 1000,cid) end function installBb(cid) local typetx = MESSAGE_STATUS_CONSOLE_BLUE print(""..tt.success[3].."") print(""..tt[4].."") doPlayerSendTextMessage(cid, typetx,""..tt.success[3].."") doPlayerSendTextMessage(cid, typetx,""..tt[4].."") addEvent(installCc, 1000,cid) end function installAa(cid) local typetx = MESSAGE_STATUS_CONSOLE_BLUE print(""..tt.success[2].."") print(""..tt[3].."") doPlayerSendTextMessage(cid, typetx,""..tt.success[2].."") doPlayerSendTextMessage(cid, typetx,""..tt[3].."") addEvent(installBb, 1000,cid) end function toInstall() local typetx = MESSAGE_STATUS_CONSOLE_BLUE print(""..tt.success[1].."") print(""..tt[2].."") doPlayerSendTextMessage(cid, typetx,""..tt.success[1].."") doPlayerSendTextMessage(cid, typetx,""..tt[2].."") addEvent(installAa, 1000,cid) end function preparation() local typetx = MESSAGE_STATUS_CONSOLE_BLUE print(""..tt[1].."") doPlayerSendTextMessage(cid, typetx,""..tt[1].."") addEvent(toInstall, 3000,cid) end if preparation() then end end return 1 end --=[by: MarcelloMkez]=-- ] ajuda ae dou até 5 REP ++ Editado Junho 29, 2012 por KennyxD Link para o comentário https://xtibia.com/forum/topic/188927-porta-ou-tile-que-so-passa-com-y-resets/ Compartilhar em outros sites More sharing options...
0 Leoxtibia 137 Postado Junho 29, 2012 Share Postado Junho 29, 2012 Sempre use a busca do fórum antes de fazer algum pedido. Talvez esse tópico possa te ajudar: http://www.xtibia.com/forum/topic/185459-pedido-tile-por-reset/ Link para o comentário https://xtibia.com/forum/topic/188927-porta-ou-tile-que-so-passa-com-y-resets/#findComment-1286190 Compartilhar em outros sites More sharing options...
0 caotic 393 Postado Junho 29, 2012 Share Postado Junho 29, 2012 (editado) Eu ja fiz mesmo vo colocar Crie um arquivo chamado passreset.lua em movements e coloca isto function onStepIn(cid, item, position, fromPosition) local reset = 2 ---Quantidade de reset necessaria-------- function getPlayerReset(cid) local qr = db.getResult("SELECT `reset` FROM `players` WHERE `id`= getPlayerGUID(cid);") rss = qr:getDataInt("reset", getPlayerGUID(cid)) if rss = 0 then rss = 0 end return rss end if not getPlayerReset(cid) = reset then doTeleportThing(cid, fromPosition, true) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao tem "..reset.." de reset") doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) return TRUE end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Seja bem vindo") return TRUE end Agora a tag: <movevent type="StepIn" value="passreset.lua" event="script" actionid="2864"></movevent> Editado Junho 29, 2012 por caotic Link para o comentário https://xtibia.com/forum/topic/188927-porta-ou-tile-que-so-passa-com-y-resets/#findComment-1286193 Compartilhar em outros sites More sharing options...
0 KennyConrad 5 Postado Junho 29, 2012 Autor Share Postado Junho 29, 2012 leoxtibia eu ja tinha visto esse ae e testei e não funcionou. <p>caotic deu esse erro</p> <p> </p> <p>[29/06/2012 12:02:10] [Error - LuaScriptInterface::loadFile] data/movements/scripts/tilereset.lua:7: 'then' expected near '&'</p> <div>[29/06/2012 12:02:10] [Warning - Event::loadScript] Cannot load script (data/movements/scripts/tilereset.lua)</div> <div>[29/06/2012 12:02:10] data/movements/scripts/tilereset.lua:7: 'then' expected near '&'</div> <div> </div> <div> </div> Link para o comentário https://xtibia.com/forum/topic/188927-porta-ou-tile-que-so-passa-com-y-resets/#findComment-1286215 Compartilhar em outros sites More sharing options...
0 caotic 393 Postado Junho 29, 2012 Share Postado Junho 29, 2012 O forum ta com erro de formataçao isto e horrivel porque faz o script ficar errado Mais eu concertei ja Link para o comentário https://xtibia.com/forum/topic/188927-porta-ou-tile-que-so-passa-com-y-resets/#findComment-1286249 Compartilhar em outros sites More sharing options...
0 KennyConrad 5 Postado Junho 29, 2012 Autor Share Postado Junho 29, 2012 (editado) continuo o mesmo erro =( Editado Junho 29, 2012 por KennyxD Link para o comentário https://xtibia.com/forum/topic/188927-porta-ou-tile-que-so-passa-com-y-resets/#findComment-1286270 Compartilhar em outros sites More sharing options...
0 Vinc 101 Postado Junho 29, 2012 Share Postado Junho 29, 2012 cara se dexo a variavel completamente errada e tinha um erro grave na comparação de valores(so tinha um =) function onStepIn(cid, item, position, fromPosition) local reset = 2 ---Quantidade de reset necessaria-------- function getPlayerReset(cid) local qr = db.getResult("SELECT `reset` FROM `players` WHERE `id`= "..getPlayerGUID(cid)..";") rss = qr:getDataInt("reset", getPlayerGUID(cid)) if rss = 0 then rss = 0 end return rss end if not getPlayerReset(cid) >= reset then doTeleportThing(cid, fromPosition, true) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao tem "..reset.." de reset") doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) return TRUE end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Seja bem vindo") return TRUE end Link para o comentário https://xtibia.com/forum/topic/188927-porta-ou-tile-que-so-passa-com-y-resets/#findComment-1286275 Compartilhar em outros sites More sharing options...
0 caotic 393 Postado Junho 29, 2012 Share Postado Junho 29, 2012 (editado) e msn tinha esquecido do ">" mais eu tinha posto sim.. So que ao editar por causa da formataçao eu retirei e não repus Foram erros tão obvios que estou com raiva de min mesmo Pocha e que nem vi a variavel la se nao tinha pego e substuido pela funçao Serio nao tinha percebido que tava declarando uma tabela Falta de atençao pura. Mil desculpas Editado Junho 29, 2012 por caotic Link para o comentário https://xtibia.com/forum/topic/188927-porta-ou-tile-que-so-passa-com-y-resets/#findComment-1286276 Compartilhar em outros sites More sharing options...
0 KennyConrad 5 Postado Junho 29, 2012 Autor Share Postado Junho 29, 2012 lordbug99 o erro persisti ;( aff Link para o comentário https://xtibia.com/forum/topic/188927-porta-ou-tile-que-so-passa-com-y-resets/#findComment-1286287 Compartilhar em outros sites More sharing options...
0 Vinc 101 Postado Junho 29, 2012 Share Postado Junho 29, 2012 qual o erro? poste-o obs; n pode ser auqle erro de antes,porque akilo era um erro de formatção do site Link para o comentário https://xtibia.com/forum/topic/188927-porta-ou-tile-que-so-passa-com-y-resets/#findComment-1286292 Compartilhar em outros sites More sharing options...
0 KennyConrad 5 Postado Junho 29, 2012 Autor Share Postado Junho 29, 2012 (editado) esse erro eu acho que é o memso [29/06/2012 17:58:52] [Error - LuaScriptInterface::loadFile] data/movements/scripts/tilereset.lua:7: 'then' expected near '=' [29/06/2012 17:58:52] [Warning - Event::loadScript] Cannot load script (data/movements/scripts/tilereset.lua) [29/06/2012 17:58:52] data/movements/scripts/tilereset.lua:7: 'then' expected near '=' bom achei esse script acho que foi feito pelo vodkart function onUse(cid, item, fromPosition) local s = 1020 local t = 5 if getPlayerStorageValue(cid, s) >= t then doTransformItem(item.uid, item.itemid) doTeleportThing(cid, topos, TRUE) doSendMagicEffect(getPlayerPosition(cid), 10) else doPlayerSendCancel(cid,"You dont have " .. t .. " resets.") end return TRUE end <action actionid="7055" script="NOME DO SEU SCRIPT.lua" /> se puderem fazer ele sem storage talvez daria certo,ou talvez você mesmo vodkart puder ajudar ae agradeço. Editado Junho 29, 2012 por KennyxD Link para o comentário https://xtibia.com/forum/topic/188927-porta-ou-tile-que-so-passa-com-y-resets/#findComment-1286345 Compartilhar em outros sites More sharing options...
0 Vinc 101 Postado Junho 29, 2012 Share Postado Junho 29, 2012 tava flatando o sinal < na linha 7 function onStepIn(cid, item, position, fromPosition) local reset = 2 ---Quantidade de reset necessaria-------- function getPlayerReset(cid) local qr = db.getResult("SELECT `reset` FROM `players` WHERE `id`= "..getPlayerGUID(cid)..";") rss = qr:getDataInt("reset", getPlayerGUID(cid)) if rss <= 0 then rss = 0 end return rss end if not getPlayerReset(cid) >= reset then doTeleportThing(cid, fromPosition, true) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao tem "..reset.." de reset") doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) return TRUE end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Seja bem vindo") return TRUE end Link para o comentário https://xtibia.com/forum/topic/188927-porta-ou-tile-que-so-passa-com-y-resets/#findComment-1286358 Compartilhar em outros sites More sharing options...
0 KennyConrad 5 Postado Junho 29, 2012 Autor Share Postado Junho 29, 2012 (editado) agora deu esse erro [29/06/2012 19:34:55] [Error - MoveEvents Interface] [29/06/2012 19:34:55] data/movements/scripts/tilereset.lua:onStepIn [29/06/2012 19:34:55] Description: [29/06/2012 19:34:55] data/movements/scripts/tilereset.lua:13: attempt to compare number with boolean [29/06/2012 19:34:55] stack traceback: [29/06/2012 19:34:55] data/movements/scripts/tilereset.lua:13: in function <data/movements/scripts/tilereset.lua:1> obs esse erro da quando passa em cima do tile. Editado Junho 29, 2012 por KennyxD Link para o comentário https://xtibia.com/forum/topic/188927-porta-ou-tile-que-so-passa-com-y-resets/#findComment-1286372 Compartilhar em outros sites More sharing options...
0 Vinc 101 Postado Junho 30, 2012 Share Postado Junho 30, 2012 function onStepIn(cid, item, position, fromPosition) local reset = 2 ---Quantidade de reset necessaria-------- function getPlayerReset(cid) local qr = db.getResult("SELECT `reset` FROM `players` WHERE `id`= "..getPlayerGUID(cid)..";") rss = qr:getDataInt("reset", getPlayerGUID(cid)) if rss <= 0 then rss = 0 end return tonumber(rss) end if getPlayerReset(cid) < reset then doTeleportThing(cid, fromPosition, true) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao tem "..reset.." de reset") doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) return TRUE end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Seja bem vindo") return TRUE end Link para o comentário https://xtibia.com/forum/topic/188927-porta-ou-tile-que-so-passa-com-y-resets/#findComment-1286527 Compartilhar em outros sites More sharing options...
0 KennyConrad 5 Postado Junho 30, 2012 Autor Share Postado Junho 30, 2012 cara valew funciono REP + Link para o comentário https://xtibia.com/forum/topic/188927-porta-ou-tile-que-so-passa-com-y-resets/#findComment-1286737 Compartilhar em outros sites More sharing options...
0 Erimyth 73 Postado Julho 6, 2012 Share Postado Julho 6, 2012 Duvida sanada. Movido. Link para o comentário https://xtibia.com/forum/topic/188927-porta-ou-tile-que-so-passa-com-y-resets/#findComment-1289163 Compartilhar em outros sites More sharing options...
Pergunta
KennyConrad 5
Galera queria um script de porta ou tile que so passa-se com uma X quantidade de resets já procurei no forum e não achei então ajuda ae o sistema de reset que eu uso não tem storage olha ele ae
[quote --[[ <(Advanced Reset System 2.0)>
Autor: MarcelloMkez. Contato: (marcello_dirt@hotmail.com)
Versão: 2.0
Testado em: 8.50 e 8.60
TFS: 0.3.6 and 0.4.0
Fórum: http://www.xtibia.com/forum/topic/142463-advanced-reset-system-20/
-=[Características]=-
~( Versão 2.0 )~
- Resets agora Armazenados na DataBase; (Sem Valor de Storage)
- Instala o System e cria a Tabela de Resets com o comando "/installreset";
- Resets no Look do jogador ex: 22:10 You see Marcello [Reset 2] (Level 8). He is an elder druid.;
- [sTAGES] para "Premium Account" e "Free Account"; ]]
--=[Functions]=--
-- installReset()' [instala o Sistema.]
-- tableResetInstall()' [Verifica Se o Sistema ja foi instaladao.]
-- nowReseting()' [Verifica, retorna o erro ou reseta.]
-- getPlayerReset(cid)' [Pega numero de resets do player.]
-- checLevelStageReset(cid)' [Verifica o Level para Resetar.]
-- newReset(cid)' [Verifica todas as Condições de Reset.]
-- addValue(value)' [Adiciona numero de resets.]
-- storage = 1020, [storage.]
--=[Comandos de Jogadores]=--
-- "/installreset" -- Só será usado uma vez, para instalar o sistema.
-- "!resetar" -- Para Resetar.
function onSay(cid, words, param)
if words =="!resetar" then
--[ Condições de Reset ] --
local coNdConf = {
needPz = true, -- Precisa estar em Pz pra resetar? [true, false]
needPa = false, -- Precisa ser Premium Account Pra resetar? [true, false]
withe = false, -- Players com Pk Withe podem resetar? [true, false]
red = true, -- Players com Pk Red pode resetar? [true, false]
battle = false, -- Players precisão estar sem battle pra resetar? [true, false]
teleport = false, -- Teleportar Player para o templo após resetar? [true, false]
look = true, -- Aparecer Resets no Look do Player? [true, false]
pid = getPlayerGUID(cid), -- Não Mexer.
--[ Configurações do Reset ] --
resetConf = {
Level = 350, -- Level Necessário para Resetar. [Valor]
backLvl = 8, -- Level que voltará após o Reset. [Valor]
time = 3, -- Tempo para o Player deslogar ao resetar, em segundos. [Valor]
},
}
--[[>> STAGES <<]]--
x=true;X=true -- Não Mexer.
local stage = {Abilitar = {x}, Desabilitar = {}, --<< Abilitar Stages?? >>-- [{x};{}]
-- [RESETS] | [PREMMY] | [FREE]
stage1= {resets= 4, premmy= 330, free= 350},
stage2= {resets= 10, premmy= 340, free= 355}, -- EXPLICANDO e Configurando stages. (Se estiver Abilitado [Abilitar = {x}])
stage3= {resets= 15, premmy= 355, free= 360}, -- resets = Número de resets para o Stage;
stage4= {resets= 20, premmy= 360, free= 365}, -- premmy = Level necessário para Premium Accounts;
stage5= {resets= 25, premmy= 370, free= 380}, -- free = Level necessário para Free Accounts;
stage6= {resets= 30, premmy= 380, free= 390}, -- Coloque em Ordem...
stage7= {resets= 35, premmy= 400, free= 410}, -- [OBS: MARQUE UM "X" PARA ABILITAR OU DESABILITAR OS STAGES]
stage8= {resets= 40, premmy= 420, free= 430}, -- EX: para desabilitar mude: Abilitar = {}, Desabilitar = {x}
stage9= {resets= 45, premmy= 440, free= 450},
stage10={resets= 49, premmy= 470, free= 480},
stage11= {resets= 54, premmy= 500, free= 510},
stage12= {resets= 59, premmy= 540, free= 550},
stage13= {resets= 64, premmy= 580, free= 590},
stage14= {resets= 69, premmy= 620, free= 630},
stage15= {resets= 74, premmy= 670, free= 680},
stage16= {resets= 79, premmy= 720, free= 730},
stage17= {resets= 84, premmy= 770, free= 780},
stage18= {resets= 89, premmy= 820, free= 830},
stage19= {resets= 94, premmy= 870, free= 880},
stage20= {resets= 100, premmy= 920, free= 930},
stage21= {resets= 105, premmy= 970, free= 980},
stage22= {resets= 115, premmy= 1030, free= 1040},
stage23= {resets= 120, premmy= 1090, free= 1100},
stage24= {resets= 120, premmy= 1190, free= 1200},
stage25= {resets= 125, premmy= 1290, free= 1300},
stage26= {resets= 130, premmy= 1390, free= 1400},
stage27= {resets= 135, premmy= 1490, free= 1500},
stage28= {resets= 140, premmy= 1590, free= 1600},
stage29= {resets= 145, premmy= 1690, free= 1700},
stage30= {resets= 150, premmy= 17890, free= 1800},
}
--[[>> FIM STAGES <<]]--
--=[Pega Valor de Resets]=--
function getPlayerReset(cid)
local qr = db.getResult("SELECT `reset` FROM `players` WHERE `id`= "..coNdConf.pid..";")
rss = qr:getDataInt("reset", coNdConf.pid)
if rss < 0 then
rss = 0
end
return rss
end
local success = " ~~ Sucesso! ~~ \nVocê tem agora "..(getPlayerReset(cid)+1).." resets. \nVocê será deslogado em "..coNdConf.resetConf.time.." segundos." ;err = doPlayerSendTextMessage
local qrt = db.getResult("SELECT `reset` FROM `players` WHERE `id`= "..coNdConf.pid..";");rss_db = qrt:getDataInt("reset", coNdConf.pid)
local lvl_query = "UPDATE `players` SET `level` = "..(coNdConf.resetConf.backLvl)..", `experience` = 0 WHERE `id`= " .. coNdConf.pid .. ";"
local reset_query = "UPDATE `players` SET `reset` = "..(getPlayerReset(cid)+(1)).." WHERE `id`= " .. coNdConf.pid .. ";"
local nolook_query = "UPDATE `players` SET `description` = '' WHERE `players`.`id`= " .. coNdConf.pid .. ";"
local look_query = "UPDATE `players` SET `description` = ' [Reset "..(getPlayerReset(cid)+(1)).."]' WHERE `players`.`id`= " .. coNdConf.pid .. ";"
--=[Reseta]=--
function addValue(value)
if coNdConf.look == false then
doRemoveCreature(cid)
db.executeQuery(lvl_query);db.executeQuery(reset_query);db.executeQuery(nolook_query)
else
doRemoveCreature(cid)
db.executeQuery(lvl_query);db.executeQuery(reset_query);db.executeQuery(look_query)
return LUA_NO_ERROR
end
end
function nowReseting()
if (getPlayerLevel(cid) < coNdConf.resetConf.Level) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "- Level Necessário Para o Reset ["..coNdConf.resetConf.Level.."]. Faltam "..coNdConf.resetConf.Level-getPlayerLevel(cid).." level's para você Resetar. -")
return true
end
if getPlayerLevel(cid) >= coNdConf.resetConf.Level and (coNdConf.teleport == false) then
doPlayerPopupFYI(cid, success)
addEvent(addValue, coNdConf.resetConf.time*1000, value)
else
doPlayerPopupFYI(cid, success)
addEvent(doTeleportThing, coNdConf.resetConf.time*900, cid, getTownTemplePosition(getPlayerTown(cid)))
addEvent(addValue, coNdConf.resetConf.time*1000, value)
return true
end
end
--[sTAGES Nao mexer em nada.]--
function checkLevelStageReset(cid)
local stages = {
{resets= stage.stage1.resets, premmy= stage.stage1.premmy, free= stage.stage1.free},
{resets= stage.stage2.resets, premmy= stage.stage2.premmy, free= stage.stage2.free},
{resets= stage.stage3.resets, premmy= stage.stage3.premmy, free= stage.stage3.free},
{resets= stage.stage4.resets, premmy= stage.stage4.premmy, free= stage.stage4.free},
{resets= stage.stage5.resets, premmy= stage.stage5.premmy, free= stage.stage5.free},
{resets= stage.stage6.resets, premmy= stage.stage6.premmy, free= stage.stage6.free},
{resets= stage.stage7.resets, premmy= stage.stage7.premmy, free= stage.stage7.free},
{resets= stage.stage8.resets, premmy= stage.stage8.premmy, free= stage.stage8.free},
{resets= stage.stage9.resets, premmy= stage.stage9.premmy, free= stage.stage9.free},
{resets=stage.stage10.resets, premmy=stage.stage10.premmy, free=stage.stage10.free},
{resets=stage.stage11.resets, premmy=stage.stage11.premmy, free=stage.stage11.free},
{resets=stage.stage12.resets, premmy=stage.stage12.premmy, free=stage.stage12.free},
{resets=stage.stage13.resets, premmy=stage.stage13.premmy, free=stage.stage13.free},
{resets=stage.stage14.resets, premmy=stage.stage14.premmy, free=stage.stage14.free},
{resets=stage.stage15.resets, premmy=stage.stage15.premmy, free=stage.stage15.free},
{resets=stage.stage16.resets, premmy=stage.stage16.premmy, free=stage.stage16.free},
{resets=stage.stage17.resets, premmy=stage.stage17.premmy, free=stage.stage17.free},
{resets=stage.stage18.resets, premmy=stage.stage18.premmy, free=stage.stage18.free},
{resets=stage.stage19.resets, premmy=stage.stage19.premmy, free=stage.stage19.free},
{resets=stage.stage20.resets, premmy=stage.stage20.premmy, free=stage.stage20.free},
{resets=stage.stage21.resets, premmy=stage.stage21.premmy, free=stage.stage21.free},
{resets=stage.stage22.resets, premmy=stage.stage22.premmy, free=stage.stage22.free},
{resets=stage.stage23.resets, premmy=stage.stage23.premmy, free=stage.stage23.free},
{resets=stage.stage24.resets, premmy=stage.stage24.premmy, free=stage.stage24.free},
{resets=stage.stage25.resets, premmy=stage.stage25.premmy, free=stage.stage25.free},
{resets=stage.stage26.resets, premmy=stage.stage26.premmy, free=stage.stage26.free},
{resets=stage.stage27.resets, premmy=stage.stage27.premmy, free=stage.stage27.free},
{resets=stage.stage28.resets, premmy=stage.stage28.premmy, free=stage.stage28.free},
{resets=stage.stage29.resets, premmy=stage.stage29.premmy, free=stage.stage29.free},
{resets=stage.stage30.resets, premmy=stage.stage30.premmy, free=stage.stage30.free},
}
local resets = getPlayerReset(cid)
for i, tab in ipairs(stages) do
if resets <= tab.resets then
coNdConf.resetConf.Level = isPremium(cid) and tab.premmy or tab.free
break
end
end
if (getPlayerLevel(cid) < coNdConf.resetConf.Level) then
err(cid, MESSAGE_STATUS_CONSOLE_BLUE, "- Level Necessário Para o Reset ["..coNdConf.resetConf.Level.."]. Faltam "..coNdConf.resetConf.Level-getPlayerLevel(cid).." level's para você Resetar. -")
return TRUE
end
if getPlayerLevel(cid) >= coNdConf.resetConf.Level and (coNdConf.teleport == false) then
doPlayerPopupFYI(cid, success)
addEvent(addValue, coNdConf.resetConf.time*1000, value)
else
doPlayerPopupFYI(cid, success)
addEvent(addValue, coNdConf.resetConf.time*1000, value)
addEvent(doTeleportThing, coNdConf.resetConf.time*900, cid, getTownTemplePosition(getPlayerTown(cid)))
return true
end
end
function newReset(cid)
if(coNdConf.needPz == true) and (getTilePzInfo(getCreaturePosition(cid)) == LUA_ERROR) then
err(cid,MESSAGE_STATUS_CONSOLE_BLUE,"- Você Precisa estar em Protection Zone Para Resetar. -") return TRUE end
if(coNdConf.needPa == true) and not isPremium(cid) then
err(cid,MESSAGE_STATUS_CONSOLE_BLUE,"- Você Precisa ser Premium Account para Resetar. -") return TRUE end
if(coNdConf.withe == false) and (getCreatureSkullType(cid) == 3) then
err(cid,MESSAGE_STATUS_CONSOLE_BLUE,"- Você não pode resetar em condições de PK Withe. -") return TRUE end
if(coNdConf.red == false) and (getCreatureSkullType(cid) == 4) then
err(cid,MESSAGE_STATUS_CONSOLE_BLUE,"- Você não pode resetar em condições de PK Red. -") return TRUE end
if(coNdConf.battle == true) and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
err(cid,MESSAGE_STATUS_CONSOLE_BLUE,"- Você Precisa estar sem Battle para Resetar. -") return TRUE end
local xy = {true,false}
table.insert(stage.Abilitar, false)
table.insert(stage.Desabilitar, false)
if stage.Abilitar[1] == xy[1] and stage.Desabilitar[1] == xy[2] then
checkLevelStageReset(cid)
elseif stage.Abilitar[1] == xy[2] and stage.Desabilitar[1] == xy[1] then
nowReseting()
else
doPlayerPopupFYI(cid, "LUA_ERROR; Configure corretamente o Sistema de STAGES!")
end
return true
end
function tableResetInstall()
addEvent(newReset, 1, cid)
return false
end
if tableResetInstall() then
end
end
--=[install System]=--
function installReset()
if db.executeQuery("ALTER TABLE `players` ADD reset INT(11) NOT NULL DEFAULT 0;") then
print("[MarcelloMkez] -= Advanced Reset System 2.0 por DataBase =- Instalado com sucesso!")
return TRUE
end
print('[Advanced Reset System/MarcelloMkez] Não foi possível instalar o Sistema.')
return FALSE
end
local tt = {
"Preparando Instalação...",
"Instalando: TableReset Db...",
"Instalando: getPlayerReset()...",
"Instalando: addValue()...",
"Instalando: checkLevelStageReset()...",
"Instalando: newReset() and nowReseting()...",
"Finalizando Instalação...",
"...",
success = {
"Iniciando...",
"function: TableReset Db... [success]",
"function: getPlayerReset()... [success]",
"function: addValue(value)... [success]",
"function: checkLevelStageReset()... [success]",
"function: newReset() and nowReseting()... [success]",
"Fim da Instalação. ",
"by: ~~ MarcelloMkez ~~ \nContato: marcello_dirt@hotmail.com",
inst = {"MarcelloMkez","Advanced Reset System 2.0 por DataBase"
},
},
}
if words == "/installreset" and getPlayerAccess(cid) >= 3 then
function install()
if installReset() then
print(""..tt.success[7].."")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,""..tt.success[8].."")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "["..tt.success.inst[1].."] -="..tt.success.inst[2].."=- Instalado com sucesso!")
else
print("["..tt.success.inst[1].."] FALHA NA INSTALAçãO! [O sistema ja foi instalado].")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "["..tt.success.inst[1].."] FALHA NA INSTALAçãO! [O sistema ja foi instalado].")
end
return 1
end
function concl(cid)
local typetx = MESSAGE_STATUS_CONSOLE_BLUE
print(""..tt.success[7].."")
print(""..tt[8].."")
doPlayerSendTextMessage(cid, typetx,""..tt.success[7].."")
doPlayerSendTextMessage(cid, typetx,""..tt[8].."")
addEvent(install, 1000,cid)
end
function finall(cid)
local typetx = MESSAGE_STATUS_CONSOLE_BLUE
print(""..tt.success[6].."")
print(""..tt[7].."")
doPlayerSendTextMessage(cid, typetx,""..tt.success[6].."")
doPlayerSendTextMessage(cid, typetx,""..tt[7].."")
addEvent(concl, 3000,cid)
end
function installDd(cid)
local typetx = MESSAGE_STATUS_CONSOLE_BLUE
print(""..tt.success[5].."")
print(""..tt[6].."")
doPlayerSendTextMessage(cid, typetx,""..tt.success[5].."")
doPlayerSendTextMessage(cid, typetx,""..tt[6].."")
addEvent(finall, 1000,cid)
end
function installCc(cid)
local typetx = MESSAGE_STATUS_CONSOLE_BLUE
print(""..tt.success[4].."")
print(""..tt[5].."")
doPlayerSendTextMessage(cid, typetx,""..tt.success[4].."")
doPlayerSendTextMessage(cid, typetx,""..tt[5].."")
addEvent(installDd, 1000,cid)
end
function installBb(cid)
local typetx = MESSAGE_STATUS_CONSOLE_BLUE
print(""..tt.success[3].."")
print(""..tt[4].."")
doPlayerSendTextMessage(cid, typetx,""..tt.success[3].."")
doPlayerSendTextMessage(cid, typetx,""..tt[4].."")
addEvent(installCc, 1000,cid)
end
function installAa(cid)
local typetx = MESSAGE_STATUS_CONSOLE_BLUE
print(""..tt.success[2].."")
print(""..tt[3].."")
doPlayerSendTextMessage(cid, typetx,""..tt.success[2].."")
doPlayerSendTextMessage(cid, typetx,""..tt[3].."")
addEvent(installBb, 1000,cid)
end
function toInstall()
local typetx = MESSAGE_STATUS_CONSOLE_BLUE
print(""..tt.success[1].."")
print(""..tt[2].."")
doPlayerSendTextMessage(cid, typetx,""..tt.success[1].."")
doPlayerSendTextMessage(cid, typetx,""..tt[2].."")
addEvent(installAa, 1000,cid)
end
function preparation()
local typetx = MESSAGE_STATUS_CONSOLE_BLUE
print(""..tt[1].."")
doPlayerSendTextMessage(cid, typetx,""..tt[1].."")
addEvent(toInstall, 3000,cid)
end
if preparation() then
end
end
return 1
end
--=[by: MarcelloMkez]=-- ]
ajuda ae dou até 5 REP ++
Editado por KennyxDLink para o comentário
https://xtibia.com/forum/topic/188927-porta-ou-tile-que-so-passa-com-y-resets/Compartilhar em outros sites
15 respostass a esta questão
Posts Recomendados