mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-01 14:38:50 +00:00
692 B
692 B
Adds an item into the specified inventory.
Should be used alongside CanCarryItem.
-- inv: string or number
-- item: table or string
-- count: number
-- metadata: table or string (optional)
-- slot: number (optional)
-- cb: function (optional)
exports.ox_inventory:AddItem(inv, item, count, metadata, slot, cb)
Example:
exports.ox_inventory:AddItem(1, 'bread', 4, nil, nil, function(success, reason)
if not success then
if reason == 'overburdened' then
TriggerClientEvent('ox_inventory:notify', source, {type = 'error', text = shared.locale('cannot_carry', count, data.label), duration = 2500})
end
end
end)