HSC

Snippet Dashboard

Version: 1.0.8

Integrations

Using CoreM Banking with JG Mechanic

JG-MechanicCoreMBankingJG-Scripts

Framework

QBCore

Updated

5/15/2026

Author

HSC

Overview

Adding CoreM-Banking to JG-Mechanic, a simple task and easy to use.

Folder/Files we will edit

The file we are editing is located in framework/sv-functions and in the config.lua

What to edit

1

In you config.lua go to line 11 [Config.SocietyBanking] add in corem_banking.

2

Head over to your framework folder then sv-fuctions.lua

3

Locate the Society Funds section and replace it with Snippet below

Requirements

corem_banking installed
JG-Mechanic V1.7.1 or higher
VSC [Visual Studio Code] to well...edit the code XD

Notes

No notes added yet.

F.A.Q

Q: This isnt working!
A: You likely added it in the wrong location.
Q: What lines are these on?
A: For this snippet ASSUMING you have no other edits, 446-574

--socity funds

sv-functions.lua

lua
-- 
-- Society Funds
-- 

local usingNewQBBanking = GetResourceState("qb-banking") == "started" and tonumber(string.sub(GetResourceMetadata("qb-banking", "version", 0), 1, 3)) >= 2

---@param society string
---@param societyType "job"|"gang"
---@return number balance
---@async
function Framework.Server.GetSocietyBalance(society, societyType)
  if Config.SocietyBanking == "okokBanking" then
    return exports["okokBanking"]:GetAccount(society)
  elseif Config.SocietyBanking == "fd_banking" then
    return exports.fd_banking:GetAccount(society)
  elseif Config.SocietyBanking == "tgg-banking" then
    return exports["tgg-banking"]:GetSocietyAccountMoney(society)
  elseif Config.SocietyBanking == "wasabi_banking" then
    return exports["wasabi_banking"]:GetAccountBalance(society, "society")
  elseif Config.SocietyBanking == "crm-banking" then
    return exports["crm-banking"]:getSocietyMoney(society) or 0
  elseif Config.SocietyBanking == "snipe-banking" then
    return exports["snipe-banking"]:GetAccountBalance(society)
  elseif (Config.Framework == "Qbox" and Config.SocietyBanking == "auto") or Config.SocietyBanking == "Renewed-Banking" then
    return exports["Renewed-Banking"]:getAccountMoney(society)
  elseif (Config.Framework == "QBCore" and Config.SocietyBanking == "auto") or Config.SocietyBanking == "qb-banking" or Config.SocietyBanking == "qb-management" then
    if Config.SocietyBanking == "qb-banking" or usingNewQBBanking then
      return exports["qb-banking"]:GetAccountBalance(society)
    else
      if societyType == "job" then
        return exports["qb-management"]:GetAccount(society)
      elseif societyType == "gang" then
        return exports["qb-management"]:GetGangAccount(society)
      end
    end
  elseif (Config.Framework == "ESX" and Config.SocietyBanking == "auto") or Config.SocietyBanking == "esx_addonaccount" then
    local balance = promise.new()

    TriggerEvent("esx_society:getSociety", society, function(data)
      if not data then return balance:resolve(0) end

      TriggerEvent("esx_addonaccount:getSharedAccount", data.account, function(account)
        return balance:resolve(account.money)
      end)
    end)

    return Citizen.Await(balance)
  end

  return 0
end

lib.callback.register("jg-mechanic:server:get-society-balance", function(_, society, type)
  return Framework.Server.GetSocietyBalance(society, type)
end)

---@param societyName string
---@param societyType "job"|"gang"
---@param amount number
function Framework.Server.PayIntoSocietyFund(societyName, societyType, amount)
  if Config.SocietyBanking == "okokBanking" then
    exports["okokBanking"]:AddMoney(societyName, amount)
  elseif Config.SocietyBanking == "fd_banking" then
    exports.fd_banking:AddMoney(societyName, amount)
  elseif Config.SocietyBanking == "tgg-banking" then
    exports["tgg-banking"]:AddSocietyMoney(societyName, amount)
  elseif Config.SocietyBanking == "wasabi_banking" then
    exports["wasabi_banking"]:AddMoney("society", societyName, amount)
  elseif Config.SocietyBanking == "crm-banking" then
    exports["crm-banking"]:addSocietyMoney(societyName, amount)
  elseif Config.SocietyBanking == "snipe-banking" then
    return exports["snipe-banking"]:AddMoneyToAccount(societyName, amount)
  elseif (Config.Framework == "Qbox" and Config.SocietyBanking == "auto") or Config.SocietyBanking == "Renewed-Banking" then
    exports["Renewed-Banking"]:addAccountMoney(societyName, amount)
  elseif (Config.Framework == "QBCore" and Config.SocietyBanking == "auto") or Config.SocietyBanking == "qb-banking" or Config.SocietyBanking == "qb-management" then
    if Config.SocietyBanking == "qb-banking" or usingNewQBBanking then
      exports["qb-banking"]:AddMoney(societyName, amount)
    else
      if societyType == "job" then
        exports["qb-management"]:AddMoney(societyName, amount)
      elseif societyType == "gang" then
        exports["qb-management"]:AddGangMoney(societyName, amount)
      end
    end
  elseif (Config.Framework == "ESX" and Config.SocietyBanking == "auto") or Config.SocietyBanking == "esx_addonaccount" then
    TriggerEvent("esx_society:getSociety", societyName, function(society)
      TriggerEvent("esx_addonaccount:getSharedAccount", society.account, function(account)
        account.addMoney(amount)
      end)
    end)
  end
end

---@param societyName string
---@param societyType "job"|"gang"
---@param amount number
function Framework.Server.RemoveFromSocietyFund(societyName, societyType, amount)
  if Config.SocietyBanking == "okokBanking" then
    exports["okokBanking"]:RemoveMoney(societyName, amount)
  elseif Config.SocietyBanking == "fd_banking" then
    exports.fd_banking:RemoveMoney(societyName, amount)
  elseif Config.SocietyBanking == "tgg-banking" then
    exports["tgg-banking"]:RemoveSocietyMoney(societyName, amount)
  elseif Config.SocietyBanking == "wasabi_banking" then
    exports["wasabi_banking"]:RemoveMoney("society", societyName, amount)
  elseif Config.SocietyBanking == "crm-banking" then
    exports["crm-banking"]:removeSocietyMoney(societyName, amount)
  elseif Config.SocietyBanking == "snipe-banking" then
    return exports["snipe-banking"]:RemoveMoneyFromAccount(societyName, amount)
  elseif (Config.Framework == "Qbox" and Config.SocietyBanking == "auto") or Config.SocietyBanking == "Renewed-Banking" then
    exports["Renewed-Banking"]:removeAccountMoney(societyName, amount)
  elseif (Config.Framework == "QBCore" and Config.SocietyBanking == "auto") or Config.SocietyBanking == "qb-banking" or Config.SocietyBanking == "qb-management" then
    if Config.SocietyBanking == "qb-banking" or usingNewQBBanking then
      exports["qb-banking"]:RemoveMoney(societyName, amount)
    else
      if societyType == "job" then
        exports["qb-management"]:RemoveMoney(societyName, amount)
      elseif societyType == "gang" then
        exports["qb-management"]:RemoveGangMoney(societyName, amount)
      end
    end
  elseif (Config.Framework == "ESX" and Config.SocietyBanking == "auto") or Config.SocietyBanking == "esx_addonaccount" then
    TriggerEvent("esx_society:getSociety", societyName, function(society)
      TriggerEvent("esx_addonaccount:getSharedAccount", society.account, function(account)
        account.removeMoney(amount)
      end)
    end)
  end
end