inventory
Go to qb-inventory > server > functions.lua
At the very bottom add the following.
function ClearStash(stashID)
if not Inventories[stashID] then return end
Inventories[stashID].items = {}
MySQL.prepare('INSERT INTO inventories (identifier, items) VALUES (?, ?) ON DUPLICATE KEY UPDATE items = ?', { stashID, json.encode(Inventories[stashID].items), json.encode(Inventories[stashID].items) })
end
exports('ClearStash', ClearStash)
function GetStashItems(stashID)
return Inventories[stashID] and Inventories[stashID].items or {}
end
exports('GetStashItems', GetStashItems)
Create item in qb-core > shared> items.lua
sn_tablet = { name = 'sn_tablet', label = 'Tablet', weight = 2000, type = 'item', image = 'tablet.png', unique = true, useable = true, shouldClose = true, description = 'Useful tablet' },
Create item in qb-core > shared> items.lua
sn_tablet = { name = 'sn_tablet', label = 'Tablet', weight = 2000, type = 'item', image = 'tablet.png', unique = true, useable = true, shouldClose = true, description = 'Useful tablet' },
Create item in ox_inventory > data > items.lua
["sn_tablet"] = {
label = "Tablet",
weight = 2000,
stack = false,
close = true,
description = "just a tablet...",
},
Last updated