Garry's Mod (with additional arguments) for use with workshop, other gamemodes, etc.



  • Garry's Mod (with additional arguments)

    A slightly modified template for Garry's Mod that allows for additional arguments which may be useful if you need +sv_setsteamaccount, -authkey, +host_workshop_collection, +gamemode, or other arguments.

    (All I added was one variable 👍)

    Usage

    Run the following command on your node machine

    curl -o /var/lib/pufferd/templates/gmod_withargs.json https://paste.ee/r/XeqOD/0 && chown pufferd:pufferd /var/lib/pufferd/templates/gmod_withargs.json
    

    Then, when creating a new server, select "Garry's Mod (with addition arguments)" and enter the arguments into the appropriate field
    0_1531159673392_withargs.png

    Template Contents

    {
      "pufferd": {
        "type": "srcds",
        "display": "Garry's Mod (with additional arguments)",
        "install": {
          "commands": [
            {
              "files": "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz",
              "type": "download"
            },
            {
              "commands": [
                "mkdir steamcmd",
                "tar --no-same-owner -xzvf steamcmd_linux.tar.gz -C steamcmd",
                "steamcmd/steamcmd.sh +login anonymous +force_install_dir ${rootdir} +app_update 4020 validate +quit",
                "mkdir -p .steam/sdk32",
                "cp steamcmd/linux32/steamclient.so .steam/sdk32/steamclient.so"
              ],
              "type": "command"
            }
          ]
        },
        "run": {
          "stop": "exit",
          "pre": [],
          "post": [],
          "arguments": [
            "+ip",
            "${ip}",
            "+port",
            "${port}",
            "-game",
            "garrysmod",
            "+map",
            "${map}",
            "+maxplayers",
            "${maxplayers}",
            "-norestart",
            "${args}"
          ],
          "program": "./srcds_run"
        },
        "environment": {
          "type": "tty"
        },
        "data": {
          "map": {
            "value": "gm_construct",
            "required": true,
            "desc": "Map to load by default",
            "display": "Map",
            "internal": false
          },
          "maxplayers": {
            "value": "20",
            "required": true,
            "desc": "Max players allowed on server",
            "display": "Max Players",
            "internal": false,
            "type": "integer"
          },
          "ip": {
            "value": "0.0.0.0",
            "required": true,
            "desc": "What IP to bind the server to",
            "display": "IP",
            "internal": false
          },
          "port": {
            "value": "27015",
            "required": true,
            "desc": "What port to bind the server to",
            "display": "Port",
            "internal": false,
            "type": "integer"
          },
          "args": {
            "value": "",
            "required": false,
            "desc": "Define arguments to pass into the starting command",
            "display": "Additional Arguments",
            "internal": false
          }
        }
      }
    }
    

    https://paste.ee/p/XeqOD


 

4
Online

803
Users

833
Topics

3.5k
Posts