- 107
- Posts
- 4
- Years
- Seen Apr 27, 2023
How do I check the amount of items in the bag and in the PC item storage?
This function:
Checks a specific item, how can I go through all pockets?
essentials v18.1
This function:
Code:
def pbQuantity(item)
item = getID(PBItems,item)
if !item || item<1
raise ArgumentError.new(_INTL("Item number {1} is invalid.",item))
end
pocket = pbGetPocket(item)
maxsize = maxPocketSize(pocket)
maxsize = @pockets[pocket].length if maxsize<0
return ItemStorageHelper.pbQuantity(@pockets[pocket],maxsize,item)
end
Checks a specific item, how can I go through all pockets?
essentials v18.1