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

Lua Container problem

Xleniz

New Member
Joined
Jul 6, 2009
Messages
178
Reaction score
3
Location
Sweden
I need help with a lua script. I'm trying to make a script that gives you an item, and that will check if you have enough spaces in backpack or cap (so it doesn't drop at floor). But I can't find the "checkcontainerspaces" function. Here's a part of the script:

Code:
	if(getPlayerFreeCap(cid) < getItemWeightById(id, 1)) then
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You do not have enough cap.")
	return false
	end
	
	if(getPlayerSlotItem(cid, 3)==0) then
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You do not have enough space.")
	return false
	end
	
	doPlayerAddItem(cid, id)
	doSendMagicEffect(getCreaturePosition(cid), 31)

Thx.
 
Back
Top