ForceDL

How do i add folders to be forced to download?
I dont like to add single files, and want to add the direction to it, and just add where the folder is located.
I want to do it with all Murderthon Weapons (Small,Assult,Heavy)
So, can someone help me with added those into forcedl? Or teach me on how to add folders (dir)?

Use this function:
[lua]
function AddDir(dir)
local _, flist = file.Find(dir…"/*", “GAME”)
if flist == nil then return end

for _, fdir in pairs(flist) do
	if fdir != ".svn" then 
		AddDir(dir.."/"..fdir)
	end
end

for k,v in pairs(file.Find(dir.."/*", "GAME")) do
	resource.AddFile(dir.."/"..v)
end

end
[/lua]

Example:
[lua]
– Adds all files in models/stuff and its subfolders to forced downloads.
AddDir(“models/stuff”)
[/lua]

Where should i add this?

Create a lua file in lua/autorun/server and paste this in it. Then place any forced downloads under that code, using resource.AddFile() if you only want to add a single file or AddDir() if you want to add a whole directory.

Ive done the lua thing, and ive added the funciton thingy, and i use This
resource.AddDir(“sound/weapons/”)
resource.AddDir(“models/shells/”)
resource.AddDir(“models/w_models/weapons/”)
resource.AddDir(“models/weapons/”)
resource.AddDir(“materials/models/shells/12gauge/”)
resource.AddDir(“materials/models/weapons/v_models/”)
resource.AddDir(“materials/models/weapons/w_models/”)
resource.AddDir(“materials/scope/”)
resource.AddDir(“materials/vgui/entities/”)
resource.AddDir(“materials/vgui/hud/”)

But they dont download it, and they only see error. This is for Murderthon Weapons 9000 Heavy (http://steamcommunity.com/sharedfiles/filedetails/?id=114984820&searchtext=Murderthon)
Any errors/fails that ive done?

Nothing, really? :tinfoil:

showthread.php?t=1147046

So, that i only need to do is only to put this into it.
resource.AddFile (“models/player/yourfile.mdl”)

And then, all the files in that place where the file is, will automatically be installed too?

No… it will only add that file. It just prevents you from adding files you don’t need to add.

So i cant do any shorcuts to spare much time? Like, its the only way to get ForceDL, is to take EVERY singel file, and do so much work on just 1 pack?

You can use AddDir in some cases where the folder is custom to the addon/gamemode/pack, however yes… this is the only way I know of.