> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wasabihosting.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Garry's Mod DarkRP Configuration Guide

> Detailed guide for setting up and configuring DarkRP on your Garry's Mod server

# Introduction to DarkRP Configuration

DarkRP is one of the most popular gamemodes for Garry's Mod, offering a role-playing experience where players can take on various jobs and interact in a simulated economy. This guide walks you through how to properly configure DarkRP on your Wasabi Hosting Garry's Mod server.

## Core Configuration Files

DarkRP uses several configuration files that are all located within the DarkRP modification folder:

> [accordion] DarkRP Configuration File Overview
>
> | File | Location | Purpose |
> | - | - | - |
> | **settings.lua** | `/garrysmod/addons/darkrpmodification/lua/darkrp_config/settings.lua` | General gameplay settings |
> | **disabled\_defaults.lua** | `/garrysmod/addons/darkrpmodification/lua/darkrp_config/disabled_defaults.lua` | Default features to disable |
> | **jobs.lua** | `/garrysmod/addons/darkrpmodification/lua/darkrp_customthings/jobs.lua` | Custom job definitions |
> | **shipments.lua** | `/garrysmod/addons/darkrpmodification/lua/darkrp_customthings/shipments.lua` | Custom shipments |
> | **entities.lua** | `/garrysmod/addons/darkrpmodification/lua/darkrp_customthings/entities.lua` | Custom entities |
> | **categories.lua** | `/garrysmod/addons/darkrpmodification/lua/darkrp_customthings/categories.lua` | Custom F4 menu categories |
> | **ammo.lua** | `/garrysmod/addons/darkrpmodification/lua/darkrp_customthings/ammo.lua` | Custom ammunition types |
> | **vehicles.lua** | `/garrysmod/addons/darkrpmodification/lua/darkrp_customthings/vehicles.lua` | Custom vehicles |
> | **mysql.lua** | `/garrysmod/addons/darkrpmodification/lua/darkrp_config/mysql.lua` | Database configuration |

## Essential Settings Configuration

The main settings.lua file controls most aspects of how DarkRP behaves on your server:

> [accordion] Economy Settings
>
> ```lua theme={null}
> -- Currency and Economy
> GM.Config.currency = "$"                     -- Symbol used for money
> GM.Config.currencyLeft = true                -- Position of currency symbol (true = left, false = right)
> GM.Config.startingmoney = 1000               -- Starting money for new players
> GM.Config.salaryInterval = 300               -- Seconds between salary payments
> GM.Config.paydelay = 160                     -- Time between salary payments (in seconds)
> GM.Config.pricemin = 50                      -- Minimum price for items in F4 menu
> GM.Config.pricecap = 500                     -- Maximum price for items not in shipments
> GM.Config.microwavefoodcost = 30             -- Cost of using the microwave
> GM.Config.mprintamount = 250                 -- Money printed by money printer
> GM.Config.normalsalary = 45                  -- Normal salary amount (if no custom set)
> GM.Config.maxdoorsperplayer = 20             -- Maximum doors a player can own
> GM.Config.propertytax = true                 -- Enable property tax
> GM.Config.wallettax = 0                      -- Tax when a player dies (percentage)
> GM.Config.wallettaxmax = 0                   -- Maximum amount of tax
> GM.Config.droppocketitems = true             -- Whether players drop items from pocket when they die
> GM.Config.clearmoneyondeath = true           -- Delete money when a player dies
> GM.Config.restrictallteams = false           -- Enable restrictions for all teams
> GM.Config.restrictbuypistol = false          -- Restrict pistol purchasing to certain teams
> GM.Config.enablebuypocket = true             -- Allow players to upgrade pocket size
> GM.Config.deathfee = 30                      -- Money removed when a player dies
> GM.Config.moneyRemoveOnDeath = true          -- Remove all money when a player dies
> ```

