Gameplay

ShadowScratch

Premium scratch cards with a real scratching surface and a shared progressive jackpot.

Version
1.0.1
Resource
SF-Scratch
Version 1.0.1 Resource SF-Scratch Frameworks ESX ยท QBCore ยท QBX ยท Standalone Bundled languages 5 Store page View

Overview#

SF-Scratch adds scratch cards you actually scratch: the surface is an HTML5 canvas the player rubs off with the mouse. Two game modes, three ticket tiers, and a progressive jackpot shared by the whole server that grows with every ticket bought until someone hits it. The draw is done entirely on the server and the prize is claimed afterwards, so nothing can be forged from the client.

Real scratching

An HTML5 canvas the player rubs off with the mouse, not a click that reveals everything.

Two game modes

match3, where three identical symbols win, and reveal, where each cell is a prize.

Shared progressive jackpot

Every ticket bought feeds one jackpot common to the whole server.

Three ticket tiers

Bronze, silver and gold, each with its own price and prize table.

Fully server-side draw

The result is decided on the server and claimed afterwards: the client never knows it in advance.

Leaderboard and history

A ranking of the biggest wins and a personal history for every player.

Discord webhooks

Big wins and jackpot hits are announced on Discord.

Dependencies#

ResourceRequiredWhy
ox_libYesInterface and notifications.
oxmysqlYesStores the jackpot and the winnings.

Installation#

  1. Drop the SF-Scratch folder into your server resources directory.
  2. Declare the ticket items listed in ITEMS.md inside your inventory, with their images.
  3. Add the ensure lines below to your server.cfg, after ox_lib and oxmysql.
  4. Set the prices, the prize tables and the jackpot seed in config.lua.
  5. Restart the server: the tables are created on the first start.
server.cfg
ensure ox_lib
ensure oxmysql
ensure SF-Scratch

Configuration#

KeyDefaultWhat it does
Config.Framework'auto'Force esx, qbcore or standalone, or leave auto-detection on.
Config.Inventory'auto'Force an inventory, or leave auto-detection on.
Config.Localeโ€”Language of the interface and the messages.
Config.Ticketsโ€”The tickets: price, mode, prize table and odds.
Config.Jackpotโ€”Starting amount, share of each ticket that feeds it, and winning odds.
Config.SellAccountโ€”Account credited when winning: cash, bank or a custom one.
Config.Cooldownโ€”Delay between two tickets.
Config.Webhookโ€”Discord webhook that receives the big wins.
Config.Debugโ€”Enables verbose logging.

Commands#

CommandPermissionWhat it does
/scratchtopโ€”Show the ranking of the biggest wins.
/scratchhistoryโ€”Show your own scratch card history.
/sf_scratch_giveitem [id] [ticket] [qty]AdminGive tickets to a player.
/sf_scratch_debugAdminToggle debug mode.

Database#

TableContents
sf_scratch_jackpotCurrent jackpot amount and the history of the hits.
sf_scratch_winsEvery recorded win, used by the leaderboard and the history.

Good to know#

The draw happens the moment the ticket is used, before anything is displayed. Scratching only reveals a result that already exists on the server.
The jackpot is shared: it is stored in the database, not in memory, so it survives restarts.