> For the complete documentation index, see [llms.txt](https://documentation.rcore.cz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.rcore.cz/paid-resources/rcore_casino/installation.md).

# Installation

Set up rcore\_casino, for both new installs and servers upgrading from v1.

This guide covers both a fresh install and upgrading from v1.

Download `rcore_casino` from your [Keymaster](https://portal.cfx.re/assets/granted-assets?page=1\&sort=asset.updated_at\&direction=asc\&search=rcore_casino).

***

## Before You Begin

You'll need:

* [ ] `mysql-async` or `oxmysql`.
* [ ] ESX, QBCore, or standalone.

## Setup

{% stepper %}
{% step %}

### Install the Resource

{% hint style="warning" %}
Upgrading from v1? Delete the old `rcore_casino` folder before you copy in the new one. Do not copy the new files over the old ones. Your v1 players are not lost: [Upgrading from v1](#upgrading-from-v1-import-your-players) brings them over.
{% endhint %}

1. Create a `[casino]` folder inside your server's `resources` folder.
2. Copy `rcore_casino_assets` and `rcore_casino` into `resources/[casino]`.
3. Add the folder to your `server.cfg`:

```cfg
ensure [casino]
```

{% endstep %}

{% step %}

### Install Inventory Items

The casino uses a set of inventory items for chips and the drinking-bar snacks. The full item list, icons, and per-inventory installation instructions live on the dedicated page: [Casino / Installing Inventory Items](https://documentation.rcore.cz/paid-resources/rcore_casino/v1-legacy/inventory-items.md).

With `CasinoCurrency.InventoryChips`, every casino needs its own chips item, for example `casino_chips` and `paleto_chips`. Register one for each casino.
{% endstep %}

{% step %}

### Set Up the Society System

Societies are the company accounts in your banking resource that the casino pays into. Every society you use must already exist there, because the casino never creates one. More in [Societies](https://documentation.rcore.cz/paid-resources/rcore_casino/features/societies.md).

**1. Enable societies**

In `configs/config.lua`:

```lua
EnableSociety = true,
```

**2. Choose your society framework**

By default `SocietyFramework` is set to `Society.AutoDetect`, so the casino will configure it automatically if one of these resources is installed:

```lua
-- Society.AutoDetect
-- Society.None
-- Society.QbBanking
-- Society.QbBossMenu
-- Society.QbManagement
-- Society.RenewedBanking
-- Society.OkokBanking
-- Society.Management710
-- Society.FdBanking
-- Society.EsxAddonAccount
-- Society.SnipeBanking
-- Society.jobs_creator
-- Society.WasabiBanking
SocietyFramework = Society.AutoDetect,
```

Only set a specific option if you run an unsupported/renamed resource or auto-detection picks the wrong one.
{% endstep %}

{% step %}

### Configure Permissions

The casino has two separate permissions, each unlocked by an ACE permission configured in your `server.cfg`:

<table><thead><tr><th width="260">ACE permission</th><th>What it unlocks</th></tr></thead><tbody><tr><td><code>rcore.casino.admin</code></td><td>The admin console (<code>/casinoconsole</code>)</td></tr><tr><td><code>rcore.casino.editor</code></td><td>The casino editor (<code>/casinoeditor</code>)</td></tr><tr><td><code>rcore.casino</code></td><td>Both of the above</td></tr></tbody></table>

**1. Set up your staff**

Paste this block into your `server.cfg`, under your permissions section:

{% code title="server.cfg" %}

```cfg
## Casino permissions ##

# Server admins - full access (admin console + casino editor)
add_ace group.admin rcore.casino allow

# Server moderators - casino editor only, no admin console
add_ace group.mod rcore.casino.editor allow
```

{% endcode %}

Everyone in your `group.admin` can open both the console and the editor, and everyone in `group.mod` can open the editor only.

**Grant yourself access**

{% tabs %}
{% tab title="ACE permission" %}
{% code title="server.cfg" %}

```cfg
# Admin console only (/casinoconsole)
add_ace identifier.license:PLAYER_LICENSE_HERE rcore.casino.admin allow

# Casino editor only (/casinoeditor)
add_ace identifier.license:PLAYER_LICENSE_HERE rcore.casino.editor allow

# Both console and editor
add_ace identifier.license:PLAYER_LICENSE_HERE rcore.casino allow
```

{% endcode %}
{% endtab %}

{% tab title="Group/Permission" %}
Access is determined by the framework groups defined in `configs/config_server.lua`, under `ServerConfig.Permissions`. To grant yourself or other players permission, add the relevant ESX group or QBCore permission name directly into the role's `groups` list:

{% code title="configs/config\_server.lua" %}

```lua
ServerConfig = {
    Permissions = {
        Admin = {
            acePermissions = { "rcore.casino.admin" },
            groups = { "admin", "mod", "moderator", "god", "casino" },
            whitelist = { "license:xxxxx", "discord:xxxxx" },
        },
        Editor = {
            acePermissions = { "rcore.casino.editor" },
            groups = { "admin", "mod", "moderator", "god", "casino" },
            whitelist = { "license:xxxxx", "discord:xxxxx" },
        },
    },
}
```

{% endcode %}
{% endtab %}

{% tab title="Whitelist" %}
Hardcode specific identifiers straight into the role's `whitelist` in `configs/config_server.lua`, handy for a quick owner grant without touching `server.cfg`:

{% code title="configs/config\_server.lua" %}

```lua
whitelist = { "license:1a2b3c4d5e6f...", "discord:123456789012345678" },
```

{% endcode %}

Supported identifier types include `license:`, `discord:`, `steam:`, `fivem:`, and `ip:`.
{% endtab %}
{% endtabs %}

Once granted, you have access to the two tools that run the casino:

* `/casinoeditor`: the in-game editor, where you place and adjust everything in the casino: tables, slots, cashiers, peds.
* `/casinoconsole`: the admin console, for managing players, chips, bans and transactions.
  {% endstep %}

{% step %}

### Configure Your Framework

The casino will configure your framework automatically. It checks for ESX, then QBCore, and falls back to Standalone if neither is running. You only need to set `Active` manually in `configs/config.lua` if detection picks the wrong one, or you use a [custom framework](https://documentation.rcore.cz/paid-resources/rcore_casino/integrations/custom-framework.md).

Whichever it lands on is printed to the server console on startup.

```lua
Framework = {
    -- which framework to use
    -- FrameworkType.ESX        for ESX
    -- FrameworkType.QBCore     for QBCore
    -- FrameworkType.Standalone for Standalone (no framework)
    -- FrameworkType.Custom     for Custom framework
    -- FrameworkType.AutoDetect automatically detects ESX or QBCore
    Active = FrameworkType.AutoDetect,

    -- esx resource name + shared object name
    ES_EXTENDED_RESOURCE_NAME = "es_extended",
    ESX_SHARED_OBJECT = "esx:getSharedObject",

    -- qbcore resource name + shared object name
    QB_CORE_RESOURCE_NAME = "qb-core",
    QBCORE_SHARED_OBJECT = "QBCore:GetObject",
}
```

{% endstep %}

{% step %}

### Install a Map Preset

`casinomapinstall` places a full, ready-to-play casino (tables, slots, cashiers, peds, blips) for one of the supported maps below. For most servers this is the fastest way to get a working casino.

{% hint style="info" %}
Presets are available for the maps listed below. If you run your own map, you'll use the in-game editor (`/casinoeditor`) to place the games, cashiers and NPCs yourself.
{% endhint %}

**What it installs**

The installer automatically places all the essential gameplay props so the casino is immediately playable:

* Slot machines, Roulette, Blackjack, Poker, Inside Track, Lucky Wheel
* Cashiers, bartenders, seats, and ambient peds
* Office computers
* Office (CCTV) cameras

**Supported maps**

Run this command from your server console with the map's id:

```bash
casinomapinstall 5
```

The first run only asks you to confirm. Run the exact same command a second time to install the preset.

You can also pass the map/resource name instead of the id. `casinomapinstall rcore_casino_interior` does the same thing as `casinomapinstall 5`.

<table data-full-width="false"><thead><tr><th width="80">ID</th><th>Map</th><th width="80">ID</th><th>Map</th></tr></thead><tbody><tr><td>1</td><td>UncleJust</td><td>9</td><td>Clawles: Casino Los Santos</td></tr><tr><td>2</td><td>Gabz Casino</td><td>10</td><td>Molo Casino</td></tr><tr><td>3</td><td>NoPixel Casino</td><td>11</td><td>Jurassic Jackpot Casino</td></tr><tr><td>4</td><td>K4MB1 Casino</td><td>12</td><td>Energy Atlantis Casino</td></tr><tr><td>5</td><td>rcore_casino_interior <em>(default)</em></td><td>13</td><td>HG: The Town Resort &#x26; Casino</td></tr><tr><td>6</td><td>Underground Casino Paleto</td><td>14</td><td>TStudio: Pearls Casino</td></tr><tr><td>7</td><td>K4MB1 Enterable (old) Casino</td><td>15</td><td>Molo Atlantis Casino</td></tr><tr><td>8</td><td>Patoche Casino</td><td>16</td><td>Prompt: Chinese Casino</td></tr><tr><td>17</td><td>Starz Casino</td><td></td><td></td></tr></tbody></table>

With `CasinoCurrency.InventoryChips`, the installed casino stays off until it has a chips item. Open `/casinoeditor`, select the new preset (for example `map_5`), set its Chips Item and turn it on. More in [Presets](https://documentation.rcore.cz/paid-resources/rcore_casino/features/editor.md#presets).

**Installing with a society (optional)**

The command takes an optional second argument, a society name:

```bash
casinomapinstall <map_id> [society_name]
```

* Without the society argument, the preset's own society settings are installed untouched.
* With a society name, the installer enables society on every game element it places and assigns the society name automatically.

```bash
# installs the map as-is
casinomapinstall 5

# installs the map and points everything at society_casino
casinomapinstall 5 society_casino
```

{% hint style="warning" %}
The society you pass here must exist in your banking resource, as set up in [Set Up the Society System](#set-up-the-society-system). If it doesn't exist, the games still pay out but their income won't be collected anywhere.
{% endhint %}

{% hint style="info" %}
Nothing here is permanent. After installing, open `/casinoeditor` to move, add, remove, or completely rebuild any part of the casino to fit your server.
{% endhint %}
{% endstep %}
{% endstepper %}

## Database

There is no SQL file to import for the casino itself. On first start it creates every table it needs. A server coming from v1 also imports its players once, see [Upgrading from v1](#upgrading-from-v1-import-your-players).

## Upgrading from v1: Import Your Players

Import your v1 players, so they keep their chips and VIP time.

{% hint style="warning" %}
Install your map preset ([Install a Map Preset](#install-a-map-preset)) first.
{% endhint %}

1. Run from the server console:

```bash
casinoimportv1
```

It prints how many players and chips are waiting, and the casino presets on the server with their map:

```
2 v1 players holding 63000 virtual chips wait in casino_players.
The casino presets on this server, maps included:

- general
- map_5   rcore_casino_interior

Usage: casinoimportv1 <preset>
```

2. Run it with the preset your players should land in, then run the exact same command a second time to confirm.

```bash
casinoimportv1 map_5
```

What gets imported into the casino:

* Virtual chips
* VIP time, free drinks
* Welcome pack

{% hint style="info" %}
If you used inventory chips in v1, the chips are already in your players' inventories and are not imported. Give the casino preset the same chips item in `/casinoeditor`.
{% endhint %}
