Garry's Mod

How to PROPERLY set up a Garry's Mod Server. (Not for absolute beginners)

Submitted by Pecker, , Thread ID: 76677

Thread Closed
23-02-2018, 05:11 AM
This post was last modified: 23-02-2018, 05:12 AM by Pecker
#1
Hello there, Nulled!
(THIS THREAD IS NOT FOR ABSOLUTE BEGINNERS)

Today, I'm simply creating a thread addressing something that i see so many new server owners messing up on a day to day basis and that's simply creating a Garry's Mod server. Assuming you know the basics of actually getting the server to start (whether you're running on a VPS/Dedi or a (terrible)hosting service), this guide will be of ease to assist you in your journeys to both creating an appealing server and a server that will run smoothly.

This guide will be closely relating to DarkRP but you may take the information from this thread and use it for any gamemode. This guide will run over the basics of the topics listed below:
  • How to properly order your addons;
  • How to gain a playerbase;
  • Correct gamemode installation (DarkRP);
  • Correct addon installation;
  • How to correctly handle server bloat;
  • Correct commandline;
  • WorkshopDL.
Not all of these will be given their own titles, but each topic will be touched on in one way or another. The most important will be titled and be given their own designated spotlight throughout this thread.

*DISCLAIMER* By initially startinga Garry's Mod server - You must know the expenses of the server NEVER come free. You must both pay in effort and money. If you are negligent to work on your server relentlessly to keep it in tip top shape, you do not deserve to own a server. You must be resilient and you must be at your very best. A good server will attract good players, a bad server will attract bad players (or no players at all).

With that being said, let's get into this. Each section is spoiler('d?)to keep the post length low unless the user browsing would like to see the entire thing.


The basics of running a Garry's Mod Server.

Assuming that you're reading this thread with the intentions of starting/improving your garry's mod server, you need to at leastknow the basics of how the serverside aspect of the server works. Something that you may want to familiarize yourself in is Lua. Lua is the 'coding' language that builds up the very game that we know and love, and the game that you'd like to (profit off of?) start a server on. If you have absolutely zero knowledge on how to at least manipulate and/or read scripts created in lua, hire a developer or save yourself the money by not even running a server. The biggest servers in the world succeed because they have content that they have customcreated - You cannot have a thriving server based ENTIRELY on gmodstore scripts, but they certainly do help.

If you're looking for resourceful scripts to use on your server, Gmodstore has a plethora of scripts that you may use to your advantage. However,they're ironically leaked rampantly on this website so if you want to save yourself some money but be an extremely scummy individual, head on over and grab some scripts from the leaks section (smh you dirty leacher).

One IMPORTANT thing you must pay attention to is the amount of content you have laying around on your server. Having too manyunnecessary addons on your server is known as bloat and WILL take a toll on your servers performance. This could affect your boot time, the latency of your users or even the happiness of your players.



Where to get started (and how to brieflyinstall an addon).

So, assuming you're just starting out and have just purchased your VPS, setup your server and/or purchased your monthly subscription to that random game hosting panel you found on the internet - you need a place to start. The most important place to start, is to learn the file structure of your server before actually touching anything. To be 100% honest, i shouldn't need to teach you as it's pretty self explanatory. Addons = Addons, Sounds = sounds, Lua = Lua scripts, Models = Models, so on so on.

Obviously though, we'll have to go over /addons to give you an idea of how the folders works. It's amazing how many people mess up simply initializing an addon because they don't understand the file structure of how an addon works. Check below for how the file path SHOULD look.
Code:
garrysmod/addons/nameofaddon/{foldertype}

Pay attention to where it says the file path above, your addons MUST follow this file structure or else the addon WILL NOT work.
What's this? You're wondering what {foldertype} means? Well folder type can mean any of the following below:
  • lua
  • models
  • materials
  • sounds
  • backgrounds
  • and whatever else belongs in there.
On countless occasions, I've been asked for assistance regarding an addon that doesn't work and i see this:
Code:
garrysmod/addons/nameofaddon/nameofaddon/{foldertype}

This is EXACTLY what you do not do. Once the first folder is there (inside of /addons), that is the very start of your addon and the next folder(s) must be the same as what i stated above. You cannot have a folder with an addon inside of it and expect it to work. For the love of god, please order your addon names accordingly. instead of having "tazer gun", name is "swep_tazer" (swep = a scripted weapon). At least make your addons folder presentable.

When you're installing addons onto your server, save yourself the bandwidth and do not bother uploading the materials/sounds/models to your addons folder. I reapeat, do NOT upload these. It is COMPLETELY useless. Do not even put them in your garrysmod/{foldertype} folders. It does absolutely nothing for the server unless you want to use up storage on your service/dedi.



Content Packs (WorkshopDL).

