Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --
- -- Society
- --
- local usingNewQBBanking = GetResourceState("qb-banking") == "started" and tonumber(string.sub(GetResourceMetadata("qb-banking", "version"), 1, 3)) >= 2
- local usingokokBanking = GetResourceState("okokBanking") == "started" -- added support for okokBanking
- function Framework.Server.RemoveFromSocietyFund(societyName, type, amount)
- if Config.Framework == "QBCore" then
- if usingokokBanking then -- added support for okokBanking
- exports['okokBanking']:RemoveMoney(societyName, amount) -- added support for okokBanking
- elseif usingNewQBBanking then -- changed
- exports['qb-banking']:RemoveMoney(societyName, amount)
- else
- if type == "job" then
- exports['qb-management']:RemoveMoney(societyName, amount)
- elseif type == "gang" then
- exports['qb-management']:RemoveGangMoney(societyName, amount)
- end
- end
- elseif Config.Framework == "ESX" then
- if type == "cash" then type = "money" end
- TriggerEvent('esx_society:getSociety', societyName, function(society)
- TriggerEvent('esx_addonaccount:getSharedAccount', society.account, function(account)
- account.removeMoney(amount)
- end)
- end)
- end
- end
- Framework.Server.CreateCallback("jg-dealerships:server:get-society-balance", function(src, cb, society, type)
- if Config.Framework == "QBCore" then
- if usingokokBanking then -- added support for okokBanking
- cb(exports['okokBanking']:GetAccount(society)) -- added support for okokBanking
- elseif usingNewQBBanking then -- changed
- cb(exports['qb-banking']:GetAccountBalance(society))
- else
- if type == "job" then
- cb(exports['qb-management']:GetAccount(society))
- elseif type == "gang" then
- cb(exports['qb-management']:GetGangAccount(society))
- end
- end
- elseif Config.Framework == "ESX" then
- if type == "cash" then type = "money" end
- TriggerEvent('esx_society:getSociety', society, function(data)
- if not data then return cb(0) end
- TriggerEvent('esx_addonaccount:getSharedAccount', data.account, function(account)
- cb(account.money)
- end)
- end)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement