Skip to content

🎰 Gambling ​

Documentation relating to the spooni_gambling.

1. Installation ​

spooni_gambling works Standalone.

To install spooni_gambling:

  • Download the resource
  • Ensure that all requirements are installed
  • Drag and drop the resource into your resources folder
    • spooni_gambling
  • Add this ensure in your server.cfg (after spooni_libs)
    bash
      ensure spooni_gambling
  • Now you can configure and translate the script as you like
    • config.lua
    • language.lua
    • functions.lua (notifications, hiding your own HUD at the tables)
  • At the end, restart the server

TIP

No items, jobs or SQL are needed: the house money and the chips of a player who crashed are kept by the server itself. Poker, blackjack and five finger fillet are played at the game's own tables in the map; the roulette table is set up by the script.

If you have any problems, you can always open a ticket in the Spooni Discord.

2. Usage ​

Players walk up to a table, sit down and buy in: the money becomes chips on the table and goes back into their pocket when they leave. At the poker tables they play Texas Hold'em against each other and the card players, with blinds, a dealer seat that goes round the table, four betting rounds, side pots and the showdown; at blackjack they play against the house dealer, with doubles, splits and insurance; at five finger fillet they bet their fingers against another player or the game's opponent in Classic, Guts or Burnout; at the roulette table they stand round the layout and put their chips on every bet of the American wheel.

Every move is the game's own animation, every card and chip is a real one on the table, everyone nearby sees the same game, and the game's own minigame HUD shows every player's chips, bets and portrait. Card players already sit at the poker and blackjack tables and one always stands up to free a seat when players come. The blackjack and roulette houses can play from their own money, which a bank or business script can read, add or take through the exports below.

3. For developers ​

Optional integrations ​

Each one is used only if you run it:

  • spooni_metabolism, the vorp HUD and the minimap are hidden while you sit at a table. Add your own HUD to HideGamblingHud in functions.lua.
  • A bank or business script can follow the blackjack and roulette houses through the events and exports below.

The framework (VORP, RSG or your own) is set in spooni_libs (framework in its config.lua, auto finds it on its own); money, names and notifications come from there.

The tables ​

GameTables in the configSeats
PokerValentine, Blackwater, Saint Denis, Thieves Landing, Rhodes6
BlackjackBlackwater, Rhodes, Van Horn4
Five Finger FilletValentine, Strawberry, Van Horn2
RouletteSaint Denis (La Bastille)6 standing

Poker, blackjack and five finger fillet use the game's own tables, so the tables and chairs are already in the map. The roulette table is not part of the map: the script spawns it at its coords. To move it, stand where you want the table, check that the floor is free and level, and put that position and heading in the config.

Poker ​

Texas Hold'em like the game's own: blinds, the dealer button, pre-flop, flop, turn and river, the showdown with true hand ranking and side pots for every all-in. The dealer seat goes round the table: the dealer gets the deck, shuffles, deals around the table, lays the flop, turn and river and passes the deck on.

KeyDoes
ESit Down, then Buy In
↑ / ↓the buy-in and the raise amount
SHIFTStart the hand (it also starts on its own with 2 players)
ENTERCheck / Call
RRaise
LEFT MOUSEAll-In
FFold
RIGHT MOUSEa tap switches first / third person, held it shows your cards up close
SPACE (hold)look down at the community cards (once the flop is out)
Hthe game's own poker help (the hands and how to play)
BACKSPACELeave and cash out (during a hand, only once you have folded)
  • Buy-in — between the table's buy_min and buy_max. Between hands the top right shows the players bought in and the seconds until the next deal.
  • Cards and chips — your two cards are held face up for you, everyone else's face down until the showdown. Your stack sits in front of you, your bets go to the middle and the winner pulls the pot.
  • Card sets — every table has its own (deck): VAL, BLA, RHO, VAN, CAMP, GK, RRS, STD_LABASTILLE, STD_OPIUM, with its own 3D cards, chips and card faces in the HUD.
  • Adding a table — one line in poker.tables, with the coordinates of the table prop itself:
lua
["MyTable"] = {coords = vector3(0.0, 0.0, 0.0), prop = "p_tablepoker01x", deck = "VAL", small_blind = 10, big_blind = 20, buy_min = 250, buy_max = 5000},

The six seats are the game's own seat positions around that table, turned to line up with the chairs standing round it.

Blackjack ​

Up to 4 players against the house dealer, with the game's own rules and animations: the dealer shuffles, deals two cards to every player and two to himself (one face down), walks to each seat to give cards, turns his hidden card over and draws until he has 17 or more.

KeyDoes
ESit Down, then Buy In
↑ / ↓the buy-in, the bet and the insurance amount
ENTERPlace Bet, Hit, Insurance
SPACESit Out, Stand, No Insurance
FDouble down (first two cards)
TABSplit a pair
Vfirst person / normal camera
BACKSPACELeave and cash out
  • Payouts — a win pays 1:1, a blackjack 3:2, insurance 2:1 (payout_win, payout_blackjack, payout_insurance); a tie gives the bet back, and seven cards without going over 21 always win (charlie_cards).
  • Split — once per hand; split aces get one card each.
  • Insurance — when the dealer shows an ace, up to half your bet; the dealer then looks under his card for blackjack.

Five Finger Fillet ​

The game's own knife game, with its own animation network, rules and buttons. Two seats per table: play against another player, or against the game's own opponent when you are alone. Both sides put in the table's stake and the first to win two rounds takes the pot.

ModeHow it is played
Classicfinish the laps (one, two once you have won a round) faster than your opponent; five lives, a mistake costs one and restarts your attempt
Gutsthe most laps in 20 seconds; a mistake only costs time
Burnoutthe most laps in 30 seconds; one mistake ends your turn
  • Play (ENTER) plays for the stake, Practice plays alone for free (three attempts, the sequence can be changed). V switches the camera, the game's zoom button looks closer, BACKSPACE stands up (a running game goes to your opponent).
  • The sequence is shown on the table next to your hand, only on your own turn, with the next button pulsing. A wrong button, a press before the knife is ready or a press too late puts the knife in a finger. After a full lap in Guts and Burnout you can do a knife trick or end your turn and keep your laps.
  • The stab keys — the game's W A D S or the arrow keys (key_stab, both lines are in the config); a table can have its own. The table shows the keys you set.
  • The opponent — npc_level (0 to 3) per table, and it plays harder after every game it loses. difficulty sets the knife's speed for everyone (1.0 = the game's, from 0.5 to 2.0).

Roulette ​

American roulette (0, 00 and 1 to 36) against the house, up to six players standing round the table, each on their own spot with their own chip colour.

KeyDoes
EStep Up, then Buy In
MOUSE WHEELthe buy-in and the bet amount
ARROW KEYSwalk your chip over the layout (hold to go faster)
TABthe printed fields or the lines between the numbers
ENTERPlace Chips
FTake Back your last chips
SPACEDone betting
Vabove the layout, above the wheel, the normal view
BACKSPACELeave and cash out (chips already on the layout stay in the round)
BetPays
Straight35:1
Split17:1
Street11:1
Corner8:1
Five number (0, 00, 1, 2, 3)6:1
Line5:1
Dozen / Column2:1
Red / Black, Even / Odd, 1 to 18 / 19 to 361:1
  • 0 and 00 only win the inside bets they are part of; every outside bet loses on them. Every payout is in the config (payout_straight ... payout_even).
  • The bets stay open until everyone pressed Done or the time is up; the clock starts with the first chip. The croupier waves "no more bets", the wheel and the ball spin, the ball drops into the pocket the server drew, the croupier sets the marker, rakes the lost chips and pays every win next to its stake.

