ULX

Author Topic: Need automatic adding files to the res file  (Read 3252 times)

0 Members and 1 Guest are viewing this topic.

OmegaAlpha

  • Guest
Need automatic adding files to the res file
« on: January 21, 2007, 04:55:14 PM »
We really need a plugin that you can tell what people to download. i hope someone gets me  ???

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Need automatic adding files to the res file
« Reply #1 on: January 21, 2007, 05:10:34 PM »
You understand that the only folder Gmod 10 lua allows writing to is /data, right?
There is no way for lua to write to /maps
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline spbogie

  • Ulysses Team Member
  • Sr. Member
  • *****
  • Posts: 456
  • Karma: 41
Re: Need automatic adding files to the res file
« Reply #2 on: January 24, 2007, 01:08:12 PM »
Create an Lua script named something like "ForceDL.lua" and place it in your "garrysmod/lua/autorun/server" folder.
Add the following line to your script for each file you wish to send to the clients.
Code: [Select]
resource.AddFile("<path to file>")Replace <path to file> with the location of your file relative to the garrysmod root directory.
I have not failed. I've just found 10,000 ways that won't work. - Thomas A. Edison
I reject your reality and substitute my own. - Adam Savage

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Need automatic adding files to the res file
« Reply #3 on: January 24, 2007, 06:38:42 PM »
Thanks spbogie. I learn something new everyday witht this team.


"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming