Oxide Dice

Street craps for FiveM servers — player-against-player dice games for cash on the street and at placeable casino and folding tables, with server-held stakes, side bets and a throw camera.

Overview

oxide-dice is a street craps resource ("shooting dice"), played player against player for cash:

Bet -> Fade -> Come-out roll -> Point -> Hit or seven-out

A player uses the dice item to put a game down at their feet, and up to seven others sit round the circle on upturned milk crates. The shooter sets a bet and the others fade it, covering part or all of it with their own cash. The shooter throws: 7 or 11 on the come-out wins, 2, 3 or 12 loses, and any other total becomes the point, which the shooter must roll again before a 7. Winners keep the dice and may press the bet; losers pass the dice clockwise. While a point is set, players can make side bets between themselves: point before 7, 7 before point, and number bets at agreed odds.

The resource is never the house. There is no rake and no bank: every dollar comes from one player and goes to another. The server holds every stake the moment it's accepted, rolls every result with a cryptographically strong random number generator, and gives every stake back if a restart interrupts a game.

The resource ships with street games for 2 to 8 players and two placeable kinds of dice table: a long casino table with a back wall, for up to 8 players round it (5 who take the dice), and a cheaper folding card table with four chairs pulled up to it. Tables come with three placement modes (admins only, players inside allowed zones, players anywhere outside blocked zones), and fixed tables of either kind at spots the server owner chooses. The resource ships its own die, table and crate models, its own street, chair and table animations, a deterministic dice simulation every nearby player sees land on the same faces, a throw camera, positional dice sounds, a dice seller, and optional police alerts for street games.

oxide-dice runs on QBCore, Qbox and ESX through o-link. Bets always use the framework's cash in hand (cash on QBCore and Qbox, money on ESX).

Technical

DependencyRequiredPurpose
o-link (1.11.0 or newer)YesFramework abstraction for character identity, cash, inventory and usable items, notify, targeting, dispatch, the HUD panel, the in-world table placement and zone drawing tools and logging
ox_libYesTranslations
oxmysqlYesDatabase access for placed tables, held stakes, owed payouts and settings
Targeting resourceYesJoining a game, playing at a table, packing a table up and the seller, through o-link (ox_target, qb-target, sleepless_interact, tgiann-target or oxide-target)
ox_inventoryESX onlyESX's built-in inventory is not supported by o-link; QBCore and Qbox run on their default inventories
Oxide HUD (free)NoPlayer-placed controls card and the server accent colour (o-link 1.12.1 or newer)
A dispatch resource supported by o-linkNoPolice alerts from street games
oxide-logger (free)NoConsole, file and Discord logging of every stake, roll and payout

Database:

  • dice_tables: every placed dice table, with its kind, its owner and its bet limits
  • dice_escrow: what each player has staked in a game still running, so a restart can give it back
  • dice_owed: payouts no account would take, paid at the player's next login
  • oxide_settings: shared live-settings storage; dice rows use resource = 'oxide-dice'

All tables are created automatically when the resource starts. No SQL script to run.

Configuration: The config files are the starting values only. The first time the resource runs, it copies them into your database, and from then on you change settings in game with /dice settings (admin only). Editing the config files on a server that has already started once won't change those settings. See Configuration.

Frontend: Vue 3 + Vite + Tailwind CSS for the controls card, the rules panel, the world tag, roll pop-ups, the amount prompt, the side bets card, the seller's store and the admin settings editor. The interface ships ready to use in web/dist; there is nothing to build, compile or install for it.

Streamed assets: The die, the casino table, the crate and the dice animations ship in stream/ and load automatically. The folding table, its chairs and the cash in the pot are base-game props.

Translations: The on-screen notifications, prompts, cards and menu text can be translated by editing locales/en.json.

