Fix for everyone being able to access boss account

This commit is contained in:
jimathy
2022-03-17 10:43:04 +00:00
committed by GitHub
parent 0065af7c9d
commit 48003e09a6

View File

@@ -136,20 +136,24 @@ AddEventHandler('onResourceStart', function(resource) if GetCurrentResourceName(
RegisterNetEvent('QBCore:Client:OnPlayerLoaded', function() createBlips() end) RegisterNetEvent('QBCore:Client:OnPlayerLoaded', function() createBlips() end)
local bossroles = {}
local gangroles = {}
Citizen.CreateThread(function() Citizen.CreateThread(function()
if Config.useATM or Config.useBanks then if Config.useATM or Config.useBanks then
local bossroles = {} while bossroles == nil do
for k, v in pairs(QBCore.Shared.Jobs) do for k, v in pairs(QBCore.Shared.Jobs) do ---Grabs the list of jobs
for l, b in pairs(QBCore.Shared.Jobs[tostring(k)].grades) do for l, b in pairs(QBCore.Shared.Jobs[tostring(k)].grades) do -- Grabs the list of grades
if QBCore.Shared.Jobs[tostring(k)].grades[l].isboss == true then if QBCore.Shared.Jobs[tostring(k)].grades[l].isboss == true then -- Checks the grade if is boss
if bossroles[tostring(k)] ~= nil then if bossroles[tostring(k)] ~= nil then -- checks if the line exists
if bossroles[tostring(k)] > tonumber(l) then bossroles[tostring(k)] = tonumber(l) end if bossroles[tostring(k)] > tonumber(l) then bossroles[tostring(k)] = tonumber(l) end -- the
else bossroles[tostring(k)] = tonumber(l) else bossroles[tostring(k)] = tonumber(l)
end end
end end
end end
end end
local gangroles = {} Wait(100)
end
while gangroles == nil do
for k, v in pairs(QBCore.Shared.Gangs) do for k, v in pairs(QBCore.Shared.Gangs) do
for l, b in pairs(QBCore.Shared.Gangs[tostring(k)].grades) do for l, b in pairs(QBCore.Shared.Gangs[tostring(k)].grades) do
if tostring(k) ~= "none" then if tostring(k) ~= "none" then
@@ -159,10 +163,11 @@ Citizen.CreateThread(function()
else gangroles[tostring(k)] = tonumber(l) else gangroles[tostring(k)] = tonumber(l)
end end
end end
end end
end end
end end
Wait(100)
end
end end
if Config.useATM then if Config.useATM then
exports['qb-target']:AddTargetModel(Config.ATMModels, { options = { { event = "jim-payments:Client:ATM:use", icon = "fas fa-money-check-alt", label = "Use ATM", id = "atm" },}, distance = 1.5, }) exports['qb-target']:AddTargetModel(Config.ATMModels, { options = { { event = "jim-payments:Client:ATM:use", icon = "fas fa-money-check-alt", label = "Use ATM", id = "atm" },}, distance = 1.5, })