> For the complete documentation index, see [llms.txt](https://ccfivem.gitbook.io/ccfivem-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ccfivem.gitbook.io/ccfivem-docs/economy-and-jobs/banking-cc_banking.md).

# Banking (cc\_banking)

Bank branches and ATMs with deposits, withdrawals, transfers by account number and a full account statement.

cc\_banking does **not** create a second money pot. Every booking goes to the framework's own bank account, so balances always match every other script on your server.

**Frameworks:** ESX Legacy, QBCore, QBox (detected automatically).

## Features

* Deposits and withdrawals at bank branches and ATMs
* Transfers by eight-digit account number, with a preview showing the recipient's name before you confirm
* Account statement that also records bank bookings made by other scripts (fuel station, vehicle shop, ...)
* Per-transaction limits and daily limits for withdrawals and transfers (daily limits survive restarts)
* Optional ATM withdrawal fee and transfer fee (percent)
* Configurable actions at ATMs (withdraw, deposit, transfer)
* Server-side validation: whole-number amounts, sign and cap checks, one booking per player at a time, rate limiting
* Automatic refund of the first step if a booking fails halfway
* Server exports for other scripts

## Pages

* Installation
* Configuration
* API
* FAQ

{% hint style="info" %}
The code is protected by Cfx asset escrow. `config/`, `locales/` and `shared/cc_framework.lua` stay editable. See Framework Bridge.
{% endhint %}

Related: cc\_billing/00%20Overview\.md) (paid bills show up on the statement), cc\_bossmenu/00%20Overview\.md). Need help? See Support.

## Installation

General steps: Installation · Dependencies

### Dependencies

| Resource                    | Required | Purpose                                                     |
| --------------------------- | -------- | ----------------------------------------------------------- |
| `oxmysql`                   | Yes      | Statement and account numbers                               |
| ESX Legacy / QBCore / QBox  | Yes      | The actual money                                            |
| `cc_lib`/00%20Overview\.md) | Optional | Shared notifications; a built-in fallback is used otherwise |

### server.cfg

```cfg
ensure oxmysql
ensure es_extended   # or qb-core / qbx_core
ensure cc_lib        # optional
ensure cc_banking
```

### Database

No SQL file is needed (the resource has no `sql/` folder). The script creates its tables on start:

* `cc_bank_transactions` - statement lines (amounts as BIGINT)
* `cc_bank_accounts` - one account number per character

### Framework notes

Nothing framework-specific to set up. The framework is detected automatically and money is booked through the framework bridge. See Framework Bridge.

### Permissions

No ACE entries are required.

{% hint style="warning" %}
Keep `Config.Debug = false` on a live server. With debug enabled, `/ccmoney` and `/ccbank` are registered without any permission check.
{% endhint %}

## Configuration

Editable files: `config/config.lua`, `config/ui.lua`, `locales/*.json`, `shared/cc_framework.lua`.

### General

```lua
Config.Debug = false   -- enables /ccmoney and /ccbank (testing only)
Config.OpenKey = 38    -- E
Config.Distance = 1.6  -- reach to a branch
Config.HistoryLimit = 30   -- lines shown on the statement
Config.QuickAmounts = { 100, 500, 1000, 5000, 25000 }
```

### Map and markers

```lua
Config.Blips = true
Config.BlipDefaults = { sprite = 108, colour = 2, scale = 0.7, shortRange = true }
Config.Marker = {
    enabled = true, type = 1, scale = vector3(1.0, 1.0, 0.3),
    offsetZ = -0.95, distance = 15.0,
    colour = { r = 139, g = 92, b = 246, a = 90 },
}
```

### Branches

Each branch has an `id`, `label`, `coords` and `blip` (`true`, `false` or a table that overrides the blip defaults). Seven branches are preconfigured (Fleeca branches, Blaine County Savings, Pacific Standard).

