diff --git a/resources/[housing]/brutal_housing/sv_utils.lua b/resources/[housing]/brutal_housing/sv_utils.lua index 4c03695f5..f095e4d62 100644 --- a/resources/[housing]/brutal_housing/sv_utils.lua +++ b/resources/[housing]/brutal_housing/sv_utils.lua @@ -83,6 +83,15 @@ end RegisterNetEvent("brutal_housing:qb-inventory:server:OpenInventory", function(job, data) local src = source - - exports['qb-inventory']:OpenInventory(src, job, data) + -- For stash inventories + if job == "stash" then + exports["tgiann-inventory"]:OpenInventory(src, "stash", data.id, { + maxWeight = data.weight or 10000, + slots = data.slots or 50, + label = data.label or "Housing Stash" + }) + -- For other inventory types + else + exports["tgiann-inventory"]:OpenInventory(src, job, data) + end end) \ No newline at end of file diff --git a/resources/[tools]/nordi_infopoint/server/main.lua b/resources/[tools]/nordi_infopoint/server/main.lua index cc72f0da1..b73b78aab 100644 --- a/resources/[tools]/nordi_infopoint/server/main.lua +++ b/resources/[tools]/nordi_infopoint/server/main.lua @@ -139,7 +139,9 @@ QBCore.Functions.CreateCallback('infopoint:getIncidents', function(source, cb) if not Player then return cb({}) end local job = Player.PlayerData.job.name - if Config.JobPermissions.jobSpecificInfo[job] and Config.JobPermissions.jobSpecificInfo[job].showIncidents then + if Config.JobPermissions and Config.JobPermissions.jobSpecificInfo and + Config.JobPermissions.jobSpecificInfo[job] and + Config.JobPermissions.jobSpecificInfo[job].showIncidents then MySQL.query('SELECT * FROM infopoint_incidents ORDER BY created_at DESC', {}, function(result) cb(result) end) @@ -180,10 +182,17 @@ QBCore.Functions.CreateCallback('infopoint:canManageLicenses', function(source, local job = Player.PlayerData.job.name local canManage = false - for _, allowedJob in pairs(Config.JobPermissions.canManageLicenses) do - if job == allowedJob then - canManage = true - break + -- Sicherheitsprüfung für Config + if Config and Config.JobPermissions and Config.JobPermissions.canManageLicenses then + if type(Config.JobPermissions.canManageLicenses) == 'table' then + for _, allowedJob in pairs(Config.JobPermissions.canManageLicenses) do + if job == allowedJob then + canManage = true + break + end + end + elseif type(Config.JobPermissions.canManageLicenses) == 'string' then + canManage = (job == Config.JobPermissions.canManageLicenses) end end @@ -199,10 +208,15 @@ RegisterNetEvent('infopoint:createEvent', function(eventData) local job = Player.PlayerData.job.name local canCreate = false - for _, allowedJob in pairs(Config.JobPermissions.canCreateEvents) do - if job == allowedJob then - canCreate = true - break + -- Sicherheitsprüfung für Config + if Config and Config.JobPermissions and Config.JobPermissions.canCreateEvents then + if type(Config.JobPermissions.canCreateEvents) == 'table' then + for _, allowedJob in pairs(Config.JobPermissions.canCreateEvents) do + if job == allowedJob then + canCreate = true + break + end + end end end @@ -264,10 +278,15 @@ RegisterNetEvent('infopoint:createJobOffer', function(jobData) local job = Player.PlayerData.job.name local canCreate = false - for _, allowedJob in pairs(Config.JobPermissions.canCreateEvents) do - if job == allowedJob then - canCreate = true - break + -- Sicherheitsprüfung für Config + if Config and Config.JobPermissions and Config.JobPermissions.canCreateEvents then + if type(Config.JobPermissions.canCreateEvents) == 'table' then + for _, allowedJob in pairs(Config.JobPermissions.canCreateEvents) do + if job == allowedJob then + canCreate = true + break + end + end end end @@ -300,10 +319,17 @@ RegisterNetEvent('infopoint:createLicenseInfo', function(licenseData) local job = Player.PlayerData.job.name local canManage = false - for _, allowedJob in pairs(Config.JobPermissions.canManageLicenses) do - if job == allowedJob then - canManage = true - break + -- Sicherheitsprüfung für Config + if Config and Config.JobPermissions and Config.JobPermissions.canManageLicenses then + if type(Config.JobPermissions.canManageLicenses) == 'table' then + for _, allowedJob in pairs(Config.JobPermissions.canManageLicenses) do + if job == allowedJob then + canManage = true + break + end + end + elseif type(Config.JobPermissions.canManageLicenses) == 'string' then + canManage = (job == Config.JobPermissions.canManageLicenses) end end @@ -336,10 +362,17 @@ RegisterNetEvent('infopoint:updateLicenseInfo', function(licenseId, licenseData) local job = Player.PlayerData.job.name local canManage = false - for _, allowedJob in pairs(Config.JobPermissions.canManageLicenses) do - if job == allowedJob then - canManage = true - break + -- Sicherheitsprüfung für Config + if Config and Config.JobPermissions and Config.JobPermissions.canManageLicenses then + if type(Config.JobPermissions.canManageLicenses) == 'table' then + for _, allowedJob in pairs(Config.JobPermissions.canManageLicenses) do + if job == allowedJob then + canManage = true + break + end + end + elseif type(Config.JobPermissions.canManageLicenses) == 'string' then + canManage = (job == Config.JobPermissions.canManageLicenses) end end @@ -375,10 +408,17 @@ RegisterNetEvent('infopoint:deleteLicenseInfo', function(licenseId) local job = Player.PlayerData.job.name local canManage = false - for _, allowedJob in pairs(Config.JobPermissions.canManageLicenses) do - if job == allowedJob then - canManage = true - break + -- Sicherheitsprüfung für Config + if Config and Config.JobPermissions and Config.JobPermissions.canManageLicenses then + if type(Config.JobPermissions.canManageLicenses) == 'table' then + for _, allowedJob in pairs(Config.JobPermissions.canManageLicenses) do + if job == allowedJob then + canManage = true + break + end + end + elseif type(Config.JobPermissions.canManageLicenses) == 'string' then + canManage = (job == Config.JobPermissions.canManageLicenses) end end