DarkRP is a roleplay gamemode for Garry's Mod. A DarkRP server needs two parts: the DarkRP gamemode itself and the darkrpmodification addon, where you make all your customizations such as jobs or settings. Afterwards you set the gamemode and a matching map in the dashboard.
Install DarkRP via the Workshop
The easiest way is the official Workshop version of DarkRP. The server downloads it automatically on startup and keeps it up to date.
-
Add DarkRP to the collection
Add DarkRP (Workshop ID248302805) to the Workshop collection your server loads. You can find out how to create a collection and enter it in the Workshop ID field under Add Mods. -
Add a map to the collection
Also add a DarkRP map to your collection, for example rp_downtown_v4c_v2 (Workshop ID110286060).
Install DarkRP from GitHub
Alternatively, you can download DarkRP from GitHub and upload it yourself. In that case you also have to install updates yourself.
-
Download DarkRP
Open the DarkRP page on GitHub, click Code and then Download ZIP. Extract the archive on your PC. -
Rename the folder
The archive contains the folderDarkRP-master. Rename it todarkrp– all lowercase. -
Connect via SFTP
Connect to your server via SFTP. -
Upload the folder
Upload thedarkrpfolder to the following directory:/garrysmod/gamemodes/ -
Check the folder structure
The filedarkrp.txtmust be located directly in thedarkrpfolder:/garrysmod/gamemodes/darkrp/darkrp.txt
Install darkrpmodification
The darkrpmodification addon is the place for all your customizations. It does not work without DarkRP.
-
Download darkrpmodification
Open the darkrpmodification page on GitHub, click Code and then Download ZIP. Extract the archive on your PC. -
Rename the addon folder
Rename the extracted folderdarkrpmodification-mastertodarkrpmodification. -
Upload the addon folder
Upload the folder via SFTP to the following directory:/garrysmod/addons/The
luafolder must then be located directly in the addon folder:/garrysmod/addons/darkrpmodification/lua/
Set the gamemode and map
-
Open the dashboard
Open the dashboard of your server. -
Open the settings
Navigate to the Settings. -
Enter the gamemode
Enter the following value in the Gamemode field:darkrp -
Enter the map
Enter the name of a DarkRP map in the Map field, for example:rp_downtown_v4c_v2If the map is in your server's collection, players download it automatically when they join. You can find out more under Change Map.
-
Restart the server
Save the setting and restart your server.
Customize DarkRP
All files for your customizations are located in the darkrpmodification addon under /garrysmod/addons/darkrpmodification/lua/. The most important ones are:
| File | Content |
|---|---|
darkrp_config/settings.lua |
General DarkRP settings, for example starting money and salary |
darkrp_config/disabled_defaults.lua |
Disabling of included jobs, modules and content |
darkrp_config/mysql.lua |
Connection to a MySQL database |
darkrp_customthings/jobs.lua |
Custom jobs and modified default jobs |
darkrp_customthings/categories.lua |
Custom categories for the F4 menu |
darkrp_customthings/shipments.lua |
Custom weapon shipments |
darkrp_customthings/entities.lua |
Custom buyable entities |
Change the settings
-
Open the file
Open the following file via SFTP:/garrysmod/addons/darkrpmodification/lua/darkrp_config/settings.lua -
Adjust the values
Every setting is on its own line with a short description above it. Only change the value after the=, for example:-- startingmoney - your wallet when you join for the first time. GM.Config.startingmoney = 500 -- normalsalary - Sets the starting salary for newly joined players. GM.Config.normalsalary = 45 -
Restart the server
Save the file and restart your server.
Create a custom category
Jobs are shown in categories in the F4 menu. Included are, among others, Citizens, Civil Protection and Gangsters. You create your own category like this:
-
Open the file
Open the following file via SFTP:/garrysmod/addons/darkrpmodification/lua/darkrp_customthings/categories.lua -
Add the category
Add your category below the lineAdd new categories under the next line!and the end of the comment]]:DarkRP.createCategory{ name = "Services", categorises = "jobs", startExpanded = true, color = Color(0, 107, 0, 255), canSee = function(ply) return true end, sortOrder = 100, }With
categorisesyou set what the category applies to. Allowed values arejobs,entities,shipments,weapons,vehiclesandammo.
Add a custom job
-
Open the file
Open the following file via SFTP:/garrysmod/addons/darkrpmodification/lua/darkrp_customthings/jobs.lua -
Add the job
Add your job below the commentAdd your custom jobs under the following line:, for example:TEAM_TAXI = DarkRP.createJob("Taxi Driver", { color = Color(20, 150, 20, 255), model = {"models/player/Group01/Male_02.mdl"}, description = [[You take the citizens of the city safely to their destination.]], weapons = {}, command = "taxi", max = 2, salary = GAMEMODE.Config.normalsalary, admin = 0, vote = false, hasLicense = false, category = "Services", }) -
Restart the server
Save the file and restart your server. The new job appears in the F4 menu.
Disable or change included content
If you want to change or remove an included job such as the Medic, you disable it first.
-
Open the file
Open the following file via SFTP:/garrysmod/addons/darkrpmodification/lua/darkrp_config/disabled_defaults.lua -
Disable the job
In theDarkRP.disabledDefaults["jobs"]block, set the value of the job totrue:["medic"] = true,In the same way you disable modules, shipments and other content in the other blocks of the file.
-
Recreate the job (optional)
If you want to keep using the job in a modified form, copy it from jobrelated.lua into yourjobs.luaand adjust it there. -
Restart the server
Save the files and restart your server.
Useful admin commands
DarkRP comes with its own commands for admins. You enter them in the in-game chat. To use them, you have to be registered as admin or superadmin on your server. You can find out how under Add Admin.
| Command | Description | Required group |
|---|---|---|
/setmoney <player> <amount> |
Sets a player's money to an amount | superadmin |
/addmoney <player> <amount> |
Gives a player additional money | superadmin |
/setlicense <player> |
Gives a player a gun license | superadmin |
/unsetlicense <player> |
Revokes a player's gun license | superadmin |
/arrest <player> |
Arrests a player | admin |
/unarrest <player> |
Releases a player | admin |
/forcerpname <player> <name> |
Changes a player's RP name | admin |
/teamban <player> <job> [seconds] |
Bans a player from a job, optionally for a number of seconds | admin |
/teamunban <player> <job> |
Lifts the ban from a job | admin |
/setspawn <job> |
Replaces the spawn points of a job with your current position | admin |
/addspawn <job> |
Adds another spawn point for a job at your position | admin |
/removespawn <job> |
Removes all custom spawn points of a job on the current map | admin |
For <player> you can use the player name or part of it, the SteamID or the SteamID64. For <job> in the spawn commands, use the command name of the job, meaning the value from command, for example taxi. With /teamban and /teamunban you can also use the name of the job. If you leave out the time with /teamban, the ban lasts until you lift it with /teamunban or the player leaves the server.
Reset the money of all players
With the following command you reset the money of all players to the starting money (startingmoney). You enter it in the console in your server's dashboard. In-game, only a superadmin can run it via the game console.
rp_resetallmoney
Use a MySQL database (optional)
By default, DarkRP stores all data such as the players' money in the SQLite database /garrysmod/sv.db on your server. You do not have to set anything up. If you want to use a MySQL database instead, for example to share the data with other applications, you need the MySQLOO module.
-
Create a database
Create a database in your server's dashboard and note down the connection details. You can find out how under Create Database. -
Check the architecture
Enter the following command in the console in your server's dashboard:lua_run print(jit.os, jit.arch)The output is, for example,
Linux x86.x86stands for 32-bit,x64for 64-bit. -
Download MySQLOO
Download the matching file from the MySQLOO releases on GitHub:- for
x86:gmsv_mysqloo_linux.dll - for
x64:gmsv_mysqloo_linux64.dll
- for
-
Upload the module
Upload the file via SFTP to the following directory. If thebinfolder does not exist yet, create it:/garrysmod/lua/bin/ -
Open the MySQL config
Open the following file via SFTP:/garrysmod/addons/darkrpmodification/lua/darkrp_config/mysql.lua -
Enter the connection details
SetEnableMySQLtotrueand enter the connection details of your database:RP_MySQLConfig.EnableMySQL = true RP_MySQLConfig.Host = "db1.cgn1.emeraldhost.de" RP_MySQLConfig.Username = "u123_AbCdEf1234" RP_MySQLConfig.Password = "YourPassword" RP_MySQLConfig.Database_name = "s123_darkrp" RP_MySQLConfig.Database_port = 3306 RP_MySQLConfig.Preferred_module = "mysqloo"Replace the example values with the connection details from the dashboard.
-
Restart the server
Save the file and restart your server. DarkRP creates the required tables in the database automatically.
