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?
Player Models Added to the Web Server, Player's still not do
-
- New to forums
- Posts: 1
- https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
- Joined: Mon May 21, 2012 8:58 pm
Re: Player Models Added to the Web Server, Player's still no
As mentioned on the wiki to add folders as a resource use this code
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.
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")
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.