Skip to content

Exports & Events ​

Use these to connect MG-Contest with your other resources. Anything not listed here is internal and may change between versions.

Open the tablet ​

Opens the tablet for a player, for example from a phone app, a radial menu or a command.

lua
TriggerEvent('mg-contest:client:openLaptop')
lua
TriggerClientEvent('mg-contest:client:openLaptop', source)

Battle pass XP ​

Server-side exports to reward players or clans with battle pass XP from your other scripts (jobs, events, missions).

AddBattlePassXP ​

lua
local ok = exports['MG-Contest']:AddBattlePassXP(citizenid, amount)
ParameterTypeDescription
citizenidstringThe player's citizen ID.
amountnumberXP to add, from 1 to 1000000.

Returns boolean: false if the battle pass is disabled, the season has ended, or a value is invalid.

AddClanBattlePassXP ​

lua
local ok = exports['MG-Contest']:AddClanBattlePassXP(clanId, amount)
ParameterTypeDescription
clanIdnumberClan ID from mg_contest_clans.id.
amountnumberXP to add, from 1 to 1000000.

Returns boolean.

Example ​

lua
-- In another server resource
RegisterNetEvent('myjob:server:finished', function()
    local src = source
    local Player = exports.qbx_core:GetPlayer(src)
    if not Player then return end

    exports['MG-Contest']:AddBattlePassXP(Player.PlayerData.citizenid, 25)
end)

WARNING

Only call the XP exports from your own server code. Never let a client event grant XP without your own checks.

Map vote data ​

lua
local data = exports['MG-Contest']:GetMapVoteData(source)

Server-side, read only. Returns the current map vote state for an online player.

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