Ir para conteúdo
  • Cadastre-se

(Resolvido)Correção em um script action


Ir para solução Resolvido por Sekk,

Posts Recomendados

<action itemid="8300" event="script" value="vipaddons.lua" />
local s = 19000
local i = 8300

function onUse(cid, item, itemEx, toPosition, fromPosition)
	if getPlayerStorageValue(cid, s) <= 0 then
		setPlayerStorageValue(cid, s, 1)
		doPlayerSendTextMessage(cid, 22, "Parabéns! Você ganhou um novo outfit.")
		doSendMagicEffect(getCreaturePosition(cid), 30)
		doPlayerRemoveItem(cid, i, 1)
		doPlayerAddOutfit(cid, coloca o id da outfit, n o type aqui, 1)
	else
		doPlayerSendCancel(cid, "Você já tem esse outfit.")
	end
	
	return true
end
<?xml version="1.0"?>
<outfits>
	<outfit id="1">
		<list gender="0" lookType="136" name="Citizen"/>
		<list gender="1" lookType="128" name="Citizen"/>
	</outfit>

	<outfit id="2">
		<list gender="0" lookType="137" name="Hunter"/>
		<list gender="1" lookType="129" name="Hunter"/>
	</outfit>

	<outfit id="3">
		<list gender="0" lookType="138" name="Mage"/>
		<list gender="1" lookType="130" name="Mage"/>
	</outfit>

	<outfit id="4">
		<list gender="0" lookType="139" name="Knight"/>
		<list gender="1" lookType="131" name="Knight"/>
	</outfit>

	<outfit id="5" premium="yes">
		<list gender="0" lookType="140" name="Noblewoman"/>
		<list gender="1" lookType="132" name="Nobleman"/>
	</outfit>

	<outfit id="6" premium="yes">
		<list gender="0" lookType="141" name="Summoner"/>
		<list gender="1" lookType="133" name="Summoner"/>
	</outfit>

	<outfit id="7" premium="yes">
		<list gender="0" lookType="142" name="Warrior"/>
		<list gender="1" lookType="134" name="Warrior"/>
	</outfit>

	<outfit id="8" premium="yes">
		<list gender="0" lookType="147" name="Barbarian"/>
		<list gender="1" lookType="143" name="Barbarian"/>
	</outfit>

	<outfit id="9" premium="yes">
		<list gender="0" lookType="148" name="Druid"/>
		<list gender="1" lookType="144" name="Druid"/>
	</outfit>

	<outfit id="10" premium="yes">
		<list gender="0" lookType="149" name="Wizard"/>
		<list gender="1" lookType="145" name="Wizard"/>
	</outfit>

	<outfit id="11" premium="yes">
		<list gender="0" lookType="150" name="Oriental"/>
		<list gender="1" lookType="146" name="Oriental"/>
	</outfit>

	<outfit id="12" premium="yes" default="0">
		<list gender="0" lookType="155" name="Pirate"/>
		<list gender="1" lookType="151" name="Pirate"/>
	</outfit>

	<outfit id="13" premium="yes" default="0">
		<list gender="0" lookType="156" name="Assassin"/>
		<list gender="1" lookType="152" name="Assassin"/>
	</outfit>

	<outfit id="14" premium="yes" default="0">
		<list gender="0" lookType="157" name="Beggar"/>
		<list gender="1" lookType="153" name="Beggar"/>
	</outfit>

	<outfit id="15" premium="yes" default="0">
		<list gender="0" lookType="158" name="Shaman"/>
		<list gender="1" lookType="154" name="Shaman"/>
	</outfit>

	<outfit id="16" premium="yes" default="0">
		<list gender="0" lookType="252" name="Norsewoman"/>
		<list gender="1" lookType="251" name="Norseman"/>
	</outfit>

	<outfit id="17" premium="yes" default="0">
		<list gender="0" lookType="269" name="Nightmare"/>
		<list gender="1" lookType="268" name="Nightmare"/>
	</outfit>

	<outfit id="18" premium="yes" default="0">
		<list gender="0" lookType="270" name="Jester"/>
		<list gender="1" lookType="273" name="Jester"/>
	</outfit>

	<outfit id="19" premium="yes" default="0">
		<list gender="0" lookType="279" name="Brotherhood"/>
		<list gender="1" lookType="278" name="Brotherhood"/>
	</outfit>

	<outfit id="20" premium="yes" default="0">
		<list gender="0" lookType="288" name="Demonhunter"/>
		<list gender="1" lookType="289" name="Demonhunter"/>
	</outfit>

	<outfit id="21" premium="yes" default="0">
		<list gender="0" lookType="324" name="Yalaharian"/>
		<list gender="1" lookType="325" name="Yalaharian"/>
	</outfit>

	<outfit id="22" default="0">
		<list gender="0" lookType="336" name="Warmaster"/>
		<list gender="1" lookType="335" name="Warmaster"/>
	</outfit>

	<outfit id="23" premium="yes" default="0">
		<list gender="0" lookType="366" name="Wayfarer"/>
		<list gender="1" lookType="367" name="Wayfarer"/>
	</outfit>

	<outfit id="24" premium="yes" default="0">
		<list gender="0" lookType="329" name="Wedding"/>
		<list gender="1" lookType="328" name="Wedding"/>
	</outfit>

	<outfit id="25" access="5" premium="yes">
		<list gender="0-3" lookType="12" name="Archdemon"/>
	</outfit>

	<outfit id="26" access="5" premium="yes">
		<list gender="0-3" lookType="159" name="Elf"/>
	</outfit>

	<outfit id="27" access="5" premium="yes">
		<list gender="0-3" lookType="160" name="Dwarf"/>
	</outfit>

	<outfit id="28" access="5" premium="yes">
		<list gender="0-3" lookType="226" name="Frog"/>
	</outfit>

	<outfit id="29" access="5" premium="yes">
		<list gender="0-3" lookType="194" name="Cult"/>
	</outfit>

	<outfit id="30" access="5" premium="yes">
		<list gender="0-3" lookType="253" name="Headsplitter"/>
	</outfit>

	<outfit id="31" access="5" premium="yes">
		<list gender="0-3" lookType="254" name="Skullhunter"/>
	</outfit>

	<outfit id="32" access="5" premium="yes">
		<list gender="0-3" lookType="255" name="Bloodwalker"/>
	</outfit>

	<outfit id="33" access="5" premium="yes">
		<list gender="0-3" lookType="264" name="Brutetamer"/>
	</outfit>

	<outfit id="34" access="3" premium="yes">
		<list gender="0-3" lookType="75" name="Gamemaster"/>
	</outfit>

	<outfit id="35" access="4" premium="yes">
		<list gender="0-3" lookType="266" name="Community Manager"/>
	</outfit>

	<outfit id="36" access="5" premium="yes">
		<list gender="0-3" lookType="302" name="God"/>
	</outfit>
