resource.AddWorkshop

From Garry's Mod
Jump to: navigation, search
 resource.AddWorkshop( )

Contents

Description

Adds a workshop addon for the client to download before entering the server.

Having the raw files from a workshop item does not count as having already downloaded it.
So players who previously downloaded a map through Fast Download will have to re-download it if you use the workshop.

You should try to only add addons that have custom content ( models, sounds, etc ).

Gamemodes that are workshop enabled are automatically added to this list - so there's no need to add them.
The server's current map is also automatically added, if it is loaded from a workshop addon.

WARNING This will not "install" the addon on your server, see Workshop for Dedicated Servers for installing Steam Workshop addons onto your servers

Arguments

string workshopid

The workshop id of the file. This cannot be a collection.

Examples

Example

Adds the Achievement Viewer addon (workshop id 104606562).
Any clients that join will download this addon if they haven't previously downloaded it from the workshop or from the server (via the workshop).

You get the ID from the URL of the workshop addon.
For example, here's the URL of the Achievement Viewer addon's page:
http://steamcommunity.com/sharedfiles/filedetails/?id=104606562
The ID is 104606562.

resource.AddWorkshop( "104606562" )

Output:

Players joining the server will now be forced to download the Achievement Viewer addon.
Personal tools
Navigation