Features

  • Server-authoritative play: clients send requests (bet, fade, throw, side bet) and the server's rules engine decides every one; a client never reports a result.
  • Cryptographically strong dice from the server's own runtime, with no fallback to a weaker generator; a throw the generator can't answer is refused.
  • Partial fades with the uncovered part of the bet returned to the shooter before the come-out roll; a roll needs at least one fader.
  • Come-out naturals (7, 11), craps (2, 3, 12), point, hit and seven-out; faders win or lose exactly what they covered.
  • Press or keep: a winning shooter keeps the dice and bets at least their last bet; the dice pass clockwise after craps or a seven-out.
  • Side bets while a point is set: even-money "point before 7" against "7 before point", and number bets on any total from 2 to 12 at 1 to 30 to 1 (configurable), up to 4 per player.
  • Cash-only escrow through the framework's cash account: every stake is taken the moment it's accepted and paid from what the game holds.
  • Payouts to a player whose cash is full go to their bank; payouts to a player who left are paid to their offline account, or stored and paid at their next login.
  • Restart safety: every stake in a running game is mirrored to the database and given back on the next start.
  • Leaving settles by the rules: a shooter who leaves with a point set forfeits to the faders; a fader's cover stays in action once the dice have been thrown; unmatched side bet offers come straight back.
  • Server timers end quiet games (nobody fades for 60 seconds, every bet returned) and remove a shooter who doesn't act (60 seconds).
  • Street games from the dice item at the player's feet, refused in vehicles, in water, on ground steeper than 15 degrees and within 6 metres of another game or table.
  • Two kinds of placeable dice table, each with its own item: the casino table (dice_table) and the folding table with four chairs (dice_folding_table). Both are placed with o-link's in-world placement tool, which previews the whole set while the player's character stays where it is and in view, with admins-only / zones / anywhere modes, drawn allowed and blocked zones, ground, road and water checks, spacing, reach and a per-player limit; owners and admins pack them up.
  • Fixed dice tables of either kind at configured spots, each with its own bet limits.
  • Its own models: a 24 mm die with rounded edges, a milk crate for the street, and a long casino table with green felt, a felt-lined cash ledge where the pot stands, and a rubber-lined back wall the throws reach. The folding table and its chairs are base-game props: players sit on the chairs, the dice land on the top in a soft toss and stop in its middle, clear of the players' hands, and ambient people are kept out of the chairs.
  • A deterministic dice simulation every nearby client runs from the same throw, ending on the server's faces; the dice always land on the play surface.
  • A throw aimed with the camera and charged by holding the mouse button, clamped by the server; the dice arc, bounce, roll and settle in about a second and a half, and hard casino table throws hit the back wall.
  • A throw camera for the players in the game: follows the dice, holds on the result, then returns.
  • Its own street, chair and table animations: on the street everyone sits on a crate and at a folding table on a chair, and the shooter picks up, shakes and throws; the others wait at their own pace and react to wins and losses; at a casino table everyone leans on the rail; characters in high heels get matching versions of every clip.
  • Rattle, throw and landing sounds, heard by everyone within 15 metres.
  • A cash pile that grows with the pot, and a world tag with pot, shooter, point and last roll.
  • A controls card (objective, keys, your stake, your side bets, timers, first-game tips) and a rules panel on H, both registered as Oxide HUD panels and working with no HUD installed.
  • A dice seller NPC with a blip, selling dice and tables for cash, with your own extra rows.
  • Optional police alerts when a street game starts, with an area cooldown; off by default; tables never alert.
  • Live in-game settings editor (/dice settings): every setting stored in the database, edited by admins, validated on save and applied without a restart; placement zones drawn in the world.
  • Model safety: missing models are reported to admins instead of hanging, and Config.ModelSwaps replaces them.
  • Every stake, roll, payout and admin action logged through o-link's logger.
  • Single /dice command: /dice help and /dice leave for players, plus admin subcommands /dice settings, /dice give, /dice table place, /dice end, /dice games and /dice demo.
  • Server exports GetSetting and SetSetting.

Documentation