> 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-shooting-range/commands.md).

# Commands and Controls

Every player command, admin command, key and prompt in the RedM Shooting Range & Competition script, and how to change them.

## Player command

| Command                     | What it does                         |
| --------------------------- | ------------------------------------ |
| `/shootingrange`            | Opens the range menu.                |
| `/shootingrange practice`   | Opens the practice setup directly.   |
| `/shootingrange tournament` | Opens the tournament board directly. |

By default the command only works within 120 metres of a range (`Config.Rules.JoinRange`). Further away, the player gets a **Too Far** notice. It always works while a player has an invite waiting or is already in a lobby, and it does nothing while they are shooting or spectating.

Set `Config.CommandAnywhere = true` to allow it anywhere on the map. Change the command name with `Config.Command`.

## Admin command

`/shootingadmin` with the subcommands `draw`, `reset`, `cancel`, `here` and `avatars`. See [Permissions and Admin Commands](/script-documentation/cas-shooting-range/permissions.md#admin-commands).

## At the range

When a player stands within 2.5 metres of a range's menu point (`Config.PromptDistance`), on foot and alive, a prompt group appears with the range's name:

| Key   | Hold  | What it does        |
| ----- | ----- | ------------------- |
| **E** | 0.9 s | Open the range menu |
| **G** | 0.9 s | Open solo practice  |

## Invites

When someone invites a player who has the menu closed, a **View Invite** prompt appears with the host's name for as long as the invite is open (30 seconds by default).

| Key   | Hold  | What it does                |
| ----- | ----- | --------------------------- |
| **H** | 0.9 s | Open the menu on the invite |

## During a match

| Key                 | What it does                                                                                            |
| ------------------- | ------------------------------------------------------------------------------------------------------- |
| **Left mouse**      | Fire. Firing is blocked until DRAW, while locked out and once you have cleared your lane.               |
| **R** (game reload) | Reload. The reload is reported to the server, which runs the reload timer for your weapon.              |
| **G** (hold 2.5 s)  | Forfeit the match                                                                                       |
| **Enter**           | Ready for the next round on the round result card. When every shooter presses it, the break is skipped. |

Shooters are held in their lane for the whole match (`Config.Rules.FreezeShooters`), so movement, sprint, jump and cover are disabled until the match ends.

## During practice

| Key   | Hold  | What it does                        |
| ----- | ----- | ----------------------------------- |
| **G** | 0.9 s | End the run and see the result      |
| **H** | 0.9 s | Restart the run with the same setup |

## While spectating

| Key             | What it does                         |
| --------------- | ------------------------------------ |
| **Left Arrow**  | Previous lane                        |
| **Right Arrow** | Next lane                            |
| **Backspace**   | Stop watching and return to the menu |

## Changing the keys

Keys are RedM control hashes in `shared/config.lua`:

```lua
Config.Keys = {
    Open     = 0xCEFD9220, -- E
    Practice = 0x760A9C6F, -- G
    Invite   = 0x84543902, -- H
    Forfeit  = 0x760A9C6F, -- G
    EndRun   = 0x760A9C6F, -- G
    Restart  = 0x84543902, -- H
}
Config.HoldMs = 900          -- hold time for the prompts and practice keys
Config.ForfeitHoldMs = 2500  -- a longer hold to forfeit
```

The menu shows key letters in its hint lines. If you change a key, change its letter in `Config.KeyLabels` too:

```lua
Config.KeyLabels = {
    Forfeit = 'G', EndRun = 'G', Restart = 'H', Continue = 'Enter',
    SpectatePrev = '←', SpectateNext = '→', SpectateLeave = 'Backspace',
}
```

The spectator keys (arrow keys and Backspace) and the Enter key for the next round are fixed in `client/spectate.lua` and `client/range.lua`.