```lua
Config.Banks = {
    { id = 'legion', label = 'Fleeca — Legion Square', coords = vector3(149.9, -1040.5, 29.4), blip = true },
    -- ...
    { id = 'pacific', label = 'Pacific Standard', coords = vector3(236.0, 216.3, 106.3),
      blip = { sprite = 108, colour = 5, scale = 0.8 } },
}
```

### ATMs

```lua
Config.Atms = {
    enabled = true,
    distance = 2.2,   -- the ATM origin sits inside the wall; below 2.0 is too short
    withdraw = true,
    deposit = true,
    transfer = true,  -- same daily limit and recipient confirmation as at the counter
    fee = 0,          -- percent on ATM withdrawals
    models = { 'prop_atm_01', 'prop_atm_02', 'prop_atm_03', 'prop_fleeca_atm' },
}
```

Add ATM models that come with MLOs to `models`. What is allowed at an ATM is enforced by the server from this config.

### Limits and fees

```lua
Config.Limits = {        -- per transaction, 0 = no limit
    deposit = 0,
    withdraw = 500000,
    transfer = 250000,
}
Config.DailyLimits = {   -- per character since midnight (database time), 0 = none
    withdraw = 2000000,
    transfer = 1000000,
}
Config.TransferFee = 0   -- percent, 0 = free
```

Daily limits are counted from the statement, so a restart or relog does not reset them.

### UI and texts

`config/ui.lua` holds the UI settings; all texts are in `locales/*.json`.

## Exports, Events & Commands

### Server exports

#### AddTransaction

Writes a statement line only. It does **not** move any money - meant for scripts that book money past the framework.

```lua
---@param src number
---@param direction 'in'|'out'
---@param amount number      positive whole number
---@param reason string|nil  short key, e.g. 'fuel'; 'shop:24/7' adds a readable label
---@return boolean
exports.cc_banking:AddTransaction(source, 'out', 250, 'fuel')
```

#### GetAccountNumber

```lua
---@return string|nil  eight-digit account number of the character
local number = exports.cc_banking:GetAccountNumber(source)  -- e.g. '12345678'
```

{% hint style="info" %}
Bank bookings made through the framework bridge (`CC.AddMoney` / `CC.RemoveMoney`) appear on the statement automatically with their reason. There are no client exports and no public events.
{% endhint %}

### Commands

| Command / key                    | Who                             | Effect                                                              |
| -------------------------------- | ------------------------------- | ------------------------------------------------------------------- |
| **E** at branch / ATM            | everyone                        | Open the bank                                                       |
| `/ccbankblips`                   | everyone                        | Toggle bank blips on the map                                        |
| `/ccbank [atm]`                  | only with `Config.Debug = true` | Open a branch (or ATM) anywhere                                     |
| `/ccmoney <amount> [cash\|bank]` | only with `Config.Debug = true` | Give test money (negative amount removes); not registered otherwise |

## FAQ & Troubleshooting

**Does cc\_banking create its own accounts?** No. It books on the framework's bank account. Only the statement and account numbers live in its own tables.

**Deposit or transfer is not offered at an ATM.** Check `Config.Atms.deposit` / `Config.Atms.transfer`. ATM props from MLOs must also be listed in `Config.Atms.models`.

**I stand at the ATM but no prompt appears.** Increase `Config.Atms.distance`. The ATM origin sits inside the wall, so values below 2.0 are usually too short.

**A transfer is rejected.** Transfers only go to players who are online. Also check `Config.Limits.transfer` and `Config.DailyLimits.transfer`.

**`/ccmoney` does not exist.** Intended. It is only registered with `Config.Debug = true` and only works in game, not in the server console.

**Can money get lost during a transfer?** A booking is two framework calls (debit, credit). If the credit fails, the server refunds the debit. This is not a database transaction: if the refund also fails (framework error, player disconnecting at that exact moment), the amount is lost and written to the server log.

**The statement table keeps growing.** Delete old rows regularly, for example:

```sql
DELETE FROM cc_bank_transactions WHERE created_at < NOW() - INTERVAL 90 DAY;
```

More help: Support


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://ccfivem.gitbook.io/ccfivem-docs/economy-and-jobs/banking-cc_banking.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