> [accordion] Police and Mayor Settings
>
> ```lua theme={null}
> -- Police and Law Enforcement
> GM.Config.chiefjailpos = true                -- Allow the Chief to set the jail position
> GM.Config.requirewarrantforfpproperty = true -- Require a warrant to enter property
> GM.Config.policelockdown = true              -- Enable police lockdown
> GM.Config.mayor = true                       -- Enable mayor elections
> GM.Config.mayorvotedelay = 60*60             -- Time (in seconds) between mayor votes
> GM.Config.maxcopsalary = 100                 -- Maximum police salary
> GM.Config.maxmayorsalary = 150               -- Maximum mayor salary
> GM.Config.maxadminsalary = 120               -- Maximum admin salary
> GM.Config.maxjailtime = 120                  -- Maximum jail time in seconds
> GM.Config.shouldResetLaws = true             -- Reset laws when mayor changes
> GM.Config.cpcanarrestcp = true               -- Can cops arrest other cops
> GM.Config.needwantedforarrest = true         -- Need wanted status to arrest
> GM.Config.chiefcanpickupplayers = true       -- Can Chief pick up players
> GM.Config.chiefjailpos = true                -- Can Chief set the jail position
> GM.Config.telejail = true                    -- Teleport to jail when arrested
> GM.Config.telefromjail = false               -- Teleport from jail when unarrested
> GM.Config.teletojail = true                  -- Teleport to jail position when arrested
> GM.Config.citizenarrest = true               -- Allow citizens to arrest
> GM.Config.warrantwait = 300                  -- Time to wait before getting a search warrant
> GM.Config.lockdowndelay = 120                -- Time in seconds before lockdown auto-ends
> ```

> [accordion] Gameplay Settings
>
> ```lua theme={null}
> -- General Gameplay
> GM.Config.removeclassitems = true            -- Remove weapons when changing jobs
> GM.Config.respawninjail = true               -- Respawn in jail when killed in jail
> GM.Config.simplebuyweapons = true            -- Display weapons when buying
> GM.Config.babygod = true                     -- Enable god mode for new spawns
> GM.Config.babygodtime = 30                   -- Duration of spawn protection in seconds
> GM.Config.canforcedooropen = true            -- Whether players can force open doors
> GM.Config.chatsound = true                   -- Play sound when receiving chat messages
> GM.Config.copscanunfreeze = true             -- Allow cops to unfreeze
> GM.Config.copscanunweld = true               -- Allow cops to unweld doors
> GM.Config.cpcanweld = true                   -- Allow CPs to weld doors
> GM.Config.customjobs = true                  -- Enable custom jobs
> GM.Config.customspawns = true                -- Enable custom spawns
> GM.Config.deathblack = true                  -- Show black screen on death
> GM.Config.showjob = true                     -- Show job above head
> GM.Config.letters = true                     -- Enable letter writing
> GM.Config.license = true                     -- Enable licenses for weapons
> GM.Config.logging = true                     -- Log certain actions
> GM.Config.lottery = true                     -- Enable lottery
> GM.Config.showname = true                    -- Show names above head
> GM.Config.strictsuicide = true               -- Prevent suicide spam
> GM.Config.hotelcost = 25                     -- Cost of hotel room
> GM.Config.hoteljailtime = 120                -- Jail time for attempted hotel room theft
> GM.Config.allowsprays = true                 -- Allow sprays
> GM.Config.allowvehicleowning = true          -- Allow players to own vehicles
> GM.Config.allowvnocollide = true             -- Allow vehicle no-collide
> GM.Config.realisticfalldamage = true         -- Realistic fall damage
> GM.Config.printeroverheat = true             -- Can money printers overheat
> GM.Config.weaponshipment = true              -- Allow weapon shipments
> GM.Config.shipmentspawntime = 10             -- Shipment spawn time
> GM.Config.hideNonBuyable = false             -- Hide non-buyable doors
> GM.Config.showvehicles = true                -- Show vehicles in F4 menu
> GM.Config.addjailpos = true                  -- Allow adding jailpos
> GM.Config.AdminsCopWeapons = true            -- Admins get cop weapons
> GM.Config.adminweapons = true                -- Give admins all weapons
> ```

## Custom Jobs Configuration

The jobs.lua file lets you define custom roles for your server:

