forked from Simnation/Main
Update sv_utils.lua
This commit is contained in:
parent
ee110f2a06
commit
dced44a739
1 changed files with 20 additions and 3 deletions
|
@ -83,15 +83,32 @@ end
|
||||||
|
|
||||||
RegisterNetEvent("brutal_housing:qb-inventory:server:OpenInventory", function(job, data)
|
RegisterNetEvent("brutal_housing:qb-inventory:server:OpenInventory", function(job, data)
|
||||||
local src = source
|
local src = source
|
||||||
|
|
||||||
-- For stash inventories
|
-- For stash inventories
|
||||||
if job == "stash" then
|
if job == "stash" then
|
||||||
exports["tgiann-inventory"]:OpenInventory(src, "stash", data.id, {
|
-- Make sure invId is a string
|
||||||
|
local stashId = tostring(data.id or "housing_" .. src)
|
||||||
|
|
||||||
|
exports["tgiann-inventory"]:OpenInventory(src, "stash", stashId, {
|
||||||
maxWeight = data.weight or 10000,
|
maxWeight = data.weight or 10000,
|
||||||
slots = data.slots or 50,
|
slots = data.slots or 50,
|
||||||
label = data.label or "Housing Stash"
|
label = data.label or "Housing Stash"
|
||||||
})
|
})
|
||||||
|
-- For trunk inventories
|
||||||
|
elseif job == "trunk" then
|
||||||
|
-- Make sure plate is a string
|
||||||
|
local plate = tostring(data)
|
||||||
|
|
||||||
|
exports["tgiann-inventory"]:OpenInventory(src, "trunk", plate)
|
||||||
|
-- For glovebox inventories
|
||||||
|
elseif job == "glovebox" then
|
||||||
|
-- Make sure plate is a string
|
||||||
|
local plate = tostring(data)
|
||||||
|
|
||||||
|
exports["tgiann-inventory"]:OpenInventory(src, "glovebox", plate)
|
||||||
-- For other inventory types
|
-- For other inventory types
|
||||||
else
|
else
|
||||||
exports["tgiann-inventory"]:OpenInventory(src, job, data)
|
-- Log error for unsupported inventory types
|
||||||
|
print("Unsupported inventory type: " .. job)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue