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

# Troubleshooting

Fix common CAS Advanced Gang System problems: a blank ledger, missing items or structures, refused withdrawals, tiers, lookout, bell and framework detection.

{% hint style="info" %}
Set `Config.Debug = true` first. Every request and every refusal is then printed in the server console with the player's id and the reason.
{% endhint %}

## The ledger opens blank

`web/dist` is missing or incomplete on the server. Copy the whole resource folder again, including `web/dist`. If you changed `web/src`, run `npm run build` in `web/` first.

## An item isn't offered to lay in

The satchel side lists only `Config.StashItems` entries the player carries. The entry's `name` must match the item id in your inventory's items table exactly. Item ids differ between servers, so check the spelling in your framework's item list.

## A structure never appears

Its `model` isn't a prop that exists in RDR3. A few seconds after joining, the F8 console prints:

```
[bearclaw] Config.Structures "..." uses model "...", which does not exist in RDR3
```

Change the model in `config.lua` to a prop from the game's camp set (`p_...`).

## "There is no Supply Wagon in camp"

The stash lives in the Supply Wagon (the structure with `isStash`), which comes with tier II. Place one in camp. Goods already laid in are safe while it's missing.

## "You must be in camp to reach the wagon"

The player is further than `Config.CampBounds` from the leader's tent. Set `Config.RemoteStash = true` if the stash should work from anywhere.

## A withdrawal is refused

The refusal names the first rule that failed. The server checks in this order.

**Stash:**

1. the rank has `stashWithdraw`,
2. the camp isn't contested (with `lockStores` on),
3. a Supply Wagon stands and the player is in camp (unless `RemoteStash`),
4. the wagon holds that many,
5. the rank's daily allowance isn't used up,
6. the player can carry it.

**Treasury:**

1. the rank has `treasuryWithdraw`,
2. the camp isn't contested (with `lockStores` on),
3. the camp owes no upkeep,
4. the treasury holds enough,
5. the rank's daily ceiling isn't used up. With `Config.ApprovalQueue` on, a draw past it becomes a request instead.

## Allow is greyed out on a request

The rider who asked isn't on the server, and the money has to go into their own purse. The request is marked *away* and waits. **Refuse** still works.

## Move is greyed out on a structure

You're outside the camp bounds. Ride back and open the structure again. The leader's tent has no **Move** or **Take down**, because the camp is measured from it.

## A tier can't be bought

The Upgrades tab shows every challenge's progress, and the refusal names the one that falls short. Also check that the camp owes no upkeep and that your rank has `upgradeBuy`. If territory is off, `contestsHeld` can never grow, so take it out of `Config.Tiers`.

## The lookout never warns

Check that a Lookout Post stands, that `Config.Lookout.enabled` is `true`, and that the riders belong to a gang, or set `countLoners = true`. After a warning, the lookout waits for `quietSeconds` of empty trail before it warns again. While the camp is contested it stays quiet.

## The alarm bell is silent

Members still get the notice and the map mark. Only the toll is missing, which means the soundset didn't load on your game build. With `Config.Debug = true`, the F8 console says `the bell soundset never loaded`. Set `Config.AlarmBell.sound` to another game soundset.

## No notices on RSG

RSG notices go through `ox_lib`. Start it before CAS Advanced Gang System. Without it, the script shows its own notices instead.

## The console says "framework: standalone" but I run a framework

With `Config.Framework = 'auto'`, CAS Advanced Gang System looks for `vorp_core`, `rsg-core`, `redemrp_main` or `redemrp`:

* **None is installed under that name.** Set `Config.Framework` to your framework.
* **It's installed but didn't start within a minute.** The console says `... never started - running standalone until it does`. When it starts, CAS Advanced Gang System switches over by itself. Ensure the framework before CAS Advanced Gang System.

With a framework named in `Config.Framework`, CAS Advanced Gang System never falls back. It waits for that framework and says so in the console.

## A rider lost their rank after an update

A rank was removed or its `id` changed in `Config.Ranks`. Riders on it moved to the nearest remaining rank, and the console listed each one. Keep rank ids stable and change only the `name`.

## An error line doesn't match the file

The server is running an older copy. Restart the resource and try again before changing any code.
