mirror of
https://github.com/jimathy/jim_bridge.git
synced 2026-11-25 04:48:35 +00:00
add new function hasFreeInventorySlots()
using the function to grab slot info, this can now check if you have enough inventory slots for items to be given, allowing it to check before TRYING to add them
This commit is contained in:
1 parent
f3fa309dbf
commit
5c69f8dd28
1 file changed
+12
@@ -870,6 +870,18 @@ function getCurrentInvWeight()
|
||||
return weight
|
||||
end
|
||||
|
||||
function hasFreeInventorySlots(slots, src)
|
||||
local inv = getPlayerInv(src)
|
||||
print(countTable(inv))
|
||||
print(countTable(inv) + slots)
|
||||
print(InventorySlots)
|
||||
print((countTable(inv) + slots) <= InventorySlots)
|
||||
if (countTable(inv) + slots) <= InventorySlots then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
-------------------------------------------------------------
|
||||
-- Check Item Existance - return boolean(true,false)
|
||||
-------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user