Clients don't download the models

Hi there.

I’m currently setting up a server, but i am having a LOT of trouble getting the clients to download the models.

in the server’s addon folder, i have a folder with the models/materials and the lua folder. In the lua folder is an autorun folder, with a lua file called fc3dmpmodelres.lua
Inside, i have this code:
[lua]
resource.AddFile( “models/cyborg_soldier.mdl” )
resource.AddFile( “models/FarCry3/pirate_1_npc.mdl” )
resource.AddFile( “models/FarCry3/rakyat-1.mdl” )
resource.AddFile( “materials/models/props/FC3PIR8BOOTS.vmt” )
resource.AddFile( “materials/models/props/FC3PIR8BOOTS.vtf” )
resource.AddFile( “materials/models/props/FC3PIR8CLOTH.vmt” )
resource.AddFile( “materials/models/props/FC3PIR8CLOTH.vtf” )
resource.AddFile( “materials/models/props/FC3PIR8FACE.vmt” )
resource.AddFile( “materials/models/props/FC3PIR8FACE.vtf” )
resource.AddFile( “materials/models/props/FC3PIR8HAT.vmt” )
resource.AddFile( “materials/models/props/FC3PIR8HAT.vtf” )
resource.AddFile( “materials/models/props/FC3PIR8PANTS.vmt” )
resource.AddFile( “materials/models/props/FC3PIR8PANTS.vtf” )
resource.AddFile( “materials/models/props/FC3PIR8SKIN.vmt” )
resource.AddFile( “materials/models/props/FC3PIR8SKIN.vtf” )
resource.AddFile( “materials/models/props/FC3PIR8TSHIRT.vmt” )
resource.AddFile( “materials/models/props/FC3PIR8TSHIRT.vtf” )
resource.AddFile( “materials/models/props/FC3RAKCLOTH.vmt” )
resource.AddFile( “materials/models/props/FC3RAKCLOTH.vtf” )
resource.AddFile( “materials/models/props/FC3RAKHEAD.vmt” )
resource.AddFile( “materials/models/props/FC3RAKHEAD.vtf” )
resource.AddFile( “materials/models/props/FC3RAKHOLSTER.vmt” )
resource.AddFile( “materials/models/props/FC3RAKHOLSTER.vtf” )
resource.AddFile( “materials/models/props/FC3RAKPANTS.vmt” )
resource.AddFile( “materials/models/props/FC3RAKPANTS.vtf” )
resource.AddFile( “materials/models/props/FC3RAKSHIRT.vmt” )
resource.AddFile( “materials/models/props/FC3RAKSHIRT.vtf” )
resource.AddFile( “materials/models/props/FC3RAKSKIN.vmt” )
resource.AddFile( “materials/models/props/FC3RAKSKIN.vtf” )
resource.AddFile( “materials/models/props/FC3RAKTEETH.vmt” )
resource.AddFile( “materials/models/props/FC3RAKTEETH.vtf” )
resource.AddFile( “materials/models/props/FC3RAKVEST.vmt” )
resource.AddFile( “materials/models/props/FC3RAKVEST.vtf” )
resource.AddFile( “materials/FarCry3/cyborg_armor1.vmt” )
resource.AddFile( “materials/FarCry3/cyborg_armor1.vtf” )
resource.AddFile( “materials/FarCry3/cyborg_armor2.vmt” )
resource.AddFile( “materials/FarCry3/cyborg_armor2.vtf” )
resource.AddFile( “materials/FarCry3/cyborg_arms.vmt” )
resource.AddFile( “materials/FarCry3/cyborg_arms.vtf” )
resource.AddFile( “materials/FarCry3/cyborg_helmet.vmt” )
resource.AddFile( “materials/FarCry3/cyborg_helmet.vtf” )
resource.AddFile( “materials/FarCry3/cyborg_legs.vmt” )
resource.AddFile( “materials/FarCry3/cyborg_legs.vtf” )
resource.AddFile( “materials/FarCry3/cyborg_neck.vmt” )
resource.AddFile( “materials/FarCry3/cyborg_neck.vtf” )
resource.AddFile( “materials/FarCry3/cyborg_visor.vmt” )
resource.AddFile( “materials/FarCry3/cyborg_visor.vtf” )
resource.AddFile( “materials/FarCry3/FC3PIR8BOOTS.vmt” )
resource.AddFile( “materials/FarCry3/FC3PIR8BOOTS.vtf” )
resource.AddFile( “materials/FarCry3/FC3PIR8CLOTH.vmt” )
resource.AddFile( “materials/FarCry3/FC3PIR8CLOTH.vtf” )
resource.AddFile( “materials/FarCry3/FC3PIR8FACE.vmt” )
resource.AddFile( “materials/FarCry3/FC3PIR8FACE.vtf” )
resource.AddFile( “materials/FarCry3/FC3PIR8HAT.vmt” )
resource.AddFile( “materials/FarCry3/FC3PIR8HAT.vtf” )
resource.AddFile( “materials/FarCry3/FC3PIR8PANTS.vmt” )
resource.AddFile( “materials/FarCry3/FC3PIR8PANTS.vtf” )
resource.AddFile( “materials/FarCry3/FC3PIR8SKIN.vmt” )
resource.AddFile( “materials/FarCry3/FC3PIR8SKIN.vtf” )
resource.AddFile( “materials/FarCry3/FC3PIR8TSHIRT.vmt” )
resource.AddFile( “materials/FarCry3/FC3PIR8TSHIRT.vtf” )
resource.AddFile( “materials/FarCry3/FC3RAKCLOTH.vmt” )
resource.AddFile( “materials/FarCry3/FC3RAKCLOTH.vtf” )
resource.AddFile( “materials/FarCry3/FC3RAKHEAD.vmt” )
resource.AddFile( “materials/FarCry3/FC3RAKHEAD.vtf” )
resource.AddFile( “materials/FarCry3/FC3RAKHOLSTER.vmt” )
resource.AddFile( “materials/FarCry3/FC3RAKHOLSTER.vtf” )
resource.AddFile( “materials/FarCry3/FC3RAKPANTS.vmt” )
resource.AddFile( “materials/FarCry3/FC3RAKPANTS.vtf” )
resource.AddFile( “materials/FarCry3/FC3RAKSHIRT.vmt” )
resource.AddFile( “materials/FarCry3/FC3RAKSHIRT.vtf” )
resource.AddFile( “materials/FarCry3/FC3RAKSKIN.vmt” )
resource.AddFile( “materials/FarCry3/FC3RAKSKIN.vtf” )
resource.AddFile( “materials/FarCry3/FC3RAKTEETH.vmt” )
resource.AddFile( “materials/FarCry3/FC3RAKTEETH.vtf” )
resource.AddFile( “materials/FarCry3/FC3RAKVEST.vmt” )
resource.AddFile( “materials/FarCry3/FC3RAKVEST.vtf” )
[/lua]
But when clients join, they don’t download these files? Did i do something wrong? Or is it because it’s in the addons folder?

Thanks!

Place the lua code inside the addon, example: addons/someaddon/lua/autorun/server

Like i said, it is already there. But will it make a difference of what folder i put? I have another custom addon that the lua is in the autorun folder and it dowloads perfectly. Will putting it in autorun/serverr really make a difference?

I’m not sure how useful these suggestions are going to be, but oh well.

  1. If you have ULX installed on your server, you can create a ‘downloads.txt’ folder in ‘garrysmod/data/ulx/’ inside that file you list the files you want clients to download, like so:


models/weapons/v_katana.dx80.vtx
models/weapons/v_katana.dx90.vtx


and so on.

  1. I know you put the original code inside ‘lua/autorun/server’ but try wrapping the code in ‘IF SERVER THEN’, like so:


if SERVER then
resource.AddFile( "models/cyborg_soldier.mdl" )
end


Forget about the if SERVER then stuff. Just move the file you currently have to lua/autorun/server