Clients downloading the files to the server.

Right so I recently added some custom files to my server, there all showing up as errors, I have a fastdl server set up, still doesn’t work.
I tried adding the resources.lua file, still doesn’t work, it’s placed in lua/autorun/server

Also as in didn’t work I mean it isn’t downloading anything besides the map if you don’t have it

Any help please? :rolleyes:

EDIT: Alright so I got it to download the files, however, there still showing up as errors :suicide:

EDIT: I have fixed the issue.

I’ve had this problem myself did you add “sv_allowdownload” “1” to your server.cfg?

Yeah.

Toxic do you mind telling us how you fixed this?

I’d love to know too

Use this code, I got it from someones post on the site, can’t remember who it was so all credit and thanks to them.

Put this as your resources.lua file


function AddDir( dir ) // Recursively adds everything in a directory to be downloaded by client
    local files, list = file.Find( dir.."/*", "GAME")
    for _, fdir in pairs(list) do
        if fdir != ".svn" then // Don't spam people with useless .svn folders
            AddDir(dir.."/"..fdir)
        end
    end
 
    for k,v in pairs( files ) do resource.AddFile(dir .. "/" .. v ) end
end
 
AddDir("") -- You use this function to add new folders and such

For any one having an issue like this,
where your content isn’t being pushed to players:
Take note of the differences here.

Specifically, when you place quotes in your server.cfg,
it changes the value to a “string value”, rather than being boolean (TRUE/FALSE ).

Take this into consideration when writing your “server.cfg”
I struggled with the same issue you are having, but then clue’d into this
basic mistake.

server.cfg content


sv_allowdownload 1

and


sv_allowdownload "1"

are 2 VERY different things.

[editline]13th June 2013[/editline]

-snip-

Mind you, I know this has already been solved, but posting this info for
others who stumble upon this.

GLua has support for C-like comments, this code is working perfectly.

Interesting, thanks for telling me!

Alright so, I got my first problem solved, I have a new one now :v

Basically the model isn’t a error anymore, but it is showing up as black and pink checkers, I have got several people to join the server to test it and it’s the same for them unless they download the actual model from the workshop.

Anyone have a fix for this?

Also before anyone asks, I do have C:SS, HL2 and TF2 installed.

My resources.lua file is placed in garrysmod/lua/autorun/server, I used a resource generator to cover every file in the server and it STILL doesn’t work. Clients that connect still have model errors and can’t see the weapons.

Yes, my server.cfg is set to download files. Yes, I checked my Fast DL and all of the files are there and ready to be downloaded, but I still don’t know why I’m having these problems, I’ve restarted the server multiple times and turned it off/back on, can’t fix this problem.

My fast download link: http://74.122.197.190/KevinD/415/garrysmod/

I don’t know what to do different, I’ve tried everything.

Here’s a link to my resources.lua file as well:

Any help would be greatly appreciated.

Edit: I should note I’ve only been testing on flatgrass, garrysmod construction, and 67th way maps with garry’s mod console command “give weapon_ttt_weaponname” and ULX rcon “ent weapon_ttt_weaponname”. I don’t know if making some re-armed maps would actually make a difference to find out if the errors persist, but I would like to know.

I was about to make a thread on this.

I added a new player model to my server it downloads for clients but they still see as errors. I added it to my resource.Addfile thing and my fast download synch i did not really find the answer in this thread