
   /* AMX Mod script.
   *
   * [SN*INFO] RoundCount Plugin by sonic (sonic@codet.de)
   *
   * (c) Copyright 2002, sonic
   * This file is provided as is (no warranties).
   *
   */
   /*    Put in server.cfg:
   *   sn_rcount_mode < flags >
   *   "a" - show roundcount/map restart in hud
   *   "b" - show roundcount/map restart in chat
   *   "c" - show map restart
   *   "d" - play sound on roundstart
   *
   *   Set sn_rcount_mode "" to disable RoundCount Plugin.
   *   Default sn_rcount_mode is "bcd"
   */
   #include <amxmod>
   new roundsnum
   public new_round() {
       new roundtime = get_cvar_num("mp_roundtime") * 60
       if (roundtime != read_data(1))
           return PLUGIN_CONTINUE
       ++roundsnum

       new msg[128], currentmap[32], rcmode[8]
       get_mapname(currentmap,31)
       new maxrounds = get_cvar_num("mp_maxrounds")

       if ( maxrounds )
           format(msg,127,"[SN*INFO]     Round     %i     of     %i    on
   %s",roundsnum,maxrounds,currentmap)
       else
           format(msg,127,"[SN*INFO]          Round         %i         on
   %s",roundsnum,currentmap)
       get_cvar_string("sn_rcount_mode",rcmode,7)
       new rcmodebits = read_flags(rcmode)
       if ( rcmodebits & 1 ) {
           set_hudmessage(220,80,0,0.05,0.15,0, 6.0, 12.0, 1.0, 2.0, 1)
           show_hudmessage(0,msg)
           set_hudmessage(220,80,0,-1.0,0.30,0, 6.0, 5.0, 1.0, 2.0, 2)
           show_hudmessage(0,"Prepare to FIGHT!")
       }
       if ( rcmodebits & 2 ) {
           client_print(0,print_chat,msg)
           client_print(0,print_chat,"[SN*INFO] Prepare to FIGHT!")
       }
       if ( rcmodebits & 8 ) client_cmd(0,"spk misc/prepare")
       return PLUGIN_CONTINUE
   }
   public new_map() {
       new currentmap[32], msg[128], rcmode[8]
       get_mapname(currentmap,31)
       roundsnum = 0
       format(msg,127,"[SN*INFO] Restart map %s",currentmap)
       get_cvar_string("sn_rcount_mode",rcmode,7)
       new rcmodebits = read_flags(rcmode)
       if ( rcmodebits & 4 ){
           if (rcmodebits & 1)
               client_print(0,print_chat,msg)
           if (rcmodebits & 2) {
               set_hudmessage(220,80,0,0.05,0.15,0,  6.0, 12.0, 1.0, 2.0,
   1)
               show_hudmessage(0,msg)
           }
       }
       return PLUGIN_CONTINUE
   }
   public plugin_init() {
       register_plugin("RoundCount","0.9","Sonic (sonic@codet.de)")
       register_event("TextMsg","new_map","a","2&#Game_C","2&#Game_w")
       register_event("RoundTime", "new_round", "bc")
       register_cvar("sn_rcount_mode","bcd")
       return PLUGIN_CONTINUE
   }
