FI

[Encerrado] FirstItens Container not Found

Por Fiapera, 20 de dez. de 2018 em Tópicos Sem Resposta

6
1.7k
FiaperaF
20 de dezembro de 2018 às 12:56

Boa tarde, Servidor deu um erro meio estranho. Se alguém poder ajudar

 

Error

Spoiler

6VYrT50.jpg

 

Meu Script

Spoiler

local firstItems = {}
firstItems[2] =
{
10518,
2173,
2458,
1988,
2378,
2503,
2509,
2647,
2160,
6132
}
firstItems[3] =
{
10518,
2173,
2458,
1988,
2378,
2503,
2509,
2647,
2160,
6132
}

function onLogin(cid)
if getPlayerStorageValue(cid, 30001) == -1 then
for i = 1, table.maxn(firstItems[getPlayerVocation(cid)]) do
doPlayerAddItem(cid, firstItems[getPlayerVocation(cid)], 1)
end
if getPlayerSex(cid) == 0 then
doPlayerAddItem(cid, 2650, 1)
else
doPlayerAddItem(cid, 2650, 1)
else
doPlayerAddItem(cid, 2173, 1)
else
doPlayerAddItem(cid, 2458, 1)
else
doPlayerAddItem(cid, 2378, 1)
else
doPlayerAddItem(cid, 2503, 1)
else
doPlayerAddItem(cid, 2509, 1)
else
doPlayerAddItem(cid, 2647, 1)
else
doPlayerAddItem(cid, 6132, 1)
end
local bag = doPlayerAddItem(cid, 10518, 1)
doAddContainerItem(bag, 2160, 1)
doAddContainerItem(bag, 2554, 1)
doAddContainerItem(bag, 2120, 1)
doAddContainerItem(bag, 2175, 1)
doAddContainerItem(bag, 7618, 20)
setPlayerStorageValue(cid, 30001, 1)
end
return TRUE
end

 

Yan LiimaY
20 de dezembro de 2018 às 15:04

Container not found(container não encontrado)

Ele não está localizando no jogador o Container com o ID X configurado, assim não sendo possivel dar o item para o jogador, e retornando um erro na Distro. 

Quando tu por o script em spoiler não se esqueça de por o code box, se não quando alguém for copiar o script pra ver, vem tudo com uns caracter bugado kkk

 

Tente assim:

Spoiler
local firstItems = {}

firstItems[0] =
{
10518,
2173,
2458,
1988,
2378,
2503,
2509,
2647,
2160,
6132
}
firstItems[1] =
{
10518,
2173,
2458,
1988,
2378,
2503,
2509,
2647,
2160,
6132
}
 
function onLogin(cid)
if getPlayerStorageValue(cid, 30001) == -1 then
for i = 1, table.maxn(firstItems[getPlayerVocation(cid)]) do
doPlayerAddItem(cid, firstItems[getPlayerVocation(cid)], 1)
end
if getPlayerSex(cid) == 0 then
doPlayerAddItem(cid, 2465, 1)
doPlayerAddItem(cid, 2650, 1)
doPlayerAddItem(cid, 2650, 1)
doPlayerAddItem(cid, 2173, 1)
doPlayerAddItem(cid, 2458, 1)
doPlayerAddItem(cid, 2378, 1)
doPlayerAddItem(cid, 2503, 1)
doPlayerAddItem(cid, 2509, 1)
doPlayerAddItem(cid, 2647, 1)
doPlayerAddItem(cid, 6132, 1)
else
doPlayerAddItem(cid, 2465, 1)
doPlayerAddItem(cid, 2650, 1)
doPlayerAddItem(cid, 2650, 1)
doPlayerAddItem(cid, 2173, 1)
doPlayerAddItem(cid, 2458, 1)
doPlayerAddItem(cid, 2378, 1)
doPlayerAddItem(cid, 2503, 1)
doPlayerAddItem(cid, 2509, 1)
doPlayerAddItem(cid, 2647, 1)
doPlayerAddItem(cid, 6132, 1)
end
local bag = doPlayerAddItem(cid, 10518, 1)
doAddContainerItem(bag, 2160, 100)
doAddContainerItem(bag, 2554, 1)
doAddContainerItem(bag, 2120, 1)
doAddContainerItem(bag, 7618, 1)
doAddContainerItem(bag, 2383, 1)
setPlayerStorageValue(cid, 30001, 1)
end
return TRUE
end

 

 

Um erro que observei foi em:

if getPlayerSex(cid) == 0 then

Tu colocou pra add item e em seguida colocou varios else, sendo que o else siginica SENAO

Ou seja, se o jogador tiver o sexo 0 ele adiciona tal item, senão ele adiciona X item. Tendeu? um exemplo em portugol.. >

