# Installation

## 🪜 **First steps** <a href="#first-steps" id="first-steps"></a>

1. Install the latest stable version of [MariaDB](https://mariadb.org/download/?t=mariadb\&p=mariadb\&r=10.9.8\&os=windows\&cpu=x86_64\&pkg=msi\&m=one).
2. Add all dependencies listed below and follow their installation instructions.
3. Add and start the script :)

## **🔴 Dependencies**

* [ox\_lib](https://github.com/overextended/ox_lib) Follow their [installation](https://overextended.dev/ox_lib) instructions.
* [oxmysql](https://github.com/overextended/oxmysql) Follow their [installation](https://overextended.dev/oxmysql) instructions.

## **🖼️ Frameworks** <a href="#frameworks" id="frameworks"></a>

Our script is compatible with **QBCore**, **QBox**, **ESX**, **Standalone**(*custom framework or no-framework*). **You don't need to do anything additional. The script will auto-detect it!**

### **⚠️ Standalone** <a href="#standalone" id="standalone"></a>

{% hint style="danger" %}
If you are using a custom framework/no-framework, **YOU** need to implement some of the core functions to adjust it to your specifics.

Locate `/client/custom/frameworks/standalone.lua` and `/server/custom/frameworks/standalone.lua` and implement the functions(you can refer to `qb.lua` or qbox`.lua`).

**NOTE: We provide limited or no support for custom frameworks.**
{% endhint %}

## 🏢 Society Accounts

#### Initializing Society (Business) Accounts

Upon the first initialization of the script, you must create society (business) accounts for roles such as **Police**, **Mechanic**, etc., in the banking table. This can be done effortlessly through the banking system's user interface (UI), provided you have administrative permissions.

**Steps to Create Society Accounts:**

1. Ensure you have **admin permissions** enabled for your account.
2. Open the **Banking** interface.
3. Navigate to the sidebar and locate the tab labeled **Admin Actions**.
4. Select **Admin Actions** to access the society creation tools.
5. Create a new society by providing the following details:
   * **Display Name**: The public-facing name of the society (e.g., "LS Customs").
   * **Society Name**: The internal name of the society, which must match the job name in your system (e.g., "mechanic" for mechanics, "police" for law enforcement).

**Important Notes:**

* Ensure that the **Society Name** matches the job name configured in your system to avoid inconsistencies.
* Double-check that all required society accounts are created during this step to ensure seamless integration with the banking functionality.

Completing these steps ensures that all essential society accounts are correctly set up and ready to use.

## **📦 Inventory** <a href="#frameworks" id="frameworks"></a>

Inventory is necessary to utilize the ***Debit Card Items*** feature. Initially, support is available for:

* **ox\_inventory (Recommended)**
* qb-inventory
* lj-inventory
* ps-inventory

### 💳 Card Items

{% tabs %}
{% tab title="ox\_inventory" %}

```lua
['debitcard_personal'] = {
    label = 'Personal Debit Card',
    stack = false,
    weight = 10,
    consume = 0,
    client = {
        export = "tgg-banking.UseCardOnAtm"
    }
},
['debitcard_shared'] = {
    label = 'Shared Debit Card',
    stack = false,
    weight = 10,
    consume = 0,
    client = {
        export = "tgg-banking.UseCardOnAtm"
    }
},
['debitcard_business'] = {
    label = 'Business Debit Card',
    stack = false,
    weight = 10,
    consume = 0,
    client = {
        export = "tgg-banking.UseCardOnAtm"
    }
},
```

{% endtab %}

{% tab title="qb-inventory" %}

```lua
['debitcard_personal'] = { ['name'] = 'debitcard_personal', ['label'] = 'Personal Card', ['weight'] = 300, ['type'] = 'item', ['image'] = 'debitcard_personal.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Access funds at local ATMs.' },

['debitcard_shared'] = { ['name'] = 'debitcard_shared', ['label'] = 'Shared Card', ['weight'] = 300, ['type'] = 'item', ['image'] = 'debitcard_shared.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Access funds at local ATMs.' },

['debitcard_business'] = { ['name'] = 'debitcard_business', ['label'] = 'Business Card', ['weight'] = 300, ['type'] = 'item', ['image'] = 'debitcard_business.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Access funds at local ATMs.' },
```

{% endtab %}
{% endtabs %}

## **🎯 Interaction** <a href="#frameworks" id="frameworks"></a>

An interaction script is required to access banking functionalities. Initially, support is available for:

* **ox\_target (Recommended)**
* qb-target
* sleepless\_interact
* interact
* drawtext

{% hint style="info" %}
You're not limited to the listed Frameworks, Inventories, and Interactions. All third-party files are open for modification, allowing you to edit and adjust them to suit your server's needs.
{% endhint %}

## ⚙️ Transaction and Balance Limits

You can enforce built-in limits using `config/config.account.lua`.

By default, limits are disabled.

```lua
Config.Limits = {
    Enabled = true, -- set false to disable all checks

    Deposit = {
        MaxAmountPerTransaction = 25000, -- nil = disabled
    },

    Withdraw = {
        MaxAmountPerTransaction = 25000, -- nil = disabled
    },

    Transfer = {
        MaxAmountPerTransaction = 50000, -- nil = disabled
    },

    AccountMaxBalanceByType = {
        personal = 150000, -- nil = disabled
        shared = nil,
        business = nil,
        savings = nil,
    },

    OwnerMaxTotalBalance = nil -- total across all owned accounts, nil = disabled
}
```

### What is enforced

* Per-transaction limits for deposit, withdraw, and transfer.
* Max resulting balance for incoming funds per account type.
* Optional total owner cap across all owned accounts.

### Notes

* ATM deposit/withdraw also follows these checks.
* Export transfer (`exports['tgg-banking']:Transfer`) also follows these checks.
* If a limit blocks the action, the player receives a localized error message.

## 🪝 Using hooks for custom policies

If you need advanced rules (for example job-specific logic, blacklist checks, external anti-cheat checks), use [Hooks](https://docs.teamsgg.dev/paid-scripts/banking/hooks).
