> 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/troubleshooting.md).

# Troubleshooting

Fix common problems with the RedM Duel & Arena System. Menu not opening, wrong framework, players placed badly, money not paid, NPCs not spawning and more.

## The menu does not open, or the screen stays black

Check the F8 console and the server console for errors first.

If there are none, check that `web/dist/index.html` exists. If the folder is missing, the menu cannot load. Download the resource again, or build the menu yourself. See [Editing the Interface](/script-documentation/cas-duel-arena-system/interface.md#building).

## "Pick a character first."

The duel menu needs a loaded character. Wait until your character has spawned, then open it again.

If it still shows, the framework was not detected correctly. See the next entry.

## The console shows the wrong framework

Look for the `[cas-duel] Framework:` line when the server starts.

* Make sure `cas-duel` is started **after** `vorp_core` or `rsg-core` in `server.cfg`.
* Set the framework by hand:

  ```lua
  Config.Framework = 'vorp'   -- or 'rsg'
  ```

## The console shows "Storage: KVP" but I use oxmysql

`oxmysql` did not start in time. Put `ensure oxmysql` above `ensure cas-duel` in `server.cfg`.

With this setting the console also prints a warning whenever oxmysql is not available, so the fallback never goes unnoticed:

```lua
Config.Storage = 'oxmysql'
```

## Players start inside a wall, or much closer than the paces they picked

The arena's street is blocked on your map. Stand in a clearer spot and measure it again with `/duel_admin arena <id>`. See [Arenas](/script-documentation/cas-duel-arena-system/arenas.md).

To see what blocked it, set `Config.Debug = true` and watch the F8 console when a duel starts.

## "You are not allowed to do that."

Your group does not have the admin permission. Add this to `server.cfg` and restart:

```cfg
add_ace group.admin duels.admin allow
```

See [Permissions](/script-documentation/cas-duel-arena-system/permissions.md).

## A challenge says the other player is busy

They are already in a duel, waiting on another challenge, watching a duel, or have a challenge of their own out. Players in a matchmaking queue can still be challenged.

## "Wait 8s before calling someone out again."

There is a short cooldown between challenges from the same player. Change it with `Config.Challenge.cooldown`.

## "You can't cover a $X wager."

The wager is higher than the cash the character has on hand. Both players must be able to cover it, both when the challenge is sent and when the duel starts.

## A player won but did not get their money

If they were offline, or on another character, when the money was due, it is kept on their profile. It is paid the next time they open `/duels`, with the message "Collected $X owed from earlier duels."

## The matchmaking queue never finds a match

A match needs a second player in the same queue within the rating range. The range widens the longer players wait. With few players online, try the casual queues or the open challenge board.

## A tournament does not start

It starts when the last slot is filled. To start it earlier, run `/duel_admin tstart <id>`. It needs at least 2 entrants. Run `/duel_admin` to see the ids.

## A tournament match never begins

Both players must be online and not busy. If one of them does not turn up within `Config.Tournament.noShowSeconds`, the other wins by walkover.

## The NPC outlaw does not appear

* Check the F8 console for "Could not load NPC model". The `model` in `Config.Npc.levels` must be a valid ped model.
* If the challenger sees the outlaw but spectators do not, your server blocks clients from creating entities. See [NPC Outlaw Duels](/script-documentation/cas-duel-arena-system/npc-outlaws.md#who-can-see-the-outlaw).

## Portraits are all silhouettes

Set a Steam Web API key in `server.cfg`:

```cfg
set steam_webApiKey "YOUR_STEAM_WEB_API_KEY"
```

## The betting buttons are greyed out

Betting closes once the first round of a duel is decided, and each spectator can place one bet per duel.

## Duelists can see other players walking through the street

Another resource is using the same routing buckets. Change `Config.Duel.bucketBase` to a range nobody else uses.

## My ammo changed after a duel (VORP)

During a duel the duel ammo is not saved. Your real ammo is reloaded from the database a couple of seconds after the duel ends, so give it a moment before checking.

## The menu is still in English after changing the language

* The value of `Config.Locale` must match the code in the language file's first table line. For `Config.Locale = 'de'` the file needs `Locales['de'] = {`.
* The file must be in the `locales/` folder of the resource.
* Restart the resource and open the menu again. If you just added a new file, run `refresh` before the restart.

See [Languages and Translation](/script-documentation/cas-duel-arena-system/languages.md).

## The hold prompt for a challenge shows empty boxes

The prompt is drawn by the game, which only shows plain English letters. Remove accents and special characters from `prompt_accept`, `prompt_decline` and `prompt_group` in your language file.

## A message shows a code such as msg\_busy instead of text

That line is missing from your language file and from `locales/en.lua`. Put the line back into `locales/en.lua` from the original download, then restart the resource.