</outfits>

 

(1º) | [8.60] - Galaxy Server - Download

(2º) | [8.60] - Glorious Server - Download

(3º) | [8.60] - Epic Server - Download

Link para o post
Compartilhar em outros sites
  • Solução

Temos umas respostas com isso:

 

1. As outfits eram para players PREMIUM e precisavam de ACCESS 5, ou seja, precisava ser da staff. Isso de acordo com o outfits.xml

<outfit id="33" access="5" premium="yes">
		<list gender="0-3" lookType="264" name="Brutetamer"/>
	</outfit>

2. No script vc n alterou o id da outfit

 

Mas tudo bem, vamos arrumar agora.

 

Troque seu outfits.xml por esse:

Spoiler

<?xml version="1.0"?>
<outfits>
	<outfit id="1">
		<list gender="0" lookType="136" name="Citizen"/>
		<list gender="1" lookType="128" name="Citizen"/>
	</outfit>

	<outfit id="2">
		<list gender="0" lookType="137" name="Hunter"/>
		<list gender="1" lookType="129" name="Hunter"/>
	</outfit>

	<outfit id="3">
		<list gender="0" lookType="138" name="Mage"/>
		<list gender="1" lookType="130" name="Mage"/>
	</outfit>

	<outfit id="4">
		<list gender="0" lookType="139" name="Knight"/>
		<list gender="1" lookType="131" name="Knight"/>
	</outfit>

	<outfit id="5" premium="yes">
		<list gender="0" lookType="140" name="Noblewoman"/>
		<list gender="1" lookType="132" name="Nobleman"/>
	</outfit>

	<outfit id="6" premium="yes">
		<list gender="0" lookType="141" name="Summoner"/>
		<list gender="1" lookType="133" name="Summoner"/>
	</outfit>

	<outfit id="7" premium="yes">
		<list gender="0" lookType="142" name="Warrior"/>
		<list gender="1" lookType="134" name="Warrior"/>
	</outfit>

	<outfit id="8" premium="yes">
		<list gender="0" lookType="147" name="Barbarian"/>
		<list gender="1" lookType="143" name="Barbarian"/>
	</outfit>

	<outfit id="9" premium="yes">
		<list gender="0" lookType="148" name="Druid"/>
		<list gender="1" lookType="144" name="Druid"/>
	</outfit>

	<outfit id="10" premium="yes">
		<list gender="0" lookType="149" name="Wizard"/>
		<list gender="1" lookType="145" name="Wizard"/>
	</outfit>

	<outfit id="11" premium="yes">
		<list gender="0" lookType="150" name="Oriental"/>
		<list gender="1" lookType="146" name="Oriental"/>
	</outfit>

	<outfit id="12" premium="yes" default="0">
		<list gender="0" lookType="155" name="Pirate"/>
		<list gender="1" lookType="151" name="Pirate"/>
	</outfit>

	<outfit id="13" premium="yes" default="0">
		<list gender="0" lookType="156" name="Assassin"/>
		<list gender="1" lookType="152" name="Assassin"/>
	</outfit>

	<outfit id="14" premium="yes" default="0">
		<list gender="0" lookType="157" name="Beggar"/>
		<list gender="1" lookType="153" name="Beggar"/>
	</outfit>

	<outfit id="15" premium="yes" default="0">
		<list gender="0" lookType="158" name="Shaman"/>
		<list gender="1" lookType="154" name="Shaman"/>
	</outfit>

	<outfit id="16" premium="yes" default="0">
		<list gender="0" lookType="252" name="Norsewoman"/>
		<list gender="1" lookType="251" name="Norseman"/>
	</outfit>

	<outfit id="17" premium="yes" default="0">
		<list gender="0" lookType="269" name="Nightmare"/>
		<list gender="1" lookType="268" name="Nightmare"/>
	</outfit>

	<outfit id="18" premium="yes" default="0">
		<list gender="0" lookType="270" name="Jester"/>
		<list gender="1" lookType="273" name="Jester"/>
	</outfit>

	<outfit id="19" premium="yes" default="0">
		<list gender="0" lookType="279" name="Brotherhood"/>
		<list gender="1" lookType="278" name="Brotherhood"/>
	</outfit>

	<outfit id="20" premium="yes" default="0">
		<list gender="0" lookType="288" name="Demonhunter"/>
		<list gender="1" lookType="289" name="Demonhunter"/>
	</outfit>

	<outfit id="21" premium="yes" default="0">
		<list gender="0" lookType="324" name="Yalaharian"/>
		<list gender="1" lookType="325" name="Yalaharian"/>
	</outfit>

	<outfit id="22" default="0">
		<list gender="0" lookType="336" name="Warmaster"/>
		<list gender="1" lookType="335" name="Warmaster"/>
	</outfit>

	<outfit id="23" premium="yes" default="0">
		<list gender="0" lookType="366" name="Wayfarer"/>
		<list gender="1" lookType="367" name="Wayfarer"/>
	</outfit>

	<outfit id="24" premium="yes" default="0">
		<list gender="0" lookType="329" name="Wedding"/>
		<list gender="1" lookType="328" name="Wedding"/>
	</outfit>

	<outfit id="25" access="5" premium="yes">
		<list gender="0-3" lookType="12" name="Archdemon"/>
	</outfit>

	<outfit id="26" access="5" premium="yes">
		<list gender="0-3" lookType="159" name="Elf"/>
	</outfit>

	<outfit id="27" access="5" premium="yes">
		<list gender="0-3" lookType="160" name="Dwarf"/>
	</outfit>

	<outfit id="28" access="5" premium="yes">
		<list gender="0-3" lookType="226" name="Frog"/>
	</outfit>

	<outfit id="29" access="5" premium="yes">
		<list gender="0-3" lookType="194" name="Cult"/>
	</outfit>

	<outfit id="30" access="5" premium="yes">
		<list gender="0-3" lookType="253" name="Headsplitter"/>
	</outfit>

	<outfit id="31" access="5" premium="yes">
		<list gender="0-3" lookType="254" name="Skullhunter"/>
	</outfit>

	<outfit id="32" access="5" premium="yes">
		<list gender="0-3" lookType="255" name="Bloodwalker"/>
	</outfit>

	<outfit id="33" premium="no">
		<list gender="0-3" lookType="264" name="Brutetamer"/>
	</outfit>

	<outfit id="34" access="3" premium="yes">
		<list gender="0-3" lookType="75" name="Gamemaster"/>
	</outfit>

	<outfit id="35" access="4" premium="yes">
		<list gender="0-3" lookType="266" name="Community Manager"/>
	</outfit>

	<outfit id="36" access="5" premium="yes">
		<list gender="0-3" lookType="302" name="God"/>
	</outfit>