Content packs, personally are the most important part of a users experience while connecting to the server (par the loading screen, since that's ONLYcosmetic). I will not teach you how to upload this to the workshop as you'll need to learn it on your own but below the end of this section, I'll post links to official sources on how to upload a garry's mod item to the workshop.

The first step to creating a content pack is to take all of the materials/sounds/models out of whatever addons you have on your server and putting them into one big ol' folder. Once you've completed this, you want upload it to the workshop (you may have to split it into multiple workshop items depending on how large your files are) and then adding said uploaded files to a workshop collection. In your commandline, you'll then want to set this as your workshopDL. If you're unaware of how to do this, read further into the guide on how to setup the commandline properly.

Once all of this is done, you want to restart your server and monitor your console. You'll see that your server is downloading the .gma files from the workshop and keeping that for the server itself. This will make sure that all models in the content pack stay solid on the server, otherwise they'd be visible for the client but not solid. Once this is done, head to the directory below and create a folder called workshop.lua:
Code:
garrysmod/lua/autorun/server

Once that file has been created, you want to edit the file and then you want to allow the client to now download the workshop files. This can be done by simply adding resource.AddWorkshop("workshopitemidhere") on seperate lines. I like to comment at the end of each like so, so i can keep track of each item:
Code:
resource.AddWorkshop("123456789") -- Test Item 1
resource.AddWorkshop("987654321") -- Test Item 2

Restart your server again, rejoin and you'll notice that you're now downloading those items on the loading screen. If you already are subscribed, then it'll skip those items and continue connecting to the server. Once you're in, tah dah- You can now see all of the models you need under organised workshop items so that the player doesn't have to subscribe to multiple playermodel items, instead they only have to subscribe to 1-3 universal items for the whole server.

Something that i advise you to do, NEVER put the map on the workshop collection. FastDL the map by putting it in your /maps folder. If you're running TCAdmin, then press the "Sync Fast Downloads" button and restart your server. Otherwise, read up on some guides on how to setup FastDL.

FastDL should only be used for maps - Do not use materials/models/sounds/etc onFastDL.

Addon Creation:https://wiki.garrysmod.com/page/Workshop_Addon_Creation
FastDL setup:https://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index70e8.html



Gamemode Installation.

Since this thread is closely aimed towards DarkRP, i'll give a quick example on how to install DarkRP itself rather than any other mode - but you'll run the same method for any other gamemode (excluding darkrpmodification). This section will be done in steps as it doesn't require much of an explanation.

Step 1: Find your gamemode folder and drag it into your garrymod/gamemodes and set it to your default gamemode in the commandline.
Step 2: (DarkRP only) Install DarkRP modification. With DarkRP, you DO NOT want to edit ANY of the core files. DarkRPModification will contain (essentially a mirror) of any files that may need to be edited such as the jobs, entities, groupchats, hud, scoreboard, f4 menu, f1 menu and more. You may grab the addon from here:https://github.com/FPtje/darkrpmodification and all you need to do is put it in /addons (after extracting the zip).
Step 3: Play around with the configurations and you're all gucci.

Bonus: For now, I'm going to teach you how to set up a job quick and easy. Here is the default template for a darkrp job:

Code:
TEAM_CITIZEN = DarkRP.createJob("Citizen", {
  color = Color(20, 150, 20, 255),
  model = {"models/player/Group01/Female_01.mdl"},
  description = [[The Citizen is the most basic level of society you can hold besides being a hobo. You have no specific role in city life.]],
  weapons = {},
  command = "citizen",
  max = 0,
  salary = GAMEMODE.Config.normalsalary,
  admin = 0,
  vote = false,
  hasLicense = false,
  candemote = false,
  category = "Citizens",
})

This is the default citizen job configuration. You may create new jobs by taking this template, copy and pasting it into jobs.lua and editing it as you wish. I'm not going to go into detail about how to do it because a six year old could do it. It's self explanatory what does and doesn't need to be changed.



Commandline.

This is mainly for the users who run their servers via TCAdmin and have the readily available"commandline" button there. If you're not running via TCAdmin and do not have an efficient commandline button laying around, do a little bit of research for the parametersfor the server.cfg file or how to set your own custom commandline without TCAdmin. This is essentially how creating a custom commandline looks in TCAdmin:

[Image: eda537593471c188772dd94bfb801394.png]

You'll notice the five options:
  • API Key: Can be found here:https://steamcommunity.com/dev/apikey
  • Server Config: Leave as server.cfg
  • Gamemode: Name what your gamemode folders name is, case sensitive.
  • Startup Map: Most likely a dropdown box, you may only select the map if it is in your /garrysmod/maps folder.
  • Workshop ID: The ID at the end of the URL of your workshop collection. This is the collection that you have your pre-prepared workshop items in. Very important if you'd like the players to refrain from seeing non-stop errors.
If you're using a custom command line and would like to change your tickrate, +/-tickrate "number" will easily do so. A darkrp server is recommended to have a lower tickrate than 66.




This is all I've got so far on this thread, I'm tired, haven't slept and have spent about two hours writing up this thread. Please leave criticism in the replies and suggestions on what to add a header on and I'll have it done. I hope somebody can at least benefit from this. Thanks for reading.

RE: How to PROPERLY set up a Garry's Mod Server. (Not for absolute beginners)

#2
Thank you. Just what i was looking for! Been trying to setup a Gmod server for some time now, but icouldn't figure out all the mods and what not.

RE: How to PROPERLY set up a Garry's Mod Server. (Not for absolute beginners)

#3
Amazing i've been developing servers for years but went on brake for 2 years there and have little lua knowledge but even in this there was things I didn't know, thank you for making the effort to help the community.

RE: How to PROPERLY set up a Garry's Mod Server. (Not for absolute beginners)

#4
thank you so much for putting all this time and effort in Smile

RE: How to PROPERLY set up a Garry's Mod Server. (Not for absolute beginners)

#5
thank you so much I was looking on how to set up a server!

RE: How to PROPERLY set up a Garry's Mod Server. (Not for absolute beginners)

#6
I have a gmod server already, but this is can be useful for novices in hosting servers

Users browsing this thread: 2 Guest(s)