Configuration
All gameplay settings live in config.lua. Restart the resource after any change. Admin identifiers are not in this file; they are in server/server.lua (see Admin Panel).
TIP
Zones and the battle pass have their own pages: Zones and Battle Pass.
General
| Option | Default | Description |
|---|---|---|
Config.Debug | false | Prints debug output. Keep it off in production. |
Config.NotificationDuplicateWindowMs | 1500 | Identical notifications within this window are shown once. |
Systems
Config.Systems selects which resources MG-Contest uses. Set a value to 'auto' to pick the first started resource from its priority list.
Config.Systems = {
Framework = 'qbx_core', -- 'qbx_core' | 'qb-core' | 'auto'
Inventory = 'ox_inventory', -- 'ox_inventory' | 'qb-inventory' | 'auto'
Target = 'auto', -- 'interact' | 'ox_target' | 'qb-target' | 'auto'
Notify = 'script', -- 'script' (built-in NUI) | 'ox_lib' | 'framework'
Phone = 'lb-phone', -- 'lb-phone' | 'npwd' | 'qb-phone'
Medical = 'auto', -- 'qbx_medical' | 'qbx_ambulancejob' | 'qb-ambulancejob' | 'qb-hospital' | 'auto'
Database = 'auto', -- only 'oxmysql' is supported
InventoryImageBase = 'auto', -- image path for battle pass rewards
FrameworkPriority = { 'qbx_core', 'qb-core' },
InventoryPriority = { 'ox_inventory', 'qb-inventory' },
TargetPriority = { 'interact', 'ox_target', 'qb-target' },
NotifyPriority = { 'script' },
PhonePriority = { 'lb-phone' },
MedicalPriority = { 'qbx_medical', 'qbx_ambulancejob', 'qb-ambulancejob', 'qb-hospital' },
DatabasePriority = { 'oxmysql' },
}Short aliases are accepted: qbx, qb, ox, lb, nui.
Medical revive events
When a contest ends, dead players are revived through your medical resource. If you run a modified qb-hospital, set its revive event here:
Config.MedicalReviveEvents = {
['qb-hospital'] = 'hospital:client:Revive',
}QBX resources use qbx_medical:client:playerRevived; qb-ambulancejob uses hospital:client:Revive.
Clans
| Option | Default | Description |
|---|---|---|
Config.MaxClanMembers | 15 | Hard cap on members per clan. |
Config.ClanCreationCost | 25000 | Price to create a clan. |
Config.MinClanNameLength | 3 | Minimum name length. |
Config.MaxClanNameLength | 20 | Maximum name length. |
Config.DefaultElo | 0 | Starting ELO of a new clan. |
Config.LeaderboardWinStreakMinimum | 2 | A clan's win streak badge appears on the leaderboard from this many wins in a row. |
INFO
The actual number of member slots also depends on the clan's battle pass level. See Clan slots.
Clan ranks
Config.ClanRanks = {
{ name = 'Leader', level = 4, canInvite = true, canKick = true, canPromote = true },
{ name = 'CoLeader', level = 3, canInvite = true, canKick = true, canPromote = true },
{ name = 'Manager', level = 2, canInvite = true, canKick = true, canPromote = false },
{ name = 'Member', level = 1, canInvite = false, canKick = false, canPromote = false },
}A higher level is a higher rank. canInvite, canKick and canPromote control what each rank can do from the Clan page.
Name filtering
| Option | Description |
|---|---|
Config.ProfanityFilterEnabled | Enables the word filter on clan names. |
Config.ProfanityWords | Words that are rejected anywhere in a name. |
Config.BlacklistedClanNames | Reserved names such as admin, staff, discord or .gg/. |
ELO ranks
Each clan's rank is the highest tier whose min is at or below its ELO.
Unranked0
Bronze500
Silver1,000
Gold2,000
Platinum3,500
Diamond5,000
Master7,500
Legend10,000Config.EloRanks = {
{ name = 'Unranked', min = 0, color = '#808080', image = 'img/unranked.png' },
{ name = 'Bronze', min = 500, color = '#cd7f32', image = 'img/bronze.png' },
-- ...
{ name = 'Legend', min = 10000, color = '#ff2222', image = 'img/legend.png' },
}Images are loaded from html/img/. Keep the list sorted by min.
Feature toggles
| Option | Default | Description |
|---|---|---|
Config.EnableWarCooldownBlock | true | Blocks a contest from starting when a scheduled contest is near. |
Config.BlockWarBeforeContestMinutes | 0 | How many minutes before a scheduled contest to block. |
Config.EnableSingleContest | true | Only one contest can run on the server at a time. |
Config.EnableZoneNameDisplay | true | Shows teammate names above heads inside contest zones. |
Config.EnablePerZoneDuration | true | Uses each zone's duration instead of Config.ContestDuration. |
Config.EnableEdgeRespawn | true | Respawns on random points around the zone edge. |
Config.EnableResultUI | true | Shows the result podium when a contest ends. |
Config.ResultUIDurationSeconds | 5 | How long the podium stays on screen. |
Config.RankUpUIDelaySeconds | 2 | Delay before the rank-up animation. |
Config.KillFeedEnabled | false | Shows the kill feed during contests. |
Contests
| Option | Default | Description |
|---|---|---|
Config.ContestDuration | 600 | Contest length in seconds, used when per-zone duration is off. |
Config.ContestCooldown | 7200 | Cooldown per zone between contests, in seconds. |
Config.ContestAutoStart | true | Starts contests automatically at scheduled times. |
Config.ContestScoreSyncIntervalSeconds | 30 | How often scores are saved to the database. |
Config.ContestScoreBroadcastDelayMs | 500 | Batches score updates sent to clients. |
Config.ZoneValidationBuffer | 15.0 | Extra meters allowed when the server checks a player is in the zone. |
Schedule
Config.ScheduledContests lists start times in 24-hour server time. Leave gaps around your server restarts.
Config.ScheduledContests = {
{ hour = 12, minute = 0 },
{ hour = 12, minute = 30 },
-- Restart 3:00PM
{ hour = 15, minute = 30 },
-- ...
}Map voting
Before each scheduled contest, players vote for the zone that will be played.
Config.MapVoting = {
Enabled = true,
StartsBeforeContestSeconds = 300, -- voting opens 5 minutes before
AllowVoteChanges = true,
VoteCooldownSeconds = 1,
}Scoring
| Option | Default | Description |
|---|---|---|
Config.PointsPerKill | 1 | Contest points per kill. |
Config.PointsPerFlagCapture | 4 | Contest points per flag capture. |
Config.EloGainOnWin | 25 | ELO for the winning clan. |
Config.EloLossOnDefeat | 15 | ELO removed from losing clans. |
Config.EloPerKill | 2 | ELO per kill. |
Config.EloPerFlagCapture | 100 | Bonus ELO for the winner if it holds the flag at the end. |
Death & respawn
| Option | Default | Description |
|---|---|---|
Config.RespawnCooldown | 15 | Seconds before auto revive. |
Config.RespawnHealth | 200 | Health after respawn. |
Config.RespawnArmor | 25 | Armor after respawn. |
Config.UseCustomSpawns | true | Uses the zone's spawnPoints instead of random positions. |
Config.SpawnProtectionTime | 3 | Seconds of invincibility after respawn. |
Config.SpawnProtectionFlash | true | Flashes the player while protected. |
Config.SpectatorEnabled | true | Dead players spectate others while waiting to respawn. E stops spectating. |
Config.SpectatorKey | 170 | Control ID to cycle the spectate target (F3). |
After the contest
-- Where players without a clan are sent when they enter an active zone
Config.NonClanTeleportCoords = vector4(-943.82, -764.73, 18.0, 181.42)
-- Random point players are sent to when a contest ends
Config.ContestEndSpawnPoints = {
vector4(-934.72, -769.65, 17.97, 175.98),
-- ...
}Vehicles & performance
| Option | Default | Description |
|---|---|---|
Config.ForceDV | true | Deletes vehicles that enter a zone with an active contest. |
Config.ZoneIdleIntervalMs | 2500 | Zone check interval when the player is far from every zone. |
Config.VehicleScanIntervalMs | 5000 | Vehicle scan interval during an active contest. |
Config.NameRefreshIntervalMs | 250 | Teammate name position refresh rate. |
Lower values react faster but use more client CPU. The defaults are tuned for most servers.
Kill streaks
Config.KillStreaks = {
{ kills = 3, label = 'Triple Kill', hpBonus = 50, armorBonus = 25, cashBonus = 200 },
{ kills = 5, label = 'Rampage', hpBonus = 50, armorBonus = 50, cashBonus = 500 },
{ kills = 7, label = 'UnStoppable', hpBonus = 100, armorBonus = 50, cashBonus = 1000 },
{ kills = 10, label = 'GodLike', hpBonus = 100, armorBonus = 100, cashBonus = 2500 },
}Bounty
| Option | Default | Description |
|---|---|---|
Config.BountyEnabled | true | Enables bounties. |
Config.BountyCheckInterval | 60 | Seconds between bounty checks. |
Config.BountyMinKills | 5 | Kills needed to receive a bounty. |
Config.BountyCashReward | 2500 | Cash for killing the target. |
Config.BountyEloReward | 10 | ELO for killing the target. |
Rewards
Money type is the account name (cash, bank). Item chance is a percentage.
Config.Rewards = {
ContestWin = {
money = { min = 2500, max = 5000, type = 'cash' },
items = {
{ item = 'pistol_ammo', amount = 100, chance = 75 },
},
},
ContestParticipation = {
money = { min = 200, max = 400, type = 'cash' },
items = {
{ item = 'pistol_ammo', amount = 50, chance = 75 },
},
},
KillReward = {
money = 50,
type = 'cash',
},
}Access control
| Option | Default | Description |
|---|---|---|
Config.SpecialRoles | { 'maf' } | Framework permission groups that may stay inside active zones without a clan (staff, spectators). |
Admin panel limits
Caps on what admins can grant from the panel:
Config.MafiaPanel = {
MaxCashGrant = 1000000,
MaxBattlePassXPGrant = 100000,
MaxElo = 1000000,
MaxContestTimeAdjustment = 1800, -- seconds
MaxBanMinutes = 10080, -- 7 days
}Tablet
| Option | Default | Description |
|---|---|---|
Config.LaptopItem | 'tablet' | Item that opens the UI. Must match your inventory item. |
Config.TabletUseCooldownMs | 1000 | Cooldown between tablet uses. |
Config.TabletOpenDelayMs | 200 | Delay on qb-inventory so the inventory closes first. |
Flags & target
| Option | Default | Description |
|---|---|---|
Config.FlagModel | `prop_gangflag_gangs` | Default flag prop (streamed with the resource). |
Config.FlagCaptureRadius | 3.0 | Distance from the flag to capture it. |
Config.TargetDistance | 2.5 | Target interaction distance. |
Config.FlagTargetIcon | 'fas fa-flag' | Target option icon. |
Config.FlagTargetLabel | 'Capture Flag' | Target option label. |
UI colors
The tablet, HUD, capture bar, respawn timer, notifications and results all use one accent color:
Config.UIColors = {
primaryColor = { fallback = 'FF7CE900' },
}Accepted formats:
#RRGGBB, for example'#3A9188'AARRGGBB, for example'FF7CE900'- A palette name:
gray,red,pink,grape,violet,indigo,blue,cyan,teal,green,lime,yellow,orange
An empty or invalid value falls back to teal #3A9188. Background and text colors are fixed.
Discord avatars
Clan member avatars come from Discord. To enable them, edit server/sv_discord.lua:
Discord.BotToken = 'YOUR_BOT_TOKEN'
Discord.GuildID = 'YOUR_GUILD_ID'Without a token, a default avatar is shown.
DANGER
Never share your bot token. Keep it only in this server-side file.
