Commands & Exports
Admin commands
Only players whose Discord ID is in Config.Admins (in server.lua) can use these. Each one can be turned off in Config.Commands.
| Command | Description |
|---|---|
/setuplab | Place a new lab and assign it to a gang. |
/setdoors | Rebuild the ox_doorlock doors for every placed lab. |
/addobj | Add a prop to the shared lab layout (applies to every lab). |
/gangslab_addxp <gang> <xp> | Give XP to a gang. |
lua
Config.Commands = {
labsetup = { enabled = true }, -- /setuplab
setdoors = { enabled = true },
addobj = { enabled = true },
gangslab_addxp = { enabled = true },
}Missions from other scripts
The Mafia creates missions for gangs in the laptop, such as robbing a number of stores. When a player completes that action in another script, report it to MG-Gangslab so the mission progresses.
Server-side:
lua
-- For a player (uses their gang automatically)
exports['MG-Gangslab']:ReportMissionObjective(source, 'store', 1)
-- For a gang directly
exports['MG-Gangslab']:ReportGangMissionObjective(gangName, 'store', 1, playerName, citizenid)| Parameter | Description |
|---|---|
source | The player's server ID. |
objectiveType | The objective type (see below). |
count | How many to add. |
Objective types from outside scripts:
| Type | Mission |
|---|---|
store | Store Robbery |
house | House Robbery |
laundromat | Laundromat Robbery |
cashexchange | Cash Exchange |
Lab actions (meth, laundry, raids) are counted automatically by MG-Gangslab.
Example in a store robbery script:
lua
-- after a successful robbery
exports['MG-Gangslab']:ReportMissionObjective(source, 'store', 1)Laptop
Open or close the lab laptop from another client script:
lua
exports['MG-Gangslab']:OpenTablet()
exports['MG-Gangslab']:CloseTablet()