Wont download models ?

~Problem Sloved~

i have a file that send things to other players that join my server >

this 1

resource.AddFile(“addons/Harry Potter/models/harry/harry_potter.dx90.vtx”)

wont send all vtx files wont send :S every 1 is waiting for ages but it wont download also i haz that with .vtf files :Z! :frowning: help plz ?

**[Resource.AddFile

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Resource.AddFile)**

Is used for sending an entire folder.

**[Resource.AddSingleFile

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Resource.AddSingleFile)**

Is used for sending a single file.

Also starts in root directory. Addon folders combine with the the roots folders anyway.
“models/harry/harry_potter.dx90.vtx” -> I think.

allright so its like this

When i use

resource.Addfile(“file”)

thats for sendin folderS?

and like this >

addons/Harry Potter
:smiley: ? ( thats folder for harrypotter model :Z)

i found this

but when i do this :

AddDir(“mapname”)

it dont even download the files :z

Wrong. **[Resource.AddSingleFile

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Resource.AddSingleFile)** is to add a SINGLE file.
What **[Resource.AddFile

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Resource.AddFile)** does is, if you do:


resource.AddFile( "models/test.mdl" )

it will automatically add the related files such as the test.vtx, test.dx90.vtx etc.


resource.AddSingleFile( "models/test.mdl" )

will ONLY add test.mdl.

will this work



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(fdir)
		end
	end
 
	for k,v in pairs(file.Find("../"..dir.."/*")) do
		"highlight">AddDir(dir)
	end
end
 
AddDir("addons/Master Chief Playermodel")
AddDir("addons\Master Chief Playermodel")


You clearly dont know what you’re talking about.

http://www.facepunch.com/showthread.php?p=21508609

i found this :smiley:

http://www.facepunch.com/showthread.php?p=20586411

[editline]11:11PM[/editline]

i use this now ,

can some 1 tell me whats rong with this ,