Card players and portraits ​

  • Card players sit at the poker (npc_players, 3 by default) and blackjack tables (npc_count, 2 by default) and are already seated when you walk up. One seat always stays free: when players come, a card player stands up after the hand and leaves, and the next player takes the seat. They play with their own chips (npc_stack), never with players' money. At five finger fillet the game's opponent sits down when you play alone (npc_opponent).
  • Portraits — the game's own HUD shows a portrait next to every seat: you are Arthur (Sadie for a woman character), every other seat at the table gets its own, never the same one twice.

The house's money ​

Every blackjack and roulette table has a house: the dealer's money, kept on the server across restarts.

  • dealer_money = 0 — no limit; the house only counts its profit (what players lost minus what they won).
  • dealer_money = 5000 (any amount) — the dealer starts with that money. Bets must fit in what he can still cover this round, the money grows when players lose and shrinks when they win, and the table closes when it runs out, until someone adds money.

Only real players' money counts, the card players' chips do not.

Config highlights (config.lua) ​

  • Shared: language, currency (cash or gold), native_hud (the game's own minigame HUD, false = the script's own), render_distance, blip_scale, chair_models.
  • Every game has its own block (poker, blackjack, fff, roulette) with enabled, its keys (key_*), its timings in ms, camera, blip and its tables.
  • Poker: max_seats, min_players, start_delay, end_round, turn_time, deal_time, board_time, sit_anim, show_cards, show_chip_props, npc_players, npc_stack; each table: coords, prop, deck, small_blind, big_blind, buy_min, buy_max.
  • Blackjack: bet_time, turn_time, deal_time, insurance_time, payout_*, charlie_cards, npc_players, npc_count, npc_stack; each table: coords, heading, dealer, deck, bet_min, bet_max, buy_min, buy_max, dealer_money.
  • Five finger fillet: key_stab, difficulty, npc_opponent, classic_limit, max_rounds; each table: coords, heading, mode, stake, npc_level, key_stab.
  • Roulette: max_players, bet_time, spin_time, result_time, payout_*, show_chip_props, dealer_idle; each table: coords, heading, dealer, bet_min, bet_max, max_spot, buy_min, buy_max, dealer_money.

The config checker in the spooni_libs panel (/spoonicfg → Script Versions) shows and fixes config mistakes. Every text players see is in language.lua.

Exports ​

After every round the server fires an event with the house's result (server side):

lua
-- result = what the house won this round (negative = it paid out), balance = the dealer's money now
AddEventHandler("spooni_gambling:blackjack:house", function(tableName, result, balance) end)
AddEventHandler("spooni_gambling:roulette:house", function(tableName, result, balance) end)

The house's money (server side; tableName is the table's name in the config, e.g. "Blackwater"):

lua
exports.spooni_gambling:GetBlackjackHouse(tableName)          -- the dealer's money (or the profit with no limit)
exports.spooni_gambling:TakeBlackjackHouse(tableName, amount) -- takes amount out (all of it if nil), never below 0; returns what it took
exports.spooni_gambling:AddBlackjackHouse(tableName, amount)  -- adds money; returns the new balance
exports.spooni_gambling:SetBlackjackHouse(tableName, amount)  -- sets the dealer's money; returns it

exports.spooni_gambling:GetRouletteHouse(tableName)
exports.spooni_gambling:TakeRouletteHouse(tableName, amount)
exports.spooni_gambling:AddRouletteHouse(tableName, amount)
exports.spooni_gambling:SetRouletteHouse(tableName, amount)

Your own HUD (client side, functions.lua):

lua
-- hide = true when the player sits down at any table, false when they leave
function HideGamblingHud(hide)
    local show = not hide
    DisplayRadar(show)
    TriggerEvent("syn_displayrange", show)
    TriggerEvent("vorp:showUi", show)
    TriggerEvent("spooni_metabolism:setNuiFocus", hide)
    -- add your own HUD's trigger here
end