• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

help first items MOD

Dramix

New Member
Joined
Jun 26, 2009
Messages
289
Reaction score
1
Hello.. i using 0.4 ot.. 8.6 client and heres my script.. first item.. when i login i dont get ( vocation items) i only get (all) + (extras)


PHP:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" version="1.0" author="The Forgotten Server" 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)
   local config = {
      voc_items = {
         { --
            {2268, 1}, -- sd
            {2191}, -- wand of dragonbreath
            {2175}, -- speelbook
            {8871}, -- focus cape
            {2323} -- hat of the mad
         },
         { --
            {2268, 1}, -- sd
            {2186}, -- moonlight rod
            {2323}, -- hat of the mad
            {2175}, -- speelbook
            {8871} -- focus cape
         },
         { --
            {2268, 1}, -- sd       
            {8472, 1}, -- gsp               
            {7368, 1}, -- assasssin star
            {8872}, -- belted cape
            {2525}, -- dwarven shield
            {2457} -- steel helmet
         },
         { --
            {2457}, -- steel helmet
            {2463}, -- plate armor
            {2525}, -- dwarven shield
            {2400} -- magic sword
         }
      },
      all_items = {
         {2643}, -- leather boots
         {2647} -- p legs
      },
      extra_items = {
         {2789, 10}, -- brown mushrooms
         {7620, 1}, -- mp
         {7618, 1}, -- hp
         {2293, 1}, -- mw
         {2305, 1}, -- great fireball
         {2274, 1}, -- avalanche
         {2261, 1}, -- destroy
         {2120}, --
         {2554} --
      },
      knight_weapons = {
            {2457}, -- steel helmet
            {2463}, -- plate armor
            {2525}, -- dwarven shield
            {2400} -- magic sword     
      },
      paladin_weapons = {
     
      }

   }
   if getPlayerGroupId(cid) < 3 then
      if getPlayerStorageValue(cid, storage) == -1 then
         local vocation = getPlayerVocation(cid)
local common = config.voc_items[vocation > 4 and vocation - 4 or vocation]
         if common ~= nil then
            for _, v in ipairs(common) do
               doPlayerAddItem(cid, v[1], v[2] or 1)
            end
         end
         local all = config.all_items
         if all ~= nil then
            for _, v in ipairs(all) do
               doPlayerAddItem(cid, v[1], v[2] or 1)
            end
         end
         local extra = config.extra_items
         local bp = doPlayerAddItem(cid, 1988, 1)
         if extra ~= nil then
            for _, v in ipairs(extra) do
               doAddContainerItem(bp, v[1], v[2] or 1)
            end
         end
         local weapons = config.knight_weapons
         if weapons ~= nil then
            for _, w in ipairs(weapons) do
               if isKnight(cid) then
                  doPlayerAddItem(cid, w[1], w[2] or 1)
               end
            end
         end

         local weapons2 = config.paladin_weapons
         if weapons2 ~= nil then
            for _, w in ipairs(weapons2) do
               if isPaladin(cid) then
                  doAddContainerItem(bp, w[1], w[2] or 1)
               end
            end
         end

         setPlayerStorageValue(cid, storage, 1)
      end
   end
   return true
end
   ]]></event>
</mod>

