> 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/qbcore/banking/installation.md).

# Installation

### Dependencies

* [`qb-core`](https://github.com/qbcore-framework/qb-core) or [`qbx_core`](https://github.com/Qbox-project/qbx_core) — latest version
* [`oxmysql`](https://github.com/overextended/oxmysql)

{% hint style="success" %}
No core file needs editing on either framework — 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** your framework resource (`qb-core`/`qbx_core`) 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="qb-inventory" %}
Add to `qb-core/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 %}

{% 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 & gang shared accounts

Every job and gang gets its own shared bank account automatically the first time it's used. Configure which grades have full access (deposit/withdraw/transfer) in `Config.Jobs` and `Config.Gangs`:

```lua
Config.Jobs = {
    ['police'] = {4},   -- grades listed here get full access
    ['ambulance'] = {4},
}

Config.Gangs = {
    ['ballas'] = {3},
}
```

A job or gang with no entry falls back to the framework's boss flag. See the **Exports** page for how other resources can pay into these accounts directly.

### Done

```
ensure zat-banking
```

Restart your server, log in, and open the bank from an NPC/location (see `Config.Locations`) or an ATM.
