Ir para conteúdo
  • Cadastre-se

(Resolvido)Ajustando Script 2


Ir para solução Resolvido por Sekk,

Posts Recomendados

Galera estou precisando de uns ajustes nesse script.

 

Descrição: Esse script, é o famoso !GO(de party) onde o Lider da PT fala esse comando, e todos da sua party mudam a outfit.

Oque eu queria: Gostaria que quando ele der esse comando, aparece algum Efeito nos jogadores da party e tivesse um delay de 360 segundos para poder usar o comando novamente.

 

Citar

function onSay(cid, words, param, channel)
 if not isInParty(cid) or getPlayerParty(cid) ~= cid then
  return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não é líder de uma party")
 end
 local outfit = getCreatureOutfit(cid)
 local addons = outfit.lookAddons
 for _, cid2 in ipairs(getPartyMembers(cid)) do
  outfit.lookAddons = 0
  doCreatureChangeOutfit(cid2, outfit)
  doPlayerSendTextMessage(cid2, MESSAGE_STATUS_CONSOLE_BLUE, "Outfit da party trocado.")
  if canPlayerWearOutfit(cid2, outfit.lookType, addons) then
   outfit.lookAddons = addons
   doCreatureChangeOutfit(cid2, outfit)
   return true
  elseif addons == 3 then
   outfit.lookAddons = (canPlayerWearOutfit(cid2, outfit.lookType, 1) and 1) or (canPlayerWearOutfit(cid2, outfit.lookType, 2) and 2) or 0
   doCreatureChangeOutfit(cid2, outfit)
  end
 end
 return true
end 

Rep+ para quem me ajudar. vlw!

Link para o post
Compartilhar em outros sites
1 hora atrás, caioitalo1 disse:

Galera estou precisando de uns ajustes nesse script.

 

Descrição: Esse script, é o famoso !GO(de party) onde o Lider da PT fala esse comando, e todos da sua party mudam a outfit.

Oque eu queria: Gostaria que quando ele der esse comando, aparece algum Efeito nos jogadores da party e tivesse um delay de 360 segundos para poder usar o comando novamente.

 

Rep+ para quem me ajudar. vlw!

	function onSay(cid, words, param, channel)
	
	local exstorage = 45714 -- any empty storage
	local time = 5*60 -- h*m*s (5 min = 5*60)
	
	if exhaustion.check(cid, exstorage) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Sorry, you need to wait 6 minutes before changing outfit again.")
		return TRUE
	end
	
	if not isInParty(cid) or getPlayerParty(cid) ~= cid then
		return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não é líder de uma party")
	end
	
	local outfit = getCreatureOutfit(cid)
	local addons = outfit.
		for _, cid2 in ipairs(getPartyMembers(cid)) do
			outfit.lookAddons = 0
			doCreatureChangeOutfit(cid2, outfit)
			doPlayerSendTextMessage(cid2, MESSAGE_STATUS_CONSOLE_BLUE, "Outfit da party trocado.")
			if canPlayerWearOutfit(cid2, outfit.lookType, addons) then
				outfit.lookAddons = addons
				doCreatureChangeOutfit(cid2, outfit)
				doSendMagicEffect(getCreaturePosition(cid2), 66)
				exhaustion.set(cid, exstorage, time)
			return true
			elseif addons == 3 then
				outfit.lookAddons = (canPlayerWearOutfit(cid2, outfit.lookType, 1) and 1) or (canPlayerWearOutfit(cid2, outfit.lookType, 2) and 2) or 0
				doCreatureChangeOutfit(cid2, outfit)
				doSendMagicEffect(getCreaturePosition(cid2), 66)
				exhaustion.set(cid, exstorage, time)
			end
		end
		
	return true
end 

 

asdukeeh.jpg

Link para o post
Compartilhar em outros sites
10 minutos atrás, ADM Milord disse:

@DukeeH Esse script dá para rodar em qualquer distro ? ou precisa de alguma função a mais nas sources ?

Não que eu lembre, apenas adicionei 2 linhas. É para ter em quase todas as distros.

