Closed i-kulgu closed 1 year ago
i can Confirm this works.
Where can I add this? :) 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
Where can I add this? :)
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
Inside any script where you want to check if the user can carry an item before giving it. Export will return a boolean so you can use that also in an if statement like :
local cancarry = exports['qb-inventory']:CanCarryItem(src, 'diamond' , 10)
if cancarry then
print('You can carry 10 diamonds')
-- User can carry the given item with given amount
else
print('You can\'t carry 10 diamonds')
-- User can't carry the given item with given amount
end
player name appears duplicate
player name appears duplicate
See the latest commit, it's fixed in there
Description
With this PR you can give an item more controlled. You'll get a list of nearby players and when you choose a player it will give the item to that selected player.
Preview: https://www.youtube.com/watch?v=WtpmP7GfGF0
Also added an export to check if the user can carry an amount of item. Usage :
Checklist