Casino
Blackjack, roulette and slot machines at staff-placed tables, plus street dice anywhere. The server shuffles, spins, rolls, runs every rule and holds every dollar. The client only asks. Built on GR1M_Poker's patterns, with no code shared and nothing in GR1M_Poker changed.
#Setup
ensure GR1M_Casinoafteroxmysql,ox_lib,ox_target,qbx_coreandox_inventory. Tables create themselves.ensure GR1M_Placertoo, or staff can't place tables.- In game, run
/gcasino, Place new table, pick Blackjack or Roulette, the model, and how many chairs. Line the see-through table up, then each chair from the dealer's left, then the dealer (ESC skips the dealer). For a table the map already has, pick ... table in the map, and Chairs already there for its chairs.
The dice item is the dice that's already in ox_inventory/data/items.lua; nothing was added there. Sell it in any shop to make street dice reachable.
#Blackjack
- Player against the dealer, one hand per seat, up to 7 seats.
- A shoe of 1 to 8 decks (6 by default) from
server/rng.js(Nodecrypto.randomInt), reshuffled once the cut card is reached (75% by default). - Dealer stands on soft 17 (or hits, per table), peeks under an ace or a ten, blackjack pays 3:2 (or 6:5), double on any two cards, split once (none, once or up to 3 per table). Split aces take one card each.
- 15 s to bet, 20 s per decision. A missed decision stands. Rebet keeps the last bet going.
- Cards are face up, so they lie on the felt for everyone near. Only the dealer's hole card stays on the server until the dealer plays.
- Rules are in
shared/blackjack.luawith no natives.
#Roulette
- European single zero by default, or American with 00 per table. The vanilla casino table's felt has a 00, so set a vanilla table to American if the felt should match.
- Every standard bet: straight, split, street, corner, line, the zero bets, red/black, odd/even, low/high, dozens and columns. Inside bets are checked against the real layout, so a made-up group of numbers is refused.
- 30 s betting window. The number is picked when bets close and only sent out after the wheel has turned. The table's wheel plays
loop_wheelon vanilla roulette tables; there is no ball. - Limits per spot and per spin are set per table.
- Rules are in
shared/roulette.luawith no natives.
#Money
- Buy-ins come from cash or bank in plain dollars. Dirty money and rcore chips aren't used.
- A table stack lives in
gr1m_casino_seats, saved before each round's bets come off and after the round is paid. - Standing up mid-round: bets already down play out, and the stack comes back when the round ends.
- On a crash or restart every row becomes
table_id = 0and is paid at next login. The saved stack is from before the round, so bets in play are refunded. - A blackjack round whose money doesn't add up pays nothing and restores the stacks.
- House money is player funded. Every table and machine is banked by a GR1M_UltraBoss account:
govby default, or the owning casino's account. Losses pay into it and wins come out of it, so no casino money is ever created. A table with no account, or with too little in it, deals nothing. Before each deal or spin that account must cover the worst case. If it can't, the table stays where it is but deals nothing (players keep their money and see why) until there is money in the account again. If a payout ever can't be taken from the account, the player is still paid and a flag is logged.
#Slot machines
- Staff place a vanilla casino slot machine (or pick one in the map) and its stool with
/gcasino, Place new table, Slot machine. One player per machine, no dealer. - 3 reels, 3 rows, 5 lines, all played on every spin. The GR1M logo is a wild that stands in for any symbol. Bets are per line ($1 to $100 by default, so $5 to $500 a spin).
- Payback is 92%, 95% or 97% per machine. That is the paytable (90%, 93%, 95%) plus the 2% that every real bet adds to the shared progressive jackpot.
tests/engine_test.luachecks each figure exactly from the reel strips inshared/slots.lua. - Three wilds on a line at the machine's top line bet win the jackpot instead of the line's own pay. The jackpot is player funded: it starts at $0, only grows from bets, and starts again from $0 after a win. The share is in
/gcasino, on any slot machine's page. - Cash in like a table. Each spin is drawn, paid and saved by the server in one go, so there is never a spin in flight to refund.
- Auto 10 or 25 (stops on a win you set, on a jackpot, or when credits run low), turbo, and Space to spin.
- Wins of $1,000 or more and jackpots float over the machine for anyone within 25 m.
- Two looks per machine: GR1M Gold and Saloon Brass. Spin totals go to History every 5 minutes, not one row per spin.
#Player-owned casinos
/gcasino, Businesses: create a casino. It becomes an UltraBoss jobcasino_<id>(Dealer, Floor, Manager, Owner). Give it tables and machines, place its For Sale and office points with the placer, set an owner (server id) or a sale price, and set the owners' limits (top bet, top line bet, top buy-in).- A business's society account banks everything it owns: losses pay in, wins come out. A table closes if the account can't cover a round; the owner reopens it from the office once there's money in it. The slots jackpot stays city-run.
- The office (Manager and Owner) shows the account, today's takings per table, and lets them change names, stakes, buy-ins, slot payback preset (92/95/97) and look, and open or close. Blackjack rules, cards and dice stay out of their reach.
- An on-duty employee can stand at a table's dealer spot and pick Deal this table to replace the NPC dealer. Players at that table get tip buttons that pay the dealer in cash.
#Rentals (slots and tables)
- Blackjack and roulette tables work the same as slot machines below: buy them in the office (Buy blackjack table $60,000, Buy roulette table $75,000 by default), place them yourself or rent them out. Tables are set up with the table, chairs and dealer placing staff use (
/placeslotor/placetable). A rented table is banked by the renter and runs with an NPC dealer; the owner's cut comes off the house's takings. - A casino owner (or Manager) can buy slot machines from the city in the office (Buy slot machine, $25,000 by default, set per casino in
/gcasino), paid from the business account. A bought machine sits in stock, placed nowhere, until it's rented. It can be sold back to the city for half its price while it isn't rented. - The owner can also place a stock machine at their own casino with
/placeslot(within 30 m of the office point or the casino's boss point). No rent, no cut: the casino's account banks it and keeps everything it takes in. Nothing vanishes: closed tables and machines stay standing. The owner or a Manager walks up to any of the casino's tables or machines and uses Pick up to put it in stock, then places it again with/placeslot(tables too), rents it out, or sells it back. - An owner lists a slot machine in the office with a weekly fee and a cut of its takings (0 to 50%).
- The boss of any other business rents it at any casino's office (Rent a slot machine). The first day is paid at once from their business account. Up to 3 per business.
- The casino sets it up: a Manager or the Owner goes to the renter's business and uses
/placeslot. It has to go within 30 m of the renter's UltraBoss boss point and never in a no-dice area. Once placed it stays where it is until it goes home. - The renter's account banks the machine. Each day a seventh of the weekly fee plus the cut of positive takings goes from renter to owner. Unpaid, the machine switches off; after 3 unpaid days it goes back where it stood.
- The renter can switch it on or off and change its name and look (Manage rented machine on the machine). Either side can end it with 24 hours' notice; staff end it at once. When it ends the machine is switched off where it stands until the owner or a Manager goes there and picks it up.
#Street dice
- Use the
diceitem. Pick someone within 3 m and a stake (cash only, $1,000 max by default), or roll for fun with no money. - The other player gets a prompt with no cursor: Y accepts, Backspace declines (both rebindable in FiveM key settings). 15 s to answer.
- On accept both stakes come out of cash, the server rolls two dice each, highest total takes both, ties roll again. Both players throw and the dice float over their heads for anyone within 15 m.
- 10 s cooldown. No dice inside the no-dice areas (Mission Row PD, Sandy and Paleto SO, Pillbox, Sandy and Paleto medical, Bolingbroke by default). Staff add more with Block where I stand in the Dice tab.
- Bets at or over $500 go to the webhook, and the same two players this many times in a day are flagged.
#Staff panel
/gcasino: Tables, Live, History, Dice and Flags. Every table setting is there: name, location, stakes, buy-ins, decks, reshuffle point, blackjack payout, soft 17, splits, spin limit, wheel, bank account and felt height. Move, add or remove the dealer, pause, close and refund, open, delete. The Dice tab holds every dice setting.
Admins are the admin and god groups or gr1m_casino.admin. Owners are god or gr1m_casino.owner; only owners set the Discord webhook (server KVP) and the "log wins over" amount.
#Things to tune in game
SeatZOffsetinconfig.luafor the sitting height, and Felt height per table if the cards float or sink.- The dice throw animation is
Dice.animDict/Dice.animNameinconfig.lua.
GR1M