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:
Thx.
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.