forked from Simnation/Main
ed
This commit is contained in:
parent
31ae223a2a
commit
ee110f2a06
2 changed files with 76 additions and 27 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue