Don't break if job isn't found

This commit is contained in:
jimathy
2022-04-25 10:04:56 +01:00
committed by GitHub
parent 2e4fcff333
commit 8af82e6d13

View File

@@ -71,6 +71,7 @@ CreateThread(function()
end end
if Config.useATM or Config.useBanks then if Config.useATM or Config.useBanks then
for k, v in pairs(QBCore.Shared.Jobs) do ---Grabs the list of jobs for k, v in pairs(QBCore.Shared.Jobs) do ---Grabs the list of jobs
if QBCore.Shared.Jobs[tostring(k)] then
for l, b in pairs(QBCore.Shared.Jobs[tostring(k)].grades) do -- Grabs the list of grades 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 -- Checks the grade if is boss if QBCore.Shared.Jobs[tostring(k)].grades[l].isboss == true then -- Checks the grade if is boss
if bossroles[tostring(k)] ~= nil then -- checks if the line exists if bossroles[tostring(k)] ~= nil then -- checks if the line exists
@@ -80,7 +81,9 @@ CreateThread(function()
end end
end end
end end
end
for k, v in pairs(QBCore.Shared.Gangs) do for k, v in pairs(QBCore.Shared.Gangs) do
if QBCore.Shared.Gangs[tostring(k)] then
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
if QBCore.Shared.Gangs[tostring(k)].grades[l].isboss == true then if QBCore.Shared.Gangs[tostring(k)].grades[l].isboss == true then
@@ -93,6 +96,7 @@ CreateThread(function()
end end
end end
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, })
for k,v in pairs(Config.WallATMLocations) do for k,v in pairs(Config.WallATMLocations) do