1
0
Fork 0
forked from Simnation/Main
This commit is contained in:
Nordi98 2025-08-10 19:55:34 +02:00
parent 31ae223a2a
commit ee110f2a06
2 changed files with 76 additions and 27 deletions

View file

@ -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)

View file

@ -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,12 +182,19 @@ QBCore.Functions.CreateCallback('infopoint:canManageLicenses', function(source,
local job = Player.PlayerData.job.name
local canManage = false
-- 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
cb(canManage)
end)
@ -199,12 +208,17 @@ RegisterNetEvent('infopoint:createEvent', function(eventData)
local job = Player.PlayerData.job.name
local canCreate = false
-- 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
if not canCreate then
TriggerClientEvent('QBCore:Notify', src, 'Du hast keine Berechtigung Events zu erstellen!', 'error')
@ -264,12 +278,17 @@ RegisterNetEvent('infopoint:createJobOffer', function(jobData)
local job = Player.PlayerData.job.name
local canCreate = false
-- 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
if not canCreate then
TriggerClientEvent('QBCore:Notify', src, 'Du hast keine Berechtigung Job-Angebote zu erstellen!', 'error')
@ -300,12 +319,19 @@ RegisterNetEvent('infopoint:createLicenseInfo', function(licenseData)
local job = Player.PlayerData.job.name
local canManage = false
-- 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
if not canManage then
TriggerClientEvent('QBCore:Notify', src, 'Du hast keine Berechtigung Lizenz-Informationen zu verwalten!', 'error')
@ -336,12 +362,19 @@ RegisterNetEvent('infopoint:updateLicenseInfo', function(licenseId, licenseData)
local job = Player.PlayerData.job.name
local canManage = false
-- 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
if not canManage then
TriggerClientEvent('QBCore:Notify', src, 'Du hast keine Berechtigung Lizenz-Informationen zu verwalten!', 'error')
@ -375,12 +408,19 @@ RegisterNetEvent('infopoint:deleteLicenseInfo', function(licenseId)
local job = Player.PlayerData.job.name
local canManage = false
-- 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
if not canManage then
TriggerClientEvent('QBCore:Notify', src, 'Du hast keine Berechtigung Lizenz-Informationen zu verwalten!', 'error')