this is xml file.. in my mods
 
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" enabled="yes">
    <config name="firstitems_config"><![CDATA[
        STORAGE = 30001
        commonItems = {
            {itemid=2160, count=100, inContainer = true}, -- 2 platinum coins
            {itemid=2173} -- leather boots
        }
        firstItems = {
            { -- Sorcerer   
                {itemid=2365}, -- backpack
                {itemid=2519}, -- dark shield
                {itemid=7735}, -- wand of vortex
                {itemid=2487}, -- magician's robe
                {itemid=2488}, -- mage hat
                {itemid=2491}, -- wand of vortex
                {itemid=2275}, -- mage hat
                {itemid=2270}, -- mage hat
                {itemid=2195}  -- blue legs
            },
            { -- Druid
                {itemid=2365}, -- backpack
                {itemid=2519}, -- dark shield
                {itemid=7735}, -- wand of vortex
                {itemid=2491}, -- wand of vortex
                {itemid=2487}, -- magician's robe
                {itemid=2488}, -- mage hat
                {itemid=2275}, -- mage hat
                {itemid=2270}, -- mage hat
                {itemid=2195}  -- blue legs
            },
            { -- Paladin
                {itemid=2365}, -- backpack
                {itemid=2519}, -- dark shield
                {itemid=2491}, -- wand of vortex
                {itemid=2487}, -- magician's robe
                {itemid=2488}, -- mage hat
                {itemid=7366}, -- mage hat
                {itemid=2275}, -- mage hat
                {itemid=2270}, -- mage hat
                {itemid=2195}  -- blue legs
            },
            { -- Knight
                {itemid=2365}, -- backpack
                {itemid=2519}, -- dark shield
                {itemid=8931}, -- wand of vortex
                {itemid=2487}, -- magician's robe
                {itemid=2488}, -- mage hat
                {itemid=2491}, -- wand of vortex
                {itemid=2275}, -- mage hat
                {itemid=2270}, -- mage hat
                {itemid=2195}  -- blue legs
            }
        }
    ]]></config>
    <event type="login" name="FirstItems" event="script"><![CDATA[
        domodlib('firstitems_config')

        for _, items in ipairs(firstItems) do
            for _, item in ipairs(commonItems) do
                table.insert(items, item)
            end
        end

        function onLogin(cid)
            if getPlayerGroupId(cid) < 4 and getPlayerStorageValue(cid, STORAGE) < 1 and firstItems[getPlayerVocation(cid)] then
                for _, v in ipairs(firstItems[getPlayerVocation(cid)]) do
                    if isItemContainer(v.itemid) then
                        backpack = doPlayerAddItem(cid, v.itemid, 1)
                    elseif v.inContainer then
                        doAddContainerItem(backpack, v.itemid, v.count or 1)
                    else
                        doPlayerAddItem(cid, v.itemid, v.count or 1)
                    end
                end
                setPlayerStorageValue(cid, STORAGE, 1)
            end
            return true
        end
    ]]></event>
</mod>

try using mine just edit the items you want.
 
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" enabled="yes">
    <config name="firstitems_config"><![CDATA[
        STORAGE = 30001
        commonItems = {
            {itemid=2160, count=100, inContainer = true}, -- 2 platinum coins
            {itemid=2173} -- leather boots
        }
        firstItems = {
            { -- Sorcerer  
                {itemid=2365}, -- backpack
                {itemid=2519}, -- dark shield
                {itemid=7735}, -- wand of vortex
                {itemid=2487}, -- magician's robe
                {itemid=2488}, -- mage hat
                {itemid=2491}, -- wand of vortex
                {itemid=2275}, -- mage hat
                {itemid=2270}, -- mage hat
                {itemid=2195}  -- blue legs
            },
            { -- Druid
                {itemid=2365}, -- backpack
                {itemid=2519}, -- dark shield
                {itemid=7735}, -- wand of vortex
                {itemid=2491}, -- wand of vortex
                {itemid=2487}, -- magician's robe
                {itemid=2488}, -- mage hat
                {itemid=2275}, -- mage hat
                {itemid=2270}, -- mage hat
                {itemid=2195}  -- blue legs
            },
            { -- Paladin
                {itemid=2365}, -- backpack
                {itemid=2519}, -- dark shield
                {itemid=2491}, -- wand of vortex
                {itemid=2487}, -- magician's robe
                {itemid=2488}, -- mage hat
                {itemid=7366}, -- mage hat
                {itemid=2275}, -- mage hat
                {itemid=2270}, -- mage hat
                {itemid=2195}  -- blue legs
            },
            { -- Knight
                {itemid=2365}, -- backpack
                {itemid=2519}, -- dark shield
                {itemid=8931}, -- wand of vortex
                {itemid=2487}, -- magician's robe
                {itemid=2488}, -- mage hat
                {itemid=2491}, -- wand of vortex
                {itemid=2275}, -- mage hat
                {itemid=2270}, -- mage hat
                {itemid=2195}  -- blue legs
            }
        }
    ]]></config>
    <event type="login" name="FirstItems" event="script"><![CDATA[
        domodlib('firstitems_config')

        for _, items in ipairs(firstItems) do
            for _, item in ipairs(commonItems) do
                table.insert(items, item)
            end
        end

        function onLogin(cid)
            if getPlayerGroupId(cid) < 4 and getPlayerStorageValue(cid, STORAGE) < 1 and firstItems[getPlayerVocation(cid)] then
                for _, v in ipairs(firstItems[getPlayerVocation(cid)]) do
                    if isItemContainer(v.itemid) then
                        backpack = doPlayerAddItem(cid, v.itemid, 1)
                    elseif v.inContainer then
                        doAddContainerItem(backpack, v.itemid, v.count or 1)
                    else
                        doPlayerAddItem(cid, v.itemid, v.count or 1)
                    end
                end
                setPlayerStorageValue(cid, STORAGE, 1)
            end
            return true
        end
    ]]></event>
</mod>

try using mine just edit the items you want.
It doesnt work :/
 
