Ir para conteúdo
  • 0

Delay Para Um Comando


Guiizeerarush

Pergunta

Galera estou com um problema no meu servidor, o cara loga mc e deixa de bot usando o comando !resetar , queria saber se teria como colocar um delay de 1 minuto ou mais para usar esse comando, para nao ter como ele laggar meu servidor!

 

O meu script de resetar está aki!

 

--[[ <(Advanced Reset System 2.0)>
	   Autor: Juniior Cwb ;*. Contato: (Juniior_Cwb@hotmail.com)
	   Versão: 2.0
	   Testado em: 8.50 e 8.60
	   TFS: 0.3.6 and 0.4.0
	   Atenção , Se Achar Esse Sistema em outro site ou forum favor comunicar Eu ( Juniior Cwb ) Juniior_Cwb@hotmail.com )
   -=[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.]
--=[Comandos de Jogadores]=--
--  "!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 = 2,					   -- 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= 350, free= 350},
stage2= {resets= 9,  premmy= 360, free= 360},	 -- EXPLICANDO e Configurando stages. (Se estiver Abilitado [Abilitar = {x}])
stage3= {resets= 14, premmy= 370, free= 370},	 -- resets = Número de resets para o Stage;
stage4= {resets= 19, premmy= 380, free= 380},	 -- premmy = Level necessário para Premium Accounts;
stage5= {resets= 24, premmy= 390, free= 390},	 -- free	= Level necessário para Free Accounts;
stage6= {resets= 29, premmy= 400, free= 400},	   -- Coloque em Ordem...
stage7= {resets= 34, premmy= 420, free= 420},	 -- [OBS: MARQUE UM "X" PARA ABILITAR OU DESABILITAR OS STAGES]
stage8= {resets= 39, premmy= 440, free= 440},	 -- EX: para desabilitar mude: Abilitar = {}, Desabilitar = {x}
stage9= {resets= 44, premmy= 460, free= 460},
stage10={resets= 49, premmy= 480, free= 480},
stage11={resets= 54, premmy= 500, free= 500},
stage12={resets= 59, premmy= 525, free= 525},
stage13={resets= 64, premmy= 700, free= 700},
stage14={resets= 69, premmy= 750, free= 750},
stage15={resets= 74, premmy= 760, free= 760},
stage16={resets= 79, premmy= 900, free= 900},
stage17={resets= 84, premmy= 1000, free= 1000},
stage18={resets= 89, premmy= 1100, free= 1100},
stage19={resets= 94, premmy= 1200, free= 1200},
stage20={resets= 99, premmy= 1500, free= 1500},
}
	--[[>> 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},
}
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()
 print(not rss_db  and LUA_ERROR or "Tabela de Resets: Instalada ... [success] ")
 addEvent(newReset, 1000, 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 == "/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
	end
return 1
end
--=[by: Juniior Cwb ;* ]=--

Link para o comentário
Compartilhar em outros sites

15 respostass a esta questão

Posts Recomendados

  • 0

tente ai

 

--[[ <(Advanced Reset System 2.0)>
			   Autor: Juniior Cwb ;*. Contato: (Juniior_Cwb@hotmail.com)
			   Versão: 2.0
			   Testado em: 8.50 e 8.60
			   TFS: 0.3.6 and 0.4.0
			   Atenção , Se Achar Esse Sistema em outro site ou forum favor comunicar Eu ( Juniior Cwb ) Juniior_Cwb@hotmail.com )
	   -=[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.]
--=[Comandos de Jogadores]=--
--  "!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 = 2,										  -- Tempo para o Player deslogar ao resetar, em segundos.  [Valor]
 },
}
local config = {
s = 11548, -- n mexa
exhau = 60 -- tempo em seegundos para salvar denovo
}
if (getPlayerStorageValue(cid, config.s) <= os.time()) then
setPlayerStorageValue(cid,config.s,os.time()+config.exhau)
doPlayerSendTextMessage(cid, 22 , "Espere 1 min para usar o comando novamente")
return true
end


			  --[[>> STAGES <<]]--
