Server rentals :: NFOservers.com

Forums

All times are UTC - 8 hours



Author Message
PostPosted: Wed May 23, 2012 9:36 pm 
Offline
New to forums
New to forums

Joined: Mon May 21, 2012 8:58 pm
Posts: 1
I even followed "resource.AddFile("file path here")"
unless i did it wrong.
Im using this btw: http://www.garrysmod.org/downloads/?a=view&id=72729

and another thing, is there any way this ("resource.AddFile("file path here")") can be used with folders?


Top
 Profile  
 
PostPosted: Fri Jun 15, 2012 3:39 pm 
Offline
New to forums
New to forums

Joined: Fri Jun 15, 2012 12:00 pm
Posts: 7
As mentioned on the wiki to add folders as a resource use this code

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
      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("models/yourmodels")


Also, make sure your resource.AddFile code is in a server sided file, for example init.lua or in garrysmod/lua/autorun/server

If your models are not downloading to your server, for me
resource.AddFile(/models/ didn't work yet
resource.AddFile(models/ worked fine, remove any /'s behind the add file, it cant hurt either way.

Edit: just noticed the date of the thread /facepalm.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
It is currently Sat May 25, 2013 7:43 pm
Powered by phpBB® Forum Software © phpBB Group