So I have been having trouble with auto-downloading for players on my darkrp server in gmod. I've tried the unconfirmed AddWorkshop code for my resource.lua so I didn't have to do AddFile and include the .vtf and .vtm, .mdl, etc. I think the code below looks correct enough but for some reason they just won't automatically download for players.
I have input resource.AddWorkshop (since they are all workshop files). Here is my current resource.lua located in garrysmod/lua/autorun/server/resource.lua :
resource.AddWorkshop( "211818654" )
resource.AddWorkshop( "123581457" )
resource.AddWorkshop( "184396116" )
resource.AddWorkshop( "107411755" )
resource.AddWorkshop( "248643568" )
resource.AddWorkshop( "166165013" )
resource.AddWorkshop( "238855334" )
resource.AddWorkshop( "133342076" )
resource.AddWorkshop( "141049673" )
resource.AddWorkshop( "173062725" )
For some reason they don't download for players and this is really weird, is it because AddWorkshop is not confirmed and I need to use AddFile? Help!
Try
[CODE]if (SERVER) then
resource.AddWorkshop(211818654)
resource.AddWorkshop(123581457)
resource.AddWorkshop(184396116)
resource.AddWorkshop(107411755)
resource.AddWorkshop(248643568)
resource.AddWorkshop(166165013)
resource.AddWorkshop(238855334)
resource.AddWorkshop(133342076)
resource.AddWorkshop(141049673)
resource.AddWorkshop(173062725)
end[/CODE]
and make sure it's in [I]garrysmod\lua\autorun\server[/I]
[QUOTE=Gary D;45598577]Try
[CODE]if (SERVER) then
resource.AddWorkshop(211818654)
resource.AddWorkshop(123581457)
resource.AddWorkshop(184396116)
resource.AddWorkshop(107411755)
resource.AddWorkshop(248643568)
resource.AddWorkshop(166165013)
resource.AddWorkshop(238855334)
resource.AddWorkshop(133342076)
resource.AddWorkshop(141049673)
resource.AddWorkshop(173062725)
end[/CODE]
and make sure it's in [I]garrysmod\lua\autorun\server[/I][/QUOTE]
I'm not an expert or anything but shouldn't there be quotation marks around the workshop ids?
[QUOTE=burger97979;45598599]I'm not an expert or anything but shouldn't there be quotation marks around the workshop ids?[/QUOTE]
No, that was proably your problem in the first place.
I've never used quotation marks around them and it's allways worked for me
[QUOTE=Gary D;45598618]No, that was proably your problem in the first place.
I've never used quotation marks around them and it's allways worked for me[/QUOTE]
Ohhhh ok, I'll go ahead and replace my code with:
if (SERVER) then
resource.AddWorkshop(211818654)
resource.AddWorkshop(123581457)
resource.AddWorkshop(184396116)
resource.AddWorkshop(107411755)
resource.AddWorkshop(248643568)
resource.AddWorkshop(166165013)
resource.AddWorkshop(238855334)
resource.AddWorkshop(133342076)
resource.AddWorkshop(141049673)
resource.AddWorkshop(173062725)
end
I'll reply on how it did!
To summerize:
Having quotation marks is 100% meaningless, the resource.AddWorkshop works either way.
You NEED to have the [CODE]if SERVER then[/CODE] or [CODE]if (SERVER) then[/CODE]
And that was probably your problem.
It should work smoothly now
[QUOTE=Gary D;45598618]No, that was proably your problem in the first place.
I've never used quotation marks around them and it's allways worked for me[/QUOTE]
Can you try joining the server to see if it auto-downloads for you? Here's the ip:
192.99.37.123:27495
It's DarkRP and the name is Fireclaw #2
[editline]5th August 2014[/editline]
[QUOTE=JasonMan34;45598674]To summerize:
Having quotation marks is 100% meaningless, the resource.AddWorkshop works either way.
You NEED to have the [CODE]if SERVER then[/CODE] or [CODE]if (SERVER) then[/CODE]
And that was probably your problem.
It should work smoothly now[/QUOTE]
Thank you for supporting the quotation marks, I feel really good about my auto-downloads now but no one is here to test it lol
[editline]5th August 2014[/editline]
Pretty sure it works now, thanks guys!
Sorry, you need to Log In to post a reply to this thread.