Make Player download a file through console

I have seen it on a few servers how would i go about making it so when someone typed something in console it makes them download a pack through Steam Workshop? Thanks

I don’t see the point in that, why not make them download all required assets upon joining?
You need a Web API key and a Steam Workshop Pack < Or whatever they are called, all free.

[editline]6th September 2013[/editline]

Startup line
+host_workshop_collection {WORKSHOP ID} -authkey {LONG STEAM KEY}
The Workshop ID is the Workshop Asset and the auth key is something you generate from steam I think, you can register one here.

Auth/Web API key:

You would likely get a faster responce in the ‘Developer Discussion’ page.

I have all that done but they weapon models show up as errors unless you have the pack downloaded.

OH ok, you have to do something called ‘resource.addFile’
Go to your serverdir/garrysmod/lua/autorun in that folder create a lua file called ‘fastdl.lua’
Inside that put:

if (SERVER) then
	resource.AddFile( "models/MODELNAME.mdl" )

Should force the client to download it.

[editline]6th September 2013[/editline]

The folder models being SERVERDIR/garrysmod/models inside there put all your models.

Awesome I’ll try it out. An this will work with steamworkshop things?

I believe steam workshop items do this ‘automaticly’ but for all models you put in your directory folder this shall work.

FYI you shall get more and better responses from the ‘Developer Discussion’ section.

Make a lua file in lua/autorun/server that looks like this.

resource.addworkshop ("123456")

For each addon, make a seperate line stating with resources.addworkshop with the number representing the addon ID. resource.adddfile is not for workshop, but FastDL.