Ir para conteúdo
  • 0

Apenas Usar Se Tiver Storage


Pergunta

Dale galerinha õ/, alguem pode por para apenas usar se tiver a storage necessaria ? =)

 

 

  Mostrar conteúdo oculto

 

Link para o comentário
https://xtibia.com/forum/topic/200252-apenas-usar-se-tiver-storage/
Compartilhar em outros sites

6 respostass a esta questão

Posts Recomendados

  • 0

Tente agora

 

local config = {
fromItem = 0, -- Item que precissa.
toItem = 7702 -- Item que vai transformar.
}
getPlayerStorageValue(uid, valueid)

function onCastSpell(cid, var)
if (getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid == config.fromItem or getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid == config.fromItem) then
doPlayerAddItem(cid, config.toItem, 1)
else
doPlayerSendCancel(cid, "You must have a " .. getItemNameById(config.fromItem) .. " in your hand to cast this spell.")
end
return true
end

Link para o comentário
https://xtibia.com/forum/topic/200252-apenas-usar-se-tiver-storage/#findComment-1400866
Compartilhar em outros sites

  • 0

O certo seria:

 

local config = {
fromItem = 0, -- Item que precissa.
toItem = 7702 -- Item que vai transformar.
}

function onCastSpell(cid, var)
if (getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid == config.fromItem or getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid == config.fromItem) then
doPlayerAddItem(cid, config.toItem, 1)
setPlayerStorageValue(cid,valueid,1))
else
doPlayerSendCancel(cid, "You must have a " .. getItemNameById(config.fromItem) .. " in your hand to cast this spell.")
end
return true
end

Link para o comentário
https://xtibia.com/forum/topic/200252-apenas-usar-se-tiver-storage/#findComment-1400872
Compartilhar em outros sites

  • 0

Na verdade o certo seria assim:

 

 

local config = {
fromItem = 0, -- Item que precissa.
toItem = 7702 -- Item que vai transformar.
}
local str = 22122 --- Id da storage
local value = 1 -- Valor da storage

function onCastSpell(cid, var)
if (getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid == config.fromItem or getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid == config.fromItem) and getPlayerStorageValue(cid, str) == value then
doPlayerAddItem(cid, config.toItem, 1)
else
doPlayerSendCancel(cid, "You must have a " .. getItemNameById(config.fromItem) .. " in your hand to cast this spell.")
end
return true
end

Editado por caotic
Link para o comentário
https://xtibia.com/forum/topic/200252-apenas-usar-se-tiver-storage/#findComment-1400881
Compartilhar em outros sites

  • 0
  Em 01/12/2012 em 16:57, Yan18 disse:

Duvida Resolvida, peça para mover.

 

Atenc. Yan18.

 

Cara, não precisa reportar o tópico se ele já tiver sido movido.

Link para o comentário
https://xtibia.com/forum/topic/200252-apenas-usar-se-tiver-storage/#findComment-1400888
Compartilhar em outros sites

×
×
  • Criar Novo...