ox_inventory
ox_inventory copied to clipboard
feat: non-persistent inventory
I had a use case where I needed the inventory to be "session based" and not save anything to the database. (eg. pvp sessions with items, loot, etc...). I don't know if this makes any sense for you but it's been useful for me so I'm sharing.
I also added the option to set framework to 'none' in case a bridge is not needed.
This is how I'm initialising the inventory on my end:
RegisterNetEvent('someServerEventHandler', function()
local Inventory = exports['ox_inventory']
local license2 = GetPlayerIdentifierByType(source, 'license2'):gsub('license2:', '')
local name = GetPlayerName(source)
Inventory:setPlayerInventory({
source = source,
identifier = license2,
name = name,
--groups: {}
});
end)