• Force Download?
    4 replies, posted
Is there a way to have the people whom join your server download all the content from your game mode by just throwing everything into a certain folder (Like Content) or??
[lua]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(fdir) end end for k,v in pairs(file.Find("../"..dir.."/*")) do resource.AddFile(dir.."/"..v) end end AddDir("folder/directory")[/lua] you can add more of the AddDir at the end if needed
[QUOTE=DocDoomsday;19796232][lua]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(fdir) end end for k,v in pairs(file.Find("../"..dir.."/*")) do resource.AddFile(dir.."/"..v) end end AddDir("folder/directory")[/lua] you can add more of the AddDir at the end if needed[/QUOTE] I just toss this into autorun right?
I would throw that code into lua/autorun/serverside right??
By the looks of it I would say so. Maybe just lua/autorun and make it so they don't download THAT file.
Sorry, you need to Log In to post a reply to this thread.