forked from Simnation/Main
fix
This commit is contained in:
parent
c844ee6915
commit
755cf22c53
2 changed files with 42 additions and 11 deletions
|
@ -74,16 +74,29 @@ function openBank()
|
||||||
QBCore.Functions.TriggerCallback("okokBanking:GetOverviewTransactions", function(cb, identifier, allDays)
|
QBCore.Functions.TriggerCallback("okokBanking:GetOverviewTransactions", function(cb, identifier, allDays)
|
||||||
for k,v in pairs(Config.Societies) do
|
for k,v in pairs(Config.Societies) do
|
||||||
if playerJobName == v then
|
if playerJobName == v then
|
||||||
if data.isBoss == true then
|
-- Get all job grades for this job
|
||||||
|
local jobGrades = QBCore.Shared.Jobs[playerJobName].grades
|
||||||
|
local highestRank = -1
|
||||||
|
|
||||||
|
-- Find the highest rank number
|
||||||
|
for grade, _ in pairs(jobGrades) do
|
||||||
|
local gradeNum = tonumber(grade)
|
||||||
|
if gradeNum and gradeNum > highestRank then
|
||||||
|
highestRank = gradeNum
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Check if player has the highest rank
|
||||||
|
if playeJob.grade.level == highestRank then
|
||||||
canAccessSociety = true
|
canAccessSociety = true
|
||||||
|
print("Boss access granted for " .. playerJobName .. " with highest rank " .. highestRank)
|
||||||
|
else
|
||||||
|
print("Not highest rank for " .. playerJobName .. ", current rank: " .. playeJob.grade.level .. ", highest: " .. highestRank)
|
||||||
end
|
end
|
||||||
elseif playerGangName == v then
|
elseif playerGangName == v then
|
||||||
if data.isBossGang == true then
|
-- Similar logic for gangs if needed
|
||||||
jobLabel = playerGangName
|
|
||||||
society = playerGangName
|
|
||||||
canAccessSociety = true
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if canAccessSociety then
|
if canAccessSociety then
|
||||||
|
|
|
@ -57,6 +57,24 @@ Config.Societies = { -- Which societies have bank accounts
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- Add this new section below the Societies section
|
||||||
|
Config.JobBossRanks = {
|
||||||
|
["police"] = {
|
||||||
|
maxRank = true, -- Automatically use the highest rank
|
||||||
|
specificRanks = {7, 8, 9} -- Or specify exact ranks that have boss access
|
||||||
|
},
|
||||||
|
["ambulance"] = {
|
||||||
|
maxRank = true,
|
||||||
|
specificRanks = {}
|
||||||
|
},
|
||||||
|
["cinema"] = {
|
||||||
|
maxRank = true, -- Will automatically detect the highest rank
|
||||||
|
specificRanks = {} -- Or you can specify ranks like {3, 4} if needed
|
||||||
|
},
|
||||||
|
-- Add other jobs as needed
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Config.ShowBankBlips = true -- True = show bank blips on the map | false = don't show blips
|
Config.ShowBankBlips = true -- True = show bank blips on the map | false = don't show blips
|
||||||
|
|
||||||
Config.BankLocations = { -- To get blips and colors check this: https://wiki.gtanet.work/index.php?title=Blips
|
Config.BankLocations = { -- To get blips and colors check this: https://wiki.gtanet.work/index.php?title=Blips
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue