> ## Documentation Index
> Fetch the complete documentation index at: https://rust-co.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuration

> Everything you can change in config/config.lua, explained in plain words.

All settings live in one file: `rco-motorworks/config/config.lua`. Open it with any text editor (Notepad works, VS Code is nicer).

> [!TIP]
>
> Only change what comes after the `=` sign. Keep the quotes `'...'`, the commas and the brackets exactly as they are. After saving, restart the server.

## The basics

| Setting | What it does | Default |
| - | - | - |
| `Config.Locale` | Language of the texts on screen: `'en'` or `'pt-br'` | `'en'` |
| `Config.Framework` | Leave `'auto'`. Only write `'rsg'` or `'vorp'` if the script guesses wrong | `'auto'` |
| `Config.MoneyAccount` | The money the workshop takes and pays: `'cash'` or `'gold'`. With gold the prices go up to whole bars | `'cash'` |
| `Config.Debug` | Prints what the script does in the consoles, for setting up. Turn it off before opening to players | `false` |

## Keys

Keys are written as the game's code of the key, not as a letter. The [keys page](https://rust-co.mintlify.site/keys.md) has the code of each one. Next to each key there is the letter shown on screen (`Config.OpenKeyLabel`...).

| Setting | What it does | Default |
| - | - | - |
| `Config.OpenKey` | Opens the workshop, driving your vehicle inside it | **R** |
| `Config.WorkKey` | A mechanic on duty, on foot beside a customer's vehicle that has an order: does the job | **G** |
| `Config.CounterKey` | Opens the owner's office and the mechanics' panel, on foot | **G** |

`Config.OpenKey` must be a key the game reads while driving. The keys are only read while their hint shows on screen, so other scripts keep them everywhere else.

## The workshops

`Config.Workshops` lists every workshop. Saint Denis comes ready; add your own the same way.

```lua theme={"dark"}
Config.Workshops = {
    saint_denis = {
        label = 'Saint Denis', coords = vector3(2683.24, -840.91, 41.30), radius = 20.3, blip = true,
        bays = { vector4(2686.63, -851.89, 42.36, 116.22), vector4(2679.85, -836.29, 42.36, 110.55) },
        owned = true, counter = vector3(2672.60, -827.54, 42.36), staffCounter = vector3(2683.87, -825.76, 42.36),
    },
    valentine = {
        label = 'Valentine', coords = vector3(x, y, z), radius = 8.0,
        owned = false,
    },
}
```

| Setting | What it does |
| - | - |
| the name before `=` | The workshop's name in the admin command (`saint_denis`). Letters, numbers and `_` only. Don't change it once it has an owner |
| `label` | The name at the top of its screen, over "Motor Works" |
| `coords` | The middle of the workshop floor |
| `radius` | How far (metres) from the middle the vehicle may stand |
| `bays` | The modification stations, `vector4(x, y, z, heading)`: where the vehicles stand to be worked on. A vehicle within `Config.BayRadius` (3 metres) of one is in the workshop. Without `bays`, the `radius` counts |
| `owned` | `true`: the workshop can have an owner, who hires mechanics. `false`: nobody owns it and customers fit their own accessories |
| `counter` | The owner's office (owned workshops only): till, commission, hiring and firing. Only the owner opens it |
| `staffCounter` | The mechanics' panel: clocking in and out, and the orders. The mechanics and the owner open it. Without it, the mechanics use the `counter` too |
| `blip` | `true`: the workshop shows on the map, with the RCO Vehicles mechanic icon (the game's blacksmith icon without RCO Vehicles) |

An owned workshop with no owner yet works as self service.

## Prices

| Setting | What it does | Default |
| - | - | - |
| `Config.Repair.Base` | The price of any repair | `0.50` |
| `Config.Repair.PerPercent` | Plus this for each percent of health missing | `0.03` |
| `Config.Paint.Price` | The price of a new paint, any of the vehicle's own colours (from its RCO Vehicles catalogue) | `2.0` |
| `Config.PriceMultiplier` | Every accessory price (set by each vehicle) is multiplied by this. `1.0` keeps them; `1.5` makes them 50% dearer | `1.0` |

A vehicle at 40% health pays `0.50 + 60 × 0.03 = $2.30`. Taking an accessory off is free.

## Owned workshops

| Setting | What it does | Default |
| - | - | - |
| `Config.Owners.Command` | The admin command that gives a workshop its owner | `'motorworks'` |
| `Config.Owners.Mode` | How every owned workshop works: `'self'`, `'staff'` or `'auto'`. The owner can't change it | `'auto'` |
| `Config.Owners.Commission` | The share of each order the mechanic who does it gets from the till (`0.2` = 20%) | `0.2` |
| `Config.Owners.CommissionMax` | The highest share the owner can set for his mechanics at the counter (he starts at `Commission`) | `0.5` |
| `Config.Owners.ExpireHours` | An order nobody did in this time is cancelled and paid back from the till | `5` |
| `Config.Owners.WorkSeconds` | How long the mechanic works on the vehicle | `12` |

The modes:

* `'self'`: customers fit their own accessories; the money goes to the till.
* `'staff'`: customers place an order and pay it into the till; a mechanic does each job.
* `'auto'`: `'staff'` while a mechanic of that workshop is on duty, `'self'` when none is.

The owner, the mechanics and the till are kept in the database, the same way on RSG and VORP: you don't create any job in your framework.

## The order of the categories

`Config.CategoryOrder` is the order the categories show in. Categories a vehicle has that are not in the list come after, by name.

```lua theme={"dark"}
Config.CategoryOrder = { 'teto', 'capo', 'frente', 'laterais', 'traseira', 'lanternas', 'rodas', 'volante' }
```

## The camera

`Config.Camera` says where the camera looks for each category. Players can still drag and zoom from there.

```lua theme={"dark"}
teto = { point = { 0.0, 0.0, 1.0 }, yaw = 155.0, pitch = 0.95, zoom = 0.45 },
```

| Setting | What it does |
| - | - |
| `bone` | A part of the vehicle to look at (`'bonnet'`, `'boot'`, `'wheel_lf'`), when the vehicle has it |
| `point` | Without the bone: a point of the vehicle, side (`-1` left to `1` right), length (`-1` back to `1` front) and height (`-1` bottom to `1` top) |
| `yaw` | The side the camera looks from: `0` behind, `90` right, `180` in front, `270` left |
| `pitch` | The camera's height, `0` low to `1` high |
| `zoom` | `0` far to `1` close |

`default` is the whole vehicle and `repair` is the repair screen. When a vehicle brings its own camera for a category or an option (in its RCO Vehicles catalogue), that one is used instead.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.