[FREE] Context Menu Scoreboard (ox_lib's context menu)

Scoreboard - the ox_lib way

Screenshot 2024-05-04 232725

Overview

It’s a pretty basic scoreboard, utilizing Overextended’s ox_lib library resource, specifically, it’s Context Menu. And also ESX to get the player count for jobs.

All you have to do is specificy in config.lua the jobs you want to display a player count for, in the menu.

Download

Installation

Just clone/download the repo to your resources directory, name it however you want, configure config.lua to your liking and have it started in your server.cfg.

This is the current default configuration, that comes in config.lua:

Config = {
	Jobs = { -- Use internal job names for as table keys
		police = {
			-- title = "",
			icon = "shield-halved",
			iconColor = "blue"
		},
		ambulance = {
			-- title = "",
			icon = "truck-medical",
			iconColor = "red"
		},
		mechanic = {
			-- title = "",
			icon = "wrench"
		}
	},
	CountRequestThreshold = 5000,
	MaxClients = 48, -- This will only be used if you havent prefixed `sv_maxclients` with `setr` (replicates that convar to the clients
	Key = "F9"
}

Use a job’s internal name as a key inside the Jobs property/node, and then set your title (optional - can be seen as a label, if you want text in a different language for example), icon and iconColor (optional).

Acknowledgments

Thanks to slicedbrain for the original repository, which gave me the itch to refactor it completely, with a good coding standard.

2 Likes

Nice , Possible to add Robbery’s into it ?