Hello guys.
I got this code back in the beta I'm pretty sure I got it from Facepunch, Im sorry I can't remember the persons name.
Here:
[CODE]local t_Filter = {
""
};
local function ProcessFolder( t_Location )
local t_Files, t_Directories = file.Find( t_Location .. "*", "GAME" )
for _, t_File in pairs( t_Files ) do
if ( !table.HasValue( t_Filter, string.GetExtensionFromFilename( t_File ) ) ) then
resource.AddFile( t_Location .. t_File );
MsgN( "resource.AddFile( '" .. t_Location .. t_File .. "' );" );
end
end
for _, t_Directory in pairs( t_Directories ) do
ProcessFolder( t_Location .. t_Directory .. "/", t_Total );
MsgN( "Found directory: '" .. t_Directory .. "'." );
end
end
if ( game.IsDedicated() ) then
ProcessFolder( "gamemodes/GAMEMODE/content/models/" );
ProcessFolder( "gamemodes/GAMEMODE/content/materials/" );
ProcessFolder( "gamemodes/GAMEMODE/content/sound/" );
ProcessFolder( "gamemodes/GAMEMODE/content/resource/" );
end[/CODE]
But this doesn't work, what happens is when I join the server it downloads one file and stops.
To make it work I need to put the content folder in "Steam/steamapps/MYNAME/garrysmod/garrysmod/gamemodes/GAMEMODE/"
Then I'm able to join the server?
How do I make this work like it should?
To me it looks like it doesn't know where to put the files when it downloads it?
Sorry, you need to Log In to post a reply to this thread.