home *** CD-ROM | disk | FTP | other *** search
/ Superpower (Alt) / SUPERPOWER.iso / q / patch / mbq624 / _motd.qc < prev    next >
Encoding:
Text File  |  1996-08-19  |  2.7 KB  |  102 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(self,PLAYER_PASSED_MOTD);
  34.       return;
  35.    }   
  36.  
  37.    // motd_motd *must* not be longer than 255 chars ! #jp#
  38.    motd_motd     = "Welcome !             \n\nThis site is running  \nServerModules (1.1.4).\nYou start as observer.\nPress fire to join the\ngame.                 \n\nHave a nice stay ...  \n";
  39.    motd_duration = 5.5; // time the motd stays center-printed (in units of seconds)
  40.  
  41. // A scratch-board:
  42. //    123456789#123456789#123456789#12345678
  43. //   "Welcome !             \n\n"
  44. //   "This site is running  \n"
  45. //   "ServerModules (1.1.4).\n"
  46. //   "You start as observer.\n"
  47. //   "Press fire to join the\n"
  48. //   "game.                 \n\n"
  49. //   "Have a nice stay ...  \n"
  50.  
  51.    self.motd_start_time = time;
  52.    self.motd_centerprint_time = time - 2;
  53.    self.motd_status    = self.motd_status | MOTD_MOTD;
  54. };
  55.  
  56. void() MotdThink =
  57. {
  58.  
  59.    if (self.button0) {
  60.       centerprint(self,"");
  61.       PlayerFlagSetFlag(self,PLAYER_PASSED_MOTD);
  62.    }
  63.  
  64.    if (self.player_flag & PLAYER_PASSED_MOTD) {
  65.       return;
  66.    }
  67.  
  68.    if (self.motd_status & MOTD_MOTD) {
  69.       if (time < self.motd_start_time + motd_duration) {
  70.          if (time > self.motd_centerprint_time + 1.8) {
  71.             centerprint(self,motd_motd);
  72.             self.motd_centerprint_time = time;
  73.          }
  74.       } else {
  75.          centerprint(self,"");
  76.          self.motd_status = self.motd_status - MOTD_MOTD;
  77.          self.motd_status = self.motd_status | MOTD_CONSOLE;
  78.       }
  79.       return;
  80.    }
  81.  
  82.    if (self.motd_status & MOTD_CONSOLE) {
  83.       sprint(self, "\nWelcome, ");
  84.       sprint(self, self.netname);
  85.       sprint(self, "\n\n");
  86.       ServerHelp(self);//#jp#(Server)
  87.       self.motd_status = self.motd_status - MOTD_CONSOLE;
  88.       PlayerFlagSetFlag(self,PLAYER_PASSED_MOTD);
  89.       return;
  90.    }
  91. };
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.