forked from Simnation/Main
fix
This commit is contained in:
parent
c844ee6915
commit
755cf22c53
2 changed files with 42 additions and 11 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue