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

Depot Tiles (Default Script TFS bug) [CLOSED]

LucasFerraz

Systems Analyst
Joined
Jun 10, 2010
Messages
2,857
Reaction score
96
Location
Brazil
No matters how many itens inside Player's DP. It aways show 1.("Your depot contains 1 item.")
LUA:
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

How can I fix this?
 
Last edited:
Maybe if you add an AID to the tile like you do on the depot chest to check that is from X city
 
22:50 You see glowing switch.
ItemID: [11062], ActionID: [1000].

No matter if have 1 or 1000 itens in depot, It just show "Your depot contains 1 item."
 
depotItems = getPlayerDepotItems(cid, item.actionid - 100)
? ?
what's the problem, use 100+townid or 0.3's script
 
Back
Top