Items
Some basic item checking functions using the latest QB-Inventory. You can implement your own inventory system into this if you know how.
function functions.HasItem(item, amount)
local hasItemWithAmounts = exports['qb-inventory']:HasItem(item, amount)
return hasItemWithAmounts -- Should Return true or false
end
function functions.HasItemsTable(data)
local hasItemsWithAmounts = exports['qb-inventory']:HasItem(data)
return hasItemsWithAmounts -- Should Return true or false
end
Here is a usage example, it will return a boolean of if they have it or not
if HapticLib.HasItem("water_bottle", 1) == false then
print("Does not have a water bottle")
end
Last updated