• 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]The characters starting items drops to the ground

Dridia

New Member
Joined
Jan 17, 2012
Messages
49
Reaction score
1
Location
Sweden
Hi, i got a problem. I'm using cryingdamson 0.3.6
The characters starting items drops to the ground when entering the game the first time.
I think it has something to do with "const_slot_backpack". I think it puts the items on the wrong place, like you can't put legs on the head slot.
I got an example on that, when you die you'll get a bag in the bag slot. It doesn't drops to the ground.

My firstitems.lua file
Lua:
local storage = 67777
function onLogin(cid)
	local config = {
		voc_items = { },
		extra_items = {
			{2789, 15}, 
			{2120},
			{5710}
		}
	}
	if getPlayerGroupId(cid) < 3 then
		if getPlayerStorageValue(cid, storage) == -1 then
			local common = config.voc_items[getPlayerVocation(cid)]
			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
						doAddContainerItem(bp, w[1], w[2] or 1)
					end
				end
			end
			
			setPlayerStorageValue(cid, storage, 1)
		end
	end
	return true
end

This is the creaturescripts.xml
XML:
	<event type="login" name="FirstItems" event="script" value="firstitems.lua"/>
 
u can use this mode .. better than lua its working for me 100%

Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" version="2.0" author="J.Dre" contact="[email protected]" enabled="yes">
	<config name="firstitems_config"><![CDATA[
		commonItems = {
			{itemid=6103, count=1, useMessage=true}, -- a book (or whatever) with a message
			{itemid=2789, count=10, inContainer = true}, -- 10 brown mushrooms
			{itemid=2152, count=10, inContainer = true}, -- 10 platinum coins
			{itemid=2554, inContainer = true}, -- shovel
			{itemid=2200, count=100}, -- protection amulet
			{itemid=2643} -- leather boots
		}
		firstItems = {
			{ -- Sorcerer	
				{itemid=1988}, -- backpack
				{itemid=2175}, -- spellbook
				{itemid=2190}, -- wand of vortex
				{itemid=8819}, -- magician's robe
				{itemid=8820}, -- mage hat
				{itemid=2468}, -- studded legs
				{itemid=7620, count=3, inContainer=true} -- mana potion
			},
			{ -- Druid
				{itemid=1988}, -- backpack
				{itemid=2175}, -- spellbook
				{itemid=2182}, -- snakebite rod
				{itemid=8819}, -- magician's robe
				{itemid=8820}, -- mage hat
				{itemid=2468}, -- studded legs
				{itemid=7620, count=3, inContainer=true} -- mana potion
			},
			{ -- Paladin
				{itemid=1988}, -- backpack
				{itemid=2456, count=1, useSlot=true, slotType=CONST_SLOT_LEFT}, -- bow
				{itemid=2544, count=100, useSlot=true, slotType=CONST_SLOT_LAST}, -- 100 arrow's
				{itemid=2660}, -- ranger's cloak
				{itemid=2481}, -- soldier helmet
				{itemid=8923}, -- ranger legs
				{itemid=7618, count=1, inContainer=true}, -- health potion
				{itemid=7620, count=2, inContainer=true} -- mana potion
			},
			{ -- Knight
				{itemid=1988}, -- backpack
				{itemid=2509}, -- steel shield
				{itemid=8602}, -- jagged sword
				{itemid=8601, inContainer=true}, -- steel axe
				{itemid=2439, inContainer=true}, -- daramanian mace
				{itemid=2465}, -- brass armor
				{itemid=2481}, -- soldier helmet
				{itemid=2478}, -- brass legs
				{itemid=7618, count=3, inContainer=true} -- health potion
			}
		}
	]]></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(getPlayerAccess(cid) < 3 and (getPlayerLastLoginSaved(cid) < 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, false)
					elseif v.inContainer then
						doAddContainerItem(backpack, v.itemid, v.count or 1)
					elseif v.useSlot then
						doPlayerAddItem(cid, v.itemid, v.count, false, v.slotType)
					elseif v.useMessage then
						local t, k = {
							writer = "Server Staff", date = os.time(),
							text = "Welcome " .. getCreatureName(cid) .. ".\n\nOur community would like to welcome you to " .. getConfigValue('serverName') .. ". If you need help with anything, please refer to the help channel.\n\nEnjoy your time!"
						}, doPlayerAddItem(cid, v.itemid, v.count or 1, false)
						doSetItemText(k, t.text, t.writer, t.date)
					else
						doPlayerAddItem(cid, v.itemid, v.count or 1)
					end
				end
			end
 
			return true
		end
	]]></event>
</mod>
 
All the items is still droped on the floor, it's not the cap. Once they have droped, i can pick them up and wear the items.
 
Both scripts work just fine (as I made them and tested them thoroughly). The mod [posted above] is up-to-date and works just fine with 0.3.7.

You are most likely using: Crying Damson (8.60 v3) which was improperly edited. I recommend upgrading to an officially released server, by TFS Developers.
 
Both scripts work just fine (as I made them and tested them thoroughly). The mod [posted above] is up-to-date and works just fine with 0.3.7.

You are most likely using: Crying Damson (8.60 v3) which was improperly edited. I recommend upgrading to an officially released server, by TFS Developers.

So you mean that it's not possible to fix that problem in Crying Damson(8.60) v3?
 
Both scripts work just fine (as I made them and tested them thoroughly). The mod [posted above] is up-to-date and works just fine with 0.3.7.

You are most likely using: Crying Damson (8.60 v3) which was improperly edited. I recommend upgrading to an officially released server, by TFS Developers.


i've got premium but cant find the full TFS server for 8.6 :S
 
Are you sure that they have enough cap, it didn't seems like you had so many newbie items? However, if they start with some equipment + your first items, they need to have more cap since you can't almost carry anything in lvl 8. If so, just edit the amout of cap you should start with. But if that's not the case, try to make all first items appear in a bp or something like that when logging in the first time.
 
Seems like a .exe bugg for me, you should download a another one. Which is kinda easy if you got premium accsess, and if not use google! Cus it seem's like it's something wrong with the launcher.

Never heard about it, If you could upload the launcher for me and I can check at it.

Reegards,

Shasy :D
 
Are you sure that they have enough cap, it didn't seems like you had so many newbie items? However, if they start with some equipment + your first items, they need to have more cap since you can't almost carry anything in lvl 8. If so, just edit the amout of cap you should start with. But if that's not the case, try to make all first items appear in a bp or something like that when logging in the first time.
It's a bug with the cryingdamson 0.3.6 (8.60) V3

Seems like a .exe bugg for me, you should download a another one. Which is kinda easy if you got premium accsess, and if not use google! Cus it seem's like it's something wrong with the launcher.

Never heard about it, If you could upload the launcher for me and I can check at it.

Reegards,

Shasy :D
I fixed it! I downloaded the TFS from the premium board! thanks you for offering your time to look at it :)
 
Back
Top