
   #include <amxmod>
   #include <amxmisc>
   #define AWP_AMMO         0
   #define AWP_SWITCH       1
   new Float:awp_fired[32]
   new awp_check[32][2]
   public change_weapon(id) {
     new strMesg[256];
     new weapon = read_data(2)
     // Are they using the AWP?
     if(weapon != 18 && weapon != 3) {
       // Set the weapon switch flag
       awp_check[id][AWP_SWITCH] = 1
       return PLUGIN_CONTINUE
     }
     new Float:ntime = get_gametime()
     new ammo = read_data(3)
     // Did they just fire the AWP?
     if(awp_check[id][AWP_AMMO] > ammo) {
       new name[33]
       get_user_name(id,name,32)
       format(strMesg,254,"%s fired AWP (ammo: %d) (AWP_SWITCH: %d) (last
   fire: %d) (ntime: %d)",
              name,ammo,awp_check[id][AWP_SWITCH],awp_fired[id],ntime)
       log_message(strMesg);
       // Was the last shot within X seconds?
       if(awp_fired[id] > ntime) {
         // Have they switched weapons since last shooting the AWP?
         if(awp_check[id][AWP_SWITCH] == 1) {
           log_message("AWP FAST SWITCH DETECTED")
           new dweap[32], sweap[32], dnum
           get_user_weapons(id,dweap,dnum)
           for(new a = 0; a < dnum; ++a){
             get_weaponname(dweap[a],sweap,31)
             engclient_cmd(id,"drop",sweap)
           }
         }
       }
       // Save when the AWP was fired
       awp_fired[id] = ntime + 2.0
       // Reset the weapon switch each shot
       awp_check[id][AWP_SWITCH] = 0
     }
     // Save the clip info
     awp_check[id][AWP_AMMO] = ammo
     return PLUGIN_CONTINUE
   }
   public plugin_init(){
     register_plugin("awp fastswitch detect", "1.0", "xxx")
     register_event("CurWeapon","change_weapon","be","1=1")  //  0 = stop
     using weapon 1 = active weapon
     return PLUGIN_CONTINUE
   }
