Ir para conteúdo

Featured Replies

  • Respostas 9
  • Visualizações 443
  • Created
  • Última resposta

Top Posters In This Topic

Posted Images

Postado
50 minutos atrás, jNo disse:

 

Deu erro no "coins" do código.

troca seu por esses!

vai em actions/others/changegold

Spoiler

local coins = {
[ITEM_GOLD_COIN] = {
to = ITEM_PLATINUM_COIN, effect = TEXTCOLOR_YELLOW
},
[ITEM_PLATINUM_COIN] = {
from = ITEM_GOLD_COIN, to = ITEM_CRYSTAL_COIN, effect = TEXTCOLOR_LIGHTBLUE
},
[ITEM_CRYSTAL_COIN] = {
from = ITEM_PLATINUM_COIN, to = 2157, effect = TEXTCOLOR_LIGHTBLUE
},
[2157] = {
from = ITEM_CRYSTAL_COIN, effect = TEXTCOLOR_TEAL
}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(getPlayerFlagValue(cid, PLAYERFLAG_CANNOTPICKUPITEM)) then
return false
end
local coin = coins[item.itemid]
if(not coin) then
return false
end
if(coin.to ~= nil and item.type == ITEMCOUNT_MAX) then
doChangeTypeItem(item.uid, item.type - item.type)
doPlayerAddItem(cid, coin.to, 1)
doSendAnimatedText(fromPosition, "$$$", coins[coin.to].effect)
elseif(coin.from ~= nil) then
doChangeTypeItem(item.uid, item.type - 1)
doPlayerAddItem(cid, coin.from, ITEMCOUNT_MAX)
doSendAnimatedText(fromPosition, "$$$", coins[coin.from].effect)
end
return true
end

 

 

Postado
  • Autor
17 minutos atrás, mateusmoretti disse:

troca seu por esses!

vai em actions/others/changegold

  Mostrar conteúdo oculto


local coins = {
[ITEM_GOLD_COIN] = {
to = ITEM_PLATINUM_COIN, effect = TEXTCOLOR_YELLOW
},
[ITEM_PLATINUM_COIN] = {
from = ITEM_GOLD_COIN, to = ITEM_CRYSTAL_COIN, effect = TEXTCOLOR_LIGHTBLUE
},
[ITEM_CRYSTAL_COIN] = {
from = ITEM_PLATINUM_COIN, to = 2157, effect = TEXTCOLOR_LIGHTBLUE
},
[2157] = {
from = ITEM_CRYSTAL_COIN, effect = TEXTCOLOR_TEAL
}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(getPlayerFlagValue(cid, PLAYERFLAG_CANNOTPICKUPITEM)) then
return false
end
local coin = coins[item.itemid]
if(not coin) then
return false
end
if(coin.to ~= nil and item.type == ITEMCOUNT_MAX) then
doChangeTypeItem(item.uid, item.type - item.type)
doPlayerAddItem(cid, coin.to, 1)
doSendAnimatedText(fromPosition, "$$$", coins[coin.to].effect)
elseif(coin.from ~= nil) then
doChangeTypeItem(item.uid, item.type - 1)
doPlayerAddItem(cid, coin.from, ITEMCOUNT_MAX)
doSendAnimatedText(fromPosition, "$$$", coins[coin.from].effect)
end
return true
end

 

 

 

A alteração é só naquele mesmo, esse ai eu fiz certo, o problema é colocar a mensagem, e fazer com que o ingot volte a ser crystal sem bug.

 

43 minutos atrás, rogaforyn2 disse:

doSendAnimatedText(fromPosition, "$$$", TEXTCOLOR_RED)

 

 

36 minutos atrás, rogaforyn2 disse:

doSendAnimatedText(fromPosition, "$$$", TEXTCOLOR_RED)

 

 

Dessa forma funciona, a mensagem sai como eu quero, porém, quando clico no gold ingot pra voltar a ser crystal, o gold ingot desaparece, e da erro no distro "doSendAnimedtext", eu tentei fazer isso:

 

--By MatheusVidaLoka
function onUse(cid, item, frompos, item2, topos)
if doRemoveItem(item.uid,1) then
doPlayerSendTextMessage(fromPosition, "$$$", TEXTCOLOR_RED)
doPlayerAddItem(cid,2160,100)
end
end

Funciona, mas da ai da um erro, "onUSE", segue a print

 

 

Sem título.png

Editado por jNo (veja o histórico de edições)

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

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

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

Postado
  • Solução

Tenta com

 

--By MatheusVidaLoka
function onUse(cid, item, frompos, item2, topos)
  if doRemoveItem(item.uid,1) then
    doPlayerSendTextMessage(cid, "$$$", TEXTCOLOR_RED)
    doPlayerAddItem(cid,2160,100)
  end
end

 

Eu nem vi o script só tinha mudado a função.

Editado por rogaforyn2 (veja o histórico de edições)

Life is so meaningless, there is nothing worth a smile
So goodbye, I'll miss you

 

 

sugestões?

 

 

Postado
  • Autor
1 hora atrás, rogaforyn2 disse:

Tenta com

 


--By MatheusVidaLoka
function onUse(cid, item, frompos, item2, topos)
  if doRemoveItem(item.uid,1) then
    doPlayerSendTextMessage(cid, "$$$", TEXTCOLOR_RED)
    doPlayerAddItem(cid,2160,100)
  end
end

 

Eu nem vi o script só tinha mudado a função.

 

Funcionou, mas da debug kkkkkkk quando volta do ingot pra crystal

problema resolvido, duvida sanada, (tinha 2 script rodando, por isso dava bug).

 

obrigado, rep.

12 horas atrás, mateusmoretti disse:

troca seu por esses!

vai em actions/others/changegold

  Mostrar conteúdo oculto


local coins = {
[ITEM_GOLD_COIN] = {
to = ITEM_PLATINUM_COIN, effect = TEXTCOLOR_YELLOW
},
[ITEM_PLATINUM_COIN] = {
from = ITEM_GOLD_COIN, to = ITEM_CRYSTAL_COIN, effect = TEXTCOLOR_LIGHTBLUE
},
[ITEM_CRYSTAL_COIN] = {
from = ITEM_PLATINUM_COIN, to = 2157, effect = TEXTCOLOR_LIGHTBLUE
},
[2157] = {
from = ITEM_CRYSTAL_COIN, effect = TEXTCOLOR_TEAL
}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(getPlayerFlagValue(cid, PLAYERFLAG_CANNOTPICKUPITEM)) then
return false
end
local coin = coins[item.itemid]
if(not coin) then
return false
end
if(coin.to ~= nil and item.type == ITEMCOUNT_MAX) then
doChangeTypeItem(item.uid, item.type - item.type)
doPlayerAddItem(cid, coin.to, 1)
doSendAnimatedText(fromPosition, "$$$", coins[coin.to].effect)
elseif(coin.from ~= nil) then
doChangeTypeItem(item.uid, item.type - 1)
doPlayerAddItem(cid, coin.from, ITEMCOUNT_MAX)
doSendAnimatedText(fromPosition, "$$$", coins[coin.from].effect)
end
return true
end

 

 

 

problema resolvido, duvida sanada, (tinha 2 script rodando, por isso dava bug, so o seu resolvia obg).

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

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

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

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.7k

Informação Importante

Confirmação de Termo