This is my code
[code]
resource.AddWorkshop( "223766392" )
[/code]
Thats a link to a work shop pack like a collection will that work or no?
resource.AddWorkshop is for single addons only, not collections. So
[url]http://steamcommunity.com/sharedfiles/filedetails/?id=105982362[/url]
Would be
resource.AddWorkshop( "105982362" )
How can you do collections then?
Like this: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/server_srcds_steamcmd/setting_up_a_server_with_steamcmd.lua.html[/url]
Get a SteamAPI Key, put it in your launch options for your server along with the collection id and the server will download them.
You can then use engine.GetAddons( ) and loop through that, and resource.AddWorkshop for v.wsid -- some wsids are invalid / non-existent so you may end up needing to parse the v.title for digits.
Simple script does that...
[lua]//
// Returns only the numbers in a string by stripping non-numbers - Josh 'Acecool' Moser
//
function string.numbers( text )
text = string.gsub( text, "%D", "" );
return tonumber( text );
end
//
// gsub pattern characters.
// Use CAPITAL of letter for INVERSE.
//
-- . all characters
-- %a letters
-- %c control characters
-- %d digits
-- %l lower case letters
-- %p punctuation characters
-- %s space characters
-- %u upper case letters
-- %w alphanumeric characters
-- %x hexadecimal digits
-- %z the character with representation 0[/lua]
Sorry, you need to Log In to post a reply to this thread.