Ir para conteúdo
  • 0

por tempo em script /cp


clebao666

Pergunta

alguem pode me ajudar por pro player usar essa magia so a cada 30 min. desde ja agradeço.

 

Vá em data\talkactions.xml,e cole isso dentro.

<talkaction words="/cp" event="script" value="areareturn.lua"/>

Depois vá em Data/talkactions/scripts, e crie um arquivo.lua com nome de areareturn e bote isso dentro.

AR = {x=2097, y=911, z=7}
--
local msg_to = "You as bee a teleported to Arena. You need to use /cp return to leave to here."
--
local sto_enter = 85315
--//--

function onSay(cid, words, param, channel)
local t = string.explode(param, ",")
if param == "" then
--
if getPlayerStorageValue(cid, 52480) >= 1 then
sendMsgToPlayer(cid, 27, "You are already dueling!")
return true end

if getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then
sendMsgToPlayer(cid, 27, "You can't do that while is in battle!")
return true end

if getPlayerLevel(cid) < 50 then
sendMsgToPlayer(cid, 27, "Sorry, you need level 50 + to enter to arena Duel!")
return true end
--
setPlayerStorageValue(cid, sto_enter, 1)
doTeleportThing(cid, AR)
sendMsgToPlayer(cid, 20, msg_to)
end
-----------------------------------------------------------------
if param and param == "return" then
--
if getPlayerStorageValue(cid, sto_enter) > 1 then
return true end

if getPlayerStorageValue(cid, 52480) >= 1 then
sendMsgToPlayer(cid, 27, "You are already dueling!")
return true end

if getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then
sendMsgToPlayer(cid, 27, "You can't do that while is in battle!")
return true end

if getPlayerLevel(cid) < 50 then
sendMsgToPlayer(cid, 27, "Sorry, you need level 50 + to enter to arena Duel.")
return true end
--
setPlayerStorageValue(cid, 154585, -1)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
end
return true
end

Link para o comentário
Compartilhar em outros sites

5 respostass a esta questão

Posts Recomendados

  • 0

Teste assim:

 

 

local AR = {x=2097, y=911, z=7}
--
local msg_to = "You as bee a teleported to Arena. You need to use /cp return to leave to here."
--
local sto_enter = 85315

local exaust = {
	storage = 1545851,
	time = 30 -- em minutos
}
--//--

function onSay(cid, words, param, channel)
	local t = string.explode(param, ",")
	if param == "" then
		if getPlayerStorageValue(cid, exaust.storage) < os.time() then
			if getPlayerStorageValue(cid, 52480) >= 1 then
				sendMsgToPlayer(cid, 27, "You are already dueling!")
				return true
			end

			if getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then
				sendMsgToPlayer(cid, 27, "You can't do that while is in battle!")
				return true
			end

			if getPlayerLevel(cid) < 50 then
				sendMsgToPlayer(cid, 27, "Sorry, you need level 50 + to enter to arena Duel!")
				return true
			end
			
		
			setPlayerStorageValue(cid, exaust.storage, os.time() + (exaust.time * 60))
			setPlayerStorageValue(cid, sto_enter, 1)
			doTeleportThing(cid, AR)
			sendMsgToPlayer(cid, 20, msg_to)
			return true
		else
			sendMsgToPlayer(cid, 27, "You use this command only every " .. exaust.time .. " minutes!")
			return true
		end
	end
	-----------------------------------------------------------------    
	if param and param == "return" then

		if getPlayerStorageValue(cid, sto_enter) > 1 then
			return true
		end

		if getPlayerStorageValue(cid, 52480) >= 1 then
			sendMsgToPlayer(cid, 27, "You are already dueling!")
			return true
		end

		if getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then
			sendMsgToPlayer(cid, 27, "You can't do that while is in battle!")
			return true
		end

		if getPlayerLevel(cid) < 50 then
			sendMsgToPlayer(cid, 27, "Sorry, you need level 50 + to enter to arena Duel.")
			return true
		end

		setPlayerStorageValue(cid, 154585, -1)
		doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
	end
	return true
end

 

 

Link para o comentário
Compartilhar em outros sites

  • 0

Teste assim:

 

 

local AR = {x=2097, y=911, z=7}
--
local msg_to = "You as bee a teleported to Arena. You need to use /cp return to leave to here."
--
local sto_enter = 85315

local exaust = {
	storage = 1545851,
	time = 30 -- em minutos
}
--//--

function onSay(cid, words, param, channel)
	local t = string.explode(param, ",")
	if param == "" then
		if getPlayerStorageValue(tid, exaust.storage) < os.time() then
			if getPlayerStorageValue(cid, 52480) >= 1 then
				sendMsgToPlayer(cid, 27, "You are already dueling!")
				return true
			end

			if getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then
				sendMsgToPlayer(cid, 27, "You can't do that while is in battle!")
				return true
			end

			if getPlayerLevel(cid) < 50 then
				sendMsgToPlayer(cid, 27, "Sorry, you need level 50 + to enter to arena Duel!")
				return true
			end
			
		
			setPlayerStorageValue(tid, exaust.storage, os.time() + (exaust.time * 60))
			setPlayerStorageValue(cid, sto_enter, 1)
			doTeleportThing(cid, AR)
			sendMsgToPlayer(cid, 20, msg_to)
			return true
		else
			sendMsgToPlayer(cid, 27, "You use this command only every " .. exaust.time .. " minutes!")
			return true
		end
	end
	-----------------------------------------------------------------    
	if param and param == "return" then

		if getPlayerStorageValue(cid, sto_enter) > 1 then
			return true
		end

		if getPlayerStorageValue(cid, 52480) >= 1 then
			sendMsgToPlayer(cid, 27, "You are already dueling!")
			return true
		end

		if getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then
			sendMsgToPlayer(cid, 27, "You can't do that while is in battle!")
			return true
		end

		if getPlayerLevel(cid) < 50 then
			sendMsgToPlayer(cid, 27, "Sorry, you need level 50 + to enter to arena Duel.")
			return true
		end

		setPlayerStorageValue(cid, 154585, -1)
		doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
	end
	return true
end

 

 

 

deu erro man.

 

[03/07/2015 15:42:11] [Error - TalkAction Interface]

[03/07/2015 15:42:11] data/talkactions/scripts/areareturn.lua:onSay

[03/07/2015 15:42:11] Description:

[03/07/2015 15:42:11] (luaGetCreatureStorage) Creature not found

 

[03/07/2015 15:42:11] [Error - TalkAction Interface]

[03/07/2015 15:42:11] data/talkactions/scripts/areareturn.lua:onSay

[03/07/2015 15:42:11] Description:

[03/07/2015 15:42:11] data/talkactions/scripts/areareturn.lua:16: attempt to compare boolean with number

[03/07/2015 15:42:11] stack traceback:

[03/07/2015 15:42:11] data/talkactions/scripts/areareturn.lua:16: in function <data/talkactions/scripts/areareturn.lua:13>

 

Link para o comentário
Compartilhar em outros sites

  • 0

@@clebao666, não me atentei as alterações, como eu faço do serviço as vezes pego scripts já prontos kkkkk

Já alterei, pode pegar a versão atualizada!

 

Tópico movido para a seção de dúvidas e pedidos resolvidos.

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...