if (SERVER) then
Resource.AddSingleFile( "Trails/materials/trails/angry.vmt" )
Resource.AddSingleFile( "Trails/materials/trails/angry.vtf" )
Resource.AddSingleFile( "Trails/materials/trails/arrow.vmt" )
Resource.AddSingleFile( "Trails/materials/trails/arrow.vtf" )
Resource.AddSingleFile( "Trails/materials/trails/ben.vmt" )
Resource.AddSingleFile( "Trails/materials/trails/ben.vtf" )
Resource.AddSingleFile( "Trails/materials/trails/carebear.vmt" )
Resource.AddSingleFile( "Trails/materials/trails/carebear.vtf" )
Resource.AddSingleFile( "Trails/materials/trails/dennis.vmt" )
Resource.AddSingleFile( "Trails/materials/trails/dennis.vtf" )
Resource.AddSingleFile( "Trails/materials/trails/epiclulz.vmt" )
Resource.AddSingleFile( "Trails/materials/trails/epiclulz.vtf" )
Resource.AddSingleFile( "Trails/materials/trails/handy.vmt" )
Resource.AddSingleFile( "Trails/materials/trails/handy.vtf" )
Resource.AddSingleFile( "Trails/materials/trails/happy.vmt" )
Resource.AddSingleFile( "Trails/materials/trails/happy.vtf" )
Resource.AddSingleFile( "Trails/materials/trails/litfuse.vmt" )
Resource.AddSingleFile( "Trails/materials/trails/litfuse.vtf" )
Resource.AddSingleFile( "Trails/materials/trails/rainbow.vmt" )
Resource.AddSingleFile( "Trails/materials/trails/rainbow.vtf" )
Resource.AddSingleFile( "Trails/materials/trails/smouch.vmt" )
Resource.AddSingleFile( "Trails/materials/trails/smouch.vtf" )
Resource.AddSingleFile( "Trails/materials/trails/star.vmt" )
Resource.AddSingleFile( "Trails/materials/trails/star.vtf" )
Resource.AddSingleFile( "Trails/materials/trails/wots.vmt" )
Resource.AddSingleFile( "Trails/materials/trails/wots.vtf" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/models/player/tinkywinky_hl2mp_player/tinkywinky_hl2mp_player.mdl" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/models/player/po_hl2mp_player/po_hl2mp_player.mdl" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/models/player/laalaa_hl2mp_player/laalaa_hl2mp_player.mdl" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/models/player/dipsy_hl2mp_player/dipsy_hl2mp_player.mdl" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/models/humans/tinkywinky_hl2mp_human/tinkywinky_hl2mp_human.mdl" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/models/humans/po_hl2mp_human/po_hl2mp_human.mdl" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/models/humans/laalaa_hl2mp_human/laalaa_hl2mp_human.mdl" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/models/humans/dipsy_hl2mp_human/dipsy_hl2mp_human.mdl" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/vgui/entities/dipsy_hl2mp.vmt" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/vgui/entities/dipsy_hl2mp.vtf" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/vgui/entities/laalaa_hl2mp.vmt" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/vgui/entities/laalaa_hl2mp.vtf" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/vgui/entities/po_hl2mp.vmt" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/vgui/entities/po_hl2mp.vtf" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/vgui/entities/tinkywinky_hl2mp.vmt" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/vgui/entities/tinkywinky_hl2mp.vtf" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/models/player/tinkywinky_hl2mp/ear.vmt" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/models/player/tinkywinky_hl2mp/ear.vtf" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/models/player/tinkywinky_hl2mp/face.vmt" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/models/player/tinkywinky_hl2mp/face.vtf" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/models/player/tinkywinky_hl2mp/plantar.vmt" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/models/player/tinkywinky_hl2mp/plantar.vtf" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/models/player/tinkywinky_hl2mp/purple.vmt" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/models/player/tinkywinky_hl2mp/purple.vtf" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/models/player/tinkywinky_hl2mp/TV.vmt" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/models/player/tinkywinky_hl2mp/TV.vtf" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/models/player/po_hl2mp/ear.vmt" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/models/player/po_hl2mp/ear.vtf" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/models/player/po_hl2mp/face.vmt" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/models/player/po_hl2mp/face.vtf" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/models/player/po_hl2mp/plantar.vmt" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/models/player/po_hl2mp/plantar.vtf" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/models/player/po_hl2mp/red.vmt" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/models/player/po_hl2mp/red.vtf" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/models/player/po_hl2mp/TV.vmt" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/models/player/po_hl2mp/TV.vtf" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/models/player/laalaa_hl2mp/ear.vmt" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/models/player/laalaa_hl2mp/ear.vtf" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/models/player/laalaa_hl2mp/face.vmt" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/models/player/laalaa_hl2mp/face.vtf" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/models/player/laalaa_hl2mp/plantar.vmt" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/models/player/laalaa_hl2mp/plantar.vtf" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/models/player/laalaa_hl2mp/TV.vmt" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/models/player/laalaa_hl2mp/TV.vtf" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/models/player/laalaa_hl2mp/yellow.vmt" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/models/player/laalaa_hl2mp/yellow.vtf" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/models/player/dipsy_hl2mp/ear.vmt" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/models/player/dipsy_hl2mp/ear.vtf" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/models/player/dipsy_hl2mp/face.vmt" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/models/player/dipsy_hl2mp/face.vtf" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/models/player/dipsy_hl2mp/green.vmt" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/models/player/dipsy_hl2mp/green.vtf" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/models/player/dipsy_hl2mp/plantar.vmt" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/models/player/dipsy_hl2mp/plantar.vtf" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/models/player/dipsy_hl2mp/TV.vmt" )
Resource.AddSingleFile( "teletubbies_npc_player_v2/materials/models/player/dipsy_hl2mp/TV.vtf" )
Resource.AddSingleFile( "models/peterboi/masterchief/masterchief.mdl" )
Resource.AddSingleFile( "models/peterboi/masterchief/Master Chief Playermodel/models/peterboi/masterchief/masterchief.mdl" )
Resource.AddSingleFile( "models/peterboi/masterchief/Master Chief Playermodel/materials/models/peterboi/masterchief/Masterchief_Armor.vmt" )
Resource.AddSingleFile( "models/peterboi/masterchief/Master Chief Playermodel/materials/models/peterboi/masterchief/Masterchief_Armor.vtf" )
Resource.AddSingleFile( "models/peterboi/masterchief/Master Chief Playermodel/materials/models/peterboi/masterchief/Masterchief_Armor_normal.vtf" )
Resource.AddSingleFile( "models/peterboi/masterchief/Master Chief Playermodel/materials/models/peterboi/masterchief/Masterchief_Clothes.vmt" )
Resource.AddSingleFile( "models/peterboi/masterchief/Master Chief Playermodel/materials/models/peterboi/masterchief/Masterchief_Clothes.vtf" )
Resource.AddSingleFile( "models/peterboi/masterchief/Master Chief Playermodel/materials/models/peterboi/masterchief/Masterchief_Clothes_normal.vtf" )
Resource.AddSingleFile( "models/peterboi/masterchief/Master Chief Playermodel/materials/models/peterboi/masterchief/Masterchief_Visor.vmt" )
Resource.AddSingleFile( "models/peterboi/masterchief/Master Chief Playermodel/materials/models/peterboi/masterchief/Masterchief_Visor.vtf" )
Resource.AddSingleFile( "models/peterboi/masterchief/Master Chief Playermodel/materials/models/peterboi/masterchief/Masterchief_Visor_normal.vtf" )
Resource.AddSingleFile( "materials/models/peterboi/masterchief/Masterchief_Armor.vmt" )
Resource.AddSingleFile( "materials/models/peterboi/masterchief/Masterchief_Armor.vtf" )
Resource.AddSingleFile( "materials/models/peterboi/masterchief/Masterchief_Armor_normal.vtf" )
Resource.AddSingleFile( "materials/models/peterboi/masterchief/Masterchief_Clothes.vmt" )
Resource.AddSingleFile( "materials/models/peterboi/masterchief/Masterchief_Clothes.vtf" )
Resource.AddSingleFile( "materials/models/peterboi/masterchief/Masterchief_Clothes_normal.vtf" )
Resource.AddSingleFile( "materials/models/peterboi/masterchief/Masterchief_Visor.vmt" )
Resource.AddSingleFile( "materials/models/peterboi/masterchief/Masterchief_Visor.vtf" )
Resource.AddSingleFile( "materials/models/peterboi/masterchief/Masterchief_Visor_normal.vtf" )
Resource.AddSingleFile( "Master Chief Playermodel/models/peterboi/masterchief/masterchief.mdl" )
Resource.AddSingleFile( "Master Chief Playermodel/materials/models/peterboi/masterchief/Masterchief_Armor.vmt" )
Resource.AddSingleFile( "Master Chief Playermodel/materials/models/peterboi/masterchief/Masterchief_Armor.vtf" )
Resource.AddSingleFile( "Master Chief Playermodel/materials/models/peterboi/masterchief/Masterchief_Armor_normal.vtf" )
Resource.AddSingleFile( "Master Chief Playermodel/materials/models/peterboi/masterchief/Masterchief_Clothes.vmt" )
Resource.AddSingleFile( "Master Chief Playermodel/materials/models/peterboi/masterchief/Masterchief_Clothes.vtf" )
Resource.AddSingleFile( "Master Chief Playermodel/materials/models/peterboi/masterchief/Masterchief_Clothes_normal.vtf" )
Resource.AddSingleFile( "Master Chief Playermodel/materials/models/peterboi/masterchief/Masterchief_Visor.vmt" )
Resource.AddSingleFile( "Master Chief Playermodel/materials/models/peterboi/masterchief/Masterchief_Visor.vtf" )
Resource.AddSingleFile( "Master Chief Playermodel/materials/models/peterboi/masterchief/Masterchief_Visor_normal.vtf" )
Resource.AddSingleFile( "Mario Bros1/models/player/slow/luigi_gxy.mdl" )
Resource.AddSingleFile( "Mario Bros1/models/player/slow/mario.mdl" )
Resource.AddSingleFile( "Mario Bros1/models/player/slow/mario_gxy.mdl" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario_gxy/slow_body.vmt" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario_gxy/slow_body.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario_gxy/slow_cap.vmt" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario_gxy/slow_cap.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario_gxy/slow_eyelid.vmt" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario_gxy/slow_eyelid.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario_gxy/slow_face.vmt" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario_gxy/slow_face.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario_gxy/slow_fake_logo.vmt" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario_gxy/slow_hair.vmt" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario_gxy/slow_hair.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario_gxy/slow_hand.vmt" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario_gxy/slow_hand.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario_gxy/slow_shoe.vmt" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario_gxy/slow_shoe.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/back.vmt" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/back.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/back_normal.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/black.vmt" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/black.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/black_normal.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/buttons.vmt" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/buttons.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/buttons_normal.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/ear.vmt" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/ear.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/ear_normal.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/eyes.vmt" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/eyes.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/eyes_normal.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/gloves.vmt" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/gloves.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/gloves_normal.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/hair.vmt" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/hair.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/hair_normal.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/hat.vmt" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/hat.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/hat_normal.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/irises.vmt" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/irises.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/irises_normal.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/jeans.vmt" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/jeans.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/jeans_normal.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/pants.vmt" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/pants.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/pants_normal.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/shirt.vmt" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/shirt.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/shirt_normal.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/shoes.vmt" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/shoes.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/shoes_normal.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/skin.vmt" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/skin.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/skin_normal.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/suspenders.vmt" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/suspenders.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/mario/suspenders_normal.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/luigi_gxy/slow_body.vmt" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/luigi_gxy/slow_body.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/luigi_gxy/slow_cap.vmt" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/luigi_gxy/slow_cap.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/luigi_gxy/slow_eye.vmt" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/luigi_gxy/slow_eye.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/luigi_gxy/slow_eyelid.vmt" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/luigi_gxy/slow_eyelid.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/luigi_gxy/slow_face.vmt" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/luigi_gxy/slow_face.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/luigi_gxy/slow_fake_logo.vmt" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/luigi_gxy/slow_hair.vmt" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/luigi_gxy/slow_hair.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/luigi_gxy/slow_hand.vmt" )
Resource.AddSingleFile( "Mario Bros1/materials/models/player/slow/luigi_gxy/slow_hand.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/assistants/waluigi/body.vmt" )
Resource.AddSingleFile( "Mario Bros1/materials/models/assistants/waluigi/body.vtf" )
Resource.AddSingleFile( "Mario Bros1/materials/models/assistants/waluigi/racket.vmt" )
Resource.AddSingleFile( "Mario Bros1/materials/models/assistants/waluigi/racket.vtf" )
Resource.AddSingleFile( "Laser STOOL 2/models/madjawa/laser_reflector.mdl" )
Resource.AddSingleFile( "Laser STOOL 2/materials/VGUI/entities/gmod_laser_killicon.vmt" )
Resource.AddSingleFile( "Laser STOOL 2/materials/VGUI/entities/gmod_laser_killicon.vtf" )
Resource.AddSingleFile( "Laser STOOL 2/materials/VGUI/entities/gmod_laser_reflector.vmt" )
Resource.AddSingleFile( "Laser STOOL 2/materials/VGUI/entities/gmod_laser_reflector.vtf" )
Resource.AddSingleFile( "Harry Potter/models/harry/harry_potter.mdl" )
Resource.AddSingleFile( "Harry Potter/materials/vgui/entities/npc_harry.vmt" )
Resource.AddSingleFile( "Harry Potter/materials/vgui/entities/npc_harry.vtf" )
Resource.AddSingleFile( "Harry Potter/materials/models/harry/texture01.vmt" )
Resource.AddSingleFile( "Harry Potter/materials/models/harry/texture01.vtf" )
Resource.AddSingleFile( "Harry Potter/materials/models/harry/texture02.vmt" )
Resource.AddSingleFile( "Harry Potter/materials/models/harry/texture02.vtf" )
Resource.AddSingleFile( "Harry Potter/materials/models/harry/texture03.vmt" )
Resource.AddSingleFile( "Harry Potter/materials/models/harry/texture03.vtf" )
Resource.AddSingleFile( "Harry Potter/materials/models/harry/texture04.vmt" )
Resource.AddSingleFile( "Harry Potter/materials/models/harry/texture04.vtf" )
Resource.AddSingleFile( "Harry Potter/materials/models/harry/texture05.vmt" )
Resource.AddSingleFile( "Harry Potter/materials/models/harry/texture05.vtf" )
Resource.AddSingleFile( "Harry Potter/materials/models/harry/texture06.vmt" )
Resource.AddSingleFile( "Harry Potter/materials/models/harry/texture06.vtf" )
Resource.AddSingleFile( "Harry Potter/materials/models/harry/texture07.vmt" )
Resource.AddSingleFile( "Harry Potter/materials/models/harry/texture07.vtf" )
Resource.AddSingleFile( "Harry Potter/materials/models/harry/texture08.vmt" )
Resource.AddSingleFile( "Harry Potter/materials/models/harry/texture08.vtf" )
Resource.AddSingleFile( "GmodPlayer/materials/silkicons/cross.vmt" )
Resource.AddSingleFile( "GmodPlayer/materials/silkicons/cross.vtf" )
Resource.AddSingleFile( "evolve/materials/gui/scoreboard_bottom.vmt" )
Resource.AddSingleFile( "evolve/materials/gui/scoreboard_bottom.vtf" )
Resource.AddSingleFile( "evolve/materials/gui/scoreboard_frags.vmt" )
Resource.AddSingleFile( "evolve/materials/gui/scoreboard_frags.vtf" )
Resource.AddSingleFile( "evolve/materials/gui/scoreboard_header.vmt" )
Resource.AddSingleFile( "evolve/materials/gui/scoreboard_header.vtf" )
Resource.AddSingleFile( "evolve/materials/gui/scoreboard_middle.vmt" )
Resource.AddSingleFile( "evolve/materials/gui/scoreboard_middle.vtf" )
Resource.AddSingleFile( "evolve/materials/gui/scoreboard_ping.vmt" )
Resource.AddSingleFile( "evolve/materials/gui/scoreboard_ping.vtf" )
Resource.AddSingleFile( "evolve/materials/gui/scoreboard_playtime.vmt" )
Resource.AddSingleFile( "evolve/materials/gui/scoreboard_playtime.vtf" )
Resource.AddSingleFile( "evolve/materials/gui/scoreboard_skull.vmt" )
Resource.AddSingleFile( "evolve/materials/gui/scoreboard_skull.vtf" )
Resource.AddSingleFile( "evolve/materials/gui/silkicons/comments.vmt" )
Resource.AddSingleFile( "evolve/materials/gui/silkicons/comments.vtf" )
Resource.AddSingleFile( "evolve/materials/gui/silkicons/key.vmt" )
Resource.AddSingleFile( "evolve/materials/gui/silkicons/key.vtf" )
Resource.AddSingleFile( "evolve/materials/gui/silkicons/shield_add.vmt" )
Resource.AddSingleFile( "evolve/materials/gui/silkicons/shield_add.vtf" )
Resource.AddSingleFile( "evolve/materials/gui/silkicons/user_add.vmt" )
Resource.AddSingleFile( "evolve/materials/gui/silkicons/user_add.vtf" )
Resource.AddSingleFile( "evolve/materials/gui/silkicons/user_comment.vmt" )
Resource.AddSingleFile( "evolve/materials/gui/silkicons/user_comment.vtf" )
Resource.AddSingleFile( "DP Helmets/models/daftpunk/ghelm.mdl" )
Resource.AddSingleFile( "DP Helmets/models/daftpunk/shelm.mdl" )
Resource.AddSingleFile( "DP Helmets/materials/VGUI/entities/dp_manuel.vmt" )
Resource.AddSingleFile( "DP Helmets/materials/VGUI/entities/dp_manuel.vtf" )
Resource.AddSingleFile( "DP Helmets/materials/VGUI/entities/dp_thomas.vmt" )
Resource.AddSingleFile( "DP Helmets/materials/VGUI/entities/dp_thomas.vtf" )
Resource.AddSingleFile( "DP Helmets/materials/models/daftpunk/DaftHelmet.vmt" )
Resource.AddSingleFile( "DP Helmets/materials/models/daftpunk/DaftHelmets.vmt" )
Resource.AddSingleFile( "DP Helmets/materials/models/daftpunk/DaftHelmets.vtf" )
Resource.AddSingleFile( "DP Helmets/materials/models/daftpunk/DaftHelmets_n.vtf" )
Resource.AddSingleFile( "DP Helmets/materials/models/daftpunk/DaftHelmet_animation.vtf" )
Resource.AddSingleFile( "DP Helmets/materials/models/daftpunk/DaftHelmet_normal.vtf" )
Resource.AddSingleFile( "DP Helmets/materials/models/daftpunk/DaftHelms_animation.vtf" )
Resource.AddSingleFile( "DP Helmets/materials/models/daftpunk/daft_hand.vmt" )
Resource.AddSingleFile( "DP Helmets/materials/models/daftpunk/daft_hand.vtf" )
Resource.AddSingleFile( "DP Helmets/materials/models/daftpunk/daft_hands.vmt" )
Resource.AddSingleFile( "DP Helmets/materials/models/daftpunk/daft_hands.vtf" )
Resource.AddSingleFile( "DP Helmets/materials/models/daftpunk/daft_hands_n.vtf" )
Resource.AddSingleFile( "DP Helmets/materials/models/daftpunk/daft_hand_normal.vtf" )
Resource.AddSingleFile( "DP Helmets/materials/models/daftpunk/daft_suit.vmt" )
Resource.AddSingleFile( "DP Helmets/materials/models/daftpunk/daft_suit.vtf" )
Resource.AddSingleFile( "DP Helmets/materials/models/daftpunk/daft_suit_n.vtf" )
Resource.AddSingleFile( "day-of-defeat/materials/maps/dod_anzio.vmt" )
Resource.AddSingleFile( "day-of-defeat/materials/maps/dod_argentan.vmt" )
Resource.AddSingleFile( "day-of-defeat/materials/maps/dod_avalanche.vmt" )
Resource.AddSingleFile( "day-of-defeat/materials/maps/dod_colmar.vmt" )
Resource.AddSingleFile( "day-of-defeat/materials/maps/dod_donner.vmt" )
Resource.AddSingleFile( "day-of-defeat/materials/maps/dod_flash.vmt" )
Resource.AddSingleFile( "day-of-defeat/materials/maps/dod_jagd.vmt" )
Resource.AddSingleFile( "day-of-defeat/materials/maps/dod_kalt.vmt" )
Resource.AddSingleFile( "counter-strike/materials/maps/cs_assault.vmt" )
Resource.AddSingleFile( "counter-strike/materials/maps/cs_compound.vmt" )
Resource.AddSingleFile( "counter-strike/materials/maps/cs_havana.vmt" )
Resource.AddSingleFile( "counter-strike/materials/maps/cs_italy.vmt" )
Resource.AddSingleFile( "counter-strike/materials/maps/cs_militia.vmt" )
Resource.AddSingleFile( "counter-strike/materials/maps/cs_office.vmt" )
Resource.AddSingleFile( "counter-strike/materials/maps/de_aztec.vmt" )
Resource.AddSingleFile( "counter-strike/materials/maps/de_cbble.vmt" )
Resource.AddSingleFile( "counter-strike/materials/maps/de_chateau.vmt" )
Resource.AddSingleFile( "counter-strike/materials/maps/de_dust.vmt" )
Resource.AddSingleFile( "counter-strike/materials/maps/de_dust2.vmt" )
Resource.AddSingleFile( "counter-strike/materials/maps/de_inferno.vmt" )
Resource.AddSingleFile( "counter-strike/materials/maps/de_nuke.vmt" )
Resource.AddSingleFile( "counter-strike/materials/maps/de_piranesi.vmt" )
Resource.AddSingleFile( "counter-strike/materials/maps/de_port.vmt" )
Resource.AddSingleFile( "counter-strike/materials/maps/de_prodigy.vmt" )
Resource.AddSingleFile( "counter-strike/materials/maps/de_tides.vmt" )
Resource.AddSingleFile( "counter-strike/materials/maps/de_train.vmt" )
Resource.AddSingleFile( "AaronsRadio/materials/silkicons/cross.vmt" )
Resource.AddSingleFile( "AaronsRadio/materials/silkicons/cross.vtf" )
end


but it wont work

i called it resource.lua

Are you including this in the init.lua file?

server/autorun

resource.lua

file i puted the code in :Z

but it wont download the models !~:(

It should be lua/autorun/server/resource.lua

autorun/server only calls the contained files serverside so you don’t need the if SERVER then stuff

Also resource.lua is too likely a filename for other addons to have as well. Try and make the filename less generic.

And as I said in the other thread.

Resource ~= resource

This allows you to add Directories to your servers FstDl rather than each individual file.

Go into your lua/autorun/server folder on your server and put this in a Lua file that you can call whatever you want.
[lua]
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/test/”)
AddDir("")
[/lua]

You can add extra directories if you want, But never add in the Base of the directory
so do not use "AddDir(“models/”) As this will add any model you have on your server into the downloads
even Ep2 ep1 and CSS content.

If you have individual files inside models/ or materials/ You will have to use
[lua]
resource.addfile(“dir/dir/dir/Filename.Extension”);
[/lua]

For those Individual files.

: this is what server does :

He find the models he says download textures models blablabla :S

Allright…

so when he try to download something , ( like uhm… blabla.vtf )

It look likes he downloading

( download balk will just load with white balks )

but then nothing happends ;p he’s for ever stuck on that file ( no gmod is not crashed ) its like he still try’s to download that file :l

cause

this happends :

I join my server
It trys to download a texture
It look likes he downloading > down right the download balk is just filling with white blocks
After balk is full the texture is not downloaded
The balk > down right at the botem does nothing

TADA :stuck_out_tongue:

[editline]07:55PM[/editline]

  • can soomeee 1 show me like 1 of his resource.AddFile(“THIS PATH”)

of models ?

Thanks

[editline]07:58PM[/editline]

this is the model i want to add ,

( the path to whole directory ) addons/Harry Potter

:S

Any 1 got an idea !?!?!?!?!? :l !:l

Do you not listen to anyone?

Addons are mounted to the root directory of GMod, so for example if you have a model in a addon folder:

It would be mounted to:

So you would use resource.AddFile like so:

[lua]
resource.AddFile(“models/mymodel.mdl”)
[/lua]

can i also use this

AddDir( “addons/Trailsmaterials/trails” ) :z

i use this ( full 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( "addons/Trails/materials/trails" ) 

[EDIT]

i get it ! Its like now ,

AddDir( “Trails/materials/trails” ) ?= directory of files like .vmt etc :Z

No, read my post again, don’t post until you read it over at least 10 times.

cant i do it with add dir ? :*( :l

Also, ( the directory of the whole file > )

C:\srcds\orangebox\garrysmod\addons\Trails\materials rails

how should i do it then :frowning: ?i read it like 20 times but dont rly get it

like

resource.AddFile (“models/trails/materials/trails/file1.vmt”)
< eg

Good Job! But I dont think that that is a valid path… No idea why the hell you have materials in a models folder.

[editline]11:25AM[/editline]

Valid as in “makes sense” obviously it would work but again, you shouldnt be storing textures in a models folder.