> 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/watch-admin-menu/configuration/server.cfg-lines.md).

# Server.cfg lines

`cfg.lua` is sent to every player, so nothing secret goes there. Keys, tokens and permissions go in `server.cfg`, webhooks in `server/discord_log.lua`.

## Convars

All of them with `set`, never `setr`.

| Convar                   | Default | What it does                                                                                                                                                                                                                            |
| ------------------------ | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `rm_watch_key`           | empty   | Your licence key. Turns on the web panel, the Discord bot, ban appeals, voice notes, auto replay and live view. See [Linking the web panel](https://docs.rainmad.com/resources/watch-admin-menu/getting-started/linking-the-web-panel). |
| `rm_watch_web_console`   | `false` | `true` lets the owner type console commands and start or stop resources from the web panel. Read on every call, no restart needed.                                                                                                      |
| `rm_watch_web_max_role`  | `owner` | A ceiling for anything sent from the web panel, whoever sends it. `admin` keeps owner only actions in game, `viewer` makes the panel read only. Any group name works.                                                                   |
| `rm_watch_discord_token` | empty   | Your own Discord bot token, for [Discord roles](https://docs.rainmad.com/resources/watch-admin-menu/permissions/discord-roles). Not needed when you link the hosted fivemad Watch bot instead.                                          |
| `rm_watch_ocr_endpoint`  | empty   | Your own OCR service for the screen check. It takes `{ image }` and returns `{ text }`.                                                                                                                                                 |
| `rm_watch_ocr_token`     | empty   | Optional, sent to the OCR service as a Bearer token.                                                                                                                                                                                    |

```cfg
set rm_watch_key "rmw_..."
set rm_watch_web_console true
set rm_watch_web_max_role "admin"
```

## Aces

### Roles

```cfg
add_ace group.rm_watch_owner rm_watch.owner allow
add_principal identifier.license:YOUR_LICENSE group.rm_watch_owner

add_ace group.admin rm_watch.admin allow
add_ace group.mod rm_watch.moderator allow
```

The object names come from `cfg.admin.aces`. The full guide is on [Roles and groups](https://docs.rainmad.com/resources/watch-admin-menu/permissions/roles-and-groups).

{% hint style="danger" %}
Never grant the bare `rm_watch` object (`add_ace group.x rm_watch allow`). Aces are hierarchical, so that one line gives every role, owner included, and every custom group you ever make.
{% endhint %}

### Commands rm\_watch runs for you

rm\_watch runs a few console commands as the resource itself, the principal `resource.rm_watch`. FXServer refuses a restricted command unless you allow it:

| Line                                               | Needed for                                                                                |
| -------------------------------------------------- | ----------------------------------------------------------------------------------------- |
| `add_ace resource.rm_watch command.profiler allow` | **Run profile** on the dashboard (per resource profiling).                                |
| `add_ace resource.rm_watch command.quit allow`     | **Restart server** from the menu, the web panel or Discord.                               |
| `add_ace resource.rm_watch command allow`          | Every command from the **Console** tab, including `ensure`, `restart`, `stop` and `quit`. |

Without the first two, those buttons say what is missing and do nothing. Instead of the broad `command` line you can allow single commands, for example `add_ace resource.rm_watch command.ensure allow`.

{% hint style="warning" %}
`add_ace resource.rm_watch command allow` lets the Console tab run anything the server console can. Only the owner role opens that tab, so give the owner role only to people you would give the server console to.
{% endhint %}

## pma-voice convars

| Convar                 | Why it matters                                                                                              |
| ---------------------- | ----------------------------------------------------------------------------------------------------------- |
| `voice_enableRadios`   | The staff voice channel is a pma-voice radio channel. With `setr voice_enableRadios 0` it is not available. |
| `voice_useNativeAudio` | Read by spectate to match pma-voice's ranges. Nothing to set for rm\_watch.                                 |

## Discord webhooks

Open `server/discord_log.lua` (it is not encrypted) and paste your webhook URLs:

```lua
local config = {
    username       = 'rm_watch',
    defaultWebhook = 'https://discord.com/api/webhooks/...', -- every category posts here
    webhooks       = {
        bans   = 'https://discord.com/api/webhooks/...',      -- a channel of its own
        joins  = false,                                       -- off
        deaths = false,
        chat   = false,
    },
}
```

| Category                         | What is posted                                                        |
| -------------------------------- | --------------------------------------------------------------------- |
| `admin`                          | Every staff action that has no category of its own.                   |
| `bans`, `warns`, `kicks`, `jail` | Those punishments, with the evidence screenshot when one is attached. |
| `reports`                        | New tickets and the transcript of a closed one.                       |
| `staff`                          | Duty on and off.                                                      |
| `screenshots`, `screencheck`     | Screenshots and screen check hits.                                    |
| `joins`, `deaths`, `chat`        | Busy channels, off until you give them a URL.                         |

A category set to `false` posts nothing. One left out uses `defaultWebhook`.
