Player Models Added to the Web Server, Player's still not do

Post Reply
resqu
New to forums
New to forums
Posts: 1
Joined: Mon May 21, 2012 8:58 pm

Player Models Added to the Web Server, Player's still not do

Post by resqu » Wed May 23, 2012 9:36 pm

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?

Mrkrabz
New to forums
New to forums
Posts: 8
Joined: Fri Jun 15, 2012 12:00 pm

Re: Player Models Added to the Web Server, Player's still no

Post by Mrkrabz » Fri Jun 15, 2012 3:39 pm

As mentioned on the wiki to add folders as a resource use this code

Code: Select all

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.
Image

Post Reply