Setting up a gmod dedicated server on your own machine.Edit
There are a number of reasons why you'd want to set up a gmod dedicated server on your own machine, such as using it to test lua scripts, or actually hosting your own server for others to play on. The process is easy and this tutorial will guide you through it.
Step 1 - Downloading the Half Life server update toolEdit
Before you download the updater it's a good idea to decide on the directory to store your servers files. You can choose anywhere, but I suggest picking an easy to find location such as your C drive. In this tutorial I'll use 'C:\srcds' as the directory, so go ahead and create the new folder.
Now you can download the HLDS update tool and place it in the srcds folder you just created. You'll have to issue a few commands in command prompt to install the garrysmod and counterstrike files needed to start the dedicated server.
To open command prompt in windows Vista/7 open the start menu and just type cmd into the search bar and hit enter. On XP you need to go to start>run and type cmd in. Once you have command prompt open you need to change directory into the srcds folder. If your folder is in C:/ type in "cd .." enough times to get to the c:/ directory (or type cd \ to go directly to the root of C:\), and then type in "cd srcds" to go into the srcds folder.
At this point you need to install the required files for the Gmod server, type the command:
HldsUpdateTool.exe -command update -game "garrysmod" -dir C:\srcds .
This will take some time as you're downloading all the Gmod game files.
Once this is complete you need to install the counterstrike files required, do this by entering the command:
HldsUpdateTool.exe -command update -game "Counter-Strike Source" -dir C:\srcds ...
** If you are you using Unix, please install wine and then run the UpdateTool through wine; if you need more information on wine + running darkrp on ubuntu, check out the guides on KBVE's GMod tutorial
If you now look in your srcds folder you'll have a bunch of files and 3 directories, "hl2", "orangebox", and "css". If you want to install DarkRP and other game mods on your server it's a good idea to put the css folder into the "orangebox" directory. When you have done that go into the "css" folder and you'll see "cstrike", move this into "orangebox".You should now be ready to start up the server. However it's a good idea to follow the next few steps in the tutorial on configuring and customising the server.
Step 2 - Configuring the serverEdit
One of the most important server files is 'server.cfg', you can find this file in 'orangebox > garrysmod > cfg'. If it isn't there you will need to create it. Open a text editor such as notepad and input the following basic server.cfg text:
hostname "YOUR SERVER NAME STRING HERE" rcon_password "YOUR RCON PASSWORD HERE" sv_password "" sv_defaultgamemode "Sandbox" sv_lan 0 sv_allowupload 1 sv_allowdownload 1 mapcyclefile "mapcycle.txt" sbox_noclip 1 sbox_godmode 0 sbox_maxprops 300 sbox_maxragdolls 5 sbox_maxnpcs 0 sbox_maxballoons 25 sbox_maxeffects 5 sbox_maxdynamite 15 sbox_maxlamps 10 sbox_maxthrusters 20 sbox_maxwheels 40 sbox_maxhoverballs 20 sbox_maxvehicles 5 sbox_maxbuttons 20 sbox_maxemitters 0 sbox_maxspawners 0 sbox_maxturrets 4 net_maxfilesize 64
There is plenty here for you to play around with, you can pretty much put any console command in here. Check out this epic list of console commands to use.
Once you've set up your server.cfg go to 'save as...' and save it as server.cfg, make sure to select "all files" from the 'Save as type' drop down box.
Step 3 - Loading maps and addonsEdit
Any maps you want to play on in your server have to be placed in the folder 'orangebox > garrysmod >maps'. Check out this link for some cool maps.
When you've placed the maps you want to use into the maps folder you need to create two files, 'maplist.txt' and 'mapcycle.txt' in the 'orangebox > garrysmod' directory. 'maplist.txt' is literally just a list of all the maps you want to be able to load onto the server at anytime, just place the map names in here without the '.bsp' extension. 'mapcycle.txt' is the list of maps to cycle through automatically, this list can be different to 'maplist.txt' however maps in here have to be in 'maplist.txt' also.