Documentation
R_Casino

r_casino Installation

Install r_casino on ESX, QBCore or QBox: ox_lib and oxmysql, the SQL tables, server.cfg start order and how to check the casino opens.

Prerequisites

Required Dependencies

  • ox_lib: UI and utilities
  • oxmysql: database
  • Framework: ESX, QBCore or QBX

Installation Steps

Download & Extract

Download R_Casino and place it in your resources folder as r_casino

Database Setup

Import sql.sql from the r_casino folder. It creates these three tables:

CREATE TABLE IF NOT EXISTS `r_casino_players` (
  `id` INT(11) NOT NULL AUTO_INCREMENT,
  `player_identifier` VARCHAR(46) NOT NULL COLLATE 'latin1_swedish_ci',
  `coins` INT(11) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `uq_player_identifier` (`player_identifier`) USING BTREE,
  INDEX `coins` (`coins`) USING BTREE
) ENGINE=InnoDB COLLATE='utf8mb4_general_ci';

CREATE TABLE IF NOT EXISTS `r_casino_case_cooldowns` (
  `id` INT(11) NOT NULL AUTO_INCREMENT,
  `player_identifier` VARCHAR(46) NOT NULL COLLATE 'latin1_swedish_ci',
  `case_value` VARCHAR(50) NOT NULL COLLATE 'utf8mb4_general_ci',
  `last_opened` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `player_case` (`player_identifier`, `case_value`) USING BTREE,
  INDEX `player_identifier` (`player_identifier`) USING BTREE
) ENGINE=InnoDB COLLATE='utf8mb4_general_ci';

CREATE TABLE IF NOT EXISTS `r_casino_history` (
  `id` INT(11) NOT NULL AUTO_INCREMENT,
  `player_identifier` VARCHAR(46) NOT NULL COLLATE 'latin1_swedish_ci',
  `game` VARCHAR(20) NOT NULL COLLATE 'utf8mb4_general_ci',
  `bet` INT(11) NOT NULL DEFAULT 0,
  `payout` INT(11) NOT NULL DEFAULT 0,
  `detail` VARCHAR(80) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
  `played_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `player_played` (`player_identifier`, `played_at`) USING BTREE
) ENGINE=InnoDB COLLATE='utf8mb4_general_ci';

Or enable auto-insert:

R.EnableAutoinsert = true
Upgrading from an older R_Casino? Keep your tables. Coin balances carry over untouched. Auto-insert adds the missing unique index for you (see Configuration).

Configure Framework

Edit config.lua:

R.Framework = "qbx" -- ESX, qbcore, or qbx
R.newESX = true
R.CoreName = "es_extended"
R.Inventory = "ox_inventory"

Add to server.cfg

ensure ox_lib
ensure oxmysql
ensure es_extended
ensure r_casino

Start Server

Perform a full server restart

Verify Installation

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

Common Issues

Having problems? Check troubleshooting