T1GER Scripts Documentation
Tebex StoreDiscordYouTubeCFX Forum
  • T1GER Scripts Documentation
  • Quick Links
    • t1ger.net | Shop Now
    • Join Discord
  • Information
    • FiveM Asset Escrow
  • Resources
    • T1GER Mechanic
      • Installation
        • Job Account
          • Setup
          • API
      • Configuration
        • Shop
      • API
        • Exports
        • Events
      • Troubleshoot
    • T1GER Library
      • Installation
        • Inventory
        • Target
        • Garage
        • Society Account
        • Vehicle Properties
      • Configuration
    • T1GER Gang System
      • Installation
      • Gang Garages
      • Product Information
    • T1GER Tuning System
      • Installation
      • API
        • Client
        • Server
      • Troubleshoot
        • Common Issues
        • Error Codes
      • Guides
        • Commands
        • Shops
        • Markers
        • Mod Stations
        • Pricing
        • Mod Orders
        • Vehicle Mods
        • Engine Swaps
        • Nitrous
    • T1GER ATM Robbery
      • Installation
      • API
        • Client
        • Server
      • Troubleshoot
        • Common Issues
        • Error Codes
      • Guides
        • Hacking Minigame
        • Dispatch
    • T1GER Dealerships
  • Free Resources
    • T1GER Keys
    • T1GER Garage
    • T1GER Bank Robbery
    • T1GER Tow Trucker
Powered by GitBook
On this page
  • ESX
  • QBCore
  • qb-banking
  • qb-management
  • Qbox
  1. Resources
  2. T1GER Mechanic
  3. Installation
  4. Job Account

Setup

Instructions on how to setup your job/society integrations with your framework to create shared accounts for jobs in runtime!

PreviousJob AccountNextAPI

Last updated 2 months ago

ESX

Download and ensure the latest esx_addonaccount from here: .

QBCore

Instructions on how to setup job/society accounts with QBCore framework compatibility.

qb-banking

If you are using qb-banking, all you need to do is download and ensure the latest version of qb-banking from here: .

qb-management

If you are using qb-management (old method), then follow these instructions.

Latest qb-management does not manage job/society accounts. This is now handled by qb-banking. If you are using old qb-management, it's highly recommended to update to latest and utilize qb-banking instead.

1

Find the file to modify

Navigate to qb-management/server/sv_boss.lua.

2

Check for functions

Do Ctrl + F (search) for GetAccount or AddMoney or RemoveMoney. If they do not exist, then do not proceed further! Instead, ensure that you have latest installed, as this resource now handles job/society accounts.

3

Insert new function

Scroll down all the way to the bottom and insert the following code:

--- Creates a management account for a job in qb-management.
---@param job_name string The name of the job to create the management account for.
---@param amount number|nil The initial balance of the account (defaults to 0 if not provided).
---@return boolean success Returns `true` if the account was created successfully, `false` otherwise.
function CreateManagementAccount(job_name, amount)
    -- Ensure a valid job name is provided
    if type(job_name) ~= "string" or job_name == "" then
        error("Invalid job_name provided")
    end

    amount = amount or 0 -- Default to 0 if no amount is provided

    -- Check if account already exists in cache
    if Accounts[job_name] then
        return Accounts[job_name] -- Account already exists, no need to create it again
    end

    -- Insert the new account into the database
    local insertSuccess = MySQL.insert.await('INSERT INTO management_funds (job_name, amount, type) VALUES (@job_name, @amount, @type)', {
        ['@job_name'] = job_name,
        ['@amount'] = amount,
        ['@type'] = 'boss'
    })

    if not insertSuccess then
        error("Database error: Failed to insert management account")
    end

    -- Store in local cache
    Accounts[job_name] = amount

    return Accounts[job_name]
end
exports("CreateManagementAccount", CreateManagementAccount)
4

Complete

Restart your server and you'll now be able to create management account in runtime!

Qbox

Download and ensure the latest version of Renewed-Banking from here: .

If you are using another banking/management for job/shared accounts, then refer to API for custom integrations on your own.

If using qb-management (old version) with backwards compatibility, then see qb-management.

https://github.com/esx-framework/esx_addonaccount
https://github.com/qbcore-framework/qb-banking
qb-banking
https://github.com/Renewed-Scripts/Renewed-Banking/releases