How to force the server to download files to the client!?
15 replies, posted
Hello
I can not get my server so that it sends the file to the client.
I poured on some server models, but when you connect customers do not download from the server model.
What can I do that the server would send files to clients!?
Thanks in advance!
[QUOTE=Robotboy655;43228151][url]http://wiki.garrysmod.com/page/resource/AddFile[/url][/QUOTE]
[ERROR] lua/autorun/download.lua:1: attempt to index global 'resource' (a nil value)
1. unknown - lua/autorun/download.lua:1
It is a serverside only function. Put it into lua/autorun/server/*
Put a fastdl.lua file into lua/autorun/server and add your files by adding resource.AddFile("filepath") and do that for all files or resource.AddWorkshop"(CollectionID")
[QUOTE=Aeternal;43228470]Put a fastdl.lua file into lua/autorun/server and add your files by adding resource.AddFile("filepath") and do that for all files or resource.AddWorkshop"(CollectionID")[/QUOTE]
Don't misinform, resource.AddWorkshop doesn't work for collections.
[QUOTE=Robotboy655;43228629]Don't misinform, resource.AddWorkshop doesn't work for collections.[/QUOTE]
It seems to work for my server just fine
Can't be unless Garry fixed it in the 14.12.2013 patch ( or whatever it was ), which I don't think he did.
[QUOTE=Robotboy655;43228715]Can't be unless Garry fixed it in the 14.12.2013 patch ( or whatever it was ), which I don't think he did.[/QUOTE]
My mistake. It was the Workshop Id for one file not the collection ID
[QUOTE]resource.AddFile("materials/models/vinrax/scp/scp-049_clothing_diffuse4.vmt")
resource.AddFile("materials/models/vinrax/scp/scp-049_clothing_diffuse4.vtf")
resource.AddFile("materials/models/vinrax/scp/scp-049_mask_diffuse5.vmt")
resource.AddFile("materials/models/vinrax/scp/scp-049_mask_diffuse5.vtf")
resource.AddFile("models/vinrax/player/scp049_player.dx80.vtx")
resource.AddFile("models/vinrax/player/scp049_player.dx90.vtx")
resource.AddFile("models/vinrax/player/scp049_player.mdl")
resource.AddFile("models/vinrax/player/scp049_player.phy")
resource.AddFile("models/vinrax/player/scp049_player.sw.vtx")
resource.AddFile("models/vinrax/player/scp049_player.vvd")
resource.AddFile("models/vinrax/weapons/c_arms_scp049.dx80.vtx")
resource.AddFile("models/vinrax/weapons/c_arms_scp049.dx90.vtx")
resource.AddFile("models/vinrax/weapons/c_arms_scp049.mdl")
resource.AddFile("models/vinrax/weapons/c_arms_scp049.sw.vtx")
resource.AddFile("models/vinrax/weapons/c_arms_scp049.vvd")
[/QUOTE]
These models do not appear in the game!
[editline]18th December 2013[/editline]
/serv/gmod/garrysmod/lua/autorun/server/fastdl.lua
[QUOTE=ACEKORN;43228951]These models do not appear in the game!
[editline]18th December 2013[/editline]
/serv/gmod/garrysmod/lua/autorun/server/fastdl.lua[/QUOTE]
Firstly, resource.AddFile automatically adds related files so your code can be reduced down to
[code]resource.AddFile("materials/models/vinrax/scp/scp-049_clothing_diffuse4.vmt")
resource.AddFile("materials/models/vinrax/scp/scp-049_mask_diffuse5.vmt")
resource.AddFile("models/vinrax/player/scp049_player.mdl")
resource.AddFile("models/vinrax/weapons/c_arms_scp049.mdl")[/code]
Secondly, have you synced these files with your FastDL server, and are they packed in .bz2 files?
resource.addworkshop ("ID HERE")
[QUOTE=nightxblade;43233741]resource.addworkshop ("ID HERE")[/QUOTE]
He's not using workshop for the last time. That's not even correct anyways.
[QUOTE=code_gs;43229351]Firstly, resource.AddFile automatically adds related files so your code can be reduced down to
[code]resource.AddFile("materials/models/vinrax/scp/scp-049_clothing_diffuse4.vmt")
resource.AddFile("materials/models/vinrax/scp/scp-049_mask_diffuse5.vmt")
resource.AddFile("models/vinrax/player/scp049_player.mdl")
resource.AddFile("models/vinrax/weapons/c_arms_scp049.mdl")[/code]
Secondly, have you synced these files with your FastDL server, and are they packed in .bz2 files?[/QUOTE]
[B]Me to the main expansion in Lua config to add the extension .Bz2[/B] ????
[QUOTE=ACEKORN;43248397][B]Me to the main expansion in Lua config to add the extension .Bz2[/B] ????[/QUOTE]
Misunderstood, I meant are all the files on your [B]FastDL[/B] packed in .bz2's? Your code is fine.
[QUOTE=ACEKORN;43248397][B]Me to the main expansion in Lua config to add the extension .Bz2[/B] ????[/QUOTE]
No you don't have to add the extension .bz2 to the code. Just add what code_gs said to lua/autorun/server and sync your FastDL.
Sorry, you need to Log In to post a reply to this thread.