Commands#
Diamond Casino keeps its commands few: two panels, an admin tool and the VIP room shortcuts. Each one checks who is using it.
Command | Who | Description |
|---|---|---|
| Admins, the owner, employees | Opens Casino Management. Employees see only the tabs they hold. |
| Admins, the | Opens Casino settings. |
| Framework admins | Gives chips to a player. With memberships on, the player needs a membership to receive them. |
| The Doors permission | Locks the casino and moves everyone inside to the entrance, or unlocks it. |
| Anyone in a VIP room | Opens the VIP Room menu. |
| Anyone in a VIP room | Leaves the room. |
| The renter | Invites a player into the room. |
| Anyone | Prints to the F8 console why the slot machines near you do or do not work. |
| Anyone | Lists the entities the casino has spawned around you, in the F8 console. |
<id> is the player's server ID, the number next to their name in the player list.
Setup Tools#
These help when you set up a new map or adjust a table. They print ready-to-paste config lines to the F8 console. Turn on Billiards debug (/casinoconfig → Billiards) or Debug output (General) first, or nothing is printed.
Command | What it does |
|---|---|
| A see-through pool table follows your aim; the mouse wheel turns it. Press |
| The same for the VIP room's pool table. It prints the offset and heading for its entry in |
| Needs the Events permission. Prints the offset of the spot you aim at from the VIP shell, for moving the room's tables and NPCs. |
| Shows the playing surface and pockets of the nearest table, with its values on screen. |
| Nudges the nearest table's surface offset or size, and prints the new values. |
| Changes the pocket radius or mouth. |
| Print the state of every table, and whether the table, cue and ball models load. |
Tuning commands change the table only until the next restart. Copy the printed values into
config/<map>/billard.luato keep them.
Server Exports#
How another resource works with the casino: a mission that rewards chips, a heist that locks the doors, an economy that replaces blackjack's chip handling.
Reading and moving chips
These work the same way whether chips are an item or a balance on the membership.
-- How many chips the player has (0 without a membership, when memberships are on)
local chips = exports['qs-diamondcasino']:GetMemberChips(source)
-- Give chips. Returns false if they could not be given, e.g. no membership
local ok = exports['qs-diamondcasino']:GiveChipsToMember(source, 500)
-- Take chips. The reason decides how the casino counts it
exports['qs-diamondcasino']:RemoveChipsFromMember(source, 500, 'admin')reason | Counted as |
|---|---|
| A purchase, an exchange or an admin removal. Not a bet. |
none | A bet. It enters the player into a running Global Jackpot. |
Every removal also pays the Casino cut to your society. Always pass a reason unless the chips really are a bet.
Locking the casino
exports['qs-diamondcasino']:ToggleLockCasino(true) -- lock: everyone inside is moved to the entrance
exports['qs-diamondcasino']:ToggleLockCasino(false) -- unlockThis does the same as the Doors tab. The lock lasts until it is undone or the resource restarts.
Replacing blackjack's chip handling
By default blackjack takes and pays chips through the two chip exports above. A custom economy can take over both:
exports['qs-diamondcasino']:SetTakeChipsCallback(function(source, amount)
-- take the stake with your own system
end)
exports['qs-diamondcasino']:SetGiveChipsCallback(function(source, amount)
-- pay the winnings with your own system
end)Client Exports#
Blackjack seat hooks
Run your own code when a player sits down at blackjack or stands up, or decide whether they may sit or must leave. A HUD can hide itself here, or a job can be kept away from the tables.
exports['qs-diamondcasino']:SetSatDownCallback(function()
-- the player sat down
end)
exports['qs-diamondcasino']:SetStandUpCallback(function()
-- the player stood up
end)
exports['qs-diamondcasino']:SetCanSitDownCallback(function()
return true -- false refuses the seat
end)
exports['qs-diamondcasino']:SetLeaveCheckCallback(function()
return false -- true makes the player leave the table
end)Scaleforms
local Scaleforms = exports['qs-diamondcasino']:Scaleforms()The helper the casino uses for its on-screen scaleforms, for advanced interface work.
Events#
Two events are safe and useful to use from your own resources:
Event | Side | Use |
|---|---|---|
| Client | Shows the casino's gold announcement banner. Trigger it from the server with a message. |
| Both, local | Fired after the settings are loaded or changed in |
-- server: announce something to one player, or to everyone with -1
TriggerClientEvent('casino:announcement', source, 'Your table is ready in the VIP room.')Examples#
Reward chips at the end of a mission
local ok = exports['qs-diamondcasino']:GiveChipsToMember(source, 2500)
if not ok then
-- with memberships on, the player has none yet: pay them another way
endClose the casino during a heist
exports['qs-diamondcasino']:ToggleLockCasino(true)
TriggerClientEvent('casino:announcement', -1, 'The Diamond Casino is closed until further notice.')
-- later
exports['qs-diamondcasino']:ToggleLockCasino(false)Sell something for chips in your own shop
local price = 1000
if exports['qs-diamondcasino']:GetMemberChips(source) >= price then
exports['qs-diamondcasino']:RemoveChipsFromMember(source, price, 'shop') -- 'shop': not a bet
-- give the item
end


