10-27-2011, 02:53 AM
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
AddDir("addons")
would this send the entire addons directory? I am trying to be positive that they have all the models, sounds, materials, resources, etc. How would this be possible? and where would I put the lua code. I tried putting it in /gamemode/sandbox/init.lua. and that made for hell on earth. so. I dont think I will do that again.
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
AddDir("addons")
would this send the entire addons directory? I am trying to be positive that they have all the models, sounds, materials, resources, etc. How would this be possible? and where would I put the lua code. I tried putting it in /gamemode/sandbox/init.lua. and that made for hell on earth. so. I dont think I will do that again.