Skip to content

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 ​

OptionDefaultDescription
Config.DebugfalsePrints debug output. Keep it off in production.
Config.NotificationDuplicateWindowMs1500Identical 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.

lua
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:

lua
Config.MedicalReviveEvents = {
    ['qb-hospital'] = 'hospital:client:Revive',
}

QBX resources use qbx_medical:client:playerRevived; qb-ambulancejob uses hospital:client:Revive.

Clans ​

OptionDefaultDescription
Config.MaxClanMembers15Hard cap on members per clan.
Config.ClanCreationCost25000Price to create a clan.
Config.MinClanNameLength3Minimum name length.
Config.MaxClanNameLength20Maximum name length.
Config.DefaultElo0Starting ELO of a new clan.
Config.LeaderboardWinStreakMinimum2A 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 ​

lua
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 ​

OptionDescription
Config.ProfanityFilterEnabledEnables the word filter on clan names.
Config.ProfanityWordsWords that are rejected anywhere in a name.
Config.BlacklistedClanNamesReserved 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,000
lua
Config.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 ​

OptionDefaultDescription
Config.EnableWarCooldownBlocktrueBlocks a contest from starting when a scheduled contest is near.
Config.BlockWarBeforeContestMinutes0How many minutes before a scheduled contest to block.
Config.EnableSingleContesttrueOnly one contest can run on the server at a time.
Config.EnableZoneNameDisplaytrueShows teammate names above heads inside contest zones.
Config.EnablePerZoneDurationtrueUses each zone's duration instead of Config.ContestDuration.
Config.EnableEdgeRespawntrueRespawns on random points around the zone edge.
Config.EnableResultUItrueShows the result podium when a contest ends.
Config.ResultUIDurationSeconds5How long the podium stays on screen.
Config.RankUpUIDelaySeconds2Delay before the rank-up animation.
Config.KillFeedEnabledfalseShows the kill feed during contests.

Contests ​

OptionDefaultDescription
Config.ContestDuration600Contest length in seconds, used when per-zone duration is off.
Config.ContestCooldown7200Cooldown per zone between contests, in seconds.
Config.ContestAutoStarttrueStarts contests automatically at scheduled times.
Config.ContestScoreSyncIntervalSeconds30How often scores are saved to the database.
Config.ContestScoreBroadcastDelayMs500Batches score updates sent to clients.
Config.ZoneValidationBuffer15.0Extra 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.

lua
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.

lua
Config.MapVoting = {
    Enabled = true,
    StartsBeforeContestSeconds = 300, -- voting opens 5 minutes before
    AllowVoteChanges = true,
    VoteCooldownSeconds = 1,
}

Scoring ​

OptionDefaultDescription
Config.PointsPerKill1Contest points per kill.
Config.PointsPerFlagCapture4Contest points per flag capture.
Config.EloGainOnWin25ELO for the winning clan.
Config.EloLossOnDefeat15ELO removed from losing clans.
Config.EloPerKill2ELO per kill.
Config.EloPerFlagCapture100Bonus ELO for the winner if it holds the flag at the end.

Death & respawn ​

OptionDefaultDescription
Config.RespawnCooldown15Seconds before auto revive.
Config.RespawnHealth200Health after respawn.
Config.RespawnArmor25Armor after respawn.
Config.UseCustomSpawnstrueUses the zone's spawnPoints instead of random positions.
Config.SpawnProtectionTime3Seconds of invincibility after respawn.
Config.SpawnProtectionFlashtrueFlashes the player while protected.
Config.SpectatorEnabledtrueDead players spectate others while waiting to respawn. E stops spectating.
Config.SpectatorKey170Control ID to cycle the spectate target (F3).

After the contest ​

lua
-- 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 ​

OptionDefaultDescription
Config.ForceDVtrueDeletes vehicles that enter a zone with an active contest.
Config.ZoneIdleIntervalMs2500Zone check interval when the player is far from every zone.
Config.VehicleScanIntervalMs5000Vehicle scan interval during an active contest.
Config.NameRefreshIntervalMs250Teammate name position refresh rate.

Lower values react faster but use more client CPU. The defaults are tuned for most servers.

Kill streaks ​

lua
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 ​

OptionDefaultDescription
Config.BountyEnabledtrueEnables bounties.
Config.BountyCheckInterval60Seconds between bounty checks.
Config.BountyMinKills5Kills needed to receive a bounty.
Config.BountyCashReward2500Cash for killing the target.
Config.BountyEloReward10ELO for killing the target.

Rewards ​

Money type is the account name (cash, bank). Item chance is a percentage.

lua
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 ​

OptionDefaultDescription
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:

lua
Config.MafiaPanel = {
    MaxCashGrant = 1000000,
    MaxBattlePassXPGrant = 100000,
    MaxElo = 1000000,
    MaxContestTimeAdjustment = 1800, -- seconds
    MaxBanMinutes = 10080,           -- 7 days
}

Tablet ​

OptionDefaultDescription
Config.LaptopItem'tablet'Item that opens the UI. Must match your inventory item.
Config.TabletUseCooldownMs1000Cooldown between tablet uses.
Config.TabletOpenDelayMs200Delay on qb-inventory so the inventory closes first.

Flags & target ​

OptionDefaultDescription
Config.FlagModel`prop_gangflag_gangs`Default flag prop (streamed with the resource).
Config.FlagCaptureRadius3.0Distance from the flag to capture it.
Config.TargetDistance2.5Target 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:

lua
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:

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.

All MG Development resources are protected. Redistribution is not permitted.