resource.AddFile
Description
Adds the specified and all related files to the list of files the client should download from the server.
For convenience, this function will automatically add any other files that are related to the selected one, and throw an error if it can't find them. For example, a .vmt
file will automatically add the .vtf
with the same name, and a .mdl
file will automatically add all .vvd
, .ani
, .dx80.vtx
, .dx90.vtx
and .phy
files with the same name, with a separate error for each missing file.
If you do not want it to do this, use resource.AddSingleFile.
See also Serving Content
There's a 8192 downloadable file limit. If you need more, consider using Workshop addons - resource.AddWorkshop. You should also consider the fact that you have way too many downloads. This limit is shared among all
resource.Add*
functions.The file must exist on the server it will not be added to the downloadables list!
Arguments
1 string path
Virtual path of the file to be added, relative to
Do not add
Do not add
garrysmod/
.Do not add
.bz2
to the filepath.Do not add
gamemodes/*gamemodename*/content/
or addons/*addonname*/
to the path, since those paths are mounted virtually as if they are in the root garrysmod/
.