
   /* AMX Mod script.
   *
   * Made by AssKicR with some code from Scarzzurs
   *
   * This file is provided as is (no warranties).
   *
   */
   #include <amxmod.inc>
   #include <amxmisc.inc>
   // VARIABLES
   new bool:BuyBlock[33]
   //--------------------------------------------------------------------
   --------------------------
   public plugin_init() {
       register_plugin("Admin NoBuy","1.0","AssKicR/Scarzzurs")
       register_clcmd("amx_nobuy","admin_nobuy",ADMIN_SLAY,"<authid,
   nick, @team or #userid>")
       register_clcmd("amx_rebuy","admin_rebuy",ADMIN_SLAY,"<authid,
   nick, @team or #userid>")
       register_clcmd("buy","nobuy")
       register_clcmd("buyequip","nobuy")
       register_clcmd("buyammo1","nobuy")
       register_clcmd("buyammo2","nobuy")
   }
   //--------------------------------------------------------------------
   --------------------------
   public nobuy(id) {
       if (BuyBlock[id]) return PLUGIN_HANDLED
       return PLUGIN_CONTINUE
   }
   //--------------------------------------------------------------------
   --------------------------
   public client_connect(id){
       BuyBlock[id]=false
   }
   //--------------------------------------------------------------------
   --------------------------
   public client_disconnect(id){
       BuyBlock[id]=false
   }
   //--------------------------------------------------------------------
   --------------------------
   public admin_nobuy(id,level,cid) {
      if (!cmd_access(id,level,cid,2))
         return PLUGIN_HANDLED
      new arg[32], name2[32]
      get_user_name(id,name2,31)
      read_argv(1,arg,31)
      if    ((arg[0]=='@')   &&   (arg[1]=='A')   &&   (arg[2]=='L')   &&
   (arg[3]=='L')) {
         new players[32], inum
         get_players(players,inum,"")

         for(new a=0;a<inum;++a)
            BuyBlock[players[a]]=true
         switch(get_cvar_num("amx_show_activity"))   {
      case  2:   client_print(0,print_chat,"ADMIN  %s:  Disable Everyones
   Buymenu",name2)
      case   1:   client_print(0,print_chat,"ADMIN:   Disable   Everyones
   Buymenu")
         }
         console_print(id,"No clients can buy")
      }
      else if (arg[0]=='@'){
         new players[32], inum
         get_players(players,inum,"ae",arg[1])
         if (inum==0){
            console_print(id,"No clients in such team")
            return PLUGIN_HANDLED
         }
         for(new a=0;a<inum;++a)
            BuyBlock[players[a]]=true
         switch(get_cvar_num("amx_show_activity"))   {
      case 2:   client_print(0,print_chat,"ADMIN %s: Disabled the Buymenu
   off all %s's",name2,arg[1])
      case 1:   client_print(0,print_chat,"ADMIN: Disable the Buymenu off
   all %s's",arg[1])
         }
         console_print(id,"No clients on %s can buy",arg[1])
      }
      else {
         new player = cmd_target(id,arg,7)
         if (!player) return PLUGIN_HANDLED
         BuyBlock[player]=true
         new name[32]
         get_user_name(player,name,31)
         switch(get_cvar_num("amx_show_activity"))   {
      case   2:   client_print(0,print_chat,"ADMIN   %s:   Disabled  %s's
   Buymenu",name2,name)
      case     1:   client_print(0,print_chat,"ADMIN:    Disabled    %s's
   Buymenu",name)
         }
         console_print(id,"Client ^"%s^" can't buy",name)
      }
      return PLUGIN_HANDLED
   }
   //--------------------------------------------------------------------
   --------------------------
   public admin_rebuy(id,level,cid) {
      if (!cmd_access(id,level,cid,2))
         return PLUGIN_HANDLED
      new arg[32], name2[32]
      get_user_name(id,name2,31)
      read_argv(1,arg,31)
      if    ((arg[0]=='@')   &&   (arg[1]=='A')   &&   (arg[2]=='L')   &&
   (arg[3]=='L')) {
         new players[32], inum
         get_players(players,inum,"")

         for(new a=0;a<inum;++a)
            BuyBlock[players[a]]=false
         switch(get_cvar_num("amx_show_activity"))   {
      case  2:   client_print(0,print_chat,"ADMIN  %s: Enable the Buymenu
   of all players",name2)
      case  1:   client_print(0,print_chat,"ADMIN:  Enable the Buymenu of
   all players")
         }
         console_print(id,"All clients can buy")
      }
      else if (arg[0]=='@'){
         new players[32], inum
         get_players(players,inum,"ae",arg[1])
         if (inum==0){
            console_print(id,"No clients in such team")
            return PLUGIN_HANDLED
         }
         for(new a=0;a<inum;++a)
            BuyBlock[players[a]]=false
         switch(get_cvar_num("amx_show_activity"))   {
      case  2:   client_print(0,print_chat,"ADMIN  %s: Enable the Buymenu
   of all %s's",name2,arg[1])
      case  1:   client_print(0,print_chat,"ADMIN:  Enable the Buymenu of
   all %s's",arg[1])
         }
         console_print(id,"All clients on %s can buy",arg[1])
      }
      else {
         new player = cmd_target(id,arg,7)
         if (!player) return PLUGIN_HANDLED
         BuyBlock[player]=false
         new name[32]
         get_user_name(player,name,31)
         switch(get_cvar_num("amx_show_activity"))   {
      case   2:   client_print(0,print_chat,"ADMIN   %s:   Enabled   %s's
   buymenu",name2,name)
      case     1:   client_print(0,print_chat,"ADMIN:     Enable     %s's
   buymenu",name)
         }
         console_print(id,"Client ^"%s^" can't buy",name)
      }
      return PLUGIN_HANDLED
   }
   //--------------------------------------------------------------------
   --------------------------AMXMOD?>
