ULX

Author Topic: Wher eis the MOTD loaded from?  (Read 3556 times)

0 Members and 1 Guest are viewing this topic.

Offline raptorivaz

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Wher eis the MOTD loaded from?
« on: March 31, 2007, 06:53:24 AM »
I was just thinking, the Motd uses html right? So you could make a whole web site with it. I was wondering two things: Does the MOTD use any modified html, and where is it loaded from so I can tell that script to look in my folder.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Wher eis the MOTD loaded from?
« Reply #1 on: March 31, 2007, 05:45:00 PM »
ULib uses the html engine provided by Source, the same engine code that every other Source game uses.
Why Garry left it out of Gmod 10, I do not know.

ULib uses the server engine variable 'motdfile' to load the file. This normally is 'motd.txt', and ULX always looks for it in the root garry's mod folder.
Though the Source engine sets so that it MUST be names *.txt, the file can contain HTML or plain text.

However, though the Source engine html interpreter is based off of internet explorer, it is limited, for several reasons including security, in what it can do.

I've recently tried to use javascript and a <div> tag to dynamically update a page and discovered that Source won't allow dynamicly updating a page once its already been presented.
I believe it also won't allow download of files. (it won't prompt where to save them)

Though it probably could be used to load multiple pages/site, I personally wouldn't think it worth while.

I made, using ULib's plugin for Source html, an advanced motd system called Umotd. This script allows for multiple information screens and commands.
It has a few default(motd,info,rules and helpme), and you can create your own that would show when player said a predefined word.

If interested, you can find Umotd in our Releases forum or at the Facepunch Studios forum Lua Releases here[Edit:Facepunch forums currently down, Search for Umotd when it comes back up]

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