qbcore-framework / qb-inventory

Slot Based Inventory System Used With QB-Core :school_satchel:
GNU General Public License v3.0
49 stars 376 forks source link

Check if user can carry item / amount #418

Closed i-kulgu closed 1 year ago

i-kulgu commented 1 year ago

Description

Add an export to check if the user can carry an amount of given items. Usage :

local cancarry = exports['qb-inventory']:CanCarryItem(src,item,amount)
if not cancarry then TriggerClientEvent("QBCore:Notify", src, "Not enough room in inventory", "error") return end

This way you know if the player can carry an item before giving it to the user.

Checklist

i-kulgu commented 1 year ago

Not merging and i won't update it. If needed you can get the codes.