CanCarryItem checks on additem
This commit is contained in:
1 parent
af33909794
commit
e30dceb540
3 files changed
+3
No files matched your search
@@ -17,6 +17,7 @@ Inventory.Stashes = Inventory.Stashes or {}
|
||||
---@param metadata table
|
||||
---@return boolean
|
||||
Inventory.AddItem = function(src, item, count, slot, metadata)
|
||||
if not ox_inventory:CanCarryItem(src, item, count, metadata) then return false end
|
||||
TriggerClientEvent("community_bridge:client:inventory:updateInventory", src, {action = "add", item = item, count = count, slot = slot, metadata = metadata})
|
||||
return ox_inventory:AddItem(src, item, count, metadata)
|
||||
end
|
||||
|
||||
@@ -21,6 +21,7 @@ end
|
||||
---@param metadata table
|
||||
---@return boolean
|
||||
Inventory.AddItem = function(src, item, count, slot, metadata)
|
||||
if getInventoryNewVersion() then if not qbInventory:CanAddItem(src, item, count) then return false end end
|
||||
TriggerClientEvent('qb-inventory:client:ItemBox', src, QBCore.Shared.Items[item], 'add', count)
|
||||
TriggerClientEvent("community_bridge:client:inventory:updateInventory", src, {action = "add", item = item, count = count, slot = slot, metadata = metadata})
|
||||
return qbInventory:AddItem(src, item, count, slot, metadata, 'community_bridge')
|
||||
|
||||
@@ -14,6 +14,7 @@ Inventory.Stashes = Inventory.Stashes or {}
|
||||
---@param metadata table
|
||||
---@return boolean
|
||||
Inventory.AddItem = function(src, item, count, slot, metadata)
|
||||
if not tgiann:CanCarryItem(src, item, count) then return false end
|
||||
TriggerClientEvent("community_bridge:client:inventory:updateInventory", src, {action = "add", item = item, count = count, slot = slot, metadata = metadata})
|
||||
return tgiann:AddItem(src, item, count, slot, metadata, false)
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user