Force DL Directory

Hi.
I’m trying to make all my players download FoodNHouseholditems.

This is how it looks in init.lua :
[lua] function AddDir(dir)
local list = file.FindDir("…/"…dir…"/*")
for _, fdir in pairs(list) do
if fdir != “.svn” then
AddDir(dir…"/"…fdir)
end
end

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

end

AddDir(“FoodNHouse/materials/models/FoodNHouseholdItems/”)
AddDir(“FoodNHouse/materials/models/CillitBang/”)
AddDir(“FoodNHouse/models/FoodNHouseholdItems/”)
AddDir(“FoodNHouse/settings/spawnlist”)
[/lua]

I tried spawnlist without the /, but noone of the above downloads.

In here, it’s a material, settings, and a models folder.
Noone of these downloads.
Why?

The FoodNHouse is a addon name I guess, you don’t need to specify the addon folder name.

Ah, I’ll try.
Will report how it goes.

Also change
[lua]
“…/”…dir…"/"
[/lua]
to
[lua]
“…/”…dir…"./
"
[/lua]
The file system will fail if the path looks like this “foo/bar//something.txt”
but it will work if it’s like this “foo/bar/./something.txt” or even this “foo/bar./something.txt”
it’s a simple failsafe:smile:

It says “448 files needed from server.” (removed my own food and household addon folder to see if it works).
Yes, I have allow any custom files on.

It just goes to sending client info, not DLing anything.

Got it working now -
thanks guys.