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

# Installation

Install CAS Horse Racing on your RedM server — VORP, RSG or standalone, oxmysql, self-building tables and no SQL to import.

## 1. Place the folder

Copy `cas-horserace` into your `resources` folder.

If you downloaded a zip, make sure the folder is named exactly `cas-horserace`. A folder named `cas-horserace-main` or `cas-horserace-1.0.0` will not work.

## 2. Add it to server.cfg

`oxmysql` must start before this resource.

```cfg
ensure oxmysql
ensure cas-horserace
```

## 3. Grant the permission

Add this line to `server.cfg`:

```cfg
add_ace group.admin cas.raceeditor allow
```

Change `group.admin` to whichever group your admins are in. See [Permissions](/script-documentation/cas-horse-racing/permissions.md) for other options.

## 4. Start the server

The database tables are created on the first start. There is no SQL file to import.

Watch your console. You should see:

```
[UIforc Racing] framework: vorp - language: en
[UIforc Racing] 0 race(s) on the calendar
```

If you see a different framework than the one you run, set it manually in `config.lua`:

```lua
Config.Framework = 'vorp'   -- 'auto' | 'vorp' | 'rsg' | 'standalone'
```

## 5. Check it in game

Join your server and type:

```
/races
```

The menu should open. If the New Race button is missing, your permission is not set. Go back to step 3.

## Updating

Replace every file except `config.lua`. Keep your own `config.lua` so you do not lose your settings, then compare it against the new one for any settings that were added.

Never delete the database tables when updating. Race history, standings, and any money owed to offline players live there.
