> For the complete documentation index, see [llms.txt](https://code-after-sex.gitbook.io/script-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://code-after-sex.gitbook.io/script-documentation/cas-duel-arena-system/arenas.md).

# Arenas

Add duel arenas to your RedM server with the in-game arena tool. Included arenas, spectator camera and automatic duelist placement.

An arena is a stretch of street or open ground where two duelists stand facing each other. Every arena has a middle point, a direction for the duel axis and a spot for the spectator camera.

## Included arenas

| Id                 | Name                   | Region             | Kind          |
| ------------------ | ---------------------- | ------------------ | ------------- |
| `blackwater_main`  | Blackwater Main Street | `great_plains`     | `town`        |
| `scarlett_meadows` | Scarlett Meadows       | `scarlett_meadows` | `countryside` |
| `rhodes_main`      | Rhodes Main Street     | `scarlett_meadows` | `town`        |
| `heartlands`       | The Heartlands         | `heartlands`       | `countryside` |
| `armadillo`        | Armadillo              | `cholla_springs`   | `town`        |
| `caliga`           | Caliga Hall            | `bayou_nwa`        | `plantation`  |
| `lagras`           | Lagras                 | `bayou_nwa`        | `settlement`  |
| `diez_coronas`     | Diez Coronas           | `nuevo_paraiso`    | `desert`      |

Names, regions and kinds are shown in the server's language. The English names are listed here.

These were measured on the default map. Custom buildings, fences or MLOs on your server can block a street, so check the ones you plan to use.

## Measuring a new arena

You do not need to type coordinates. The arena tool measures the spot for you.

1. Stand in the middle of the street you want to use. Outdoors, with open ground on both sides.
2. Face roughly along the street.
3. Run:

   ```
   /duel_admin arena main_street
   ```

   The id can be anything made of letters, numbers and underscores. Use an existing id to re-measure that arena.
4. The tool tries every direction around you and picks the one with the longest clear run on both sides. If the direction you are facing is just as clear, it keeps yours. It also finds a clear spot to the side for the spectator camera.
5. You get one of three answers:

| Message                           | Meaning                                                                    |
| --------------------------------- | -------------------------------------------------------------------------- |
| `saved: all 20 paces clear`       | Perfect. Every pace setting fits.                                          |
| `saved: only N of 20 paces clear` | Longer duels will be shortened here. Try a more open spot if that matters. |
| `saved, but you are indoors`      | Go outside and run it again.                                               |

6. Open `arena_log.txt` in the `cas-duel` folder. The last line looks like this:

   ```
   main_street: center = vector3(-800.2, -1326.7, 42.6), heading = 175.0, spectate = vector3(-808.2, -1326.0, 45.6)  -- 20/20 paces clear, John, 2026-09-25 14:02, zones: town=0 district=131399519 printed=0 written=0
   ```
7. Add it to `Config.Arenas` in `config.lua`, with a region, kind and map artwork:

   ```lua
   { id = 'main_street', region = 'great_plains', kind = 'town', map = 'plains',
     center = vector3(-800.2, -1326.7, 42.6), heading = 175.0, spectate = vector3(-808.2, -1326.0, 45.6) },
   ```
8. Give it a name in each [language file](/script-documentation/cas-duel-arena-system/languages.md) you use, for example in `locales/en.lua`:

   ```lua
   arena_main_street = 'Main Street',
   ```

   Without it the menu shows `Main Street`, built from the id.
9. Restart the resource.

To measure where another player is standing, run it from the server console with their server id:

```
duel_admin arena main_street 12
```

## Arena fields

| Field      | Meaning                                                                                                                                                  |
| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`       | Unique id. Used by queues, tournaments and the board.                                                                                                    |
| `label`    | Optional. A fixed name for every language. Without it the name is `arena_<id>` in the language file.                                                     |
| `region`   | Region shown under the arena. An id such as `great_plains` is shown as `region_great_plains` from the language file; any other text is shown as written. |
| `kind`     | Short description shown with the region. An id such as `town` is shown as `arena_kind_town` from the language file; any other text is shown as written.  |
| `map`      | Region artwork in the menu: `heartlands`, `big_valley`, `cholla`, `gaptooth`, `plains`, `rio_bravo`, `scarlett` or `tall_trees`.                         |
| `center`   | The middle point between the two duelists. The height can be approximate; the ground is found automatically.                                             |
| `heading`  | Direction of the duel axis in degrees.                                                                                                                   |
| `spectate` | Where the spectator camera stands. It looks at the center.                                                                                               |

## Automatic placement

When a duel starts, both positions are checked against the world: walls, buildings, fences, interiors and sudden drops. If the configured distance does not fit, both duelists are pulled towards the middle by the same amount, so the duel stays fair. Positions inside another building or behind a wall are avoided.

To see why an arena was shortened, turn on debug output and watch the F8 console:

```lua
Config.Debug = true
```

## Using an arena elsewhere

* **Challenges:** every arena in `Config.Arenas` can be picked in the menu.
* **Matchmaking:** only the arenas listed in `Config.Queue.arenas` are used, picked at random.
* **Board posts:** the arena in `Config.Board.post`.
* **Tournaments:** the `arena` of each template.

If you remove an arena, remove its id from those lists too.
