I need a check to determine if the player has any available slots where items can be placed.
This script will be used for quests etc, I've already made a check on the player's cap, now I need to check for the player's available slots.
Can't get it to work, all I get is:
This is the function from functions.lua:
Any help will be greatly appreciated!
This script will be used for quests etc, I've already made a check on the player's cap, now I need to check for the player's available slots.
Code:
function onUse(cid, item, frompos, item2, topos)
local BP = getPlayerSlotItem(cid, CONST_SLOT_BACKPACK).uid
if getContainerCapByID(BP) < 1 then
doStuff
else
doOtherStuff
end
Can't get it to work, all I get is:
With or without a backpack.attempt to call global 'getContainerCapByID' (a nil value)
This is the function from functions.lua:
Code:
getContainerCapById(itemid)
Any help will be greatly appreciated!
Last edited: