From 51d9f2d06ed101fc4645e2cc9354e4aeb6c1b497 Mon Sep 17 00:00:00 2001 From: Nordi98 Date: Sun, 29 Jun 2025 07:15:36 +0200 Subject: [PATCH] fix --- resources/[tools]/okokBanking/config.lua | 4 ++-- resources/[tools]/okokBanking/server.lua | 17 +++++++++++------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/resources/[tools]/okokBanking/config.lua b/resources/[tools]/okokBanking/config.lua index f4109054a..148cb4a13 100644 --- a/resources/[tools]/okokBanking/config.lua +++ b/resources/[tools]/okokBanking/config.lua @@ -70,8 +70,8 @@ Config.JobBossRanks = { specificRanks = {} }, ["cinema"] = { - maxRank = false, -- Will automatically detect the highest rank - specificRanks = {0,1} -- Or you can specify ranks like {3, 4} if needed + maxRank = true, -- Will automatically detect the highest rank + specificRanks = {1} -- Or you can specify ranks like {3, 4} if needed }, ["kayas"] = { maxRank = true, diff --git a/resources/[tools]/okokBanking/server.lua b/resources/[tools]/okokBanking/server.lua index d8da2f7f5..49b71e18f 100644 --- a/resources/[tools]/okokBanking/server.lua +++ b/resources/[tools]/okokBanking/server.lua @@ -565,12 +565,16 @@ AddEventHandler("okokBanking:DepositMoneyToSociety", function(amount, society, s end if amount <= playerMoney and not Config.UseCashAsItem or amount <= playerMoneyCash and Config.UseCashAsItem then - if Config.UseQBManagement or Config.UseQBBanking then - if Config.UseQBBanking then - exports['qb-banking']:AddMoney(society, amount) - else - exports['qb-management']:AddMoney(society, amount) - end + if Config.UseQBManagement then + exports['qb-management']:AddMoney(society, amount) + elseif Config.UseQBBanking then + -- Direct database update for qb-banking since export isn't available + MySQL.query('UPDATE bank_accounts SET account_balance = account_balance + @amount WHERE account_name = @society', { + ['@amount'] = amount, + ['@society'] = society, + }, function(changed) + print("Updated bank account for " .. society .. " with amount " .. amount) + end) else MySQL.query('UPDATE okokbanking_societies SET value = value + @value WHERE society = @society AND society_name = @society_name', { ['@value'] = amount, @@ -612,6 +616,7 @@ AddEventHandler("okokBanking:DepositMoneyToSociety", function(amount, society, s end end) + RegisterServerEvent("okokBanking:WithdrawMoneyToSociety") AddEventHandler("okokBanking:WithdrawMoneyToSociety", function(amount, society, societyName, societyMoney) local _source = source