Disclaimer: Not responsible for any confusion induced by this tutorial. If you don't understand the basics underlined from here on out, you don't deserve to have a server of your own.
SECOND more important disclaimer: Make sure to edit the files posted to your needs. I'm not going to help you if you come to me saying: ohmagawd i kant kunnekt to ip 192.168.2.5! zomg u quack!
I'm going to keep this moderately concise. Feel free to post / pm if you need help.
[LIST=1][*]A dedicated server computer. I don't care if you have multiple cores and dual LAN cards. It's the stupidest idea EVER to host the server on your local machine. I don't even think it works.
[*]A good internet connection (512k if it's a dedicated connection, many more if not. Dedicated as in, nobody uses it but your server.)
[*]A Windows OS. Anything Win2K up should work just fine. Windows Server Edition == Bonus points (Less bloat, when you get down to it. You're not running accelerated graphics or media daemons. Vista and Seven are no-no's unless you're using classic theme.)
[*]A brain. This takes a bit of tweaking to get right.
[*]Some patience. Actually, lots of patience.[/LIST]
Installing the base
Go here and download the Windows version of SRCDS. Ignore everything else.
Access your server, copy the install file, and install to C:\srcds for easy access.
Now, open up Notepad, and copy and paste these lines.
Here's the tricky part.
echo Updating/installing CS:S
hldsupdatetool -command update -game "Counter-Strike Source" -dir .
echo Updating/installing dods
hldsupdatetool -command update -game "dods" -dir .
echo Updating/installing hl2mp
hldsupdatetool -command update -game "hl2mp" -dir .
echo Updating/installing tf
hldsupdatetool -command update -game "tf" -dir .
echo Installing Episodic Content
hldsupdatetool -command update -game "episode1" -dir .
echo Updating/installing Garrysmod
hldsupdatetool -command update -game garrysmod -verify_all -retry -dir .
echo Update/installation Complete
[LIST=1][*]Click File > Save As...[*]In the file name box, type hldsupdater.bat[*]In the box that says "Text documents (.txt)", change it to All Files (*.*)
[*]Leave encoding set to whatever it is. It doesn't matter.
[*]Save it to C:\srcds[/LIST]
Volia. If there are game content files that you don't want, remove the two lines for it from the batch file.
For example, lets say I don't want DOD:S on my server. I remove this:
Anyways. Let that sucker run, It will take a while.
echo Updating/installing dods
hldsupdatetool -command update -game "dods" -dir .
You have to do some tweaking now.
Your server's garrysmod folder is C:\srcds\orangebox\garrysmod now, so you can install addons that you like. Remember this, though. The more addons you have, the more likely it is that you will get join crashes when people join. This is even more true on weaker serving machines. Trust me, I've spent hours picking out addons that I simply don't need because they just joincrash so much.
Add maps too, you can never have too many maps.
So, now you have addons and maps. This is good, but we still need to configure some server settings.
Rule of thumb: It is an addon, when, if you go inside the folder it has a file called "info.txt"
If it's an addon, go out of the folder and drag the entire folder into the addons folder.
Open up the cfg folder inside your server's garrysmod folder. Create a file called "server.cfg" if it doesn't already exist (Use the method we did earlier, saving a file as All Files (*.*) except instead of hldsupdate.bat, use server.cfg)
Here is an example, taken from my server.
Adjust to your needs. If you want to use less system resources set the limits lower. I just wing it and change the limits in-game by admin mod (Which, we'll get to later.)
"hostname" "Ark's 24/7 Spacebuild of WIN"
"sv_region" "0" // eastcoast: 0 - westcoast: 1 - south america: 2 - europe: 3 - asia: 4 - australia: 5 - middle east: 6 - africa: 7 - world: 255
// Sandbox server settings
"sbox_plpldamage" "0" // set this to 1 to disable player vs player damage.
// Sandbox limits
Now, go to your server desktop or somewhere easy to access, and create this .bat file:
Name it whatever you want, as long as it ends with .bat
echo Protecting srcds from crashes...
echo If you want to close srcds and this script, close the srcds window and type Y depending on your language followed by Enter.
title srcds.com Watchdog
echo (%time%) srcds started
start /wait c:\srcds\orangebox\srcds.exe -console -game garrysmod -hostname -ip 192.168.2.5 -port 27015 +sv_lan 0 +map sb_gooniverse -gamemode sandbox +sv_gamemode SB3 +sv_defaultgamemode sandbox +maxplayers 24 +sv_maxfps 512 -maxfps 512
echo (%time%) WARNING: srcds closed or crashed, restarting.
Let's examine the main line.
Basically, here's what it's saying.
start /wait c:\srcds\orangebox\srcds.exe -console -game garrysmod -ip 192.168.2.5 -port 27015 +sv_lan 0 +map gm_construct -gamemode sandbox +maxplayers 24 +sv_maxfps 512 -maxfps 512
Launch the orangebox engine in console mode, run the game Garry's Mod, set IP to the network adapter's assigned IP (You don't need this unless you have multiple network adapters connected and only want it to listen on one, in which case you can find the IP of the desired adapter by opening a command prompt and typing "ipconfig", where you will be able to find the adapters and their corresponding IP addresses.)
Set listening port to 27015 (Default, but you have to change it if you have multiple servers on one machine.)
Make sure it's not a LAN server but an internet server
Start with map gm_construct
Set gamemode to sandbox (default)
Set maximum player slots (Usually want to set this lower.)
Set maximum frames per second.
(Frames per second is how many physics frames the server calculates a second. It's nice to have this at a high level, but by default it runs at 64 maximum, even with sv_maxfps set, but i will add the workaround later.)
Edit the BAT file for your specific situation
So now you have a server with addons and maps.
Now you can go ahead and grab your favorite admin mod real quick. I prefer ULX or Evolve.
Just drop it in the addons folder. Nothing else needs to be done with that for now.
Run your server,
Currently, it's a basic sandbox gamemode with addons and no admin mod. You can connect by LAN, but not by internet yet.
So go ahead, launch GMOD, open console and type "connect ip"
Where "ip" is the LAN address of your server (Usually 192.168.(0,1,2).x)
Like, some possible addresses:
You get the picture.
The lan IP address rarely ends with 1 unless the server is the computer everyone on your network connects to to get internet.
192.168.x.1 is, for the most part, the router's address.
So now you're in your server, hopefully.
But now you want Owner or Super Admin to make the server truly yours.
So, remember that RCON password we set earlier in server.cfg? (Forgot? Look back up and make sure you edit that file!)
Make sure you're still in the server and do this.
Hit the console key
Type "rcon_password <password here>" Without quotes, and replace <password here> with the actual password.
Now, if you type "rcon <command>", that command will be run on the server's console. (Or you could always remote desktop to the server and run the commands, but.)
Now, for specific mods:
ASS_GiveOwnership (part of name, player ID) (Player ID is the number before the player's name when you type Status in console)
Exmaple: ASS_GiveOwnership arche
ulx_setrank (pname, pid) (rank) (immunity)
(Example: Superadmin Immunity for me: ulx_setrank arche SuperAdmin Immunity) (Haven't used ULX for a while, don't kill me.
ev_SetRank <name> Owner
Now you have to bind a key to the admin menu (My favorite is X)
bind x +ASS_Menu
bind x +ev_menu
bind x ulx_menu
Now you can go abuse those admin powers.
Opening up to internet
Now we have to get it out on the internet.
Protip: If your router has an option for it, set your server in the DMZ. But only if it is a windows OS with Windows Firewall built in, or a third party firewall. DMZ makes it so that the router's firewall has no effect on the targeted computer. To set the DMZ you usually just put in the server's LAN IP.
Now, port forwarding was really hit or miss for me. Not going to lie. Lots of people say different things about port forwarding. This is what usually works.
Ports 27000-27030 TCP and UDP
Port 4380 UDP
Should work from internet now.
Go to www.whatismyip.net
Copy the IP to clipboard (This is your external IP, the one that you want to give to friends to connect to your server)
Go into GMOD console and type "connect ip" but this time, press ctrl and V to paste the IP into console.
Gamemodes seem overcomplicated to me.
Basically, here's what I would do for DarkRP.
Put the darkrp gamemode in to gamemodes/
Edit the server batch file and add
Go into game.cfg and add
-gamemode DarkRP +sv_gamemode DarkRP +sv_defaultgamemode DarkRP
Make sure that the DarkRP gamemode's folder is named DarkRP. The gamemode corresponds with the folder name when it comes to loading the gamemode.
Did I miss something?
More detail about something?
This is still pretty much a draft. Feedback and criticism much appreciated.
Parts borrowed from the Garry's Mod Wiki article on dedicated server setup (Good reading!)
I hope I can help at least five souls.