> ## Documentation Index
> Fetch the complete documentation index at: https://docs.r-scripts.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Step-by-step guide to install R_Casino on your FiveM server

## Prerequisites

<Steps>
  <Step title="Required Dependencies">
    * **ox\_lib** - UI and utilities
    * **oxmysql** - Database operations
    * **Framework** - ESX, QBCore, or QBX
  </Step>
</Steps>

## Installation Steps

<Steps>
  <Step title="Download & Extract">
    Download R\_Casino and place it in your `resources` folder as `r_casino`
  </Step>

  <Step title="Database Setup">
    Import the SQL file:

    ```sql theme={null}
    CREATE TABLE IF NOT EXISTS `r_casino_players` (
      `id` INT(11) NOT NULL AUTO_INCREMENT,
      `player_identifier` VARCHAR(46) NOT NULL,
      `coins` INT(11) NOT NULL DEFAULT 0,
      PRIMARY KEY (`id`)
    );

    CREATE TABLE IF NOT EXISTS `r_casino_case_cooldowns` (
      `player_identifier` varchar(255) NOT NULL,
      `case_value` varchar(255) NOT NULL,
      `last_opened` datetime NOT NULL,
      PRIMARY KEY (`player_identifier`, `case_value`)
    );
    ```

    Or enable auto-insert:

    ```lua theme={null}
    R.EnableAutoinsert = true
    ```
  </Step>

  <Step title="Configure Framework">
    Edit `config.lua`:

    ```lua theme={null}
    R.Framework = "ESX" -- ESX, qbcore, or qbx
    R.newESX = true
    R.CoreName = "es_extended"
    R.Inventory = "ox_inventory"
    ```
  </Step>

  <Step title="Add to server.cfg">
    ```cfg theme={null}
    ensure ox_lib
    ensure oxmysql
    ensure es_extended
    ensure r_casino
    ```
  </Step>

  <Step title="Start Server">
    Perform a full server restart
  </Step>
</Steps>

## Verify Installation

1. Type `/casino` in-game
2. Press **F5** (default fast key)

<Card title="Common Issues" icon="wrench" href="/r_casino/common-issues">
  Having problems? Check troubleshooting
</Card>
