Scripts
ds-banking


standaloneRequirements
- QBCore / Qbox / ESX
- OneSync Infinity
- Server v7290 or newer
- oxmysql

Overview
## ds-banking
Banking system with **QBCore**, **ESX**, **QBox**, or **Standalone** support.
Includes **deposit/withdraw**, **transfers**, **transaction history**, **loans + credit score**,
and **credit cards** (PIN, block/reset, tiers).
### Features
- **Framework support**: `auto` detect (`qbx_core` → QBox, `qb-core` → QBCore, `es_extended` → ESX, else Standalone)
- **Accounts**
- **QBCore**: checking + **shared accounts** + **job/gang accounts**
- **ESX / QBox / Standalone**: checking (+ savings stored in `ds_banking_data`)
- **Loans**: configurable min/max amount, term, APR by credit score
- **Credit score**: configurable range and score changes (pay on time / miss payment)
- **Cards**: tiered cards, optional requirement at ATM, images included
- **Discord logs** (optional): action logs + exploit/invalid-amount logging via webhook
- **Targets / interaction**: optional `qb-target` / `ox_target` (or simple `E` key style)
- **Persistence**: `oxmysql`, `mysql-async`, `ghmattimysql`, or `none`
### Requirements
- **One framework** (optional): `qb-core` / `es_extended` / `qbx_core`
- **Database** (recommended): `oxmysql` (default) or `mysql-async` / `ghmattimysql`
- **Inventory** (for cards): supports
- `ox_inventory`, `qb-inventory`, `qs-inventory`, `ps-inventory`,
- `codem-inventory`, `core_inventory`, `chezza-inventory`
### Installation
1. **Drag & drop** `ds-banking` into your `resources` folder.
2. **Import SQL** (once) into your database:
- Run `Sql/ds-banking.sql`
also run:
- `Sql/migration_1.sql`
- `Sql/migration_2.sql`
- `Sql/migration_2.sql`
3. **Ensure dependencies** (example order):
```
ensure oxmysql
ensure qb-core # or es_extended / qbx_core (or none for standalone)
ensure ox_inventory # or your inventory
ensure ds-banking
```
4. **Configure** the resource in `config.lua` (see below).
5. **Add card items + images** (required if `Config.RequireCardAtATM = true`).
### Card items (required for ATM if enabled)
**Item names (must exist in your inventory):**
- `basic_bank_card`
- `silver_bank_card`
- `gold_bank_card`
- `platinum_bank_card`
**Add items:**
- **QBCore**: copy from `items/additems/qbcore/items.lua` → `qb-core/shared/items.lua`
- **ox_inventory (ESX/QBox/QBCore)**: copy from:
- `items/additems/esx/items.lua` (ESX)
- `items/additems/qbox/items.lua` (QBox)
**Add images:**
- Copy the `.png` files from `items/inventory//` into your inventory image folder:
- **ox_inventory**: `ox_inventory/web/images/`
- **qb-inventory**: `qb-inventory/html/images/`
- (or your inventory’s equivalent)
Then set `Config.CardImageBase` to match your inventory, for example:
- `nui://ox_inventory/web/images/`
- `nui://qb-inventory/html/images/`
### Configuration (`config.lua`)
Common options you’ll likely change:
- **Framework**: `Config.Framework = "auto" | "qbcore" | "esx" | "qbox" | "standalone"`
- **Inventory**: `Config.Inventory = "auto"` (or set to your inventory name)
- **Persistence**: `Config.Persistence = "oxmysql" | "mysql-async" | "ghmattimysql" | "none"`
- **ATM card requirement**: `Config.RequireCardAtATM = true/false`
- **Targeting**: `Config.useTarget = true/false`
- **Discord logs**: `Config.DiscordLogs.Enabled = true` + set `WebhookURL`
- **Loans / score tuning**: `Config.Loan*` and `Config.CreditScore*`
### Admin commands
Commands included:
- **`/givebank [id] [amount]`**: Add money to player bank
- **`/setbank [id] [amount]`**: Set player bank balance
- **`/setcredit [id] [score]`**: Set credit score (300–850)
- **`/clearloans [id]`**: Clear all loans for player
**Permissions**
- **QBCore**: requires the `admin` permission (QBCore command permission)
- **ESX / QBox / Standalone**: add ACE rules to your `server.cfg` (or `exec` the file):
```cfg
# option A: paste into server.cfg
add_ace group.admin command.givebank allow
add_ace group.admin command.setbank allow
add_ace group.admin command.setcredit allow
add_ace group.admin command.clearloans allow
# assign your staff (replace with your license)
add_principal identifier.license:xxxxxxxx group.admin
# option B: exec the bundled file
exec "resources/ds-banking/Read These/ACE_PERMISSIONS.cfg"
```
### Troubleshooting
- **UI doesn’t open / no interaction**: make sure `ds-banking` is started and not erroring in console; verify your framework is detected and `Config.Framework` isn’t forcing the wrong one.
- **ATM says you need a card**: add the card items + images, or set `Config.RequireCardAtATM = false`.
- **Database errors**: ensure your chosen DB wrapper is started **before** `ds-banking` and `Config.Persistence` matches it.


