Ir para conteúdo
  • 0

Erro First Items


Nathan96

Pergunta

Estou com um pequeno errinho aqui que não consegui identificar então pra quem mi ajudar Rep +

 

 

local commonItems = {

-- ITEMS ALL VOCS RECEIVE

{itemid=2120, count=1}, -- rope

{itemid=5710, count=1}, -- shovel

{itemid=2160, count=1}, -- 10 k

{itemid=2173, count=1}, -- aol

{itemid=2789, count=10}, -- brown mushrooms

}

 

local firstItems = {

{ -- SORC ITEMS

{itemid=2457, count=1}, -- steel helmet

{itemid=2463, count=1}, -- plate armor

{itemid=2647, count=1}, -- plate legs

{itemid=3982, count=1}, -- leather boots

{itemid=2510, count=1}, -- plate shield

{itemid=2190, count=1}, -- wand of vortex

 

{itemid=2420, count=1}, -- machete

{itemid=7620, count=1}, -- mana potion

},

{ -- DRUID ITEMS

{itemid=2457, count=1}, -- steel helmet

{itemid=2463, count=1}, -- plate armor

{itemid=2647, count=1}, -- plate legs

{itemid=3982, count=1}, -- leather boots

{itemid=2510, count=1}, -- plate shield

{itemid=2182, count=1}, -- snakebite rod

 

{itemid=2420, count=1}, -- machete

{itemid=7620, count=1}, -- mana potion

},

{ -- PALADIN ITEMS

{itemid=2457, count=1}, -- steel helmet

{itemid=2463, count=1}, -- plate armor

{itemid=2647, count=1}, -- plate legs

{itemid=3982, count=1}, -- leather boots

{itemid=2510, count=1}, -- plate shield

{itemid=2389, count=1}, -- spear

 

{itemid=2420, count=1}, -- machete

{itemid=7620, count=1}, -- mana potion

},

{ -- KNIGHT ITEMS

{itemid=2457, count=1}, -- steel helmet

{itemid=2463, count=1}, -- plate armor

{itemid=2647, count=1}, -- plate legs

{itemid=3982, count=1}, -- leather boots

{itemid=2510, count=1}, -- plate shield

{itemid=2383, count=1}, -- spike sword

 

{itemid=2420, count=1}, -- machete

{itemid=7620, count=1}, -- mana potion

},

{ -- MINER ITEMS

{itemid=2457, count=1}, -- steel helmet

{itemid=2463, count=1}, -- plate armor

{itemid=2647, count=1}, -- plate legs

{itemid=3982, count=1}, -- leather boots

{itemid=2510, count=1}, -- plate shield

{itemid=2422, count=1}, -- iron hammer

 

{itemid=2420, count=1}, -- machete

{itemid=7620, count=1}, -- mana potion

},

{ -- ELF ITEMS

{itemid=2457, count=1}, -- steel helmet

{itemid=2463, count=1}, -- plate armor

{itemid=2647, count=1}, -- plate legs

{itemid=3982, count=1}, -- leather boots

{itemid=2510, count=1}, -- plate shield

{itemid=5907, count=1}, -- slingshot

 

{itemid=2420, count=1}, -- machete

{itemid=7620, count=1}, -- mana potion

},

{ -- ORC ITEMS

{itemid=2457, count=1}, -- steel helmet

{itemid=2463, count=1}, -- plate armor

{itemid=2647, count=1}, -- plate legs

{itemid=3982, count=1}, -- leather boots

{itemid=2510, count=1}, -- plate shield

{itemid=2378, count=1}, -- battle axe

 

{itemid=2420, count=1}, -- machete

{itemid=7620, count=1}, -- mana potion

},

{ -- ELVEN APPRENTICE ITEMS

{itemid=2457, count=1}, -- steel helmet

{itemid=2463, count=1}, -- plate armor

{itemid=2647, count=1}, -- plate legs

{itemid=3982, count=1}, -- leather boots

{itemid=2510, count=1}, -- plate shield

{itemid=2182, count=1}, -- snakebite rod

 

{itemid=2420, count=1}, -- machete

{itemid=7620, count=1}, -- mana potion

},

{ -- ORC SKIRMISTER ITEMS

{itemid=2457, count=1}, -- steel helmet

{itemid=2463, count=1}, -- plate armor

{itemid=2647, count=1}, -- plate legs

{itemid=3982, count=1}, -- leather boots

{itemid=2510, count=1}, -- plate shield

{itemid=5907, count=1}, -- slingshot

 

{itemid=2420, count=1}, -- machete

{itemid=7620, count=1}, -- mana potion

},

{ -- ORC SORC ITEMS

{itemid=2457, count=1}, -- steel helmet

{itemid=2463, count=1}, -- plate armor

{itemid=2647, count=1}, -- plate legs

{itemid=3982, count=1}, -- leather boots

{itemid=2510, count=1}, -- plate shield

{itemid=2190, count=1}, -- wand of vortex

 

{itemid=2420, count=1}, -- machete

{itemid=7620, count=1}, -- mana potion

}

}

 

for _, items in ipairs(firstItems) do

for _, item in ipairs(commonItems) do

table.insert(items, item)

end

end

 

function onLogin(cid)

if getPlayerGroupId(cid) < 2 then

local hasReceivedFirstItems = getPlayerStorageValue(cid, 67708)

 

if hasReceivedFirstItems == -1 then

--[[local backpack = ]]doPlayerAddItem(cid, 11237, 1)

 

local giveItems = firstItems[getPlayerVocation(cid)]

 

if giveItems ~= nil then

for _, v in ipairs(giveItems) do

--doAddContainerItem(backpack, v.itemid, v.count or 1)

doPlayerAddItem(cid, v.itemid, v.count or 1)

end

 

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Bem Vindo você acaba de receber seus primeiros equipamentos")

setPlayerStorageValue(cid, 67708, 1)

end

end

end

return TRUE

end

 

 

Só as 4 primeiras vocations que estão recebendo items as outras não !

Link para o comentário
Compartilhar em outros sites

14 respostass a esta questão

Posts Recomendados

  • 0

qual a id das voc? o index ali segue a odern numerica depois do kinght vem a voc 5(normamente master sorcer) se as voc na foremem seguencia tem que seta o index manualmente assim

se o id da vocs na forem miner = 5,elf = 6,orc = 7,eleven = 8 e ORC SKIRMISTER = 9,subtitua a tabela first item,pela abaixo e configure onde diz "id da voc"(o id correto da voc)

local firstItems = {
{ -- SORC ITEMS
{itemid=2457, count=1}, -- steel helmet
{itemid=2463, count=1}, -- plate armor
{itemid=2647, count=1}, -- plate legs
{itemid=3982, count=1}, -- leather boots
{itemid=2510, count=1}, -- plate shield
{itemid=2190, count=1}, -- wand of vortex

{itemid=2420, count=1}, -- machete
{itemid=7620, count=1}, -- mana potion
},
{ -- DRUID ITEMS
{itemid=2457, count=1}, -- steel helmet
{itemid=2463, count=1}, -- plate armor
{itemid=2647, count=1}, -- plate legs
{itemid=3982, count=1}, -- leather boots
{itemid=2510, count=1}, -- plate shield
{itemid=2182, count=1}, -- snakebite rod

{itemid=2420, count=1}, -- machete
{itemid=7620, count=1}, -- mana potion
},
{ -- PALADIN ITEMS
{itemid=2457, count=1}, -- steel helmet
{itemid=2463, count=1}, -- plate armor
{itemid=2647, count=1}, -- plate legs
{itemid=3982, count=1}, -- leather boots
{itemid=2510, count=1}, -- plate shield
{itemid=2389, count=1}, -- spear

{itemid=2420, count=1}, -- machete
{itemid=7620, count=1}, -- mana potion
},
{ -- KNIGHT ITEMS
{itemid=2457, count=1}, -- steel helmet
{itemid=2463, count=1}, -- plate armor
{itemid=2647, count=1}, -- plate legs
{itemid=3982, count=1}, -- leather boots
{itemid=2510, count=1}, -- plate shield
{itemid=2383, count=1}, -- spike sword

{itemid=2420, count=1}, -- machete
{itemid=7620, count=1}, -- mana potion
},
[id da voc] = { -- MINER ITEMS
{itemid=2457, count=1}, -- steel helmet
{itemid=2463, count=1}, -- plate armor
{itemid=2647, count=1}, -- plate legs
{itemid=3982, count=1}, -- leather boots
{itemid=2510, count=1}, -- plate shield
{itemid=2422, count=1}, -- iron hammer

{itemid=2420, count=1}, -- machete
{itemid=7620, count=1}, -- mana potion
},
[id da voc] = { -- ELF ITEMS
{itemid=2457, count=1}, -- steel helmet
{itemid=2463, count=1}, -- plate armor
{itemid=2647, count=1}, -- plate legs
{itemid=3982, count=1}, -- leather boots
{itemid=2510, count=1}, -- plate shield
{itemid=5907, count=1}, -- slingshot

{itemid=2420, count=1}, -- machete
{itemid=7620, count=1}, -- mana potion
},
[id da voc] = { -- ORC ITEMS
{itemid=2457, count=1}, -- steel helmet
{itemid=2463, count=1}, -- plate armor
{itemid=2647, count=1}, -- plate legs
{itemid=3982, count=1}, -- leather boots
{itemid=2510, count=1}, -- plate shield
{itemid=2378, count=1}, -- battle axe

{itemid=2420, count=1}, -- machete
{itemid=7620, count=1}, -- mana potion
},
{ -- ELVEN APPRENTICE ITEMS
{itemid=2457, count=1}, -- steel helmet
{itemid=2463, count=1}, -- plate armor
{itemid=2647, count=1}, -- plate legs
{itemid=3982, count=1}, -- leather boots
{itemid=2510, count=1}, -- plate shield
{itemid=2182, count=1}, -- snakebite rod

{itemid=2420, count=1}, -- machete
{itemid=7620, count=1}, -- mana potion
},
[id da voc] = { -- ORC SKIRMISTER ITEMS
{itemid=2457, count=1}, -- steel helmet
{itemid=2463, count=1}, -- plate armor
{itemid=2647, count=1}, -- plate legs
{itemid=3982, count=1}, -- leather boots
{itemid=2510, count=1}, -- plate shield
{itemid=5907, count=1}, -- slingshot

{itemid=2420, count=1}, -- machete
{itemid=7620, count=1}, -- mana potion
},
[id da voc] = { -- ORC SORC ITEMS
{itemid=2457, count=1}, -- steel helmet
{itemid=2463, count=1}, -- plate armor
{itemid=2647, count=1}, -- plate legs
{itemid=3982, count=1}, -- leather boots
{itemid=2510, count=1}, -- plate shield
{itemid=2190, count=1}, -- wand of vortex

{itemid=2420, count=1}, -- machete
{itemid=7620, count=1}, -- mana potion
}
}

Link para o comentário
Compartilhar em outros sites

  • 0

Em parte deu certo mais essa linha

 

 

local commonItems = {

{ -- ITEMS ALL VOCS RECEIVE

{itemid=2120, count=1}, -- rope

{itemid=5710, count=1}, -- shovel

{itemid=2160, count=1}, -- 10 k

{itemid=2173, count=1}, -- aol

{itemid=2789, count=10}, -- brown mushrooms

}

 

 

As outras vocations não estão recebendo

Link para o comentário
Compartilhar em outros sites

  • 0

antes de "if giveItem~=nil then"

coloque isto

if  not isInArray({1,2,3,4},getPlayerVocation(cid)) then
for _, v in ipairs(commonItems) do
doPlayerAddItem(cid, v.itemid, v.count or 1)
end
end

Link para o comentário
Compartilhar em outros sites

  • 0

Tenta colocar assim:

 

if  not isInArray({1,2,3,4},getPlayerVocation(cid)) then
if getPlayerStorageValue(cid, 4596) == FALSE then
for _, v in ipairs(commonItems) do
doPlayerAddItem(cid, v.itemid, v.count or 1)
setPlayerStorageValue(cid, 4596)
end
end
end

Editado por Leoxtibia
Link para o comentário
Compartilhar em outros sites

  • 0

Aparece algum erro no distro? Não sei oq pode tá acontecendo, tenta assim dessa vez, e se apareceu erro, posta ele aí:

 

if getPlayerStorageValue(cid, 4596) == -1 then
if  not isInArray({1,2,3,4},getPlayerVocation(cid)) then
for _, v in ipairs(commonItems) do
doPlayerAddItem(cid, v.itemid, v.count or 1)
setPlayerStorageValue(cid, 4596)
end
end
end

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...