Code:
<event type="login" name="FirstItems" script="firstitems.lua"/>

Code:
local firstKnight =
{
2647, -- Plate Legs --
2465, -- Brass Armor --
2643, -- Leather Boots --
2525, -- Dwarven Sheild --
2490 -- Dark Helmet --
}
local firstPaladin =
{
2660, -- Ranger's Cloak --
8923, -- Ranger's Legs --
2490, -- Dark Helmet --
2643, -- Leather Boots --
2525 -- Dwarven Sheild --
}
local firstDruid =
{
2643, -- Leather Boots --
2175, -- Spellbook --
2490, -- Dark Helmet --
8819, -- Magician's Robe --
2478, -- Brass Legs --
2182 -- Snakebite Rod --
}
local firstSorcerer =
{
2643, -- Leather Boots --
2175, -- Spellbook --
8819, -- Magician's Robe --
2478, -- Brass Legs --
2190, -- Wand Of Vortex --
2490 -- Dark Helmet --
}


function onLogin(cid)

if getPlayerStorageValue(cid, 30001) == -1 then
local bag = doPlayerAddItem(cid, 1988, 1) -- Backpack --
if getPlayerVocation(cid) == 4 then -- if player is knight --
for i = 1, table.maxn(firstKnight) do
doPlayerAddItem(cid, firstKnight, 1)
end
doAddContainerItem(bag, 8209 , 1) -- Sword --
doAddContainerItem(bag, 2429 , 1) -- Axe --
doAddContainerItem(bag, 2423 , 1) -- Club --

end
if getPlayerVocation(cid) == 3 then -- if player is paladin --
for i = 1, table.maxn(firstPaladin) do
doPlayerAddItem(cid, firstPaladin, 1)
end
doAddContainerItem(bag, 2389, 10) -- 10 Spears in bag --
end
if getPlayerVocation(cid) == 2 then -- if player is druid --
for i = 1, table.maxn(firstDruid) do
doPlayerAddItem(cid, firstDruid, 1)
end
end

if getPlayerVocation(cid) == 1 then -- if player is sorcerer --
for i = 1, table.maxn(firstSorcerer) do
doPlayerAddItem(cid, firstSorcerer, 1)

end
end
setPlayerStorageValue(cid, 30001, 1)
end
return TRUE
end
 
Code:
<event type="login" name="FirstItems" script="firstitems.lua"/>

Code:
local firstKnight =
{
2647, -- Plate Legs --
2465, -- Brass Armor --
2643, -- Leather Boots --
2525, -- Dwarven Sheild --
2490 -- Dark Helmet --
}
local firstPaladin =
{
2660, -- Ranger's Cloak --
8923, -- Ranger's Legs --
2490, -- Dark Helmet --
2643, -- Leather Boots --
2525 -- Dwarven Sheild --
}
local firstDruid =
{
2643, -- Leather Boots --
2175, -- Spellbook --
2490, -- Dark Helmet --
8819, -- Magician's Robe --
2478, -- Brass Legs --
2182 -- Snakebite Rod --
}
local firstSorcerer =
{
2643, -- Leather Boots --
2175, -- Spellbook --
8819, -- Magician's Robe --
2478, -- Brass Legs --
2190, -- Wand Of Vortex --
2490 -- Dark Helmet --
}


function onLogin(cid)

if getPlayerStorageValue(cid, 30001) == -1 then
local bag = doPlayerAddItem(cid, 1988, 1) -- Backpack --
if getPlayerVocation(cid) == 4 then -- if player is knight --
for i = 1, table.maxn(firstKnight) do
doPlayerAddItem(cid, firstKnight, 1)
end
doAddContainerItem(bag, 8209 , 1) -- Sword --
doAddContainerItem(bag, 2429 , 1) -- Axe --
doAddContainerItem(bag, 2423 , 1) -- Club --

end
if getPlayerVocation(cid) == 3 then -- if player is paladin --
for i = 1, table.maxn(firstPaladin) do
doPlayerAddItem(cid, firstPaladin, 1)
end
doAddContainerItem(bag, 2389, 10) -- 10 Spears in bag --
end
if getPlayerVocation(cid) == 2 then -- if player is druid --
for i = 1, table.maxn(firstDruid) do
doPlayerAddItem(cid, firstDruid, 1)
end
end

if getPlayerVocation(cid) == 1 then -- if player is sorcerer --
for i = 1, table.maxn(firstSorcerer) do
doPlayerAddItem(cid, firstSorcerer, 1)

end
end
setPlayerStorageValue(cid, 30001, 1)
end
return TRUE
end
doesnt work :7
 
Back
Top