> For the complete documentation index, see [llms.txt](https://zat-scripts.gitbook.io/zat-scripts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zat-scripts.gitbook.io/zat-scripts/esx/banking/installation.md).

# Installation

### Dependencies

* [`es_extended`](https://github.com/esx-framework/esx_core) — latest version (ESX Legacy)
* [`oxmysql`](https://github.com/overextended/oxmysql)

{% hint style="success" %}
No core file needs editing — bank money stays in sync automatically. See Framework Sync for how it works.
{% endhint %}

### 1. Install

1. Extract the archive into your `resources` folder.
2. Add `ensure zat-banking` **after** `es_extended` in `server.cfg`.
3. That's it for the database — every table `zat-banking` needs is created automatically the first time it starts (`CREATE TABLE IF NOT EXISTS`). There's no `.sql` file to run by hand.

### 2. Add the bank card item

Add the item's image (`bank_card.png` — not included in the resource, use your own) to your inventory addon's images folder, then register the item itself depending on which inventory you run:

{% tabs %}
{% tab title="ESX default inventory" %}
Add the item through your normal ESX item process (`ox_inventory`'s legacy item table, `esx_inventoryhud`, or however your server adds items to the `items` table) with the name `bank_card`, `usable` set to true.
{% endtab %}

{% tab title="ox\_inventory" %}
Add to `ox_inventory/data/items.lua`:

```lua
['bank_card'] = {
    label = 'Bank Card',
    weight = 0,
    stack = false,
    close = true,
    description = 'Used to access ATM',
    client = {
        image = 'bank_card.png',
        export = 'zat-banking.bank_card',
    },
},
```

{% endtab %}

{% tab title="qs-inventory" %}
Add to `qs-inventory/shared/items.lua`:

```lua
['bank_card'] = {
    ['name'] = 'bank_card',
    ['label'] = 'Bank Card',
    ['weight'] = 0,
    ['type'] = 'item',
    ['image'] = 'bank_card.png',
    ['unique'] = true,
    ['useable'] = true,
    ['shouldClose'] = true,
    ['description'] = 'Used to access ATM',
},
```

{% endtab %}
{% endtabs %}

### 3. Admins

Add identifiers to `shared/config.lua`'s `Config.Admins` table to grant access to the `/bankadmin` panel:

```lua
Config.Admins = {
    ['god'] = {   -- full access: can deposit, withdraw, and set balances
        'license:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
    },
    ['admin'] = { -- view-only: cannot move money
        'license:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
    },
}
```

### 4. Job shared accounts

{% hint style="info" %}
ESX doesn't have gangs, so `Config.Gangs` only applies on QBCore/Qbox. Job accounts on ESX currently use a fixed "grade 4 or higher" boss check rather than the configurable `Config.Jobs` grade list QBCore/Qbox get — full parity is planned.
{% endhint %}

Every job gets its own shared bank account automatically the first time it's used. See the **Exports** page for how other resources (e.g. a robbery or business script) can pay into a job's account directly.

### Done

```
ensure zat-banking
```
