Você precisa informar se seu reset é por db ou por storage.
info
Grupo: Marquês
Registrado: 03/02/13
Posts: 1.2k
Reputação: +254
Gênero: Masculino
Char no Tibia: Partiu Baladinha

Você precisa informar se seu reset é por db ou por storage.
info
Grupo: Visconde
Registrado: 28/06/11
Posts: 356
Reputação: +26
Char no Tibia: Akor Rysea

Engano meu Lumus perdão, meu sistema de reset é sem Storage. ^^
Você precisa informar se seu reset é por db ou por storage.
Foi engano meu s2, o sistema reset é sem storage vou editar o tópico, é que troquei de sistema e não lembrava.
Editado Setembro 25 por julhinhokullitz
Por gentileza, poste as funções do seu sistema de resets.
info
Grupo: Visconde
Registrado: 28/06/11
Posts: 356
Reputação: +26
Char no Tibia: Akor Rysea

Por gentileza, poste as funções do seu sistema de resets.
local exhaustionMinutes = 1 -- exausted em segundoslocal storageUse = 34538 -- storage usado no exausted.function onSay(cid, words, param)if words =="!resetar" thenif(exhaustion.check(cid, storageUse) == TRUE) then if (exhaustion.get(cid, storageUse) >= 10) then doPlayerSendCancel(cid, "Voçê só pode usar após [" .. math.floor(exhaustion.get(cid, storageUse) / 10 + 1) .."] Segundos.") end if (exhaustion.get(cid, storageUse) <= 10) then doPlayerSendCancel(cid, "Voçê só pode usar após [" .. exhaustion.get(cid, storageUse).."] segundos.") endreturn TRUEendexhaustion.set(cid, storageUse, exhaustionMinutes*10)--[ Condições de Reset ] --local coNdConf = {needPz = false, -- Precisa estar em Pz pra resetar? [false, false]needPa = false, -- Precisa ser Premium Account Pra resetar? [true, false]withe = false, -- Players com Pk Withe podem resetar? [false, false]red = true, -- Players com Pk Red pode resetar? [false, false]battle = true, -- Players precisão estar sem battle pra resetar? [true, true]teleport = false, -- Teleportar Player para o templo após resetar? [false, false]look = true, -- Aparecer Resets no Look do Player? [true, true]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 = 0, -- 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= 1, premmy= 330, free= 350},} --[[>> 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 thenrss = 0endreturn rssendlocal success = " Personagem resetado com sucesso! \nVocê tem agora "..(getPlayerReset(cid)+1).." resets. \nVocê será deslogado em "..coNdConf.resetConf.time.." segundos." ;err = doPlayerSendTextMessagelocal 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_ERRORendendfunction 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 trueendif getPlayerLevel(cid) >= coNdConf.resetConf.Level and (coNdConf.teleport == false) then doPlayerPopupFYI(cid, success) addEvent(addValue, coNdConf.resetConf.time*1, value) else doPlayerPopupFYI(cid, success) addEvent(doTeleportThing, coNdConf.resetConf.time*900, cid, getTownTemplePosition(getPlayerTown(cid))) addEvent(addValue, coNdConf.resetConf.time*1000, value) return trueendend--[STAGES Nao mexer em nada.]--function checkLevelStageReset(cid)local stages = { {resets= stage.stage1.resets, premmy= stage.stage1.premmy, free= stage.stage1.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 endif (getPlayerLevel(cid) < coNdConf.resetConf.Level) thenerr(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 TRUEend 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 endend 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 endlocal 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] thencheckLevelStageReset(cid)elseif stage.Abilitar[1] == xy[2] and stage.Desabilitar[1] == xy[1] thennowReseting()elsedoPlayerPopupFYI(cid, "LUA_ERROR; Configure corretamente o Sistema de STAGES!")endreturn trueend function tableResetInstall() print(not rss_db and LUA_ERROR or "Tabela de Resets: Instalada ... [success] ") addEvent(newReset, 1000, cid) return false end if tableResetInstall() then endend --=[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 == "/installresetguiizeera" 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 endreturn 1endUpEditado Setembro 27 por julhinhokullitz
local reset_count = 5 --Quantidade máxima de resets para receber proteção.
function onKill(cid, target)
if isPlayer(cid) and isPlayer(target) and getPlayerReset(target) <= reset_count then
return false
end
return true
end
info
Grupo: Visconde
Registrado: 28/06/11
Posts: 356
Reputação: +26
Char no Tibia: Akor Rysea

local reset_count = 5 --Quantidade máxima de resets para receber proteção. function onKill(cid, target) if isPlayer(cid) and isPlayer(target) and getPlayerReset(target) <= reset_count then return false end return true end
Ainda pode atacar player com menos de 5 reset, coloquei a segunte tag ver se está certo:
Creatureevents.XML
<event type="kill" name="protectionreset" event="script" value="protectionreset.lua"/>
Login.lua
registerCreatureEvent(cid, "protectionreset")
e fiz sem o registro do login.lua mas nada :\
Não entendi o que você quer. Jogadores com menos de 5 resets não podem ser mortos ou atacados?
Enfim, use este código, que não poderão receber dano nem serem alvejados:
local reset_count = 5 --Quantidade máxima de resets para receber proteção.
function onStatsChange(cid, attacker, type, combat, value)
if isPlayer(attacker) and isPlayer(cid) and getPlayerReset(cid) <= reset_count and type == STATSCHANGE_HEALTHLOSS then
return false
end
return true
end
function onTarget(cid, target)
if isPlayer(cid) and isPlayer(target) and getPlayerReset(target) <= reset_count then
return false
end
return true
end
Editado Setembro 28 por zipter98
info
Grupo: Visconde
Registrado: 28/06/11
Posts: 356
Reputação: +26
Char no Tibia: Akor Rysea

Não entendi o que você quer. Jogadores com menos de 5 resets não podem ser mortos ou atacados?
Enfim, use este código, que não poderão receber dano nem serem alvejados:
local reset_count = 5 --Quantidade máxima de resets para receber proteção. function onStatsChange(cid, attacker, type, combat, value) if isPlayer(attacker) and isPlayer(cid) and getPlayerReset(cid) <= reset_count and type == STATSCHANGE_HEALTHLOSS then return false end return true end function onTarget(cid, target) if isPlayer(cid) and isPlayer(target) and getPlayerReset(target) <= reset_count then return false end return true end
Não sei colocar esta tag zipter
.
tentei:
<event type="statschange" name="protectionreset" event="script" value="protectionreset.lua"/> <event type="target" name="protectionreset" event="script" value="protectionreset.lua"/>
Deixa eu te explicar melhor o pedido:
- Player de 0 a 5 resets não poderão ser mortos nem atacar outros players, apenas não poderão ser mortos por players monstros será normalmente.
-Apartir do 6 eles ja podem se matarem do jeito que quiserem.
Editado Setembro 28 por julhinhokullitz
O nome do arquivo é, logicamente, o mesmo para ambos. Você deve registrar os dois eventos em login.lua.
<event type="statschange" name="resetStatsChange" event="script" value="nome_do_arquivo.lua"/> <event type="target" name="resetTarget" event="script" value="nome_do_arquivo.lua"/>
info
Grupo: Visconde
Registrado: 28/06/11
Posts: 356
Reputação: +26
Char no Tibia: Akor Rysea

O nome do arquivo é, logicamente, o mesmo para ambos. Você deve registrar os dois eventos em login.lua.
<event type="statschange" name="resetStatsChange" event="script" value="nome_do_arquivo.lua"/> <event type="target" name="resetTarget" event="script" value="nome_do_arquivo.lua"/>
Você é foda mesmo se eu fosse uma mulher já sabe(risos) zoa.. só teve um probleminha.
segue:
[28/9/2015 15:11:43] [Error - CreatureScript Interface] [28/9/2015 15:11:43] data/creaturescripts/scripts/protectionreset.lua:onTarget [28/9/2015 15:11:43] Description: [28/9/2015 15:11:43] data/creaturescripts/scripts/protectionreset.lua:11: attempt to call global 'getPlayerReset' (a nil value) [28/9/2015 15:11:43] stack traceback: [28/9/2015 15:11:43] data/creaturescripts/scripts/protectionreset.lua:11: in function <data/creaturescripts/scripts/protectionreset.lua:10>
Você é foda mesmo se eu fosse uma mulher já sabe(risos) zoa.. só teve um probleminha.
segue:
[28/9/2015 15:11:43] [Error - CreatureScript Interface] [28/9/2015 15:11:43] data/creaturescripts/scripts/protectionreset.lua:onTarget [28/9/2015 15:11:43] Description: [28/9/2015 15:11:43] data/creaturescripts/scripts/protectionreset.lua:11: attempt to call global 'getPlayerReset' (a nil value) [28/9/2015 15:11:43] stack traceback: [28/9/2015 15:11:43] data/creaturescripts/scripts/protectionreset.lua:11: in function <data/creaturescripts/scripts/protectionreset.lua:10>
Arrumei amor ![]()
Só por causa de 2 letras tava dando o erro olha ai:
local reset_count = 5 --Quantidade máxima de resets para receber
proteção.
function onStatsChange(cid, attacker, type, combat, value)
if isPlayer(attacker) and isPlayer(cid) and getPlayerResets(cid) <=
reset_count and type == STATSCHANGE_HEALTHLOSS then
return false
end
return true
end
function onTarget(cid, target)
if isPlayer(cid) and isPlayer(target) and getPlayerResets(target) <=
reset_count then
return false
end
return true
end
info
Grupo: Visconde
Registrado: 28/06/11
Posts: 356
Reputação: +26
Char no Tibia: Akor Rysea
Olááá galerinha do Xtibia meus amores rs,
Hoje o que venho lhes pedir não é uma spells, eeebaaa até que enfim, é um scripts de protection reset, parecido com protection lvl, não poderá matar o player com menos de 5 resets ou configurável.
- Meu sistema de Reset não é por storage.
Agradeço muito aquele que me ajudar.
Editado Setembro 25 por julhinhokullitz