From 755cf22c53e12eae2a3edbd1135ddf074c08a0e6 Mon Sep 17 00:00:00 2001 From: Nordi98 Date: Sun, 29 Jun 2025 06:20:21 +0200 Subject: [PATCH] fix --- resources/[tools]/okokBanking/client.lua | 35 ++++++++++++++++-------- resources/[tools]/okokBanking/config.lua | 18 ++++++++++++ 2 files changed, 42 insertions(+), 11 deletions(-) diff --git a/resources/[tools]/okokBanking/client.lua b/resources/[tools]/okokBanking/client.lua index 5cea369c6..1b8e4dfe1 100644 --- a/resources/[tools]/okokBanking/client.lua +++ b/resources/[tools]/okokBanking/client.lua @@ -73,17 +73,30 @@ function openBank() QBCore.Functions.TriggerCallback("okokBanking:GetPlayerInfo", function(data) QBCore.Functions.TriggerCallback("okokBanking:GetOverviewTransactions", function(cb, identifier, allDays) for k,v in pairs(Config.Societies) do - if playerJobName == v then - if data.isBoss == true then - canAccessSociety = true - end - elseif playerGangName == v then - if data.isBossGang == true then - jobLabel = playerGangName - society = playerGangName - canAccessSociety = true - end - end +if playerJobName == v 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 + 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 +elseif playerGangName == v then + -- Similar logic for gangs if needed +end + end if canAccessSociety then diff --git a/resources/[tools]/okokBanking/config.lua b/resources/[tools]/okokBanking/config.lua index 9a123859d..c0473270b 100644 --- a/resources/[tools]/okokBanking/config.lua +++ b/resources/[tools]/okokBanking/config.lua @@ -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.BankLocations = { -- To get blips and colors check this: https://wiki.gtanet.work/index.php?title=Blips