```lua theme={null}
-- Example Custom Jobs for Different Playstyles

-- Law Enforcement
TEAM_POLICE = DarkRP.createJob("Police Officer", {
    color = Color(25, 25, 170, 255),
    model = {"models/player/police.mdl", "models/player/police_fem.mdl"},
    description = [[Protect and serve the city. 
Arrest lawbreakers and keep the city safe.]],
    weapons = {"arrest_stick", "unarrest_stick", "weapon_glock2", "stunstick", "door_ram", "weaponchecker"},
    command = "police",
    max = 4,
    salary = 100,
    admin = 0,
    vote = false,
    hasLicense = true,
    category = "Civil Protection",
    PlayerSpawn = function(ply)
        ply:SetArmor(100)
        return
    end
})

TEAM_CHIEF = DarkRP.createJob("Police Chief", {
    color = Color(20, 20, 255, 255),
    model = "models/player/combine_soldier_prisonguard.mdl",
    description = [[The chief of police is the leader of the Civil Protection unit.
Coordinate the police force to enforce law and order in the city.
Hit a player with arrest baton to arrest them.]],
    weapons = {"arrest_stick", "unarrest_stick", "weapon_deagle2", "stunstick", "door_ram", "weaponchecker"},
    command = "chief",
    max = 1,
    salary = 120,
    admin = 0,
    vote = true,
    hasLicense = true,
    chief = true,
    category = "Civil Protection",
    PlayerSpawn = function(ply)
        ply:SetArmor(100)
        return
    end
})

-- Government Officials
TEAM_MAYOR = DarkRP.createJob("Mayor", {
    color = Color(150, 20, 20, 255),
    model = "models/player/breen.mdl",
    description = [[The Mayor of the city.
You make the laws and manage the Police Force.
Type /joblaws to set laws.]],
    weapons = {},
    command = "mayor",
    max = 1,
    salary = 150,
    admin = 0,
    vote = true,
    hasLicense = false,
    mayor = true,
    category = "Civil Protection",
})

-- Criminals
TEAM_GANG = DarkRP.createJob("Gang Member", {
    color = Color(75, 75, 75, 255),
    model = {
        "models/player/group03/male_01.mdl",
        "models/player/group03/male_02.mdl",
        "models/player/group03/male_03.mdl",
        "models/player/group03/male_04.mdl"
    },
    description = [[The lowest person in the criminal ladder.
A gang member having great success may be invited to the mob.]],
    weapons = {},
    command = "gangster",
    max = 3,
    salary = 45,
    admin = 0,
    vote = false,
    hasLicense = false,
    category = "Gangsters",
})

TEAM_MOB = DarkRP.createJob("Mob Boss", {
    color = Color(25, 25, 25, 255),
    model = "models/player/gman_high.mdl",
    description = [[The leader of the criminals in the city.
Run the crime syndicate and organize your gangsters to take control.]],
    weapons = {"lockpick"},
    command = "mobboss",
    max = 1,
    salary = 90,
    admin = 0,
    vote = true,
    hasLicense = false,
    category = "Gangsters",
})

-- Commercial
TEAM_GUN = DarkRP.createJob("Gun Dealer", {
    color = Color(255, 140, 0, 255),
    model = "models/player/monk.mdl",
    description = [[A Gun Dealer is the only person who can sell guns to other people.
Make sure you aren't caught selling illegal firearms to terrorists or cops!]],
    weapons = {},
    command = "gundealer",
    max = 2,
    salary = 85,
    admin = 0,
    vote = false,
    hasLicense = false,
    category = "Citizens",
})

TEAM_MEDIC = DarkRP.createJob("Medic", {
    color = Color(47, 79, 79, 255),
    model = "models/player/kleiner.mdl",
    description = [[With your medical knowledge, you heal players to full health.
You also have the ability to sell medical supplies.]],
    weapons = {"med_kit"},
    command = "medic",
    max = 3,
    salary = 75,
    admin = 0,
    vote = false,
    hasLicense = false,
    medic = true,
    category = "Citizens",
})

TEAM_COOK = DarkRP.createJob("Cook", {
    color = Color(238, 99, 99, 255),
    model = "models/player/mossman.mdl",
    description = [[As a cook, you can use your culinary expertise to create delicious food.
Sell your culinary creations to hungry players in the city.]],
    weapons = {},
    command = "cook",
    max = 2,
    salary = 65,
    admin = 0,
    vote = false,
    hasLicense = false,
    cook = true,
    category = "Citizens",
})
```

