ShadowScratch
Premium scratch cards with a real scratching surface and a shared progressive jackpot.
- Version
- 1.0.1
- Resource
- SF-Scratch
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#
| Resource | Required | Why |
|---|---|---|
ox_lib | Yes | Interface and notifications. |
oxmysql | Yes | Stores the jackpot and the winnings. |
Installation#
- Drop the SF-Scratch folder into your server resources directory.
- Declare the ticket items listed in ITEMS.md inside your inventory, with their images.
- Add the ensure lines below to your server.cfg, after ox_lib and oxmysql.
- Set the prices, the prize tables and the jackpot seed in config.lua.
- Restart the server: the tables are created on the first start.
ensure ox_lib ensure oxmysql ensure SF-Scratch
Configuration#
| Key | Default | What 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#
| Command | Permission | What it does |
|---|---|---|
/scratchtop | โ | Show the ranking of the biggest wins. |
/scratchhistory | โ | Show your own scratch card history. |
/sf_scratch_giveitem [id] [ticket] [qty] | Admin | Give tickets to a player. |
/sf_scratch_debug | Admin | Toggle debug mode. |
Database#
| Table | Contents |
|---|---|
sf_scratch_jackpot | Current jackpot amount and the history of the hits. |
sf_scratch_wins | Every recorded win, used by the leaderboard and the history. |