1
0
Fork 0
forked from Simnation/Main
This commit is contained in:
Nordi98 2025-06-29 06:20:21 +02:00
parent c844ee6915
commit 755cf22c53
2 changed files with 42 additions and 11 deletions

View file

@ -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