se getPlayerSex(cid) == 0 entao
doPlayerAddItem(cid, 2465, 1)
senao
doPlayerAddItem(cid, 2465, 1)
fim

 

Editado Dezembro 20 por nedroesdoksdja

FiaperaF
20 de dezembro de 2018 às 16:37
1 hora atrás, Yan Liima disse:

Container not found(container não encontrado)

Ele não está localizando no jogador o Container com o ID X configurado, assim não sendo possivel dar o item para o jogador, e retornando um erro na Distro. 

Quando tu por o script em spoiler não se esqueça de por o code box, se não quando alguém for copiar o script pra ver, vem tudo com uns caracter bugado kkk

 

Tente assim:

  Mostrar conteúdo oculto

local firstItems = {}

firstItems[0] =
{
10518,
2173,
2458,
1988,
2378,
2503,
2509,
2647,
2160,
6132
}
firstItems[1] =
{
10518,
2173,
2458,
1988,
2378,
2503,
2509,
2647,
2160,
6132
}
 
function onLogin(cid)
if getPlayerStorageValue(cid, 30001) == -1 then
for i = 1, table.maxn(firstItems[getPlayerVocation(cid)]) do
doPlayerAddItem(cid, firstItems[getPlayerVocation(cid)], 1)
end
if getPlayerSex(cid) == 0 then
doPlayerAddItem(cid, 2465, 1)
doPlayerAddItem(cid, 2650, 1)
doPlayerAddItem(cid, 2650, 1)
doPlayerAddItem(cid, 2173, 1)
doPlayerAddItem(cid, 2458, 1)
doPlayerAddItem(cid, 2378, 1)
doPlayerAddItem(cid, 2503, 1)
doPlayerAddItem(cid, 2509, 1)
doPlayerAddItem(cid, 2647, 1)
doPlayerAddItem(cid, 6132, 1)
else
doPlayerAddItem(cid, 2465, 1)
doPlayerAddItem(cid, 2650, 1)
doPlayerAddItem(cid, 2650, 1)
doPlayerAddItem(cid, 2173, 1)
doPlayerAddItem(cid, 2458, 1)
doPlayerAddItem(cid, 2378, 1)
doPlayerAddItem(cid, 2503, 1)
doPlayerAddItem(cid, 2509, 1)
doPlayerAddItem(cid, 2647, 1)
doPlayerAddItem(cid, 6132, 1)
end
local bag = doPlayerAddItem(cid, 10518, 1)
doAddContainerItem(bag, 2160, 100)
doAddContainerItem(bag, 2554, 1)
doAddContainerItem(bag, 2120, 1)
doAddContainerItem(bag, 7618, 1)
doAddContainerItem(bag, 2383, 1)
setPlayerStorageValue(cid, 30001, 1)
end
return TRUE
end

 

 

Um erro que observei foi em:

if getPlayerSex(cid) == 0 then

Tu colocou pra add item e em seguida colocou varios else, sendo que o else siginica SENAO

Ou seja, se o jogador tiver o sexo 0 ele adiciona tal item, senão ele adiciona X item. Tendeu? um exemplo em portugol.. >

se getPlayerSex(cid) == 0 entao
doPlayerAddItem(cid, 2465, 1)
senao
doPlayerAddItem(cid, 2465, 1)
fim

 

Então manim adicionei, Ele vem sem evocação precisa falar com 1 npc para escolher 2 evocação porem quando escolhe e mandado para o Templo Não vem com os itens, so quando reloga o char os itens fica tudo no chão e da o erro

Spoiler

727v5Lu.png

 

Yan LiimaY
20 de dezembro de 2018 às 16:53
14 minutos atrás, Fiapera disse:

Então manim adicionei, Ele vem sem evocação precisa falar com 1 npc para escolher 2 evocação porem quando escolhe e mandado para o Templo Não vem com os itens, so quando reloga o char os itens fica tudo no chão e da o erro

  Mostrar conteúdo oculto

727v5Lu.png

 

Altere essa linha:

local bag = doPlayerAddItem(cid, 10518, 1)

Talvez o ID da bag esteja errado. troque o 10518 por 1987 ou pelo ID de alguma bag existente no seu OT

FiaperaF
20 de dezembro de 2018 às 18:18
1 hora atrás, Yan Liima disse:

Altere essa linha:

local bag = doPlayerAddItem(cid, 10518, 1)

Talvez o ID da bag esteja errado. troque o 10518 por 1987 ou pelo ID de alguma bag existente no seu OT

Tente colocando outro tipo de BP não vai. kkkkkk Da o mesmo erro

Editado Dezembro 20 por Fiapera

2 meses depois...
MarshmelloM
20 de fevereiro de 2019 às 16:31
A questão neste suporte foi encerrada por falta de respostas. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta.

+ Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda.
* Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado.