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

# Troubleshooting

Fix common problems with the RedM Shooting Range & Competition script: framework not found, menu not opening, tokens, notifications, shots not counting, held payments and more.

Turn on `Config.Debug = true` to get detailed logs in the server console while you look into a problem.

## The console says "No supported framework found"

The resource started before your framework, or the framework failed to load.

* Make sure `ensure cas-shootingcompetition` comes after `vorp_core` or `rsg-core` in `server.cfg`.
* Check the console further up for errors from the framework itself.
* Set `Config.Framework = 'vorp'` or `'rsg'` to skip detection.

## "The shooting range is not ready for you yet. Select a character first."

The server could not load the player's range profile. Usually the player has no character loaded yet. If a loaded player keeps getting it:

* Check that oxmysql is running and the database is reachable. The console shows an error if the tables could not be created or a profile could not be read.
* Check the framework line in the console (see above).

## Nothing happens at the range master

* The prompt only shows within 2.5 metres of the menu point (`Config.PromptDistance`), on foot and alive. Get off the horse.
* If the range master is missing, check the console for `Config.Ped.Model ... is not a valid ped model`.

## /shootingrange says "Too Far"

The command only works within 120 metres of a range. Set `Config.CommandAnywhere = true` to allow it anywhere.

## The menu is empty or does not open

* Make sure `web/dist` exists and has `index.html` and an `assets` folder. If you built the interface yourself, build it again. See [Editing the Interface](/script-documentation/cas-shooting-range/interface.md#build).
* Look for errors in the F8 console.

## Range Tokens or gold do not work

* The `range_token` item must exist in your inventory, on both frameworks. On RSG the gold item (`gold_bar` by default) must exist too. See [Installation](/script-documentation/cas-shooting-range/installation.md), step 4.
* To stop using them, set `enabled = false` for that currency in `Config.Currencies`.

## No notifications on RSG Core

Notifications outside the menu use `ox_lib` on RSG. Make sure `ox_lib` is started before this resource.

## "The range is in use"

Every lane at that range is taken by other matches or practice runs. Wait for one to finish, use a range with more lanes, or add another range. See [Shooting Ranges](/script-documentation/cas-shooting-range/ranges.md).

## "Ride to the range" when readying up

A shooter must be within 120 metres of the firing line to ready up (`Config.Rules.JoinRange`).

## Shots are not counting

* The shooter must be holding the match weapon.
* Firing is blocked before DRAW, during a lockout and after the lane is cleared.
* Shots only count from your own lane. Hits on another lane's targets are wrong lane shots.
* A shot less than 70 ms after the previous one is ignored.
* If a target breaks but still counts as standing, it comes back after 1.5 seconds. Hit it again.

## Targets float or sink into the ground

The range was set up on uneven ground or next to objects. Measure it again with `/shootingadmin here <range id>` on flatter ground. See [Shooting Ranges](/script-documentation/cas-shooting-range/ranges.md#measuring-a-new-range).

## A player says their winnings are missing

If the player was offline or their inventory was full, the payment is held and paid the next time they load a character. Held payments are in the `shooting_pending` table.

## A match is stuck

Run `/shootingadmin cancel <player id>` for one of the shooters. The match is cancelled and every stake is refunded.

## Steam portraits do not show

* Set `steam_webApiKey` in `server.cfg`. See [Installation](/script-documentation/cas-shooting-range/installation.md), step 5.
* Players with a private Steam profile, or without Steam, get the default silhouette.
* Run `shootingadmin avatars` in the server console to see what was found for each player.

## The tournament does not start

* The draw needs `MinPlayers` entrants (4 by default) when the sign up time ends. With fewer, sign ups are extended.
* An admin can draw early with `/shootingadmin draw` (2 entrants or more).
* `Config.Tournament.Enabled` must be `true`.

## The server was restarted during a match

Every stake that was held is refunded automatically the next time each player loads a character. See [Wagers, Entry Fees and Payouts](/script-documentation/cas-shooting-range/wagers.md#restarts-and-crashes).
