fyalhed
Member
- Joined
- Nov 18, 2017
- Messages
- 156
- Reaction score
- 20
I can check if player got cap to get the items by just check getPlayerFreeCap
But sometimes players has the cap, but don't have space, slots in backpack to recive the items
How to check if player has the free slots enough?
Code:
-- dont have cap
if getPlayerFreeCap(cid) < TILE.needcap then
doTeleportThing(cid, fromPosition, false)
doSendMagicEffect(position, CONST_ME_MAGIC_BLUE)
doPlayerPopupFYI(cid, 'You need '.. TILE.needcap ..' OZ CAP to recive the items!')
return false
end
for i = 1, #TILE.extraItems do
doPlayerAddItem(cid, TILE.extraItems[i].itemID, TILE.extraItems[i].count)
end
setPlayerStorageValue(cid, item.actionid, 1)
But sometimes players has the cap, but don't have space, slots in backpack to recive the items
How to check if player has the free slots enough?