QB
Starting Order
To avoid issues with your other scripts, make sure to start this script after your framework and before any of your scripts that use the inventory. Otherwise, you may encounter problems with inventory-dependent scripts.
ensure ox_lib
ensure qb-core
ensure tgiann-inventory
ensure ...
Deleting Script
If you have qb-weapons and qb-inventory or another inventory script. delete it
Exports
Search for exports['qb-inventory']
and exports["qb-inventory"]
in all your scripts, and replace them with exports['tgiann-inventory']
New itemList Event
Add this event to the bottom of qb-core/shared/items.lua to update the QB Shared Items data
TriggerEvent("__cfx_export_tgiann-inventory_Items", function(ref)
if not ref then return end
QBShared.Items = ref()
end)
AddEventHandler("tgiann-inventory:itemList", function(items)
QBShared.Items = items
end)
Convert QB Inventory Data to TGIANN Inventory Data
Upload sql_main.sql to your database
Start tgiann-inventory and use convertqb ( server/convert.lua ) on cmd/live console
If you want to automatically transfer your items file, use the convertitems command
OpenInventory Exports
In default QB, the export looks like this:
exports['qb-inventory']:OpenInventory(src, 'policetrash', {
maxweight = 4000000,
slots = 300,
})
You need to modify these exports as follows: Add the "stash"
value after the player's ID (src
, source
, etc.). Here's the updated example:
exports['tgiann-inventory']:OpenInventory(src, "stash", "policetrash", {
maxweight = 4000000,
slots = 300,
})
More Examples
-- Example 1
-- Old
exports['qb-inventory']:OpenInventory(src, stashName)
-- New
exports['tgiann-inventory']:OpenInventory(src, "stash", stashName)
-- Example 2
-- Old
exports['qb-inventory']:OpenInventory(src, currentEvidence, {
maxweight = 4000000,
slots = 500,
})
-- New
exports['tgiann-inventory']:OpenInventory(src, "stash", currentEvidence, {
maxweight = 4000000,
slots = 500,
})
More Info
Last updated