Downloading models

I am not sure if this is the correct section to post this in, but i will give it a try.

I am maintaining a Garry’s Mod server, we are using FastDL hosted from xfactorservers.com. But whatever we try, people just wont download the models/materials that we add.
And i maybe hoped that it is something extra i have to do, to make them download the models/materials

Maybe try Force Downloader?

The models and materials folders are not downloaded by default, you should try adding them with resource.AddFile.

To recursively add directories, you can try this script:



function AddDir(dir) // recursively adds everything in a directory to be downloaded by client
	local list = file.FindDir("../"..dir.."/*")
	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(file.Find("../"..dir.."/*")) do
		resource.AddFile(dir.."/"..v)
	end
end

AddDir("models");


Save to a file like ‘resources.lua’ in the garrysmod/autorun folder.

Please note that there is a limit to the number of files clients can download, so you should specify this further, by adding a subfolder (“models/folderhere”) instead of the models folder itself, which in most cases is too big already.