steamworks
Steamworks related functions.
Methods
steamworks.ApplyAddons()
Refreshes clients addons.
You really should be using steamworks. DownloadUGC. This is a legacy function.
Downloads a file from the supplied addon and saves it as a . cache file in garrysmod/cache/ folder.
This is mostly used to download the preview image of the addon.
In case the retrieved file is an image and you need the IMaterial, use AddonMaterial with the path supplied from the callback.
A serverside implementation of this function can be provided by binary modules, such as gmsv_workshop.
Downloads a Steam Workshop file by its ID and returns a path to it.
A serverside implementation of this function can be provided by binary modules, such as gmsv_workshop.
Retrieves info about supplied Steam Workshop addon.
steamworks.GetList( string type, table tags, number offset, number numRetrieve, number days, string userID, function resultCallback )
Retrieves a customized list of Steam Workshop addons.
We advise against using this. It may be changed or removed in a future update.
You should use the callback of steamworks. RequestPlayerInfo instead.
Retrieves players name by their 64bit SteamID.
You must call steamworks. RequestPlayerInfo a decent amount of time before calling this function.
Returns whenever the client is subscribed to the specified Steam Workshop item.
steamworks.OpenWorkshop()
Opens the workshop website in the steam overlay browser.
steamworks.Publish( string filename, string image, string name, string desc, table tags, function callback, number fileid = nil, string changelist = "None given." )
This is used internally - although you're able to use it you probably shouldn't.
Publishes dupes, saves or demos to workshop.
Requests information of the player with SteamID64 for later use with steamworks. GetPlayerName.
Sets the workshop item as "completed" by the player. There will be a visual indicator on the Steam Workshop for completed items.
Sets whether you have played this addon or not. This will be shown to the user in the Steam Workshop itself:
Sets if an addon should be enabled or disabled. Call steamworks. ApplyAddons afterwards to update.
Returns whenever the specified Steam Workshop addon will be mounted or not.
This is used internally - although you're able to use it you probably shouldn't.
Subscribes to the specified workshop addon. Call steamworks. ApplyAddons afterwards to update.
steamworks.Unsubscribe( string workshopItemID )
This is used internally - although you're able to use it you probably shouldn't.
Unsubscribes to the specified workshop addon. Call steamworks. ApplyAddons afterwards to update.
This function should never be called without a user's consent and should not be called if the addon is currently in use (aka: the user is not in the main menu) as it may result in unexpected behaviour.
Opens the workshop website for specified Steam Workshop item in the Steam overlay browser.
This is used internally - although you're able to use it you probably shouldn't.
Makes the user vote for the specified addon