</outfits>

 

 

E troque seu script por esse:

 

Spoiler

local s = 19000

function onUse(cid, item, itemEx, toPosition, fromPosition)
	if getPlayerStorageValue(cid, s) <= 0 then
		setPlayerStorageValue(cid, s, 1)
		doPlayerSendTextMessage(cid, 22, "Parabéns! Você ganhou um novo outfit.")
		doSendMagicEffect(getCreaturePosition(cid), 30)
		doPlayerRemoveItem(cid, 8300, 1)
		doPlayerAddOutfitId(cid, 33, 1)
	else
		doPlayerSendCancel(cid, "Você já tem esse outfit.")
	end
	
	return true
end

 

 

Link para o post
Compartilhar em outros sites

obrigado bro, agr ficou funcional, ajudando bastante :3, duvida sanada.

(1º) | [8.60] - Galaxy Server - Download

(2º) | [8.60] - Glorious Server - Download

(3º) | [8.60] - Epic Server - Download

Link para o post
Compartilhar em outros sites
17 horas atrás, Sekk disse:

@jNo

 

Seu action.xml ta como? Tem que estar assim:


<action itemid="XXXX" event="script" value="arquivo.lua"/>

local s = 19000
local i = -- muda aqui o id do item

function onUse(cid, item, itemEx, toPosition, fromPosition)
	if getPlayerStorageValue(cid, s) <= 0 then
		setPlayerStorageValue(cid, s, 1)
		doPlayerSendTextMessage(cid, 22, "Parabéns! Você ganhou um novo outfit.")
		doSendMagicEffect(getCreaturePosition(cid), 30)
		doPlayerRemoveItem(cid, i, 1)
		doPlayerAddOutfit(cid, coloca o id da outfit, n o type aqui, 1)
	else
		doPlayerSendCancel(cid, "Você já tem esse outfit.")
	end
	
	return true
