Spoiler anzeigen
Running Your Server
Once all of the setup has been made it is time to run your newly christened Gmod server! There are a couple of methods of doing this.
[edit] Command Line Interface
Method one involves using your current knowledge of the command line to navigate to the srcds.exe directory(C:\srcds\orangebox) and typing
srcds.exe -console -game garrysmod +map X +maxplayers X -autoupdate
The X's meaning the map name(Ex: gm_construct), and the maximum amount of players, respectively.
[edit] Shortcut
Another, and faster way to start your server it to create a shortcut to srcds.exe. Once made and placed where you like right-click on it and go to properties. Now go to the Target box and enter the parameters after srcds.exe:
-console -game garrysmod +map X +maxplayers X -autoupdate
The X's meaning the map name(Ex: gm_construct), and the maximum amount of players, respectively.
Crash Recovery
Batch File Recovery
Batch files are little script files that tell Windows what to do. If srcds crashes, it will not restart like possible under Linux (Linux uses a "Script" file too).
What we are going to do is make sure that as soon HLDS suddenly quits it will restart. First we open notepad. What we write in there is the following:
Command(s):
@echo off
cls
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
:srcds
echo (%time%) srcds started.
start /wait srcds.exe -console -game garrysmod +map gm_construct +maxplayers 16
echo (%time%) WARNING: srcds closed or crashed, restarting.
goto srcds
Replace the marked part with your own commandline and values. Save the file as C:\srcds\orangebox\srcds.bat in notepad (NOT .txt) and next time click the srcds.bat file. If you need to close srcds, close the hlds window and press Y (depending on language) at the Terminate batch question. Please do note this does not work with crashes/errors that involve a Windows error box.