I'm working on my Gmod server and I want to add some addons. But how do I do it? If you know, please tell me. Thank you.
EDIT: This problem was solved. You don't have to reply anymore.
For workshop addons, create a Steam workshop collection and put +host_workshop_collection <id> in your server startup BAT file. For legacy, put the folders in (server directory)/garrysmod/addons/
Where is the start.bat file located at? The .cfg file?
How do you startup your server?
I open the srcds shortcut application and start it.
If you're on Windows, make a file called start.bat in the same directory as your SRCDS. Put this in the contents:
[code]srcds.exe -console -game "garrysmod" +map NAMEOFTHEMAP +maxplayers 16 +gamemode NAMEOFTHEGAMEMODE +host_workshop_collection IDHERE[/code]
Okay, thanks! I'll try it right now.
[editline]3rd July 2016[/editline]
Still won't work...
[QUOTE=Great Dog;50641202]Okay, thanks! I'll try it right now.
[editline]3rd July 2016[/editline]
Still won't work...[/QUOTE]
What do you mean it won't work? The start.bat doesn't work? or The addons still aren't being added to your server?
This is what I did:
srcds.exe -console -game "garrysmod" +map gm_flatgrass +maxplayers 16 +gamemode sandbox +host_workshop_collection 715819417
[editline]3rd July 2016[/editline]
I added a Start.bat file in Desktop>server>gmod, and in that start.bat file, I added that line of code.
[editline]3rd July 2016[/editline]
[QUOTE=Thane;50641389]What do you mean it won't work? The start.bat doesn't work? or The addons still aren't being added to your server?[/QUOTE]
The addons are not being added to my server.
[QUOTE=Great Dog;50641413]This is what I did:
srcds.exe -console -game "garrysmod" +map gm_flatgrass +maxplayers 16 +gamemode sandbox +host_workshop_collection 715819417
[editline]3rd July 2016[/editline]
I added a Start.bat file in Desktop>server>gmod, and in that start.bat file, I added that line of code.
[editline]3rd July 2016[/editline]
The addons are not being added to my server.[/QUOTE]
Okay I'm going to assume that the addons aren't being added since you didn't answer my question.
I ran into this problem also. What you must do is:
Navigate to YourServerName/garrysmod/lua/autorun/server
Create a new lua file called "workshop.lua"
Open the file
In that file put
[CODE]resource.AddWorkshop("Addon ID Here")[/CODE]
You'll have to do this for every addon in your collection. And remember you're getting the ADDON ID not the COLLECTION ID.
So you'll have to go to every addon and the the ID at the end of the URL for all of the addons you want in your server. At first just do a few to make sure it works.
EDIT:
Sorry was typing this reply when you answered the question.
EDIT2:
There's no "=" after resource.AddWorkshop it's just resource.AddWorkshop("")
If I want to add more than one addon, do I do
1 resource.AddWorkshop("Addon ID Here")
2 resource.AddWorkshop("Addon ID Here")
3
[editline]3rd July 2016[/editline]
Or do I do
resource.AddWorkshop=("EXAMPLE EXAMPLE")
The first one
Okay.
[editline]3rd July 2016[/editline]
It finally worked! Thank you!
Sorry, you need to Log In to post a reply to this thread.