> [!TIP]
>
> Balance your job distribution! A healthy server typically has about 40% law enforcement/government, 30% civilian jobs, and 30% criminal roles.

## Custom Entities Configuration

The entities.lua file allows you to create buyable entities for players:

```lua theme={null}
-- Legal Entities
DarkRP.createEntity("Health Kit", {
    ent = "item_healthkit",
    model = "models/items/healthkit.mdl",
    price = 150,
    max = 5,
    cmd = "buyhealthkit",
    allowed = {TEAM_MEDIC},
    category = "Medical Supplies",
})

DarkRP.createEntity("Armor Kit", {
    ent = "item_battery",
    model = "models/items/battery.mdl",
    price = 200,
    max = 5,
    cmd = "buyarmorkit",
    allowed = {TEAM_MEDIC},
    category = "Medical Supplies",
})

DarkRP.createEntity("Food Stand", {
    ent = "food_stand",
    model = "models/props_c17/furniturefridge001a.mdl",
    price = 300,
    max = 1,
    cmd = "buyfoodstand",
    allowed = {TEAM_COOK},
    category = "Food",
})

-- Illegal Entities
DarkRP.createEntity("Money Printer", {
    ent = "money_printer",
    model = "models/props_c17/consolebox01a.mdl",
    price = 1000,
    max = 2,
    cmd = "buymoneyprinter",
    allowed = {TEAM_GANG, TEAM_MOB},
    category = "Illegal",
})

DarkRP.createEntity("Drug Lab", {
    ent = "drug_lab",
    model = "models/props_lab/crematorcase.mdl",
    price = 400,
    max = 3,
    cmd = "buydruglab",
    allowed = {TEAM_GANG, TEAM_MOB},
    category = "Illegal",
})

DarkRP.createEntity("Lockpick", {
    ent = "lockpick",
    model = "models/weapons/w_crowbar.mdl",
    price = 150,
    max = 2,
    cmd = "buylockpick",
    allowed = {TEAM_GANG, TEAM_MOB},
    category = "Illegal",
})
```

> [!WARNING]
>
> Be careful about pricing illegal items. If they're too cheap, your economy will be flooded with money from printers!

## Custom Shipments Configuration

Configure weapon shipments in the shipments.lua file:

```lua theme={null}
-- Pistols
DarkRP.createShipment("Desert Eagle", {
    model = "models/weapons/w_pist_deagle.mdl",
    entity = "weapon_deagle2",
    price = 215,
    amount = 10,
    separate = true,
    pricesep = 215,
    noship = false,
    allowed = {TEAM_GUN},
    category = "Pistols",
})

DarkRP.createShipment("Glock", {
    model = "models/weapons/w_pist_glock18.mdl",
    entity = "weapon_glock2",
    price = 165,
    amount = 10,
    separate = true,
    pricesep = 165,
    noship = false,
    allowed = {TEAM_GUN},
    category = "Pistols",
})

-- Rifles
DarkRP.createShipment("AK47", {
    model = "models/weapons/w_rif_ak47.mdl",
    entity = "weapon_ak472",
    price = 2450,
    amount = 10,
    separate = false,
    pricesep = 0,
    noship = false,
    allowed = {TEAM_GUN},
    category = "Rifles",
})

DarkRP.createShipment("M4A1", {
    model = "models/weapons/w_rif_m4a1.mdl",
    entity = "weapon_m42",
    price = 2250,
    amount = 10,
    separate = false,
    pricesep = 0,
    noship = false,
    allowed = {TEAM_GUN},
    category = "Rifles",
})

-- Shotguns
DarkRP.createShipment("Pump Shotgun", {
    model = "models/weapons/w_shot_xm1014.mdl",
    entity = "weapon_pumpshotgun2",
    price = 1750,
    amount = 10,
    separate = false,
    pricesep = 0,
    noship = false,
    allowed = {TEAM_GUN},
    category = "Shotguns",
})
```

