Ir para conteúdo

Featured Replies

Postado
5 minutos atrás, raphadoidera disse:

Colocando dessa forma, não iria possibilitar apenas a vocação 1 e 13 de usarem? Ao invés de possibilitar da vocação 1 até a vocação 13?

pra ser da 1 até a 13 coloca assim
 

if getPlayerVocation(cid) >= 1 and getPlayerVocation(cid) <= 13 then
		..código..

end


ai ele checa se a vocação é maior ou igual a 1 e menos igual 13, ou seja tudo entre 1 e 13 ele pega

 

 

7 minutos atrás, raphadoidera disse:

if getPlayerVocation(cid) == 1 or if getPlayerVocation(cid) == 13

me equivoquei nessa parte ali esse "or if" não tem, só "or get..", usa oq te passei acima que vai funcionar

.
vou arrumar aqui o script pra vc

 

local remover = false -- Remover ao usar?  false = não remove, true = remover

local outfits = {
    [11478] = {out = 2013},
}


function onUse(cid, item)
    local t = outfits[item.itemid]

  if getPlayerVocation(cid) >= 1 and getPlayerVocation(cid) <= 13 then
      if getCreatureOutfit(cid).lookType ~= 2013 then    									 --se o outfit for diferente do 2013
            setPlayerStorageValue(cid, 1234567, getCreatureOutfit(cid).lookType)    	     --salva o looktype atual do player
            doCreatureChangeOutfit(cid, {lookType = t.out})								 --transforma
            doPlayerSendTextMessage(cid, 22, "Voce alterou seu Outfit!")
      else
            doCreatureChangeOutfit(cid, {lookType = getPlayerStorageValue(cid, 1234567)})	 --se o looktype for 2013 volta ao original
            doPlayerSendTextMessage(cid, 22, "De volta ao seu outfit original!")
      end
      if remover then
          doRemoveItem(item.uid, 1)			-- pode deixar 1 aqui e no escopo deixa false
      end
   end

    return true
end





 

  • Respostas 11
  • Visualizações 1.1k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • local remover = false -- Remover ao usar? false = não remove, true = remover local outfits = { [11478] = {out = 2013}, } function onUse(cid, item) local t = outfits[item.itemid] if getP

  • raphadoidera
    raphadoidera

    Certinho irmão, muito obrigado do fundo do coração!    Irmão, notei só agora um erro na Script. if getPlayerVocation(cid) > 13 then Aqui está falando que toda vocação menor que 13

Posted Images

Postado
  • Autor
5 minutos atrás, FeeTads disse:

pra ser da 1 até a 13 coloca assim
 


if getPlayerVocation(cid) >= 1 and getPlayerVocation(cid) <= 13 then
		..código..

end


ai ele checa se a vocação é maior ou igual a 1 e menos igual 13, ou seja tudo entre 1 e 13 ele pega

 

 

me equivoquei nessa parte ali esse "or if" não tem, só "or get..", usa oq te passei acima que vai funcionar

 

Ainda ta dando esse erro na distro.

 

image.thumb.png.d8c78122324b7ff0f1dab8390eebd7a5.png

Postado
9 minutos atrás, raphadoidera disse:

Ainda ta dando esse erro na distro.

 tenta assim.

 

local remover = false -- Remover ao usar?  false = não remove, true = remover

local outfits = {
    [11478] = {out = 2013},
}


function onUse(cid, item)
    local t = outfits[item.itemid]

  if getPlayerVocation(cid) > 13 then
      return true
  end
      if getCreatureOutfit(cid).lookType ~= 2013 then    									 --se o outfit for diferente do 2013
            setPlayerStorageValue(cid, 1234567, getCreatureOutfit(cid).lookType)    	     --salva o looktype atual do player
            doCreatureChangeOutfit(cid, {lookType = t.out})								 --transforma
            doPlayerSendTextMessage(cid, 22, "Voce alterou seu Outfit!")
      else
            doCreatureChangeOutfit(cid, {lookType = getPlayerStorageValue(cid, 1234567)})	 --se o looktype for 2013 volta ao original
            doPlayerSendTextMessage(cid, 22, "De volta ao seu outfit original!")
      end
      if remover then
          doRemoveItem(item.uid, 1)			-- pode deixar 1 aqui e no escopo deixa false
      end

    return true
end


se continuar esse erro, procura por "getPlayerVocation" na sua source em luascript.cpp

Postado
  • Autor
3 minutos atrás, FeeTads disse:

 tenta assim.

 


local remover = false -- Remover ao usar?  false = não remove, true = remover

local outfits = {
    [11478] = {out = 2013},
}


function onUse(cid, item)
    local t = outfits[item.itemid]

  if getPlayerVocation(cid) > 13 then
      return true
  end
      if getCreatureOutfit(cid).lookType ~= 2013 then    									 --se o outfit for diferente do 2013
            setPlayerStorageValue(cid, 1234567, getCreatureOutfit(cid).lookType)    	     --salva o looktype atual do player
            doCreatureChangeOutfit(cid, {lookType = t.out})								 --transforma
            doPlayerSendTextMessage(cid, 22, "Voce alterou seu Outfit!")
      else
            doCreatureChangeOutfit(cid, {lookType = getPlayerStorageValue(cid, 1234567)})	 --se o looktype for 2013 volta ao original
            doPlayerSendTextMessage(cid, 22, "De volta ao seu outfit original!")
      end
      if remover then
          doRemoveItem(item.uid, 1)			-- pode deixar 1 aqui e no escopo deixa false
      end

    return true
end


se continuar esse erro, procura por "getPlayerVocation" na sua source em luascript.cpp

 

Funcionou papai, só mais uma coisa mano (foi mal). Queria que você colocasse pra sair no chat "Sua vocação não pode usar este item." caso uma vocação diferente tente usar o item, por favor.

Postado
  • Solução
3 minutos atrás, raphadoidera disse:

Funcionou papai, só mais uma coisa mano (foi mal). Queria que você colocasse pra sair no chat "Sua vocação não pode usar este item." caso uma vocação diferente tente usar o item, por favor.

local remover = false -- Remover ao usar?  false = não remove, true = remover

local outfits = {
    [11478] = {out = 2013},
}


function onUse(cid, item)
    local t = outfits[item.itemid]

  if getPlayerVocation(cid) > 13 then
      doPlayerSendTextMessage(cid, 22, "Sua vocação não pode usar este item!")
      return true
  end
      if getCreatureOutfit(cid).lookType ~= 2013 then    									 --se o outfit for diferente do 2013
            setPlayerStorageValue(cid, 1234567, getCreatureOutfit(cid).lookType)    	     --salva o looktype atual do player
            doCreatureChangeOutfit(cid, {lookType = t.out})								 --transforma
            doPlayerSendTextMessage(cid, 22, "Voce alterou seu Outfit!")
      else
            doCreatureChangeOutfit(cid, {lookType = getPlayerStorageValue(cid, 1234567)})	 --se o looktype for 2013 volta ao original
            doPlayerSendTextMessage(cid, 22, "De volta ao seu outfit original!")
      end
      if remover then
          doRemoveItem(item.uid, 1)			-- pode deixar 1 aqui e no escopo deixa false
      end

    return true
end

 

se funcionar deixa o rep+ ai pra ajudar <3

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

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo