Installation — Diamond Casino | Quasar Store | Quasar Store
Documentation
Installation
Install Diamond Casino on your FiveM server: requirements, load order in server.cfg, the casino map and VIP shell, the database, the casino items and granting admin access.
Before installing Diamond Casino, make sure your server meets the requirements. OneSync, two libraries and a framework are mandatory. Everything else is optional, and most of it is detected automatically.
Requirement
Status
Notes
OneSync
Required
Enabled by default on txAdmin servers.
oxmysql
Required
Database access.
ox_lib
Required
Callbacks, zones, menus and notifications.
Framework
Required
es_extended (ESX) or qb-core (QBCore), detected automatically. With neither, the script falls back to a standalone bridge, which is a template you fill in yourself.
xsound or mx-surround
Optional
Plays the background music in the casino and the VIP rooms. Without either, turn the music off (see Configuring the Resource).
Casino map
Optional
The included casino_map, or one of the supported casino MLOs.
casino_vip
Included
The VIP room shell. Required for VIP rooms.
Target
Optional
qtarget or ox_target. Without a target resource, NPCs and games show a 3D prompt and players press E.
Vehicle keys
Optional
Hands over the keys of the car won on the Lucky Wheel.
Society
Optional
Pays the casino's cut of each sale into a society account.
screenshot-basic
Optional
Takes a photo of the jackpot winner for the Discord announcement.
qs-interface · qs-textui
Optional
Styled notifications, progress bars and 3D prompts. Without them, the script uses ox_lib's and the game's own.
Some integrations are picked by checking which resources are already running when the casino starts:
Layer
How it is chosen
Framework
Detected: es_extended or qb-core.
Casino map
Detected from the MLO resource name. If none is found, the GTA Diamond Casino layout is used.
Vehicle keys
Detected from eleven supported resources.
Music
xsound → mx-surround
Notifications
qs-interface → ox_lib
Society · Target
Not detected. Set them in config/main.lua.
Integrations covers each layer in detail and how to force a value.
When you buy Diamond Casino, it is automatically linked to your CFX Portal account.
Sign in to the CFX Portal with the same account you used at checkout. Open Granted Assets and download Diamond Casino. The download contains:
lua
[diamondcasino]/
├── qs-diamondcasino/ -- the script
├── casino_map/ -- the Diamond Casino interior (only if you have no other casino MLO)
├── casino_vip/ -- the VIP room shell
├── [sql]/ -- qs-diamondcasino.sql, the tables to import
└── [img]/ -- inventory images for the casino items
Inside qs-diamondcasino:
lua
qs-diamondcasino/
├── config/ -- config/main.lua, plus one folder per casino map
├── custom/ -- framework bridges (editable)
├── client/custom/ -- target, vehicle keys, weather (editable)
├── server/custom/ -- society, Discord logs, quests (editable)
├── locales/ -- 41 languages
├── music/ -- the casino's music tracks
├── sql/ -- database.sql, only needed in one case (see below)
└── web/build/ -- the interface, already built
The folder must be named qs-diamondcasino. The script checks its own name on start. A renamed copy prints You have renamed the script! and does not start. Do not rename casino_map or casino_vip either.
Then open server.cfg. Every dependency, and everything you want detected, has to start before Diamond Casino:
bash
ensure oxmysql
ensure ox_lib
# Framework
ensure es_extended
# ensure qb-core# Optional integrations
ensure xsound # or mx-surround
ensure ox_target # only with Config.UseTarget = true
ensure qs-vehiclekeys # or another supported keys resource
ensure esx_society # or qb-management / qb-banking / ap-government
ensure screenshot-basic
# The map: the included interior OR your casino MLO
ensure casino_map
# ensure gabz_casino
ensure casino_vip
ensure qs-diamondcasino
Load order matters. The framework, the map and the keys resource are detected once, while the casino starts. Anything that starts after it is not found.
Import [sql]/qs-diamondcasino.sql into your server's database once, with HeidiSQL, phpMyAdmin or any other client. This import is required. The memberships and the ban list are only created by that file. The script creates its other tables itself on first start.
Table
Holds
Created by
casino_memberships
Memberships, the VIP flag, chips (when they are not an item), and the dates of the last wheel spin and chip limit.
The SQL file
casino_blocked_players
Players banned from the casino, and why.
The SQL file
casino_store
Everything set in the management panel: the bankroll, staff, walls, cameras, podium car, music, events, jackpot, VIP room settings and the dashboard figures.
Automatic
casino_jackpot_winners
Every Global Jackpot winner.
Automatic
casino_inside
Who logged out inside the casino or a VIP room, so they can be put back at the entrance on their next login.
Automatic
qs_casino_settings · qs_casino_shop_items
The values changed in /casinoconfig, and the VIP shop and bar lists.
Automatic
If your database user cannot create tables, the console says so and /casinoconfig will not save. In that case, also import qs-diamondcasino/sql/database.sql. When you update from an older version, data from earlier releases moves into the new tables automatically on the first start.
The casino gives and takes items through your framework, so each item has to exist in your inventory. The images are in [img]/. Copy them into your inventory's image folder.
Item
Label
Used by
casinochips
Casino Chips
The casino currency, when chips are an item (the default).
Diamond Casino has two panels with different access rules. /casinoconfig holds the settings and is for server admins. /casino runs the venue and is for admins, the casino's owner and its employees.
Automatic, nothing to configure. Server admins can open both panels. On ESX that means the admin and superadmin groups. On QBCore it means the god and admin permissions, or anyone with the command ace.
To let someone change the settings without making them a framework admin, give them the qs-diamondcasino.config ace in server.cfg:
bash
add_ace group.admin qs-diamondcasino.config allow
# or a single player
add_ace identifier.license:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx qs-diamondcasino.config allow
This ace opens /casinoconfig only. It is deliberately outside command., so nobody inherits it by accident.
Next, hand the casino to its owner. As an admin, open /casino, press the crown button next to the title, and pick an online player. The owner can then hire employees and run the casino without any server permission. No job is involved; access is stored by the casino itself.
Prices, limits, game rules, the shop lists and the language are set in game with /casinoconfig, saved to the database and applied live. The files only hold what has to be known before the server starts, or what depends on the map:
File
Contents
config/main.lua
Detection of the framework, map and keys; the society; target mode; the music tracks; the custom wall models; the shape of the VIP room; the phone waypoint; the HUD functions.
config/<map>/main.lua
The NPCs, doors, blip, casino zone, security cameras and key spots for that map.
config/<map>/*.lua
Table and machine positions, table limits, the crowd, the Lucky Wheel prizes and the pool tables.
server/custom/webhooks.lua
Discord logs, one URL per category.
server/custom/society/
The society account each supported resource pays into.
The values to review first, in config/main.lua:
lua
Config.Society = 'esx_society'-- 'none', 'esx_society', 'qb-management', 'qb-banking', 'ap-government'
Config.UseTarget = false-- true = qtarget / ox_target, false = 3D prompt + E
Config.TargetDistance = 5.0-- target reach, in metres
Config.Sound = 'midnight_tokyo.mp3'-- starting music track, false = no music
QBCore servers: change Config.Society. It ships set to esx_society. Set it to qb-management, qb-banking or none. Config.Sound only sets the track the casino starts with. Once someone picks a track in /casino → Music, that choice is saved, and editing the file afterwards changes nothing.
Restart the server and read the console. You should see the framework that was loaded:
bash
[INFO] Successfully loaded the framework. esx
esx or qb means the framework was found. standalone means it was not; move your framework above ensure qs-diamondcasino. Then join the server and work through the first visit:
Walk into the casino
The Diamond Casino blip is on the map. Inside, the cashier, membership desk, doormen, shop and bar NPCs appear as you approach, along with the crowd and the music.
Buy a membership and chips
Buy a membership at the membership desk, then exchange bank money for chips at the cashier. Sit down at any table to play.
Set the casino up
Open /casinoconfig to choose the language, prices and limits. Then open /casino and assign the owner. Usage covers the rest.
From here on, almost nothing needs a restart. The few settings that do are marked Needs restart in the panel.
Copy the images into your inventory's html/images/ folder.