
   /* AMXMOD script - roaming_admin_menu
   *
   *  Roaming Admin Menu by Fractal.
   *
   *  Updated/enhanced version of OLO's "spectating_admin" plugin for CS.
   *  This   version  is  designed  to  work  with  other  mods  (DoD  in
   particular).
   *
   *  Allows    Admin    to    "target"    a    player   for   punishment
   (slap/slay/kick/ban) by aiming at them.
   *  (for Admins that like to play or do a lot of spectating)
   *
   *  How to use:
   *  Bind  a  key  to "amx_roamingmenu" then aim at player and press the
   key to get the menu.
   *  (note: you must have access level "d" to use)
   *
   */
   #include <amxmod>
   new admin_target[33]
   public actionRoamingMenu(id,key){
       if (!is_user_connected(admin_target[id])){
           client_print(id,print_chat,"This  player has left the server")

           return PLUGIN_HANDLED
       }
       switch(key){
           case 0: {
               user_slap(admin_target[id],1)
               displayRoamingMenu(id)
           }
           case 1: user_kill(admin_target[id])
           case 2: server_cmd("kick #
   %d",get_user_userid(admin_target[id]))
           case 3: {
               new userid = get_user_userid(admin_target[id])
               server_cmd("banid 15.0 #%d kick",userid)
           }
           case 4: {
               new userid = get_user_userid(admin_target[id])
               server_cmd("banid 0.0 #%d kick;writeid",userid)
           }
       }
       return PLUGIN_HANDLED
   }
   public displayRoamingMenu(id){
       new menuBody[512], name[33]
       get_user_name(admin_target[id],name,32)
       format(menuBody,511,"Roaming       Admin      Menu^n^n      target
   aquired:  %s^n^n1.  Slap  (1  damage)^n2. Slay^n3. Kick^n4. Ban for 15
   mins^n5. Ban Permanently^n^n0. Exit",name)
       new keys = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<9)
       show_menu(id,keys,menuBody)
   }
   public cmdRoamingMenu(id){
       if ( !(get_user_flags(id) & ADMIN_BAN) ){
           console_print(id,"You have no access to that command")
           return PLUGIN_HANDLED
       }
       new target, body
       get_user_aiming(id,target,body)
       if (!target){
           set_hudmessage(255,  1, 1, 0.05, 0.475, 0, 3.0, 6.0, 0.1, 0.5,
   6)
           show_hudmessage(id,"No target specified")
           return PLUGIN_HANDLED
       }
       if (get_user_flags(target)&ADMIN_IMMUNITY){
           set_hudmessage(255,  1, 1, 0.05, 0.475, 0, 3.0, 6.0, 0.1, 0.5,
   6)
           show_hudmessage(id,"That player has immunity")
           return PLUGIN_HANDLED
       }
       admin_target[id] = target
       displayRoamingMenu(id)
       return PLUGIN_CONTINUE
   }
   public plugin_init() {
       register_plugin("Roaming Admin Menu","0.9.4","Fractal")
       register_menucmd(register_menuid("Roaming                    Admin
   Menu"),1023,"actionRoamingMenu")
       register_clcmd("amx_roamingmenu","cmdRoamingMenu",ADMIN_BAN,"load
   roaming admin menu")
       return PLUGIN_CONTINUE
   }
