Never I had problem because always I used the Sample system (website). Now, in the moment, im utilizing barely the system of Account Manager. When i create the vocation Knight, to the entering in the character, he receives Debug and some items go to stop in the ground. Because that happens?
I studied the possibility of use the system FirstItems.Xml (mods), but not knowledge uses-him. As I do for alter the items that the char receives for this system?
my firstitems.lua (data/creaturescript/scripts/firstitems.lua)
Knight = Vocation 4.
and my firstitems.xml system (mods):
I studied the possibility of use the system FirstItems.Xml (mods), but not knowledge uses-him. As I do for alter the items that the char receives for this system?
my firstitems.lua (data/creaturescript/scripts/firstitems.lua)
LUA:
local firstItems = {}
firstItems[0] =
{
2173,
2525,
3965,
2124,
2457,
2647,
2643
}
firstItems[1] =
{
2173,
2525,
2190,
2124,
2457,
2647,
2643
}
firstItems[2] =
{
2173,
2525,
2182,
2124,
2457,
2647,
2643
}
firstItems[3] =
{
2173,
2525,
2399,
2124,
2457,
2647,
2643
}
firstItems[4] =
{
2173,
2525,
2428,
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)][i], 1)
end
if getPlayerSex(cid) == 0 then
doPlayerAddItem(cid, 2463, 1)
else
doPlayerAddItem(cid, 2463, 1)
end
local bag = doPlayerAddItem(cid, 10521, 1)
doAddContainerItem(bag, 2160, 2)
doAddContainerItem(bag, 2554, 1)
doAddContainerItem(bag, 2120, 1)
doAddContainerItem(bag, 7618, 1)
setPlayerStorageValue(cid, 30001, 1)
end
return TRUE
end
Knight = Vocation 4.
and my firstitems.xml system (mods):
XML:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" version="1.0" author="The Forgotten Server" contact="otland.net" enabled="yes">
<config name="firstitems_config"><![CDATA[
config = {
storage = 30001,
items = {2050, 2382}
}
]]></config>
<event type="login" name="FirstItems" event="script"><![CDATA[
domodlib('firstitems_config')
function onLogin(cid)
if(getPlayerStorageValue(cid, config.storage) > 0) then
return true
end
for _, id in ipairs(config.items) do
doPlayerAddItem(cid, id, 1)
end
if(getPlayerSex(cid) == PLAYERSEX_FEMALE) then
doPlayerAddItem(cid, 2651, 1)
else
doPlayerAddItem(cid, 2650, 1)
end
doAddContainerItem(doPlayerAddItem(cid, 1987, 1), 2674, 1)
setPlayerStorageValue(cid, config.storage, 1)
return true
end
]]></event>
</mod>
Last edited by a moderator: