AT

First Items

Por Ateu, 31 de ago. de 2010 em Archived

script
5
1.8k
AteuA
31 de agosto de 2010 às 14:15

Vou pedir denovo porque da última vez que pedi, não me deram pronto, tentaram me ensinar o que já sabia mais não da conta e continuo sem dar. Dessa vez com um erro diferente. Eu preciso do script first items customizado, porque além de dar erro, não consigo botar os items que quero que os chares começem.

 

O erro:

 

Toda vez que alguém loga, aparece com 2 backpacks (tentei tirar 1 delas e não dei conta) e então quando sai e loga novamente, aparece com mais 2 backpacks, e assim vai... Se alguém entrar e sair 10 vezes vai ter 20 backpacks. E isso é a única razão do meu OT sério ainda não estar online...

 

Eis como está o script:

 

local firstItems = {}

firstItems[0] =

{

}

firstItems[1] =

{

2525,

8819,

8820,

2190,

2647,

2643

}

firstItems[2] =

{

2525,

8819,

8820,

2182,

2647,

2643

}

firstItems[3] =

{

2525,

2399,

2124,

2457,

2647,

2643

}

firstItems[4] =

{

2525,

2383,

2124,

2457,

2647,

2643

}

 

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

 

local bag = doPlayerAddItem(cid, 1988, 1)

setPlayerStorageValue(cid, 30001, 1)

end

local bag = doPlayerAddItem(cid, 1988, 1)

doAddContainerItem(bag, 2152, 2)

doAddContainerItem(bag, 2554, 1)

doAddContainerItem(bag, 2120, 1)

doAddContainerItem(bag, 7618, 1)

setPlayerStorageValue(cid, 30001, 1)

return TRUE

end

 

Minha intenção é que cada classe comece com:

 

Knight:

 

Brass Armor, Brass Legs, Dwarven Shield, Leather Boots, Soldier Helmet, Jagged Sword, 1 Health Potion, 2 Platinum Coins, Shovel, Rope.

 

 

Sorcerer:

 

Magician Robe, Mage Hat, Dwarven Shield, Studdeed Legs, Leather Boots, Wand of Vortex, 1 Mana Potion, 2 Platinum Coins, Shovel, Rope.

 

 

Paladin:

 

Belted Cape, Brass Legs, Dwarven Shield, Leather Boots, Soldier Helmet, 5 Spear, 1 Health Potion, 2 Platinum Coins, Shovel, Rope.

 

 

Druid:

 

Magician Robe, Mage Hat, Dwarven Shield, Studdeed Legs, Leather Boots, Snakebite Rod, 1 Mana Potion, 2 Platinum Coins, Shovel, Rope.

 

 

Se não for muita filhadaputisse preguiça minha, eu peço por favor que alguém poste o script pronto... Já sei editar mais quando eu mesmo faço sempre da algum erro.

 

Valeu deis de já...

LuquitosmaurizL
31 de agosto de 2010 às 14:31

Kra isso so aconteceu uma vez comigo por causa de erro no sql.

AteuA
31 de agosto de 2010 às 15:03

Eu já tinha pensado nisso, até desativei o sql e limpei a database mais não mudou nada...

SinosS
31 de agosto de 2010 às 15:57

Tenta esse aqui mano:

 

local firstItems = {}

firstItems[0] =

{

2525,

3965,

2124,

2457,

2647,

2643

}

firstItems[1] =

{

2525,

2190,

2124,

8820,

2468,

2643,

8819

}

firstItems[2] =

{

2525,

2182,

2124,

8820,

2468,

2643,

8819

}

firstItems[3] =

{

2525,

2389,

2124,

2481,

2478,

2643,

8872

}

firstItems[4] =

{

2525,

8602,

2124,

2481,

2478,

2643,

2465

}

 

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

local bag = doPlayerAddItem(cid, 1988, 1)

doAddContainerItem(bag, 2152, 2)

doAddContainerItem(bag, 2554, 1)

doAddContainerItem(bag, 2120, 1)

doAddContainerItem(bag, 7618, 1)

setPlayerStorageValue(cid, 30001, 1)

end

return TRUE

end

Vê se consegue ae!

:ph34r:

VodkartV
31 de agosto de 2010 às 16:05

só pra esclarecer porque ta vindo 2 bp

 

local bag = doPlayerAddItem(cid, 1988, 1)
setPlayerStorageValue(cid, 30001, 1)
end
local bag = doPlayerAddItem(cid, 1988, 1)
doAddContainerItem(bag, 2152, 2)
doAddContainerItem(bag, 2554, 1)
doAddContainerItem(bag, 2120, 1)
doAddContainerItem(bag, 7618, 1)
setPlayerStorageValue(cid, 30001, 1)
return TRUE
end

 

o certo seria:

 

local bag = doPlayerAddItem(cid, 1988, 1)
doAddContainerItem(bag, 2152, 2)
doAddContainerItem(bag, 2554, 1)
doAddContainerItem(bag, 2120, 1)
doAddContainerItem(bag, 7618, 1)
setPlayerStorageValue(cid, 30001, 1)
return TRUE
end

Editado Agosto 31 por Vodkart