> For the complete documentation index, see [llms.txt](https://docs.rainmad.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rainmad.com/resources/mad-racing-system-racing-tablet/installation.md).

# Installation

## Installation

### 1. Requirements

| Required    | Notes                                                     |
| ----------- | --------------------------------------------------------- |
| `ox_lib`    | Hard dependency                                           |
| `oxmysql`   | Profiles, tracks, results, crews                          |
| `rm_stream` | 3D billboards: checkpoint signs, lobby prompt, nameplates |
| Framework   | Qbox, QBCore, ESX, or standalone                          |

Without `rm_stream` the resource still runs, but every 3D billboard is disabled and the console says so at start.

***

### 2. Drop in the resource

Place `rm_racing` in your resources folder and start it **after** its dependencies:

```cfg
ensure ox_lib
ensure oxmysql
ensure rm_stream
ensure rm_racing
```

***

### 3. Database

Nothing to import. On first start every table is created and every migration is applied automatically. The console prints one line:

```
> database       18 applied, 14 already present
```

Existing columns are detected and skipped, so a restart on an up-to-date database applies nothing and prints no errors.

***

### 4. Items

Only needed if you use the tablet item or item payouts. Ready-made lists are in the `items/` folder:

| File                       | For                        |
| -------------------------- | -------------------------- |
| `items - ox_inventory.lua` | ox\_inventory              |
| `items - qb shared.lua`    | qb-core `shared/items.lua` |

| Item               | Used for                                                        |
| ------------------ | --------------------------------------------------------------- |
| `rm_racing_tablet` | Opens the tablet. Set `cfg.tabletItem = false` for command-only |
| Payout items       | Whatever you list in `cfg.itemPayouts.lists`                    |

{% hint style="info" %}
`cfg.itemPayouts.enabled` ships on with `water`, `sandwich` and `lockpick`. If your server does not have those item names, change the lists or turn it off.
{% endhint %}

***

### 5. Pick your adapters

Open `cfg.lua` section 1 and match it to your server:

```lua
cfg.framework    = 'auto'
cfg.notification = 'ox_lib'
cfg.textUI       = 'rm_racing'
cfg.vehiclelock  = 'auto'
cfg.dispatch     = false
```

`'auto'` probes the known resources in order. `false` skips the category and its calls become no-ops. `cfg.textUI = 'rm_racing'` uses the built-in NUI hint and needs nothing installed.

See cfg.lua Reference for the full option lists.

***

### 6. Discord logging (optional)

Webhooks live in `server/webhook.lua`, never in `cfg.lua` — `cfg.lua` is a shared file and everything in it reaches clients.

Leave the URL empty to keep logging off. Competition winners, new tracks and bounty claims post an embed with the track's map snapshot attached.

***

### 7. Production check

In `cfg.lua`:

```lua
cfg.standalone.perSessionId = false
```

This is a development flag that splits one license into several profiles. It must be off in production.

Then start the server and confirm the banner is clean:

```
  ╔══════════════════════════════════════════════╗
  ║         R A I N M A D   R A C I N G          ║
  ╚══════════════════════════════════════════════╝
  > version        rm_racing v1.1.4
  > framework      qbox (qbInv=false, oxInv=true)
  > database       18 applied, 14 already present
  > seed tracks    364 statement(s)
  > status         server ready
  > tablet item    rm_racing_tablet
  > scheduler      4 slot(s), 4 race(s) queued, next 19:00
```

A `!` or `x` line means that subsystem did not come up. In-game, `/racing` should open the tablet.
