I'm having problems adding custom models/textures to my server. Once they're added, they won't seem to download to clients computers. I have sv_download and upload set to 1. My maxfilesize at 64. I just need to know where to put models & textures where they will be downloaded to the computers of others.
I've heard all sorts of places to put them, merge them with the root folders, put them in the addons folder, edit your resource.lua and include every single filename.
I'd appreciate it if someone could help me, thanks!
You have to make the clients download them.
You need to make a lua file in autorun/server and add all your materials etc
[code]resource.AddFile("models/Weapons/yourmodelmaterial.vtf")[/code]
Thanks.
Is there any way I could make the process faster than manually adding every single file to resources.lua?
I'm pretty sure there is a way to add an entire folder, let me look.
[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/yourmodels")[/code]
here it is.
Thanks a ton!
I can use this with any directory right? Like
allthecodehere
AddDir("addons/theaddon")
Sorry, you need to Log In to post a reply to this thread.