mirror of
https://github.com/jimathy/jim_bridge.git
synced 2026-08-18 06:26:01 +01: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:
@@ -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