> For the complete documentation index, see [llms.txt](https://visionstore.gitbook.io/visionstore-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://visionstore.gitbook.io/visionstore-docs/scripts/boxing-creator/developers/custom-framework.md).

# Custom framework

Connect any framework, economy or HUD by editing the open bridge files.

Every call the script makes to a framework, inventory, notification or HUD goes through two open files. Keep the **function names** and **what they return**, and you can point them at anything.

## Server: `bridge/sv_bridge.lua`

| Function                                       | Must return                                                                                |
| ---------------------------------------------- | ------------------------------------------------------------------------------------------ |
| `Bridge.player(src)`                           | Your framework's player object, or `nil`                                                   |
| `Bridge.citizenId(src)`                        | A stable character id (string, max 64 chars), or `nil` if not loaded                       |
| `Bridge.name(src)`                             | The character's display name                                                               |
| `Bridge.isFemale(src)`                         | `true` / `false`                                                                           |
| `Bridge.isDead(src)`                           | `true` if dead or downed                                                                   |
| `Bridge.sourceOf(id)`                          | The server id of an online character, or `nil`                                             |
| `Bridge.cash(src, account)`                    | How much money they have                                                                   |
| `Bridge.take(src, account, amount, reason)`    | `true` if taken, `false` if they can't afford it                                           |
| `Bridge.give(target, account, amount, reason)` | `true` if paid. `target` can be a server id **or** a character id of an **offline** player |
| `Bridge.isAdmin(src)`                          | `true` for staff                                                                           |
| `Bridge.hasKoPerk(src)`                        | `true` if they get the knockout finisher                                                   |
| `Bridge.hpBonus(src)`                          | Extra HP as a fraction (`0.05` = +5%)                                                      |
| `Bridge.gym(src)`                              | `{ power, chin, cardio }` (0–100) or `nil`                                                 |

### Example: plugging in a custom economy (standalone)

```lua
function Bridge.standaloneCash(src, account)
    return exports['my-economy']:GetBalance(src, account)
end

function Bridge.standaloneTake(src, account, amount, reason)
    return exports['my-economy']:Remove(src, account, amount, reason)
end

function Bridge.standaloneGive(target, account, amount, reason)
    return exports['my-economy']:Add(target, account, amount, reason)
end
```

{% hint style="warning" %}
`Bridge.give` must also work for **offline** players (winnings are paid after a disconnect). Credit the database directly when the player isn't online, as the built-in QBCore / ESX code does.
{% endhint %}

### Example: admins by Discord role instead of ACE

```lua
function Bridge.isAdmin(src)
    return exports['my-discord-perms']:HasRole(src, 'Staff')
end
```

## Client: `bridge/cl_bridge.lua`

| Function                                           | What it does                                                 |
| -------------------------------------------------- | ------------------------------------------------------------ |
| `Bridge.notify(text, kind, duration, title)`       | Shows a notification (dispatches on `Config.Notify`)         |
| `Bridge.customNotify(title, text, kind, duration)` | Your own notification when `Config.Notify = 'custom'`        |
| `Bridge.disarm()`                                  | Holsters the current weapon                                  |
| `Bridge.lockInventory(locked)`                     | Locks / unlocks the inventory and hotbar during fights       |
| `Bridge.setHudHidden(hidden)`                      | Hides / shows the player's HUD. Return `true` when it worked |

### Example: a custom inventory lock

```lua
function Bridge.lockInventory(locked)
    exports['my-inventory']:SetBusy(locked)
end
```


---

# 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://visionstore.gitbook.io/visionstore-docs/scripts/boxing-creator/developers/custom-framework.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.
