SRCDS Steam group


sv_downloadurl and resource.AddDir Help
#1
Hey guys.
Well i have been experimenting with Fast-Dl lately ,but i can't seem to make it download my models and materials.

I have this code :



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[/code]
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.."/*")) do
resource.AddFile(dir.."/"..v)
end
end

AddDir("models/Humans/Group02")
AddDir("materials/models/Humans/female/Group02")
AddDir("materials/models/Humans/male/Group02")




Well i placed it in ; garrysmod\lua\autorun But idk if that is correct if someone could inform me how to name it and where to place it, i would appreciate it .






EDIT: Also im using this for GMOD.
Reply
#2
First of all welcome to this forum.

Well that code should work, seeing as you got from the wiki. So what is your fastdownload setup?
Is everything you want downloaded to the clients on the server aswell as the Fastdl? Are all your lua cache files on the Fastdl?

The file is in the correct location, However I would recommend moving it to "/lua/autorun/server", this way it won't be added to the lua cache file and only run on the server (where it needs to).
Reply
#3
(08-30-2011, 02:10 AM)gamerlv Wrote:  First of all welcome to this forum.

Well that code should work, seeing as you got from the wiki. So what is your fastdownload setup?
Is everything you want downloaded to the clients on the server aswell as the Fastdl? Are all your lua cache files on the Fastdl?

The file is in the correct location, However I would recommend moving it to "/lua/autorun/server", this way it won't be added to the lua cache file and only run on the server (where it needs to).

Hey, and thank you Smile. But the problem is already fixed , i placed the codes in DarkRP init.lua so, everything is ok . Smile Thank you anyways Big Grin


Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)