How the hell do i add models so it downloads clientside?
5 replies, posted
It's in the name.
[url]http://www.garrysmod.org/downloads/?a=view&id=72729[/url]
I have put them in my servers addons folder, i even extracted the models and materials to the main garrysmod directory. Whenever people join they see an error. I have put the files on my Fast Download also.
People see me as an error when they join.
You need to use resource.AddFile and make them download the model.
Umm.. What?
This is a quite important matter, for those servers with special content.
Please, HELP US! :3
You need to use the [b][url=http://wiki.garrysmod.com/?title=Resource.AddFile]Resource.AddFile [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] function in a Lua script. You'll have to get a Lua scripter or write the script yourself to setup the download of the files that you want to pass to the client.
So persay..
[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.."/*")) do
resource.AddFile(dir.."/"..v)
end
end
AddDir("models/myadminmodel")
AddDir("materials/myadminmodel")
[/Code]
I could do that to just download the entire Models/Materials folder correct?
[code]resource.AddFile( "models/myadminmodel/tesla.avi" )
resource.AddFile( "materials/myadminmodel/tesla.avi" )[/code]
Or i could just use this for file by file correct?
Sorry, you need to Log In to post a reply to this thread.