• 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!

"Your depot contains 1 item."

Muzzy

New Member
Joined
Jul 8, 2008
Messages
125
Reaction score
1
Hey,

To start off, I've looked around and found people experiencing the same problem, but the solution for them didn't work for me. I've set the actionID of the tile to 101 and 102(tried both), but no luck. It just keeps saying I have 1 item when I actually have more. I don't think it's a faulty script, I think it's my ignorance that strikes back, but how do I go about this? Have I set the townID wrong somehow?

11alg1g.jpg


Code:
local increasingItemID = {416, 446, 3216, 11062}
local decreasingItemID = {417, 447, 3217, 11063}
function onStepIn(cid, item, position, fromPosition)
	if isInArray(increasingItemID, item.itemid) == TRUE then
		doTransformItem(item.uid, item.itemid + 1)
		if item.actionid > 1000 then
			getLevelTile(cid, item, position)
		elseif getTilePzInfo(position) == TRUE then
			getDepotItems(cid, item)
		end
	elseif item.itemid == 426 then
		doTransformItem(item.uid, 425)
		if item.actionid > 1000 then
			getLevelTile(cid, item, position)
		elseif getTilePzInfo(position) == TRUE then
			getDepotItems(cid, item)
		end
	end
	return TRUE
end
 
 
function onStepIn(cid, item, position, fromPosition)
	if isInArray(increasingItemID, item.itemid) == TRUE then
		doTransformItem(item.uid, item.itemid + 1)
		if item.actionid > 1000 then
			getLevelTile(cid, item, position)
		elseif getTilePzInfo(position) == TRUE then
			getDepotItems(cid, item)
		end
	elseif item.itemid == 11062 then
		doTransformItem(item.uid, 11063)
		if item.actionid > 1000 then
			getLevelTile(cid, item, position)
		elseif getTilePzInfo(position) == TRUE then
			getDepotItems(cid, item)
		end
	end
	return TRUE
end
 
 
function onStepOut(cid, item, position, fromPosition)
	if isInArray(decreasingItemID, item.itemid) == TRUE then
		doTransformItem(item.uid, item.itemid - 1)
	elseif item.itemid == 425 then
		doTransformItem(item.uid, item.itemid + 1)
	end
	return TRUE
end
 
function getLevelTile(cid, item, position)
	if isPlayer(cid) == TRUE then
		if getPlayerLevel(cid) < item.actionid - 1000 then
			doTeleportThing(cid, {x = getPlayerPosition(cid).x, y = getPlayerPosition(cid).y, z = getPlayerPosition(cid).z + 1}, FALSE)
			doSendMagicEffect(position, CONST_ME_MAGIC_BLUE)
		end
	end
	return TRUE
end
 
function getDepotItems(cid, item)
	if item.actionid > 100 then
		if isPlayer(cid) == TRUE then
			depotItems = getPlayerDepotItems(cid, item.actionid - 100)
			if depotItems < 2 then
				doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Your depot contains 1 item.")
			else
				doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Your depot contains " ..depotItems.. " items.")
			end
		end
	end
	return TRUE
end

Thanks in advance,
~Muzzy
 

Similar threads

Back
Top