x=true;X=true -- Não Mexer.
local stage = {Abilitar = {x}, Desabilitar = {},		 --<< Abilitar Stages?? >>--				    [{x};{}]
--	    [RESETS]	  |  [PREMMY]  |   [FREE]
stage1= {resets= 4,  premmy= 350, free= 350},
stage2= {resets= 9,  premmy= 360, free= 360},    -- EXPLICANDO e Configurando stages. (Se estiver Abilitado [Abilitar = {x}])
stage3= {resets= 14, premmy= 370, free= 370},    -- resets = Número de resets para o Stage;
stage4= {resets= 19, premmy= 380, free= 380},    -- premmy = Level necessário para Premium Accounts;
stage5= {resets= 24, premmy= 390, free= 390},    -- free	    = Level necessário para Free Accounts;
stage6= {resets= 29, premmy= 400, free= 400},	  -- Coloque em Ordem...
stage7= {resets= 34, premmy= 420, free= 420},    -- [OBS: MARQUE UM "X" PARA ABILITAR OU DESABILITAR OS STAGES]
stage8= {resets= 39, premmy= 440, free= 440},    -- EX: para desabilitar mude: Abilitar = {}, Desabilitar = {x}
stage9= {resets= 44, premmy= 460, free= 460},
stage10={resets= 49, premmy= 480, free= 480},
stage11={resets= 54, premmy= 500, free= 500},
stage12={resets= 59, premmy= 525, free= 525},
stage13={resets= 64, premmy= 700, free= 700},
stage14={resets= 69, premmy= 750, free= 750},
stage15={resets= 74, premmy= 760, free= 760},
stage16={resets= 79, premmy= 900, free= 900},
stage17={resets= 84, premmy= 1000, free= 1000},
stage18={resets= 89, premmy= 1100, free= 1100},
stage19={resets= 94, premmy= 1200, free= 1200},
stage20={resets= 99, premmy= 1500, free= 1500},
}
		    --[[>> 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},
}
    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()
	 print(not rss_db  and LUA_ERROR or "Tabela de Resets: Instalada ... [success] ")
	 addEvent(newReset, 1000, 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 == "/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
		    end
return 1
end
--=[by: Juniior Cwb ;* ]=--

Link para o comentário
Compartilhar em outros sites

  • 0

Nao deu Certo apareceu a msg de 1 min apenas na primeira vez que usei o comando logo depois ja deu pra usar!

 

dai aparece isso

 

 

15:47 - Level Necessário Para o Reset [360]. Faltam 352 level's para você Resetar. -

15:47 - Level Necessário Para o Reset [360]. Faltam 352 level's para você Resetar. -

15:47 - Level Necessário Para o Reset [360]. Faltam 352 level's para você Resetar. -

 

dai o cara fica usando esse comando sem parar ai o servidor fica laag!

 

ai la no servidor fica essa msg sem parar!

 

 

[09/08/2012 11:46:38] Tabela de Resets: Instalada ... [success]

[09/08/2012 11:46:38] Tabela de Resets: Instalada ... [success]

[09/08/2012 11:46:38] Tabela de Resets: Instalada ... [success]

[09/08/2012 11:46:39] Tabela de Resets: Instalada ... [success]

[09/08/2012 11:46:39] Tabela de Resets: Instalada ... [success]

 

 

 

Queria que ficasse igual o comando de sacar do radbr original, nem aparece msg nenhuma simplismente vc tem que esperar alguns segundos para o comando funcionar novamente!

Editado por Guiizeerarush
Link para o comentário
Compartilhar em outros sites

  • 0

tenta assim

 

--[[ <(Advanced Reset System 2.0)>
			   Autor: Juniior Cwb ;*. Contato: (Juniior_Cwb@hotmail.com)
			   Versão: 2.0
			   Testado em: 8.50 e 8.60
			   TFS: 0.3.6 and 0.4.0
			   Atenção , Se Achar Esse Sistema em outro site ou forum favor comunicar Eu ( Juniior Cwb ) Juniior_Cwb@hotmail.com )
	   -=[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.]
--=[Comandos de Jogadores]=--
--  "!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 = 2,										  -- Tempo para o Player deslogar ao resetar, em segundos.  [Valor]
 },
}
local waittime = 60 --Default (30 seconds)
exhaustion.set(cid, storage, waittime)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Espere " .. exhaustion.get(cid, storage) .. " Segundos.")


			  --[[>> STAGES <<]]--
x=true;X=true -- Não Mexer.
local stage = {Abilitar = {x}, Desabilitar = {},		 --<< Abilitar Stages?? >>--				    [{x};{}]
--	    [RESETS]	  |  [PREMMY]  |   [FREE]
stage1= {resets= 4,  premmy= 350, free= 350},
stage2= {resets= 9,  premmy= 360, free= 360},    -- EXPLICANDO e Configurando stages. (Se estiver Abilitado [Abilitar = {x}])
stage3= {resets= 14, premmy= 370, free= 370},    -- resets = Número de resets para o Stage;
stage4= {resets= 19, premmy= 380, free= 380},    -- premmy = Level necessário para Premium Accounts;
stage5= {resets= 24, premmy= 390, free= 390},    -- free	    = Level necessário para Free Accounts;
stage6= {resets= 29, premmy= 400, free= 400},	  -- Coloque em Ordem...
stage7= {resets= 34, premmy= 420, free= 420},    -- [OBS: MARQUE UM "X" PARA ABILITAR OU DESABILITAR OS STAGES]
stage8= {resets= 39, premmy= 440, free= 440},    -- EX: para desabilitar mude: Abilitar = {}, Desabilitar = {x}
stage9= {resets= 44, premmy= 460, free= 460},
stage10={resets= 49, premmy= 480, free= 480},
stage11={resets= 54, premmy= 500, free= 500},
stage12={resets= 59, premmy= 525, free= 525},
stage13={resets= 64, premmy= 700, free= 700},
stage14={resets= 69, premmy= 750, free= 750},
stage15={resets= 74, premmy= 760, free= 760},
stage16={resets= 79, premmy= 900, free= 900},
stage17={resets= 84, premmy= 1000, free= 1000},
stage18={resets= 89, premmy= 1100, free= 1100},
stage19={resets= 94, premmy= 1200, free= 1200},
stage20={resets= 99, premmy= 1500, free= 1500},
}
		    --[[>> 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},
}
    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()
	 print(not rss_db  and LUA_ERROR or "Tabela de Resets: Instalada ... [success] ")
	 addEvent(newReset, 1000, 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 == "/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
		    end
return 1
end
--=[by: Juniior Cwb ;* ]=--

 

Dps de colar isso va na pasta Lib e crie um arquivo lua chamado Lua Database

 

e dentro dele escreve isso dentro

 

dofile(getDataDir() .. "lib/exhaustion.lua")

Link para o comentário
Compartilhar em outros sites

  • 0

16:16 Espere 60 Segundos.

16:16 - Level Necessário Para o Reset [360]. Faltam 352 level's para você Resetar. -

16:16 Espere 60 Segundos.

16:16 - Level Necessário Para o Reset [360]. Faltam 352 level's para você Resetar. -

 

Nao deu certo!

 

o que trava o servidor é a tabela iniciada no servidor

 

 

[09/08/2012 12:17:36] Tabela de Resets: Instalada ... [success]

[09/08/2012 12:17:40] Tabela de Resets: Instalada ... [success]

[09/08/2012 12:17:40] Tabela de Resets: Instalada ... [success]

 

Tem como deixar igual o comando !sacar do radbr original, que vc usa o comando e ele nao funciona só depois de uns 30 s!

Link para o comentário
Compartilhar em outros sites

  • 0

Não vou analisar o código acima, mais assim resolve o seu problema caso o de cima não esteja correto novamente.

 

--[[ <(Advanced Reset System 2.0)>
			   Autor: Juniior Cwb ;*. Contato: (Juniior_Cwb@hotmail.com)
			   Versão: 2.0
			   Testado em: 8.50 e 8.60
			   TFS: 0.3.6 and 0.4.0
			   Atenção , Se Achar Esse Sistema em outro site ou forum favor comunicar Eu ( Juniior Cwb ) Juniior_Cwb@hotmail.com )
	   -=[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.]
--=[Comandos de Jogadores]=--
--  "!resetar"		  -- Para Resetar.

local exhaustionMinutes = 2 -- exausted em minutos
local storageUse = 34538 -- storage usado no exausted.

function onSay(cid, words, param)
if words =="!resetar" then
if(exhaustion.check(cid, storageUse) == TRUE) then
  if (exhaustion.get(cid, storageUse) >= 60) then
  doPlayerSendCancel(cid, "Voçê só pode usar após [" .. math.floor(exhaustion.get(cid, storageUse) / 60 + 1) .."] minutos.")
  end
   if (exhaustion.get(cid, storageUse) <= 60) then
   doPlayerSendCancel(cid, "Voçê só pode usar após [" .. exhaustion.get(cid, storageUse).."] segundos.")
   end
return TRUE
end
exhaustion.set(cid, storageUse, exhaustionMinutes*60)
--[ 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 = 2,										  -- 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= 350, free= 350},
stage2= {resets= 9,  premmy= 360, free= 360},    -- EXPLICANDO e Configurando stages. (Se estiver Abilitado [Abilitar = {x}])
stage3= {resets= 14, premmy= 370, free= 370},    -- resets = Número de resets para o Stage;
stage4= {resets= 19, premmy= 380, free= 380},    -- premmy = Level necessário para Premium Accounts;
stage5= {resets= 24, premmy= 390, free= 390},    -- free	    = Level necessário para Free Accounts;
stage6= {resets= 29, premmy= 400, free= 400},	  -- Coloque em Ordem...
stage7= {resets= 34, premmy= 420, free= 420},    -- [OBS: MARQUE UM "X" PARA ABILITAR OU DESABILITAR OS STAGES]
stage8= {resets= 39, premmy= 440, free= 440},    -- EX: para desabilitar mude: Abilitar = {}, Desabilitar = {x}
stage9= {resets= 44, premmy= 460, free= 460},
stage10={resets= 49, premmy= 480, free= 480},
stage11={resets= 54, premmy= 500, free= 500},
stage12={resets= 59, premmy= 525, free= 525},
stage13={resets= 64, premmy= 700, free= 700},
stage14={resets= 69, premmy= 750, free= 750},
stage15={resets= 74, premmy= 760, free= 760},
stage16={resets= 79, premmy= 900, free= 900},
stage17={resets= 84, premmy= 1000, free= 1000},
stage18={resets= 89, premmy= 1100, free= 1100},
stage19={resets= 94, premmy= 1200, free= 1200},
stage20={resets= 99, premmy= 1500, free= 1500},
}
		    --[[>> 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},
}
    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()
	 print(not rss_db  and LUA_ERROR or "Tabela de Resets: Instalada ... [success] ")
	 addEvent(newReset, 1000, 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 == "/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
		    end
return 1
end
--=[by: Juniior Cwb ;* ]=--

Link para o comentário
Compartilhar em outros sites

  • 0

Jhon992

 

 

Vlw cara tah funcionando perfeitamente!]

 

Tah dando um erro no servidor mais parece que nao tah interferindo em nada nao?

 

 

[09/08/2012 12:25:01] [Error - TalkAction Interface]

[09/08/2012 12:25:01] data/lib/exhaustion.lua

[09/08/2012 12:25:02] Description:

[09/08/2012 12:25:02] data/lib/exhaustion.lua:1: chunk has too many syntax levels

[09/08/2012 12:25:02] [Warning - LuaScriptInterface::initState] Cannot load data/lib/

[09/08/2012 12:25:02] Reloaded talk actions.

Link para o comentário
Compartilhar em outros sites

  • 0

Éh, não era pra estar aparecendo esse erro n, sahdua. Alguma coisa ta errada.

 

Verifica se teu arquivo data/lib/034-exhaustion.lua, ta assim:

exhaustion =
{
   check = function (cid, storage)
       if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
           return false
       end

       return getPlayerStorageValue(cid, storage) >= os.time()
   end,

   get = function (cid, storage)
       if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
           return false
       end

       local exhaust = getPlayerStorageValue(cid, storage)
       if(exhaust > 0) then
           local left = exhaust - os.time()
           if(left >= 0) then
               return left
           end
       end

       return false
   end,

   set = function (cid, storage, time)
       setPlayerStorageValue(cid, storage, os.time() + time)
   end,

   make = function (cid, storage, time)
       local exhaust = exhaustion.get(cid, storage)
       if(not exhaust) then
           exhaustion.set(cid, storage, time)
           return true
       end

       return false
   end
}

Editado por Jhon992
Link para o comentário
Compartilhar em outros sites

  • 0

Tah Assim!

 

exhaustion =
{
   check = function (cid, storage)
    if(getPlayerStorageValue(cid, storage) >= os.time(t)) then
	    return TRUE
    end
    return FALSE
   end,
   get = function (cid, storage)
    local exhaust = getPlayerStorageValue(cid, storage)
    if(exhaust > 0) then
	    local left = exhaust - os.time(t)
	    if(left >= 0) then
		    return left
	    end
    end
    return FALSE
   end,
   set = function (cid, storage, time)
    setPlayerStorageValue(cid, storage, os.time(t) + time)
   end,
   make = function (cid, storage, time)
    local exhaust = exhaustion.get(cid, storage)
    if(not exhaust) then
	    exhaustion.set(cid, storage, time)
	    return TRUE
    end
    return FALSE
   end
}

Link para o comentário
Compartilhar em outros sites

  • 0

Galera, por favor ponham esses arquivos em spoiler, o tópico ta GIGANTE.

 

Não sabe botar em spoiler?

 

Simples faça assim:

[spoiler.]ARQUIVO[/spoiler.]

Explicando:

 

-Vermelho: Ponto a ser retirado

-Roxo: Seu arquivo

Editado por Newtonnotwen
Link para o comentário
Compartilhar em outros sites

  • 0

Estou com outro problema, no meu ot tem um cara comprando um item sem gastar nada!

 

Ele usa essa hotkey do elf e compra a super uh sem gastar nada!

 

auto 1 buyitems 3162 0

 

o script do npc tah aki!

 

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Forasteiro" script="data/npc/scripts/default.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="133" head="114" body="114" legs="114" feet="114" addons="3"/>
<parameters>
 <parameter key="module_shop" value="1"/>
 <parameter key="message_greet" value="Ola |PLAYERNAME|. Eu vendo items especiais. Diga {trade}."/>
 <parameter key="shop_sellable" value="ring of the sky,2123,5000; gold ring,2179,2500"/>
 <parameter key="shop_buyable" value="runa do inferno,2307,20000;super uh,2275,150000;magic teleport,2349,8000000;infernal,6529,20000;energy ring,2167,10000;magic prison,2272,100000;soft boots,6132,100000"/>
</parameters>
</npc>

Link para o comentário
Compartilhar em outros sites

  • 0
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
function onCreatureAppear(cid)   npcHandler:onCreatureAppear(cid)   end
function onCreatureDisappear(cid)  npcHandler:onCreatureDisappear(cid)   end
function onCreatureSay(cid, type, msg)  npcHandler:onCreatureSay(cid, type, msg)  end
function onThink()    npcHandler:onThink()	 endnpcHandler:addModule(FocusModule:new())

Link para o comentário
Compartilhar em outros sites

  • 0

troque por esse

 

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
function onCreatureAppear(cid)   npcHandler:onCreatureAppear(cid)   end
function onCreatureDisappear(cid)  npcHandler:onCreatureDisappear(cid)   end
function onCreatureSay(cid, type, msg)  npcHandler:onCreatureSay(cid, type, msg)  end
function onThink()    npcHandler:onThink()	 end
npcHandler:addModule(FocusModule:new())

Link para o comentário
Compartilhar em outros sites

  • 0

Esse erro é bem fácil de consertar, pode ser feito pelas sources (que é o modo mais correto) ou com uma simples edição nas bibliotecas do sistema de NPCs que vem com os servidores.

 


 

Abra o arquivo modules.lua, localizado em data/npc/lib/npcsystem e procure por:

 

function ShopModule:callbackOnBuy(cid, itemid, subType, amount, ignoreCap, inBackpacks)

 

Acima de:

 



	local subType = shopItem.subType or 1
	local a, b = doNpcSellItem(cid, itemid, amount, subType, ignoreCap, inBackpacks, backpack)

 

Adicione:

 


	if(amount == 0) then
		return false
	end

 


 

E SkyLigh, peço que evite postagens sem sentido que não ajudam em nada.

 

Abraços.

Editado por Oneshot
Link para o comentário
Compartilhar em outros sites

  • 0

Coloquei aki mais ainda está comprando!

 

Compra de 1 em 1 sem gastar nada!

 

7:30 Bought 0x super ultimate healing rune for 0 gold.

 

fica comprando de 1 em 1 sem gastar nada!

 

Vou testar o do oneshot e ja deixo a resposta aki!

 

O meu nao tem isso aki esta o script do npcsysten!

 

 

-- This file is part of Jiddo's advanced NpcSystem v3.0x. This npcsystem is free to use by anyone, for any purpuse.
-- Initial release date: 2007-02-21
-- Credits: Jiddo, honux(I'm using a modified version of his Find function).
-- Please include full credits whereever you use this system, or parts of it.
-- For support, questions and updates, please consult the following thread:
-- http://otfans.net/showthread.php?t=67810
if(NpcSystem == nil) then

-- Loads the underlying classes of the npcsystem.
dofile('data/npc/scripts/lib/npcsystem/keywordhandler.lua')
dofile('data/npc/scripts/lib/npcsystem/queue.lua')
dofile('data/npc/scripts/lib/npcsystem/npchandler.lua')
dofile('data/npc/scripts/lib/npcsystem/modules.lua')


-- Global npc constants:

-- Keyword nestling behavior. For more information look at the top of keywordhandler.lua
KEYWORD_BEHAVIOR = BEHAVIOR_NORMAL_EXTENDED

-- Gerrting and unGreeting keywords. For mor information look at the top of modules.lua
FOCUS_GREETWORDS = {'hi', 'hello'}
FOCUS_FAREWELLWORDS = {'bye', 'farewell', 'cya'}


-- The word for accepting/declining an offer. CAN ONLY CONTAIN ONE FIELD! For more information look at the top of modules.lua
SHOP_YESWORD = {'yes'}
SHOP_NOWORD = {'no'}

-- Pattern used to get the amount of an item a player wants to buy/sell.
PATTERN_COUNT = '%d+'

-- Talkdelay behavior. For mor information, look at the top of npchandler.lua.
NPCHANDLER_TALKDELAY = TALKDELAY_ONTHINK

-- Constant strings defining the keywords to replace in the default messages.
-- For more information, look at the top of npchandler.lua...
TAG_PLAYERNAME = '|PLAYERNAME|'
TAG_ITEMCOUNT = '|ITEMCOUNT|'
TAG_TOTALCOST = '|TOTALCOST|'
TAG_ITEMNAME = '|ITEMNAME|'
TAG_QUEUESIZE = '|QUEUESIZE|'





NpcSystem = {
  --
 }

-- Gets an npcparameter with the specified key. Returns nil if no such parameter is found.
function NpcSystem.getParameter(key)
 local ret = getNpcParameter(tostring(key))
 if((type(ret) == 'number' and ret == 0) or ret == nil) then
  return nil
 else
  return ret
 end
end

-- Parses all known parameters for the npc. Also parses parseable modules.
function NpcSystem.parseParameters(npcHandler)

 local ret = NpcSystem.getParameter('idletime')
 if(ret ~= nil) then
  npcHandler.idleTime = tonumber(ret)
 end

 local ret = NpcSystem.getParameter('talkradius')
 if(ret ~= nil) then
  npcHandler.talkRadius = tonumber(ret)
 end

 local ret = NpcSystem.getParameter('talkdelaytime')
 if(ret ~= nil) then
  npcHandler.talkDelayTime = tonumber(ret)
 end

 local ret = NpcSystem.getParameter('message_greet')
 if(ret ~= nil) then
  npcHandler:setMessage(MESSAGE_GREET, ret)
 end
 local ret = NpcSystem.getParameter('message_farewell')
 if(ret ~= nil) then
  npcHandler:setMessage(MESSAGE_FAREWELL, ret)
 end
 local ret = NpcSystem.getParameter('message_buy')
 if(ret ~= nil) then
  npcHandler:setMessage(MESSAGE_BUY, ret)
 end
 local ret = NpcSystem.getParameter('message_sell')
 if(ret ~= nil) then
  npcHandler:setMessage(MESSAGE_SELL, ret)
 end
 local ret = NpcSystem.getParameter('message_onbuy')
 if(ret ~= nil) then
  npcHandler:setMessage(MESSAGE_ONBUY, ret)
 end
 local ret = NpcSystem.getParameter('message_onsell')
 if(ret ~= nil) then
  npcHandler:setMessage(MESSAGE_ONSELL, ret)
 end
 local ret = NpcSystem.getParameter('message_needmoremoney')
 if(ret ~= nil) then
  npcHandler:setMessage(MESSAGE_NEEDMOREMONEY, ret)
 end
 local ret = NpcSystem.getParameter('message_nothaveitem')
 if(ret ~= nil) then
  npcHandler:setMessage(MESSAGE_NOTHAVEITEM, ret)
 end
 local ret = NpcSystem.getParameter('message_idletimeout')
 if(ret ~= nil) then
  npcHandler:setMessage(MESSAGE_IDLETIMEOUT, ret)
 end
 local ret = NpcSystem.getParameter('message_walkaway')
 if(ret ~= nil) then
  npcHandler:setMessage(MESSAGE_WALKAWAY, ret)
 end
 local ret = NpcSystem.getParameter('message_alreadyfocused')
 if(ret ~= nil) then
  npcHandler:setMessage(MESSAGE_ALREADYFOCUSED, ret)
 end
 local ret = NpcSystem.getParameter('message_placedinqueue')
 if(ret ~= nil) then
  npcHandler:setMessage(MESSAGE_PLACEDINQUEUE, ret)
 end
 local ret = NpcSystem.getParameter('message_decline')
 if(ret ~= nil) then
  npcHandler:setMessage(MESSAGE_DECLINE, ret)
 end

 -- Parse modules.
 for parameter, module in pairs(Modules.parseableModules) do
  local ret = NpcSystem.getParameter(parameter)
  if(ret ~= nil) then
   local number = tonumber(ret)
   if(number ~= 0 and module.parseParameters ~= nil) then
 local instance = module:new()
 npcHandler:addModule(instance)
 instance:parseParameters()
   end
  end
 end

end
end

 

 

alguem ?

Editado por Guiizeerarush
Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...