Before You Begin#
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. |
| Required | Database access. |
| Required | Callbacks, zones, menus and notifications. |
Framework | Required |
|
| 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 |
| Included | The VIP room shell. Required for VIP rooms. |
Target | Optional |
|
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. |
| Optional | Takes a photo of the jackpot winner for the Discord announcement. |
| 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: |
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 |
|
Notifications |
|
Society · Target | Not detected. Set them in |
Integrations covers each layer in detail and how to force a value.
github.comReleases · overextended/oxmysqlMySQL resource for FXServer.github.comReleases · overextended/ox_libA FiveM resource and script library for Lua and JS.github.comXogy/xsoundSound library for FiveM, used for the casino's background music.Downloading Diamond Casino#
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:
[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 itemsInside qs-diamondcasino:
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 builtThe 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 renamecasino_maporcasino_vipeither.
Installing the Resource#
Move the folders into your server's resources directory. They can sit anywhere inside it, including a category folder:
resources/
└── [qs]/
└── [diamondcasino]/
├── qs-diamondcasino/
├── casino_map/
└── casino_vip/Then open server.cfg. Every dependency, and everything you want detected, has to start before Diamond Casino:
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-diamondcasinoLoad 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.
The Database#
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 |
|---|---|---|
| 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 |
| Players banned from the casino, and why. | The SQL file |
| Everything set in the management panel: the bankroll, staff, walls, cameras, podium car, music, events, jackpot, VIP room settings and the dashboard figures. | Automatic |
| Every Global Jackpot winner. | Automatic |
| Who logged out inside the casino or a VIP room, so they can be put back at the entrance on their next login. | Automatic |
| The values changed in | Automatic |
If your database user cannot create tables, the console says so and
/casinoconfigwill not save. In that case, also importqs-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.
Registering the Items#
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 |
|---|---|---|
| Casino Chips | The casino currency, when chips are an item (the default). |
| Gold Watch · Diamond Ring · Luxury Cigar Box · Expensive Champagne | The VIP shop, and Lucky Wheel prizes. |
| Royal Flush Whiskey · High Roller Vodka · Lucky 7's Tequila · Blackjack Bourbon | The bar, and Lucky Wheel prizes. These are usable: drinking one applies its effect. |
| — | One Lucky Wheel prize. Already exists on most servers. |
Add to ox_inventory/data/items.lua:
['casinochips'] = { label = 'Casino Chips', weight = 0, stack = true, close = false, description = 'Chips for the Diamond Casino.' },
['gold_watch'] = { label = 'Gold Watch', weight = 200, stack = true },
['diamond_ring'] = { label = 'Diamond Ring', weight = 50, stack = true },
['luxury_cigar'] = { label = 'Luxury Cigar Box', weight = 300, stack = true },
['expensive_champagne'] = { label = 'Expensive Champagne', weight = 750, stack = true },
['royal_flush_whiskey'] = { label = 'Royal Flush Whiskey', weight = 500, stack = true, close = true },
['high_roller_vodka'] = { label = 'High Roller Vodka', weight = 500, stack = true, close = true },
['lucky_7s_tequila'] = { label = "Lucky 7's Tequila", weight = 500, stack = true, close = true },
['blackjack_bourbon'] = { label = 'Blackjack Bourbon', weight = 500, stack = true, close = true },Copy the images into ox_inventory/web/images/.
Add to qb-core/shared/items.lua. Drinks are useable; everything else is not:
casinochips = { name = 'casinochips', label = 'Casino Chips', weight = 0, type = 'item', image = 'casinochips.png', unique = false, useable = false, shouldClose = false, description = 'Chips for the Diamond Casino.' },
gold_watch = { name = 'gold_watch', label = 'Gold Watch', weight = 200, type = 'item', image = 'gold_watch.png', unique = false, useable = false, shouldClose = false, description = '' },
diamond_ring = { name = 'diamond_ring', label = 'Diamond Ring', weight = 50, type = 'item', image = 'diamond_ring.png', unique = false, useable = false, shouldClose = false, description = '' },
luxury_cigar = { name = 'luxury_cigar', label = 'Luxury Cigar Box', weight = 300, type = 'item', image = 'luxury_cigar.png', unique = false, useable = false, shouldClose = false, description = '' },
expensive_champagne = { name = 'expensive_champagne', label = 'Expensive Champagne', weight = 750, type = 'item', image = 'expensive_champagne.png', unique = false, useable = false, shouldClose = false, description = '' },
royal_flush_whiskey = { name = 'royal_flush_whiskey', label = 'Royal Flush Whiskey', weight = 500, type = 'item', image = 'royal_flush_whiskey.png', unique = false, useable = true, shouldClose = true, description = '' },
high_roller_vodka = { name = 'high_roller_vodka', label = 'High Roller Vodka', weight = 500, type = 'item', image = 'high_roller_vodka.png', unique = false, useable = true, shouldClose = true, description = '' },
lucky_7s_tequila = { name = 'lucky_7s_tequila', label = "Lucky 7's Tequila", weight = 500, type = 'item', image = 'lucky_7s_tequila.png', unique = false, useable = true, shouldClose = true, description = '' },
blackjack_bourbon = { name = 'blackjack_bourbon', label = 'Blackjack Bourbon', weight = 500, type = 'item', image = 'blackjack_bourbon.png', unique = false, useable = true, shouldClose = true, description = '' },Copy the images into your inventory's html/images/ folder.
Add to qs-inventory/shared/items.lua:
['casinochips'] = {
name = 'casinochips', label = 'Casino Chips', weight = 0, type = 'item',
image = 'casinochips.png', unique = false, useable = false, shouldClose = false,
description = 'Chips for the Diamond Casino.'
},
['royal_flush_whiskey'] = {
name = 'royal_flush_whiskey', label = 'Royal Flush Whiskey', weight = 500, type = 'item',
image = 'royal_flush_whiskey.png', unique = false, useable = true, shouldClose = true,
description = ''
},
-- repeat for the other shop items and drinks: drinks useable = true, the rest useable = falseCopy the images into qs-inventory/html/images/.
For an ESX inventory that reads items from the database:
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES
('casinochips', 'Casino Chips', 0, 0, 1),
('gold_watch', 'Gold Watch', 1, 0, 1),
('diamond_ring', 'Diamond Ring', 1, 0, 1),
('luxury_cigar', 'Luxury Cigar Box', 1, 0, 1),
('expensive_champagne', 'Expensive Champagne', 1, 0, 1),
('royal_flush_whiskey', 'Royal Flush Whiskey', 1, 0, 1),
('high_roller_vodka', 'High Roller Vodka', 1, 0, 1),
('lucky_7s_tequila', 'Lucky 7''s Tequila', 1, 0, 1),
('blackjack_bourbon', 'Blackjack Bourbon', 1, 0, 1);Claiming Admin Access#
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:
add_ace group.admin qs-diamondcasino.config allow
# or a single player
add_ace identifier.license:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx qs-diamondcasino.config allowThis 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.
Configuring the Resource#
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 |
|---|---|
| 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. |
| The NPCs, doors, blip, casino zone, security cameras and key spots for that map. |
| Table and machine positions, table limits, the crowd, the Lucky Wheel prizes and the pool tables. |
| Discord logs, one URL per category. |
| The society account each supported resource pays into. |
The values to review first, in config/main.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 musicQBCore servers: change
Config.Society. It ships set toesx_society. Set it toqb-management,qb-bankingornone.Config.Soundonly 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.
Verifying the Installation#
Restart the server and read the console. You should see the framework that was loaded:
[INFO] Successfully loaded the framework. esxesx 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
/casinoconfigto choose the language, prices and limits. Then open/casinoand 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.



