[HIGHLIGHT][i]Re-done entire thread; learned stuff by reading the replies[/i][/HIGHLIGHT]
[i]Please [b]bump[/b] this thread when you're done reading, so other people can see this thread![/i]
[b]The Wiki: [b][url=http://wiki.garrysmod.com/?title=Resource.AddFile]Resource.AddFile [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b][/b]
--->
In this thread, I'll be covering, how you make players who connect to your server, download stuff if they dont have it :eng101:
[HIGHLIGHT]1 - Lets Get Started[/HIGHLIGHT]
Navigate to your garrysmod/garrysmod/lua/autorun/server folder (Incase you dont have the "autorun" or the "server" folder, simply create those), right click and make a new text document.
[HIGHLIGHT]2 - The Coding[/HIGHLIGHT]
The coding, or whatever you want to call it, is extremely easy to do here, simply write:
[code]resource.AddFile ("the/path/of/model.mdl")[/code]
Forexample:
[code]resource.AddFile ("models/barney.mdl")[/code]
If the player, who connected to your server, doesent have the barney.mdl file, he will download the 6 model files.
Now, to make them see the model, you have to add the materials (.vtf) files:
[code]resource.AddFile ("materials/models/barney/barney_head_normal.vtf")[/code]
And; if you're running a map, which arent a standard map, you can make them download that too!
[code]resource.AddFile ("maps/rp_evocity_v2d.bsp")[/code]
Like that
[HIGHLIGHT]3 - Saving The File[/HIGHLIGHT]
Hit "Save as..." and name it resource.lua, and put it into your garrysmod/lua/autorun/server folder.
[HIGHLIGHT]4 - Done![/HIGHLIGHT]
That's actually it! Just restart your server and whenever people connect to your server, without having the barney model, they will download all the 6 model files + the materials for him.
[HIGHLIGHT]5 - Addition[/HIGHLIGHT]
You can also use the [URL=http://wiki.garrysmod.com/?title=Resource.AddFile]AddDir Command[/URL], which makes them download the whole directory.
I'm sorry, but I'm not able to explain what it does, cause I... well, cant :doh:
[HIGHLIGHT]Useful Replies[/HIGHLIGHT]
[QUOTE=commander204]Rectifing, you only need to add the .mdl model gmod takes care to send all the others![/QUOTE]
[QUOTE=ChewGum]Don't need to do lua files, they are auto.[/QUOTE]
[QUOTE=sniperlover]It doesn't automatically send the materials, only the dx90, dx80 etc files. [/QUOTE]
[QUOTE=Overv]Use AddCSLuaFile.[/QUOTE]
[QUOTE=Av3nger3]The wiki sucks dick.[/QUOTE]
[b]Remember:[/b]
[QUOTE=Gbps]A crap load of materials and models a game does not make[/QUOTE]
[HIGHLIGHT]Easy Method![/HIGHLIGHT]
[b][URL=http://www.facepunch.com/showthread.php?t=842886]Resource Script Generator[/URL][/b]
[i]Credits to [b]Kogitsune[/b] for making it[/i]
Rectifing, you only need to add the .mdl model gmod takes care to send all the others!
Really? I didnt know that >:( Damn, the time I could have saved, lol.
And for the people who rated me dumb; in 15 minutes, I answered 4 posts like this - so, I thought it would be easier if someone just made a tutorial, well - frankly I dont care :)
Don't need to do lua files, they are auto.
[lua]resource.AddFile ("lua/weapons/weapon_ak47/shared.lua")[/lua]
What zé fuck. Use [url=http://wiki.garrysmod.com/?title=AddCSLuaFile]AddCSLuaFile[/url]. Note however, that in this case the file is sent automatically.
Well, again - I've seen many threads asking for this - so I decided just to make a quick tutorial about it.
2 things:
Isn't this warez?
Could I download all the CS:S stuff for RP and shit?
[QUOTE=~ZOMG;19074266]2 things:
Isn't this warez?
Could I download all the CS:S stuff for RP and shit?[/QUOTE]
1) Nope.
2) That would be warez.
[QUOTE=Jamie932;19074569]1) Nope.
2) That would be warez.[/QUOTE]
The content is available via hlds update tool.
If I set up a server for people who don't have a certain game, and force their client to download it, and then they copy the stuff into their folder, would THAT be illegal? I don't want a reply from some 11 year old who thinks he is right, I want a reply from someone who KNOWS the answer.
[QUOTE=Chad Mobile;19079145]If I set up a server for people who don't have a certain game, and force their client to download it, and then they copy the stuff into their folder, would THAT be illegal? I don't want a reply from some 11 year old who thinks he is right, I want a reply from someone who KNOWS the answer.[/QUOTE]
You cant make them download a game...
I have never heard of someone being able to get the game, as it doesen't use most of the code and has a completely different style.
Anyway, now all we need to do is get some clientside-gel on this and we can get ALL the content without having to go through outdated and shit links.
[QUOTE=Busymonkey;19080053]You cant make them download a game...[/QUOTE]
No, I mean the content from that game.
A crap load of materials and models a game does not make. :eng101:
He means the content from the game. Not the game itself.
As much as anyone would like to tell you it's warez or not and whether or not it truly is, it is not illegal, and if it was, you would not and could not be punished.
Ok, thanks :)
[editline]07:36PM[/editline]
I'm [B]not going to do this[/B], it was just a question that popped into my head :doh:
[QUOTE=infinitywrai;19048115]You know we have a wiki for this...[/QUOTE]
The wiki sucks dick. The explanation is fucked up and just stresses you out to the point of killing people.
[QUOTE=av3nger3;19906148]The wiki sucks<clip>[/QUOTE]
It's a wiki... if you can do better... edit it.
I find it frustrating too that many command articles have no info and my time doesn't allow me to explore the command myself, but I find it even more frustrating when people rate the information already there with such negativity but don't do anything to help it themselves.
*bump*
Re-did whole thread + Making it more possible that newbies see's this, instead of making a whole new thread.
seeing as though the search button isnt working for me i am lucky to have found this. would just like to ask, i followed your instructions (have been researching all day to be honest) and it does work. Only problem is, when i join my server to download the files, the file downloads but doesnt seem to pass the baton to the next file. all activity dies while the garrysmod loading icon keeps on spinning.
Id appreciate any help with this!
Cheers
Kyle
Are you just sure that it aint loading?
ignore my previous post, it was a mistake in the code kindly corrected by a user here called 'themaw'
Cheers
:)
Can i ask though, is the .mdl the only file you need to write code for or are there others that need to be downloaded to the clients computer.
I ask because i am using this code on my server but when people join after downloading the .mdl and its associated files they still see the player model as an error.
Even after restarting their game and rejoining the server.
Any ideas?
Cheers
Kyle
Damn I want to make so the client does [b]NOT[/b] download the server's addons models so the joining time is lower and you make me a tutorial to [b]FORCE[/b] the downloading.
[QUOTE=Kyliie;21503553]Can i ask though, is the .mdl the only file you need to write code for or are there others that need to be downloaded to the clients computer.
I ask because i am using this code on my server but when people join after downloading the .mdl and its associated files they still see the player model as an error.
Even after restarting their game and rejoining the server.
Any ideas?
Cheers
Kyle[/QUOTE]
Sorry, I've never heard of that before. Are you sure they're downloading it?
[QUOTE=dj_night;21506380]Damn I want to make so the client does [b]NOT[/b] download the server's addons models so the joining time is lower and you make me a tutorial to [b]FORCE[/b] the downloading.[/QUOTE]
The client can just turn off the download function if they dont want to download all the shit..
[img]http://dl.dropbox.com/u/3684498/TurnOff.jpg[/img]
heyhey, Watch this.
[url]http://www.facepunch.com/showthread.php?t=858476[/url]
Thanks to KFrohman.
I found it last week.(LATE.)
Sorry, you need to Log In to post a reply to this thread.