## Custom Categories

Organize your F4 menu with custom categories in categories.lua:

```lua theme={null}
-- Job Categories
DarkRP.createCategory{
    name = "Civil Protection",
    categorises = "jobs",
    startExpanded = true,
    color = Color(0, 107, 0, 255),
    canSee = function(ply) return true end,
    sortOrder = 1,
}

DarkRP.createCategory{
    name = "Citizens",
    categorises = "jobs",
    startExpanded = true,
    color = Color(0, 107, 0, 255),
    canSee = function(ply) return true end,
    sortOrder = 2,
}

DarkRP.createCategory{
    name = "Gangsters",
    categorises = "jobs",
    startExpanded = true,
    color = Color(75, 75, 75, 255),
    canSee = function(ply) return true end,
    sortOrder = 3,
}

-- Entity Categories
DarkRP.createCategory{
    name = "Medical Supplies",
    categorises = "entities",
    startExpanded = true,
    color = Color(0, 107, 0, 255),
    canSee = function(ply) return true end,
    sortOrder = 1,
}

DarkRP.createCategory{
    name = "Food",
    categorises = "entities",
    startExpanded = true,
    color = Color(0, 107, 0, 255),
    canSee = function(ply) return true end,
    sortOrder = 2,
}

DarkRP.createCategory{
    name = "Illegal",
    categorises = "entities",
    startExpanded = true,
    color = Color(75, 75, 75, 255),
    canSee = function(ply) return table.HasValue({TEAM_GANG, TEAM_MOB}, ply:Team()) end,
    sortOrder = 3,
}

-- Shipment Categories
DarkRP.createCategory{
    name = "Pistols",
    categorises = "shipments",
    startExpanded = true,
    color = Color(0, 107, 0, 255),
    canSee = function(ply) return true end,
    sortOrder = 1,
}

DarkRP.createCategory{
    name = "Rifles",
    categorises = "shipments",
    startExpanded = true,
    color = Color(0, 107, 0, 255),
    canSee = function(ply) return true end,
    sortOrder = 2,
}

DarkRP.createCategory{
    name = "Shotguns",
    categorises = "shipments",
    startExpanded = true,
    color = Color(0, 107, 0, 255),
    canSee = function(ply) return true end,
    sortOrder = 3,
}
```

## MySQL Database Setup

For large servers, SQLite may not be sufficient. Configure MySQL in mysql.lua:

```lua theme={null}
RP.Config.MySQLConfig = {
    EnableMySQL = true,
    Host = "localhost",
    Database = "darkrp",
    Username = "username",
    Password = "password",
    Port = 3306
}
```

> [!WARNING]
>
> Always use strong, unique passwords for your database and never share them with anyone!

## Performance Optimization

Large DarkRP servers can experience performance issues. Use these settings for better performance:

```lua theme={null}
-- Add these to settings.lua for better performance

-- Reduce entity calculations
GM.Config.npckillpay = 0                    -- Disable NPC kill rewards to reduce calculations
GM.Config.rewardvault = false               -- Disable reward vault to reduce database operations
GM.Config.chatsounds = false                -- Disable chat sounds to reduce network traffic

-- Reduce database operations
GM.Config.logging = false                   -- Disable logging for better performance
GM.Config.backuptime = 600                  -- Increase time between data backups (in seconds)

-- Limit entity spam
GM.Config.pocketitems = 5                   -- Reduce maximum pocket items
GM.Config.maxdoors = 10                     -- Reduce maximum doors per player
GM.Config.maxlawboards = 2                  -- Reduce maximum law boards
GM.Config.maxletters = 10                   -- Reduce maximum letters
GM.Config.maxvehicles = 4                   -- Reduce maximum vehicles

-- Reduce player movement calculations
GM.Config.ironshoot = false                 -- Disable iron sight shooting mechanics
GM.Config.dynamicvoice = false              -- Disable dynamic voice to reduce calculations
```

