My force download script downloads certain files over, and over again every time we change maps.

Ever since I started using the resource.AddFile() method of FastDL, (doing a NFOservers websync used to be all i had to do, but then it broke.) certain files I have added re-download every time we change maps.

It’s only a couple models for a skin pack, not every single one, which is another weird thing. If it did this you’d figure it would do every file, but it doesn’t.

Also, I’ve used a timer, and to be honest it doesn’t slow down the time at all, actually I don’t think it’s even really downloading them every time, but it says it is, which gives players on my server the illusion it keeps downloading new things, and causes them to not want to play on the server.

How can I resolve this?

If files are downloading over and over that means they aren’t actually downloading. This can happen if the file casing from resource.AddFile doesn’t exactly match the exact casing of the path & file itself.

oh so it’s just a capitalization thing? that means i have to retype all of the resouce.addfile for all of those fucking textures ಠ_ಠ

NFO uses linux platform for their Garry’s Mod servers, so you may have to.

before you join, you can type “developer 4; download_debug 1” in console (without quotes) and you’ll probably see some green stuff in console after you got in. That should display errors and hopefully guide you.

thanks a bunch

If you do not want to retype all of those resource.Addfile, here is a script that does it for you.

[lua]if SERVER then
local function AddResourceDir(directory, sdir)
local files, folders = file.Find(“addons/”…directory…"*", “GAME”)
for k,v in pairs(folders) do
–print(directory…v…"/")
AddResourceDir(directory…v…"/", sdir)
end
for k,v in pairs(files) do
–resource.AddSingleFile(“addons/”…directory…v)
resource.AddSingleFile(string.gsub((directory…v), sdir, “”))
end
end

AddResourceDir("tdm_gmc/models/", "tdm_gmc/")
AddResourceDir("tdm_gmc/materials/", "tdm_gmc/")
AddResourceDir("tdm_gmc/sound/", "tdm_gmc/")

end[/lua]

Put it in the /garrysmod/addons/[addon]/lua/autorun
And just change the AddResourceDir to whatever your addon name is.

[editline]3rd July 2013[/editline]

Ops, you do not need the ones that are dark green. Just old notes for myself.