-2

I'm currently in the middle of making a game launcher for my Garry's Mod server. Right now, when you press Launch all it does is start Garry's Mod with Process.Start("GarrysMod.exe").

Is it possible for me to start Garrys Mod with launch arguments for example that starts Garrys Mod up and connects to the server when it loads (e.g Process.Start("GarrysMod.exe -connect 1.2.3.4). If anyone knows if this is possible or how to do this, please let me know.

Thanks!

1 Answers1

0

The simplest (and preferred) way of doing this is this:

steam://connect/<IP or DNS name>[:<port>][/<password>]

This will connect the user to the server specified by the IP or DNS name. You do not need to specify anything. Steam will detect on it's own that you want to connect to a GMod Server.

If GMod is already running it will just connect the user, otherwise GMod will be started.
More Information can be found here

Other Methods should not be necessary when using the official steam version of Garry's Mod

Mischa
  • 1,303
  • 12
  • 24
  • Thanks for the response, I've done this instead: ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.FileName = Settings.Default["FilePath"].ToString(); startInfo.Arguments = "+connect 1.2.3.4"; Process.Start(startInfo); – Joe Stevens May 05 '18 at 21:10