FastDL help.

Hi,

I have create a lua file in lua/autorun :
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…"/*", true)) do
resource.AddFile(dir…"/"…v)
end
end

resource.AddFile( “materials/halfliferp/halfliferp1942.png” )
resource.AddFile( “materials/halfliferp/1942rp.png” )
resource.AddFile( “resource/fonts/DIRTYEGO.TTF” )
resource.AddFile( “sound/voixcitoyen/male/ok01.wav” )
AddDir( “models/humans/suits01/.” )
AddDir( “models/tuxs/.” )
AddDir( “models/bloocobalt/deadrising/.” )
AddDir( “sound/voixcitoyen/female/.” )
AddDir( “sound/voixcitoyen/male/.” )
AddDir( “materials/models/humans/suits/.” )

I have add voices for Half Life ² Role-Play and i’ve set the line for the FastDL but the sounds dosn’t want to be downloaded.
Please help me.
Thanks.

As far as I know, the AddDir function you are using only worked on GMod 12 because some of the file functions were modified. If you want, you can use the following code instead. I’m using it myself and it works:

[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]