## Common Issues & Troubleshooting

> [accordion] Missing Jobs in F4 Menu
>
> If jobs aren't appearing in the F4 menu:
>
> 1. Check for Lua errors in the console
> 2. Verify your jobs.lua syntax
> 3. Make sure you've configured proper categories
> 4. Restart the server after making changes
> 5. Check that the job's max count isn't set to 0

> [accordion] Money Printers Overheating Too Quickly
>
> Adjust these settings in your entities/printing\_money/init.lua file:
>
> ```lua theme={null}
> -- Money printer settings
> local PRINTER_HEALTH = 100        -- Default health of printer
> local TEMPERATURE_INCREASE = 0.15  -- How quickly temperature increases
> local TEMPERATURE_DECREASE = 0.05  -- How quickly it cools down when off
> local TEMPERATURE_DAMAGE = 55      -- Temperature at which damage starts
> local DAMAGE_AMOUNT = 5            -- Amount of damage when overheating
> local MONEY_AMOUNT = 250           -- Money printed per cycle
> local PRINT_DELAY = 150            -- Time between printing money (seconds)
> ```

> [accordion] Doors Not Working Properly
>
> If doors aren't working correctly:
>
> 1. Make sure F2 property is enabled
> 2. Check that you've configured door groups properly
> 3. Verify door ownership settings in settings.lua:
>    ```lua theme={null}
>    GM.Config.doorsowned = true
>    GM.Config.doorlabel = true
>    GM.Config.canforcedooropen = true
>    ```
> 4. Delete the darkrp\_door database files if needed

## Best Practices for Server Owners

1. **Balance your economy** - Don't make money too easy to get
2. **Create job diversity** - Have a good mix of legal and illegal jobs
3. **Limit overpowered weapons** - Don't give too many powerful weapons to one team
4. **Consider player count** - Adjust max jobs based on your average player count
5. **Use MySQL for large servers** - SQLite can cause lag with many players
6. **Regular restarts** - Schedule server restarts every 6-12 hours
7. **Backup configurations** - Always backup your DarkRP configs before changes
8. **Test before implementing** - Test changes on a development server first

> [!NOTE]
>
> The most successful DarkRP servers focus on role-playing and creating interesting scenarios rather than just giving players powerful weapons.

## Map Considerations

DarkRP gameplay is heavily influenced by the map you choose:

> [tab] rp\_downtown\_v4c
>
> A classic DarkRP map with good layout:
>
> * Well-defined police/mayor areas
> * Good building distribution
> * Logical bank location
> * Clear downtown area
>
> Recommended Settings:
>
> ```lua theme={null}
> GM.Config.maxdoors = 15
> GM.Config.maxlawboards = 3
> GM.Config.maxletters = 15
> ```

> [tab] rp\_evocity\_v33x
>
> A larger city map with lots of buildings:
>
> * Many apartment buildings
> * Large downtown area
> * Multiple shop locations
> * Good for higher player counts
>
> Recommended Settings:
>
> ```lua theme={null}
> GM.Config.maxdoors = 20
> GM.Config.maxlawboards = 5
> GM.Config.maxletters = 20
> ```

> [tab] rp\_rockford\_v2b
>
> A modern city map:
>
> * Clean visual style
> * Well-organized districts
> * Good performance optimization
> * Multiple police stations
>
> Recommended Settings:
>
> ```lua theme={null}
> GM.Config.maxdoors = 18
> GM.Config.maxlawboards = 4
> GM.Config.maxletters = 18
> ```

By following this configuration guide, you'll be able to create an engaging and well-balanced DarkRP server on Wasabi Hosting. Remember that the key to a successful DarkRP server is ongoing moderation and balance adjustments based on player feedback.

If you need further assistance, contact our support team.

> [card] [Get your own Garry's Mod server](https://wasabihosting.com/game-servers/garrysmod)
>
> Deploy a DDoS-protected Garry's Mod server on AMD Ryzen hardware in about two minutes, and plans start at €12.50/month.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.