
   /* AMX Mod script.
   *
   * (c) Copyright 2002, -]TFL[-rAz-
   * This file is provided as is (no warranties).
   *
   */
   #include <amxmod>
   new ct_score = 0
   new terrorist_score = 0
   new Float:last_timelimit
   public change_map(){
       last_timelimit = get_cvar_float("mp_timelimit")
       set_cvar_float("mp_timelimit",0.01)
   }
   public back_timelimit()
       set_cvar_float("mp_timelimit",last_timelimit)
   public new_round(){
       if ((get_cvar_num("mp_roundtime") * 60) != read_data(1))
           return PLUGIN_CONTINUE

       new winslimit = get_cvar_num("amx_winslimit") - 1
       set_hudmessage(200, 100, 0, 0.05, 0.75, 0, 6.0, 6.0, 0.5, 0.15, 1)
       if ((winslimit!=-1)&&((ct_score-terrorist_score)>winslimit)){
           set_task(4.0,"change_map")
           show_hudmessage(0,"CT's  have shut out T's with score of %d to
   %d^nChanging map...",ct_score,terrorist_score)
       }
       else if ((winslimit!=-1)&&((terrorist_score-ct_score)>winslimit)){
           set_task(4.0,"change_map")
           show_hudmessage(0,"T's  have shut out CT's with score of %d to
   %d^nChanging map...",terrorist_score,ct_score)
       }
       else if (ct_score > terrorist_score)
           show_hudmessage(0,"CT's   are   winning  over  T's  %d  to  %d
   rounds",ct_score,terrorist_score )
       else if (ct_score < terrorist_score)
           show_hudmessage(0,"T's   are   winning  over  CT's  %d  to  %d
   rounds",terrorist_score,ct_score)
       else if (ct_score + terrorist_score) /* if any */
           show_hudmessage(0,"Both teams have won %d rounds",ct_score)
       return PLUGIN_CONTINUE
   }
   public team_score(){
       new team[2]
       read_data(1,team,1)
       if (team[0]=='C')
           ct_score = read_data(2)
       else if (team[0]=='T')
           terrorist_score = read_data(2)
       return PLUGIN_CONTINUE
   }
   public plugin_init(){
       register_plugin("Wins Limit","0.4","-]TFL[-rAz-")
       register_event("TeamScore", "team_score", "a")
       register_event("RoundTime", "new_round", "bc")
       register_event("30", "back_timelimit", "a")
       register_cvar("amx_winslimit","7")
       return PLUGIN_CONTINUE
   }
