home *** CD-ROM | disk | FTP | other *** search
/ Superpower (Alt) / SUPERPOWER.iso / q / patch / mbq090 / _motd.qc < prev    next >
Encoding:
Text File  |  1996-08-31  |  3.1 KB  |  100 lines

  1. /*
  2. **
  3. ** _motd.qc (Motd Code, 1.0)
  4. **
  5. ** Copyright (C) 1996 Johannes Plass
  6. ** 
  7. ** This program is free software; you can redistribute it and/or modify
  8. ** it under the terms of the GNU General Public License as published by
  9. ** the Free Software Foundation; either version 2 of the License, or
  10. ** (at your option) any later version.
  11. ** 
  12. ** This program is distributed in the hope that it will be useful,
  13. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. ** GNU General Public License for more details.
  16. **
  17. ** You should have received a copy of the GNU General Public License
  18. ** along with this program; if not, write to the Free Software
  19. ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. ** 
  21. ** Author:   Johannes Plass (plass@dipmza.physik.uni-mainz.de)
  22. **
  23. */
  24.  
  25. void(entity player) MotdInfo =
  26. {
  27.    // nothing to do
  28. };
  29.  
  30. void(entity player) MotdInit =
  31. {
  32.    if (!USE_MODULE_MOTD) {
  33.       PlayerFlagSetFlag(player,PLAYER_PASSED_MOTD);
  34.       return;
  35.    }   
  36.  
  37.    /*
  38.    ** 'motd_motd' is the message shown when a player first connsects
  39.    **             to the server. Note that it *must* not be longer than 
  40.    **             255 chars !
  41.    ** 'motd_duration' is the time the motd stays center-printed 
  42.    **             on the player's screen (in units of seconds).
  43.    ** By default *no* message is shown.
  44.    */
  45.    motd_motd     = "";
  46.    motd_duration = 2.0; // time the motd stays center-printed (in units of seconds)
  47.    //motd_motd     = "Welcome !             \n\nThis site is running  \nServerModules (1.8.4).\nYou start as observer.\nPress fire to join the\ngame.                 \n\nHave a nice stay ...  \n";
  48.    //motd_duration = 5.0;
  49.  
  50.    // A message-scratch-board:
  51.    //    123456789#123456789#123456789#12345678
  52.    //   "Welcome !             \n\n"
  53.    //   "This site is running  \n"
  54.    //   "ServerModules (1.8.4).\n"
  55.    //   "You start as observer.\n"
  56.    //   "Press fire to join the\n"
  57.    //   "game.                 \n\n"
  58.    //   "Have a nice stay ...  \n"
  59.  
  60.    player.motd_start_time = time;
  61.    player.motd_centerprint_time = time - 2;
  62.    player.motd_status = player.motd_status | MOTD_MOTD;
  63. };
  64.  
  65. void() MotdThink =
  66. {
  67.    if (self.button0) {
  68.       centerprint(self,"");
  69.       self.motd_status = 0;
  70.       PlayerFlagSetFlag(self,PLAYER_PASSED_MOTD);
  71.    }
  72.  
  73.    if (self.player_flag & PLAYER_PASSED_MOTD) return;
  74.  
  75.    if (self.motd_status & MOTD_MOTD) {
  76.       if (time < self.motd_start_time + motd_duration) {
  77.          if (time > self.motd_centerprint_time + 1.8) {
  78.             centerprint(self,motd_motd);
  79.             self.motd_centerprint_time = time;
  80.          }
  81.       } else {
  82.          centerprint(self,"");
  83.          self.motd_status = self.motd_status - MOTD_MOTD;
  84.          self.motd_status = self.motd_status | MOTD_CONSOLE;
  85.       }
  86.       return;
  87.    }
  88.  
  89.    if (self.motd_status & MOTD_CONSOLE) {
  90.       sprint(self, "\nWelcome, ");
  91.       sprint(self, self.netname);
  92.       sprint(self, "\n\n");
  93.       ServerHelpShowHelp(self);//#jp#(ServerHelp)
  94.       self.motd_status = self.motd_status - MOTD_CONSOLE;
  95.       PlayerFlagSetFlag(self,PLAYER_PASSED_MOTD);
  96.       return;
  97.    }
  98.  
  99. };
  100.