> 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-horse-racing/configuration.md).

# Configuration

Configure CAS Horse Racing for RedM — currency (cash or gold), race rules, prize splits, parimutuel betting, entry fees, the scout camera and the race master.

Everything is in `config.lua`. Restart the resource after editing it:

```
restart cas-horserace
```

Only the settings below are worth changing. Everything else has a sensible default.

## Currency

If your server charges in gold instead of cash, change this:

```lua
Config.Currency = {
    symbol = '$',
    kind   = 'cash',   -- 'cash' or 'gold'
}
```

Getting this wrong means entry fees are taken from the wrong wallet.

## Language

```lua
Config.Language = 'en'   -- 'en' or 'tr'
```

To add your own, copy `locales/en.lua`, rename it, and set the name here.

{% hint style="warning" %}
Text drawn by the game itself, such as the prompts above a race master, can only use plain English letters. Accented or special characters appear as empty boxes. Text inside the menu is not affected.
{% endhint %}

## Race rules

```lua
Config.Lobby = {
    minRiders = 2,      -- fewer than this at the line and the race is called off
    maxRiders = 8,      -- most riders a race can hold
}

Config.Race = {
    callRadius      = 60.0,   -- how close to the line a rider must be at the start
    noShowRefund    = true,   -- refund riders who entered but were not there
    ridersUpSeconds = 60,     -- how long before the start riders are called
    countdownSeconds = 5,
    requireHorse    = true,   -- no horse, no start
    dismountEndsRace = true,
    deathEndsRace   = true,
}
```

Set `noShowRefund = false` to keep no-show entry fees in the purse. Players who crash or disconnect will lose their fee, so most servers leave it on.

## Prize money

```lua
Config.Payout = {
    mode            = 'pool',   -- 'pool' or 'fixed'
    fixed           = 100.0,    -- used only when mode is 'fixed'
    houseCutPercent = 5.0,      -- taken off the pot before it is split
    splits = {
        [2] = { 100 },
        [3] = { 70, 30 },
        [4] = { 60, 30, 10 },
        [6] = { 50, 27, 15, 8 },
        [8] = { 45, 25, 15, 10, 5 },
    },
}
```

`splits` is keyed by field size. A field of five is paid using the `[4]` row. Each row must add up to 100 or less. Whatever is left over stays with the house.

## Betting

```lua
Config.Bets = {
    enabled      = true,
    housePercent = 5.0,       -- taken off the pool before it is shared out
    minStake     = 5.0,
    maxStake     = 500.0,
    maxPerRace   = 1000.0,    -- one person's total across all their bets
    stakes       = { 5, 10, 25, 50, 100, 250 },
}
```

`stakes` are the buttons shown on the race sheet. Any value outside `minStake` and `maxStake` is hidden rather than offered and then refused.

Riders cannot bet on a race they are in.

Set `enabled = false` to turn betting off completely.

## Entry fee options

```lua
Config.Fees = { 0, 5, 10, 25, 50, 100, 250 }
```

The fee amounts offered when creating a race.

## Teleporting

```lua
Config.Editor = {
    allowTeleport = false,
}
```

Turning this on gives `/race_goto` to anyone with [permission](/script-documentation/cas-horse-racing/permissions.md). It is a teleport. Leave it off on a live server unless you trust everyone who has permission.

## The scout camera

The Show me button on the race sheet flies a camera out to the start line.

```lua
Config.Post = {
    preview = {
        radius = 34.0,   -- how far out it circles
        height = 18.0,   -- how high above the ground
        fov    = 50.0,
        spin   = 9.0,    -- degrees per second
    },
}
```

## The race master

```lua
Config.Post = {
    key      = 0xD51B784F,   -- E
    distance = 2.5,          -- how close you must be for the prompt
    ped = {
        enabled  = true,
        model    = 'a_m_m_valtownfolk_01',
        scenario = 'WORLD_HUMAN_SMOKING',
    },
}
```

Set `scenario = false` if you want him to stand still.

## Debug mode

```lua
Config.Debug = false
```

Turning this on adds console detail and about twenty-five extra commands for adjusting how gates, flags, and arrows look. Leave it off on a live server.
