diff --git a/resources/[housing]/brutal_housing/sv_utils.lua b/resources/[housing]/brutal_housing/sv_utils.lua index f095e4d62..62021bb59 100644 --- a/resources/[housing]/brutal_housing/sv_utils.lua +++ b/resources/[housing]/brutal_housing/sv_utils.lua @@ -83,15 +83,32 @@ end RegisterNetEvent("brutal_housing:qb-inventory:server:OpenInventory", function(job, data) local src = source + -- For stash inventories 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, slots = data.slots or 50, 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 else - exports["tgiann-inventory"]:OpenInventory(src, job, data) + -- Log error for unsupported inventory types + print("Unsupported inventory type: " .. job) end -end) \ No newline at end of file +end)