
   /* AMX Mod script.
   *
   *  C4players
   *  by Scarzzurs/The_Unbound
   *  email: Scarzzurs@hotmail.com
   *  MSN: Scarzzurs@hotmail.com
   *  ICQ#: 84124020
   *
   *  version:1.50
   *
   *  updated  to  show players why they can't plant, because most people
   can't understand why
   *  they can't use c4.
   *
   *  sv_c4players set how many players that have to be on the server,
   *  before players can use the c4/bomb.
   *  sv_c4players_special  sets  if it should ignore sv_c4players if the
   number of cts is higher then 2 times the number of ts
   *
   */
   #include <amxmod>
   public c4(id){
       if (get_cvar_num("sv_c4players_special")){
           new cts
           new ts
           new MyTeam[32]
           new players[32]
           new player_num
           get_players(players, player_num)
           for (new i = 0; i < player_num; i++){
               get_user_team(players[i],MyTeam,32)
               if(equal(MyTeam,"CT"))
                   ++cts
               else ++ts
           }
           if ((ts * 2) <= cts && cts != 0 && ts != 0)
               return PLUGIN_CONTINUE
       }
       new numplayers = get_playersnum()
       if (get_cvar_num("sv_c4players") >= numplayers){
           engclient_cmd(id,"weapon_knife")
           client_print(id,print_center,"You  cannot  use  C4,  need more
   players")
       }
       return PLUGIN_CONTINUE
   }
   public plugin_init(){
       register_cvar("sv_c4players", "3")
       register_cvar("sv_c4players_special", "1")
       register_plugin("c4_players","1.50","Scarzzurs")
       register_event("CurWeapon","c4","be","1=1","2=6")
       return PLUGIN_CONTINUE
   }