Apenas arrume o time la em cima, que coloquei 5 em vez de 6 minutos.

Qualquer erro eu posso ajudar.

asdukeeh.jpg

Link para o post
Compartilhar em outros sites
8 horas atrás, DukeeH disse:

	function onSay(cid, words, param, channel)
	
	local exstorage = 45714 -- any empty storage
	local time = 5*60 -- h*m*s (5 min = 5*60)
	
	if exhaustion.check(cid, exstorage) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Sorry, you need to wait 6 minutes before changing outfit again.")
		return TRUE
	end
	
	if not isInParty(cid) or getPlayerParty(cid) ~= cid then
		return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não é líder de uma party")
	end
	
	local outfit = getCreatureOutfit(cid)
	local addons = outfit.
		for _, cid2 in ipairs(getPartyMembers(cid)) do
			outfit.lookAddons = 0
			doCreatureChangeOutfit(cid2, outfit)
			doPlayerSendTextMessage(cid2, MESSAGE_STATUS_CONSOLE_BLUE, "Outfit da party trocado.")
			if canPlayerWearOutfit(cid2, outfit.lookType, addons) then
				outfit.lookAddons = addons
				doCreatureChangeOutfit(cid2, outfit)
				doSendMagicEffect(getCreaturePosition(cid2), 66)
				exhaustion.set(cid, exstorage, time)
			return true
			elseif addons == 3 then
				outfit.lookAddons = (canPlayerWearOutfit(cid2, outfit.lookType, 1) and 1) or (canPlayerWearOutfit(cid2, outfit.lookType, 2) and 2) or 0
				doCreatureChangeOutfit(cid2, outfit)
				doSendMagicEffect(getCreaturePosition(cid2), 66)
				exhaustion.set(cid, exstorage, time)
			end
		end
		
	return true
end 

 

Não pegou mano, deu error.

20160525_191936.png

Link para o post
Compartilhar em outros sites
  • Solução
	function onSay(cid, words, param, channel)
	
	local exstorage = 45714 -- any empty storage
	local time = 5*60 -- h*m*s (5 min = 5*60)
	
	if exhaustion.check(cid, exstorage) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Sorry, you need to wait 6 minutes before changing outfit again.")
		return TRUE
	end
	
	if not isInParty(cid) or getPlayerParty(cid) ~= cid then
		return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não é líder de uma party")
	end
	
	local outfit = getCreatureOutfit(cid)
	local addons = outfit
		for _, cid2 in ipairs(getPartyMembers(cid)) do
			outfit.lookAddons = 0
			doCreatureChangeOutfit(cid2, outfit)
			doPlayerSendTextMessage(cid2, MESSAGE_STATUS_CONSOLE_BLUE, "Outfit da party trocado.")
			if canPlayerWearOutfit(cid2, outfit.lookType, addons) then
				outfit.lookAddons = addons
				doCreatureChangeOutfit(cid2, outfit)
				doSendMagicEffect(getCreaturePosition(cid2), 66)
				exhaustion.set(cid, exstorage, time)
			return true
			elseif addons == 3 then
				outfit.lookAddons = (canPlayerWearOutfit(cid2, outfit.lookType, 1) and 1) or (canPlayerWearOutfit(cid2, outfit.lookType, 2) and 2) or 0
				doCreatureChangeOutfit(cid2, outfit)
				doSendMagicEffect(getCreaturePosition(cid2), 66)
				exhaustion.set(cid, exstorage, time)
			end
		end
		
	return true
end 

 

Link para o post
Compartilhar em outros sites
Em 25/05/2016 at 15:45, DukeeH disse:

Não que eu lembre, apenas adicionei 2 linhas. É para ter em quase todas as distros.

Apenas arrume o time la em cima, que coloquei 5 em vez de 6 minutos.

Qualquer erro eu posso ajudar.

 @DukeeH De qualquer forma eu agradeço, assim que terminar o cast system, vou testar essa função, a sources que eu tô usando são para 7,72. Mais o tfs 0.3.7 da OTX. 

Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo