
   /* AMXMOD script.
   *
   * DoD Clanmatch MJV
   * Thanks to Scorpio for the needed push :)
   *
   * Plugin for setting a DOD match
   *
   * [8.6.2003]
   * - added console go command for hlsw use...
   *  -  added  mp_timelimit  30 server-command after matchmap just to be
   sure,
   *   that on small timelimit value, the waiting time before match (if
   *   something  is  delaying  players etc.) won't be reached and map to
   change
   *   before even started...
   * - fixed -ff command
   *  - added setpass&showpass - console command for password setting (so
   that other
   *   clanleader  can  have  temporary access to password without giving
   rcon away)
   *
   * [18.6.2003]
   * - added new consolecommands to play with mp_clan-cvars...
   * - added setpass command, that now gives apportunity to assign match
   *   admins, with limited priviliges temporarely, eg.  to host a clan
   *   match without giving away your servers rcon...
   * - added showpass command
   * - added setnextmap command
   * - added the ability to run whole match with new or old style...
   *
   * Console commands:
   *   setmatch   Sets the match parameters
   *              Accepts the following command line triggers:
   *              -time     Matchtime  in minutes (default 15, max 60 min
   1)
   *              -mode     First  number  tells  how  many times map1 is
   played.
   *                        Second tells, how many times map2 is played.
   *                        Only  these  combinations are counted: 1 2 11
   12 21 22.
   *              -map1     First map to be played (defaul current map)
   *                        Sets also map2.
   *              -map2     Second map to be played.
   *              -config   Give  alternative  config-file  for  a match.
   Files has to be
   *                        located in /dod-directory
   *                        (default: match.cfg)
   *              -ff       Sets mp_friendlyfire to match. (default: 1)
   *              -old      If  set  to  1,  uses the 'old' - sv_maxspeed
   method...
   *                        (default: 0)
   *   startmatch Starts the match process with the active settings
   *   stopmatch  Stops  current  running match process. Use this to stop
   the
   *              match process, whatever the cause. After this, you have
   to
   *              type  setmatch  again  followed  by  startmatch, or use
   direct
   *              clan match commands...
   *   public     Stops the match and runs server.cfg and public.cfg
   *   go         Starts the actual match on old style match...
   *   setnextmap  Sets  amx_nextmap. If no map is specified, current map
   is set
   *              to be nextmap...
   *   setpass    Sets a password for server. (See showpass...)
   *   showpass   Shows   current  pass  to  server.  Now  if  given  the
   ADMIN_LEVEL_A
   *              rights  to  someone,  he is able to use all these match
   commands,
   *              also password setting, to admin a match, without giving
   *              out your rcon password...
   *   cm         Shows or sets mp_clan_match cvar. If set to 1, executes
   also match.cfg
   *              If set to 0, stops the match process...
   *   tl         Shows or sets mp_timelimit cvar...
   *   rr         Starts the clanmatch
   *   rd         Starts  the  clanmatch with the new 'say ready'-method,
   where match is
   *              started   as   soon   as   boths   sides  someone  says
   'ready'...
   *   ff         Shows or sets mp_frienlyfire cvar...
   *   tm         Shows or sets mp_clan_timer cvar...
   *   rs         Shows or sets mp_clan_respawntime cvar...
   *
   * Say command:
   *   say go -   Same as console go...
   *
   *
   * Match process - now three possibilities to run...:
   *  First:
   *   Set match parameters with setmatch-console command.
   *   After  that, type startmatch in console. Now map is changed to the
   match map.
   *   After  mapchange,  everybody  chooses  their sides and classes and
   when both teams
   *   are ready, their leaders say 'ready', and match restarts round.
   *   Same repeats as many maps, that was configured...
   *
   *   Example:
   *   setmatch -time 20 -map1 dod_anzio -map2 dod_flash -mode 12 -ff 0
   *      This sets match process to be anzio played once (-mode 1*), and
   *      flash  twice  (-mode  *2),  with friendlyfire off, timelimit 20
   minutes
   *
   *  Second:
   *   Set match parameters with setmatch-console command.
   *   After  that, type startmatch in console. Now sv_maxspeed is set to
   zero,
   *   and  map  is  changed to the match map. After mapchange, everybody
   chooses their
   *   sides and classes and when everything is ready, admin says 'go'.
   *   Script  then  calculates  the  time that has passed, and starts to
   count so, that
   *   at match start, the actual game time should be near to the playing
   time.
   *   So, the waiting time is always at least 8 secs and can be 68 secs.
   That varies
   *   from the moment that go was said.
   *   Same repeats as many maps, that was configured...
   *   When counter reaches to zero sv_maxspeed is released.
   *
   *   Example:
   *   setmatch -time 15 -map1 dod_chemille -map2 dod_caen -mode 22 -ff 1
   -old 1
   *      This  sets the whole match process to be: old sv_maxspeed style
   -old 1,
   *      play  two maps, both twice, with friendly fire on, timelimit is
   15 minutes.
   *
   *  Third:
   *   You  can  use  all  the  original clan (and few others) cvars with
   shortened
   *   equivalents.
   *   Eg. tl is mp_timelimit, cm is mp_clan_match cvar etc...
   *   So  first  change  the  map to what you want to play and use these
   commands
   *   to set the match parameters...
   *
   *   Example:
   *   changemap to dod_donner
   *   cm 1                   (match mode on, runs also match.cfg...)
   *   ff 1                   (friendlyfire on)
   *   tl 15                  (timelimit to 15 minutes)
   *   setnextmap dod_donner  (if nextmap to be played is also donner...)
   *   rr                     (or  rd...both  restart round and start the
   match)
   *
   */
   #include <amxmod>
   #include <amxmisc>
   new MAX_MATCH_TIME = 60
   new MIN_MATCH_TIME = 1
   new timelimit = 0
   new matchOn = 0
   new oldStyle = 0
   public count(parm[]) {
      new sec = parm[0]
      if (sec) {
         if (sec&1) {
            set_hudmessage(255,50,50,0.38,0.35,0,6.0,0.9,0.1,0.1,3)
         } else {
            set_hudmessage(255,255,255,0.38,0.35,0,6.0,0.9,0.1,0.1,2)
         }
         show_hudmessage(0,"-[ Match beginning in %d ]-",sec)
         sec--
         parm[0]=sec
         set_task(1.0,"count",71172,parm,1)
      } else {
         set_hudmessage(255,255,255,0.38,0.39,0,6.0,5.0,0.1,3.0,3)
         show_hudmessage(0,"M a t c h   i s   l i v e  !")
         set_cvar_num("mp_timelimit",timelimit)
         set_cvar_string("sv_maxspeed","500")
      }
   }
   public matchgo(id) {
      if (!(get_user_flags(id)&ADMIN_LEVEL_A))
         return PLUGIN_HANDLED
      if (matchOn)
         return PLUGIN_HANDLED
      // Plugins Pause
      server_cmd("amx_ppause pause mapchooser.amx")
      server_cmd("amx_ppause pause task_scheduler.amx")
      new match = get_cvar_num("clan_match")
      set_cvar_num("clan_match",match-1)
      matchOn = 1
      remove_task(71171)
      new tleft = get_timeleft()
      new tlimit = get_cvar_num("mp_timelimit")
      new ptime = get_cvar_num("clan_match_timelimit")
      new ltim = (tlimit*60) - tleft
      new lsec = 60 - (ltim % 60)
      new lmin = ltim / 60
      if (lsec>14) {
         timelimit = lmin+1+ptime
      } else {
         timelimit = lmin+2+ptime
         lsec+=60
      }
      new parm[1]
      parm[0]=lsec-7
      set_task(1.0,"count",71172,parm,1)
      return PLUGIN_HANDLED
   }
   public setparameters(id,command[],parameter[]) {
      new string[32]
      if (equal(command,"-time")) {
         new ptime
         ptime = str_to_num(parameter)
         if ((ptime<MIN_MATCH_TIME)||(ptime>MAX_MATCH_TIME)) {
            get_cvar_string("clan_match_timelimit",string,31)
            console_print(id,"*  %s is not a valid playing time ... using
   the default %s",parameter,string)
         } else {
            set_cvar_string("clan_match_timelimit",parameter)
         }
      } else if (equal(command,"-map1")) {
         if (is_map_valid(parameter)) {
            set_cvar_string("clan_match_mapa",parameter)
        set_cvar_string("clan_match_mapb",parameter)
         } else {
            get_cvar_string("clan_match_mapa",string,31)
         console_print(id,"* %s is not a valid map ... setting to default
   %s",parameter,string)
         }
      } else if (equal(command,"-ff")) {
         if (equal(parameter,"0")) {
            set_cvar_string("clan_match_ff","0")
         } else if (equal(parameter,"1")) {
            set_cvar_string("clan_match_ff","1")
         } else {
            get_cvar_string("clan_match_ff",string,31)
        console_print(id,"* %s is not a valid value for ff ... setting to
   default %s",parameter,string)
         }
      } else if (equal(command,"-map2")) {
         if (is_map_valid(parameter)) {
            set_cvar_string("clan_match_mapb",parameter)
         } else {
            get_cvar_string("clan_match_mapb",string,31)
            console_print(id,"*  %s  is not a valid clanmatch-nextmap ...
   using the default %s ",parameter,string)
         }
      } else if (equal(command,"-config")) {
         new filename[100] = ""
         format(filename,99,"%s",parameter)
         if (file_exists(filename)) {
            set_cvar_string("clan_match_config",parameter)
         } else {
            get_cvar_string("clan_match_config",string,31)
         console_print(id,"*  %s is not a valid config file ... using the
   default file %s",parameter,string)
         }
      } else if (equal(command,"-mode")) {
         new mode = str_to_num(parameter)
         switch (mode) {
            case 1,11,12,2,21,22:
   set_cvar_string("clan_match_mode",parameter)
            default: {
               get_cvar_string("clan_match_mode",string,31)
               console_print(id,"*  %s  is  not  a valid value for -mode,
   setting to default %s",parameter,string)
            }
         }
      } else if (equal(command,"-old")) {
         oldStyle = str_to_num(parameter)
      }
   }
   public delayed_mapchange() {
      new cmd[45]
      new string[32]
      get_cvar_string("clan_match_mapa",string,31)
      format(cmd,44,"changelevel %s",string)
      server_cmd(cmd)
   }
   public startmatch(id) {
      if (!(get_user_flags(id)&ADMIN_LEVEL_A))
         return PLUGIN_HANDLED
      if (matchOn) {
         console_print(id,"*  Match  in  progress...stop  it  first  with
   stopmatch...")
         return PLUGIN_HANDLED
      }
      new string[32]
      get_cvar_string("clan_match_config",string,31)
      if (!file_exists(string)) {
         console_print(id,"*  There  is  no  assigned  config  file for a
   match. Create it first... (default: dod/match.cfg)")
         return PLUGIN_HANDLED
      }
      get_cvar_string("clan_match_mapa",string,31)
      if (!string[0]) {
         new matchmap[32]
         get_mapname(matchmap,31)
         set_cvar_string("clan_match_mapa",matchmap)
         set_cvar_string("clan_match_mapb",matchmap)
         set_cvar_string("clan_match_mode","1")
         oldStyle = 0
      }
      new mode = get_cvar_num("clan_match_mode")
      new nmode
      switch (mode) {
         case 1:     nmode = 1
         case 11,2:  nmode = 2
         case 12,21: nmode = 3
         case 22:    nmode = 4
      }
      if (!oldStyle) {
         server_cmd("amx_tsay yellow * Clan match is about to begin")
         server_cmd("amx_tsay   white   *  Changing  now  to  map  to  be
   played...")
         nmode+= 4
         set_task(5.0,"delayed_mapchange")
         set_cvar_string("mp_clan_match","1")
      } else {
         server_cmd("amx_tsay yellow * Clan match is about to begin")
         server_cmd("amx_tsay  white  *  Setting  everybody  to stop, and
   changing now to map to be played...")
         set_cvar_string("sv_maxspeed","0")
         set_cvar_string("mp_clan_match","0")
         set_task(5.0,"delayed_mapchange")
      }
      set_cvar_num("clan_match",nmode)
      return PLUGIN_HANDLED
   }
   public show_prepare_old() {
      server_cmd("amx_tsay  yellow  *  Choose your sides and classes, and
   wait for an game launch from admin...")
   }
   public show_prepare() {
      server_cmd("amx_tsay  yellow  Teams ... say ready, when ok to start
   match...")
   }
   public show_prepare2() {
      server_cmd("amx_tsay  yellow  Teams ... say ready, when ok to start
   match...")
      // Plugins Pause
      server_cmd("amx_ppause pause task_scheduler.amx")
   }
   public new_style_match() {
      new match = get_cvar_num("clan_match")
      switch (match) {
         case 6,7,8: {
            set_cvar_num("clan_match",match-1)
         }
         case 5: {
            set_cvar_num("clan_match",0)
         }
      }
      matchOn = 1
      match = get_cvar_num("clan_match_timelimit")
      set_cvar_num("mp_timelimit",match)
      set_cvar_string("mp_clan_readyrestart","1")
   }
   public old_style_match() {
      set_cvar_string("sv_maxspeed","0")
      set_cvar_string("mp_timelimit","30")
   }
   public prepare_match() {
      new cmd[100]
      new string[32]
      new string2[32]
      get_cvar_string("clan_match_config",string,31)
      format(cmd,99,"exec %s",string)
      server_cmd(cmd)
      new match = get_cvar_num("clan_match")
      new mode = get_cvar_num("clan_match_mode")
      get_cvar_string("clan_match_mapa",string,31)
      get_cvar_string("clan_match_mapb",string2,31)
      if (match>4) {
         oldStyle = 0
         match-=4
      } else {
        oldStyle = 1
      }
      switch (match) {
         case 4: format(cmd,99,"amx_nextmap %s",string)
         case 3: {
            switch (mode) {
               case 21: format(cmd,99,"amx_nextmap %s",string)
               default: format(cmd,99,"amx_nextmap %s",string2)
            }
         }
         case 2: {
            switch (mode) {
               case 2: format(cmd,99,"amx_nextmap %s",string)
               default: format(cmd,99,"amx_nextmap %s",string2)
            }
         }
         case 1:   format(cmd,99,"amx_nextmap %s",string2)
      }
      server_cmd(cmd)
      get_cvar_string("clan_match_ff",string,31)
      set_cvar_string("mp_friendlyfire",string)
      if (oldStyle) {
         set_task(3.0,"old_style_match")
         set_task(15.0,"show_prepare_old",71171,"",0,"a",1)
      } else {
         // Plugins Pause
         server_cmd("amx_ppause pause mapchooser.amx")
         server_cmd("amx_ppause pause timeleft.amx")
         set_task(30.0,"show_prepare")
         set_task(45.0,"show_prepare")
         set_task(59.0,"show_prepare2")
         set_task(3.0,"new_style_match")
      }
   }
   public setmatch(id) {
      if (!(get_user_flags(id)&ADMIN_LEVEL_A))
         return PLUGIN_HANDLED
      new string[32]
      get_mapname(string,31)
      oldStyle = 0
      set_cvar_string("clan_match_mapa",string)
      set_cvar_string("clan_match_mapb",string)
      set_cvar_string("clan_match_mode","1")
      set_cvar_string("clan_match_timelimit","15")
      set_cvar_string("clan_match_config","match.cfg")
      set_cvar_string("clan_match_ff","1")
      new argv = 1
      new argc = read_argc() - 1
      while (argc) {
         new cmd[32]
         read_argv(argv,cmd,31)
         argv++
         argc--
         if (argc) {
            new par[32]
        read_argv(argv,par,31)
            setparameters(id,cmd,par)
        argv++
        argc--
         }
      }
      console_print(id,"* ----------------------------------")
      if (oldStyle) {
         console_print(id,"*    Clan   match   style   of   running:  old
   sv_maxspeed")
      } else {
         console_print(id,"* Clan match style of running:  using original
   clan-commands")
      }
      get_cvar_string("clan_match_timelimit",string,31)
      console_print(id,"* Clan match timelimit:  %s",string)
      console_print(id,"*
   FriendlyFire:  %s",get_cvar_num("clan_match_ff")?"on":"off")
      new mode = get_cvar_num("clan_match_mode")
      new string2[32]
      get_cvar_string("clan_match_mapa",string,31)
      get_cvar_string("clan_match_mapb",string2,31)
      switch (mode) {
         case 1:  console_print(id,"* Played map is:  %s",string)
         case 11: {
            console_print(id,"* First map is:  %s - played once",string)
            console_print(id,"*    Second    map    is:  %s    -   played
   once",string2)
         }
         case 12: {
            console_print(id,"* First map is:  %s - played once",string)
            console_print(id,"*    Second    map    is:  %s    -   played
   twice",string2)
         }
         case   2:  console_print(id,"*   Played  map  is:  %s  -  played
   twice",string)
         case 21: {
            console_print(id,"* First map is:  %s - played twice",string)
            console_print(id,"*    Second    map    is:  %s    -   played
   once",string2)
         }
         case 22: {
            console_print(id,"* First map is:  %s - played twice",string)
            console_print(id,"*    Second    map    is:  %s    -   played
   twice",string2)
         }
      }
      get_cvar_string("clan_match_config",string,31)
      console_print(id,"*    Executed    config    file    before   match
   is:  %s",string)
      console_print(id,"* To start clan match with these parameters, type
   to console: startmatch")
      return PLUGIN_HANDLED
   }
   public public_confs(id) {
      if (!(get_user_flags(id)&ADMIN_LEVEL_A))
         return PLUGIN_HANDLED
      matchOn = 0
      remove_task(71171)
      remove_task(71172)
      set_cvar_string("clan_match","0")
      set_cvar_string("mp_clan_match","0")
      set_cvar_string("sv_maxspeed","500")
      server_cmd("exec server.cfg")
      server_cmd("exec public.cfg")
      console_print(id,"Public configs loaded...")
      server_cmd("amx_tsay yellow * Public configs loaded...")
      return PLUGIN_HANDLED
   }
   public setpass(id) {
      if (!(get_user_flags(id)&ADMIN_LEVEL_A))
         return PLUGIN_HANDLED
      new argc = read_argc() - 1
      new cmd[32] = ""
      if (argc) {
         read_argv(1,cmd,31)
      }
      if (!cmd[0]) {
        console_print(id,"Removed server password...")
        set_cvar_string("sv_password","")
      } else {
         console_print(id,"Setting server password to %s",cmd)
         set_cvar_string("sv_password",cmd)
      }
      return PLUGIN_HANDLED
   }
   public setnextmap(id) {
      if (!(get_user_flags(id)&ADMIN_LEVEL_A))
         return PLUGIN_HANDLED
      new argc = read_argc() - 1
      new cmd[32] = ""
      if (argc) {
         read_argv(1,cmd,31)
      }
      if (!cmd[0]) {
        get_mapname(cmd,31)
        console_print(id,"Setting amx_nextmap to %s",cmd)
        set_cvar_string("amx_nextmap",cmd)
      } else {
         if (is_map_valid(cmd)) {
            set_cvar_string("amx_nextmap",cmd)
        console_print(id,"Setting amx_nextmap to %s",cmd)
         } else {
            console_print(id,"Map is not valid ... %s",cmd)
         }
      }
      return PLUGIN_HANDLED
   }
   public showpass(id) {
      if (!(get_user_flags(id)&ADMIN_LEVEL_A))
         return PLUGIN_HANDLED
      new string[32]
      get_cvar_string("sv_password",string,31)
      if (!string[0]) {
         console_print(id,"There is no password in server...")
      } else {
         console_print(id,"Server password is %s",string)
      }
      return PLUGIN_HANDLED
   }
   public origmatch(id) {
      if (!(get_user_flags(id)&ADMIN_LEVEL_A))
         return PLUGIN_HANDLED
      new argc = read_argc() - 1
      new cmd[32] = ""
      new param[32] = ""
      read_argv(0,cmd,31)
      if (argc) {
         read_argv(1,param,31)
      }
      if (equal(cmd,"cm")) {
         if (argc) {
            set_cvar_string("mp_clan_match",param)
            console_print(id,"mp_clan_match set to %s",param)
            new cmatch = strtonum(param)
            if (cmatch==1) {
               server_cmd("exec match.cfg")
            } else if (cmatch==0) {
               if (matchOn) {
                  server_cmd("sv_maxspeed 500")
                  set_cvar_string("mp_clan_match","0")
                  set_cvar_string("clan_match","0")
                  console_print(id,"Match stopped...")
                  server_cmd("amx_tsay yellow * Match stopped...")
               }
               matchOn = 0
            }
         } else {
            get_cvar_string("mp_clan_match",param,31)
            console_print(id,"mp_clan_match is %s",param)
         }
      } else if (equal(cmd,"tl")) {
         if (argc) {
            set_cvar_string("mp_timelimit",param)
            console_print(id,"mp_timelimit set to %s",param)
         } else {
            get_cvar_string("mp_timelimit",param,31)
            console_print(id,"mp_timelimit is %s",param)
         }
      } else if (equal(cmd,"rr")) {
         if (matchOn) {
            console_print(id,"Stop the match first...")
         } else {
            // Plugins Pause
            server_cmd("amx_ppause pause mapchooser.amx")
            server_cmd("amx_ppause pause task_scheduler.amx")
            server_cmd("amx_ppause pause timeleft.amx")
            matchOn = 1
            set_cvar_string("mp_clan_restartround","1")
         }
      } else if (equal(cmd,"ff")) {
         if (argc) {
            set_cvar_string("mp_friendlyfire",param)
            console_print(id,"mp_friendlyfire set to %s",param)
         } else {
            get_cvar_string("mp_friendlyfire",param,31)
            console_print(id,"mp_friendlyfire is %s",param)
         }
      } else if (equal(cmd,"tm")) {
         if (argc) {
            set_cvar_string("mp_clan_timer",param)
            console_print(id,"mp_clan_timer set to %s",param)
         } else {
            get_cvar_string("mp_clan_timer",param,31)
            console_print(id,"mp_clan_timer is %s",param)
         }
      } else if (equal(cmd,"rs")) {
         if (argc) {
            set_cvar_string("mp_clan_respawntime",param)
            console_print(id,"mp_clan_respawntime set to %s",param)
         } else {
            get_cvar_string("mp_clan_respawntime",param,31)
            console_print(id,"mp_clan_respawntime is %s",param)
         }
      } else if (equal(cmd,"rd")) {
         if (matchOn) {
            console_print(id,"Stop the match first...")
         } else {
            // Plugins Pause
            server_cmd("amx_ppause pause mapchooser.amx")
            server_cmd("amx_ppause pause task_scheduler.amx")
            server_cmd("amx_ppause pause timeleft.amx")
            matchOn = 1
            set_cvar_string("mp_clan_readyrestart","1")
            server_cmd("amx_tsay  yellow  Teams ... say ready, when ok to
   start match...")
         }
      }
      return PLUGIN_HANDLED
   }
   public stop_match(id) {
      if (!(get_user_flags(id)&ADMIN_LEVEL_A))
         return PLUGIN_HANDLED
      if (!matchOn)
         return PLUGIN_HANDLED
      matchOn = 0
      remove_task(71171)
      remove_task(71172)
      server_cmd("sv_maxspeed 500")
      set_cvar_string("mp_clan_match","0")
      set_cvar_string("clan_match","0")
      console_print(id,"Match stopped...")
      server_cmd("amx_tsay yellow * Match stopped...")
      return PLUGIN_HANDLED
   }
   public plugin_init(){
      register_plugin("DoD Clanmatch","0.9.4","MJV")
      register_concmd("setmatch","setmatch",ADMIN_LEVEL_A,"use: -time -ff
   -map1   -map2   -config  -mode  -old  (eg.  setmatch  -time  15  -map1
   dod_donner)")
      register_concmd("startmatch","startmatch",ADMIN_LEVEL_A,"-   starts
   the clan match process")
      register_concmd("public","public_confs",ADMIN_LEVEL_A,"-      loads
   server.cfg and public.cfg")
      register_concmd("stopmatch","stop_match",ADMIN_LEVEL_A,"-     stops
   clan match process")
      register_concmd("go","matchgo",ADMIN_LEVEL_A,"- starts the map with
   the old style match...")
      register_concmd("setpass","setpass",ADMIN_LEVEL_A,"-     sets     a
   password for server...")
      register_concmd("showpass","showpass",ADMIN_LEVEL_A,"-   shows  the
   password for server...")
      register_concmd("setnextmap","setnextmap",ADMIN_LEVEL_A,"- sets the
   next map...")
      register_concmd("cm","origmatch",ADMIN_LEVEL_A,"-              sets
   mp_clan_match for orig style match...")
      register_concmd("tl","origmatch",ADMIN_LEVEL_A,"- sets mp_timelimit
   for orig style match...")
      register_concmd("rr","origmatch",ADMIN_LEVEL_A,"-              sets
   mp_clan_restartround and starts orig style match...")
      register_concmd("ff","origmatch",ADMIN_LEVEL_A,"-              sets
   mp_friendlyfire for orig style match...")
      register_concmd("tm","origmatch",ADMIN_LEVEL_A,"-              sets
   mp_clan_timer for orig style match...")
      register_concmd("rs","origmatch",ADMIN_LEVEL_A,"-              sets
   mp_clan_respawntime for orig style match...")
      register_concmd("rd","origmatch",ADMIN_LEVEL_A,"-              sets
   mp_clan_readyrestart and starts waiting teams to say ready...")
      register_clcmd("say go","matchgo",ADMIN_LEVEL_A)
      register_cvar("clan_match","0")
      register_cvar("clan_match_mapa","")
      register_cvar("clan_match_mapb","")
      register_cvar("clan_match_mode","1")
      register_cvar("clan_match_timelimit","15")
      register_cvar("clan_match_config","match.cfg")
      register_cvar("clan_match_ff","1")
      new match = get_cvar_num("clan_match")
      switch (match) {
         case 1,2,3,4,5,6,7,8: {
            prepare_match()
         }
      }
      return PLUGIN_CONTINUE
   }