end

 

Obs.: Tem linhas pra editar no script, edite

Obs2.: 'local i' deve ser igual ao 'itemid' do actions.xml

Cara Ficaria mt agradecido se vc pudesse editar esse item fazendo 

com quem só tivesse a storage (89745,4) pudesse usar pra ganhar a outifit ? , dsclp esqueci de completar.

Editado por Breaky (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

@Breaky?

local s = 89745
local i = -- muda aqui o id do item

function onUse(cid, item, itemEx, toPosition, fromPosition)
	if getPlayerStorageValue(cid, s) <= 0 then
		setPlayerStorageValue(cid, s, 4)
		doPlayerSendTextMessage(cid, 22, "Parabéns! Você ganhou um novo outfit.")
		doSendMagicEffect(getCreaturePosition(cid), 30)
		doPlayerRemoveItem(cid, i, 1)
		doPlayerAddOutfit(cid, coloca o id da outfit, n o type aqui, 1)
	else
		doPlayerSendCancel(cid, "Você já tem esse outfit.")
	end
	
	return true
end

 

Link para o post
Compartilhar em outros sites
4 horas atrás, Breaky disse:

Cara Ficaria mt agradecido se vc pudesse editar esse item fazendo 

com quem só tivesse a storage (89745,4) pudesse usar pra ganhar a outifit ? , dsclp esqueci de completar.

no caso só quem tem uma certa storage pode usar o item se nao tiver nao pode ganhar a outifit (storage : 89745,4) esqueci de falar isso , dsclp

 

Editado por Breaky (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
23 horas atrás, Sekk disse:

acho que eu n entendi direito ainda, dsclp kkkk

tipo assim : o cara faz a quest  , ganha um item.

mais o player só podera usar esse item se tiver essa storage : 89745,4.

se ele nao tiver a storage nao pode usar o item.

se ele tiver a storage , ele usa o item remove o item e ganha uma outift. só isso.

e o player nao pode transformar nem reverter mais , por causa da outifit. terá que ficar com aquela outifit para sempre. 

Link para o post
Compartilhar em outros sites

Acho que assim ta certo, testa ai @Breaky

function onUse(cid, item, itemEx, toPosition, fromPosition)

local s = 89745
local outfitF = 136 -- outfit Female citizen
local outfitM = 128 -- outfit Male citizen
local condo = createConditionObject(CONDITION_OUTFIT)

if getPlayerStorageValue(cid, s) == 4 then
 doPlayerRemoveItem(cid, item.uid, 1)
  if getPlayerSex(cid) == 0 then
   addOutfitCondition(condo, {lookType = outfitF, lookHead = 114, lookBody = 114, lookLegs = 114, lookFeet = 114}) -- escolhe a cor de cada membro do outfit ai
    doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_BLUE)
	 doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Now, you cannot change your outfit!")
	  else
	 addOutfitCondition(condo, {lookType = outfitM, lookHead = 114, lookBody = 114, lookLegs = 114, lookFeet = 114})
	doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_BLUE)
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Now, you cannot change your outfit!")
  end
else
  doPlayerSendCancel(cid, "Sorry, you can't use this item yet.")
end
return true
end
 

 

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