Overview
A comprehensive scoreboard system for FiveM servers with playtime tracking, rewards system, job monitoring, and heist availability indicators. Now supports both QBCore and Qbox/QBX frameworks!
Features
Real-Time Player Information
- Live player list with character names
- Job titles and grades
- Player ID display
- Hidden identity support for staff/admins
Job Monitoring
- Real-time job counter for configured jobs
- Shows only on-duty players
- Supports both job names and job types
- Customizable job icons and labels
Heist Availability Indicator
- Shows which heists are available
- Based on police officer count
- Configurable requirements per heist
- Real-time updates when police go on/off duty
Playtime Tracking
- Automatic playtime tracking for all players
- Saves every minute and on disconnect
- Persistent across sessions
- Admin commands for management
Reward/Battlepass System
- Milestone-based rewards for playtime
- Multiple reward types (Money, Vehicles, Houses, Items)
- Discord webhook notifications
- One-time claimable rewards
User-Friendly Interface
- Modern, clean UI design with SG-UI theme
- Theme Toggle - Switch between themes
- Icon Support - Font Awesome icons
- Configurable keybind (default: F10)
Framework Compatibility
- QBCore - Full support
- Qbox/QBX - Full support
- Automatic Detection - No manual configuration needed
Dependencies
Required
oxmysql- Database operationsqb-core(QBCore) ORqbx_core(Qbox)
Optional but Recommended
ox_lib- Required for Qbox, optional for QBCore
Installation
Download and Extract
Place in resources/[scripts]/sg-scoreboard/
Database Setup
The script uses player metadata for playtime and rewards tracking. No additional database tables needed!
Configure Framework (Optional)
Edit config.lua:
Config.Framework = 'auto' -- 'auto', 'qbcore', or 'qbox'
Config.Debug = false -- Enable for debuggingFor QBCore only, you can comment out these lines in fxmanifest.lua:
-- '@qbx_core/modules/lib.lua',
-- '@qbx_core/modules/playerdata.lua',For Qbox/QBX, keep them uncommented (default).
Add to server.cfg
ensure oxmysql
ensure qb-core # or qbx_core for Qbox
ensure ox_lib # Required for Qbox
ensure sg-scoreboardConfigure Settings
Edit config.lua to customize settings (see Configuration section below)
Configuration
Edit config.lua to customize:
General Settings
Config.KeyBind = "F10" -- Keybind to open scoreboard
Config.Webhook = "your_discord_webhook_url" -- For reward claims
Config.MoneyType = "bank" -- "bank" or "cash" for money rewardsHidden Players
Config.HiddenLicenses = {
"license:abc123...", -- Add player licenses to hide their identity
}Use /getlicense [id] command to get a player's license.
Jobs to Display
Config.Jobs = {
{ job = "police", label = "Police", icon = "fas fa-shield-alt" },
{ job = "ambulance", label = "Ambulance", icon = "fas fa-ambulance" },
{ type = "mechanic", label = "Mechanic", icon = "fas fa-wrench" },
-- Add more jobs...
}- - Use
jobfor specific job names - - Use
typefor job types (matches multiple jobs) - - Icons: Use Font Awesome classes (e.g.,
"fas fa-wrench") or emojis for backward compatibility
Heists
Config.Robberies = {
{ order = 1, label = "Fleeca Bank", icon = "fas fa-university", requiredCops = 3 },
-- Configure your heists...
}Icons: Use Font Awesome classes (e.g., "fas fa-university") or emojis for backward compatibility
Rewards/Battlepass
Config.Rewards = {
{ hours = 10, reward = "R1,500,000", type = "money", amount = 1500000 },
{ hours = 15, reward = "Starter Car", type = "vehicle", vehicle = "mk1rabbit" },
{ hours = 200, reward = "IPL House", type = "house", houseType = "apartment" },
-- Add more rewards...
}Usage
For Players
Open Scoreboard:
- Press
F10(or configured keybind) - Or use
/togglescoreboardcommand
Tabs:
- Players - View all online players
- Jobs - See on-duty job counts
- Heists - Check heist availability
- Rewards - View and claim playtime rewards
Theme Toggle:
- - Click the theme toggle button (palette icon) in the header to switch between themes
- - New Theme (Default) - Modern SG-UI styled theme with clean, solid backgrounds
- - Old Theme - Classic theme with background images that change based on the active tab
- - Your theme preference is automatically saved and will be remembered next time you open the scoreboard
Claiming Rewards:
- - Navigate to Rewards tab
- - Green rewards are claimable
- - Yellow rewards are locked (need more playtime)
- - Gray rewards are already claimed
- - Click "CLAIM" button to receive reward
For Admins
Commands:
/checkplaytime [id]- Check player's playtime (optional id)/giveplaytime [id] [hours]- Give playtime to a player (admin only)/getlicense [id]- Get player's license for hiding identity (admin only)
Hiding Admin Identity:
- Get player's license:
/getlicense [id] - Copy the license from chat/console
- Add to
Config.HiddenLicensesin config.lua - Restart script
- Player will show as "Hidden Identity" on scoreboard
Reward Types
Money Rewards
{ hours = 10, reward = "R1,500,000", type = "money", amount = 1500000 }Automatically added to player's bank or cash
Vehicle Rewards
{ hours = 15, reward = "Starter Car", type = "vehicle", vehicle = "mk1rabbit" }Automatically added to player's garage
House Rewards
{ hours = 200, reward = "IPL House", type = "house", houseType = "apartment" }Requires manual fulfillment by Real Estate
Item Rewards
{ hours = 50, reward = "Special Item", type = "item", item = "special_item" }Automatically added to inventory
Playtime Tracking
Automatic Tracking:
- - Starts when player joins server
- - Saves every 60 seconds
- - Saves on player disconnect
- - Saves on resource stop
- - Persistent across sessions
Stored In:
- - Player metadata:
metadata.playtime(in seconds) - - Player metadata:
metadata.claimedRewards(table of claimed reward IDs)
For Testing:
- - Use
/giveplaytime [id] [hours]to add playtime - - Use
/checkplaytime [id]to verify playtime
Discord Webhooks
Configure Config.Webhook to receive notifications when players claim rewards:
Notification includes:
- - Player name and Citizen ID
- - Reward type and details
- - Timestamp
- - Vehicle plates (for vehicle rewards)
- - Money amount and account type (for money rewards)