
   /* AMX Mod script.
   *
   * (c) Copyright 2002-2003, Mike Cao (mike@mikecao.com)
   * This file is provided as is (no warranties).
   */
   #include <amxmod>
   #include <amxmisc>
   /*
   *
   * This plugin allows admins to disarm players. It teleports
   * them offscreen, removes their weapons, and teleports them
   * back.
   *
   * Usage: amx_disarm <authid, nick, @team or #userid>
   * Examples:
   * amx_disarm @CT
   * amx_disarm @TERRORIST
   * amx_disarm #213
   *
   */
   disarm_player(id,victim){
       new name[32], origin[3]
       get_user_origin(victim,origin)
       origin[2] -= 2000
       set_user_origin(victim,origin)
       new iweapons[32], wpname[32], inum
       get_user_weapons(victim,iweapons,inum)
       for(new a=0;a<inum;++a){
           get_weaponname(iweapons[a],wpname,31)
           engclient_cmd(victim,"drop",wpname)
       }
       engclient_cmd(victim,"weapon_knife")
       origin[2] += 2005
       set_user_origin(victim,origin)
       get_user_name(victim,name,31)
       console_print(id,"Client ^"%s^" has been disarmed",name)
   }
   public admin_disarm(id,level,cid) {
       if (!cmd_access(id,level,cid,2))
           return PLUGIN_HANDLED
       new arg[32]
       read_argv(1,arg,31)
       if (arg[0]=='@'){
           new players[32], /*name[32],*/ inum
           get_players(players,inum,"ae",arg[1])
           if (inum==0){
               console_print(id,"No alive clients in such team")
               return PLUGIN_HANDLED
           }
           for(new a=0;a<inum;++a){
               /*if (get_user_flags(players[a])&ADMIN_IMMUNITY){
                   get_user_name(players[a],name,31)
                   console_print(id,"Skipping  ^"%s^"  because client has
   immunity",name)
                   continue
               }*/
               disarm_player(id,players[a])
           }
       }
       else {
           new player = cmd_target(id,arg,5)
           if (!player) return PLUGIN_HANDLED
           disarm_player(id,player)
       }
       return PLUGIN_HANDLED
   }
   public plugin_init(){
       register_plugin("Admin Disarm","1.1","mike_cao")
       register_concmd("amx_disarm","admin_disarm",ADMIN_LEVEL_A,"<authid
   , nick, @team or #userid>")
       return PLUGIN_CONTINUE
   }
