
   /* AMX Mod script.
   *
   * This file is provided as is (no warranties).
   * A better awp restriction for cs (this works for 1.6)
   * This plugin changes a players awp to a scout.
   * It basically burries the player 2000 units down, drops the awp,
   * gives a scout/ammo and puts them back.
   */
   #include <amxmod>
   #include <amxmisc>
   public check_awp(id) {
       if (get_cvar_num("sv_awp2scout")!=1)
       {
           return PLUGIN_CONTINUE
       }else{
           new parm[1]
           parm[0] = id

               set_task(0.1,"drop_down",id,parm,1)
               set_task(0.1,"a2s",id,parm,1)
               set_task(0.1,"pop_up",id,parm,1)
       }
               return PLUGIN_CONTINUE
   }
   public drop_down(parm[]) {
       new id = parm[0]
       new origin[3]
       get_user_origin(id,origin)
       origin[2] -= 2000
       set_user_origin(id,origin)
   }
   public a2s(parm[]) {
       new id = parm[0]
       engclient_cmd(id,"weapon_awp")
       engclient_cmd(id,"drop")
       give_item(id,"weapon_scout")
       give_item(id,"ammo_762nato")
   }
   public pop_up(parm[]) {
       new id = parm[0]
       new origin[3]
       get_user_origin(id,origin)
       origin[2] += 2005
       set_user_origin(id,origin)
   }
   public plugin_init() {
          register_plugin("Awp2Scout","0.1","[-3LH-]Geezus")
          register_event("WeapPickup","check_awp","b","1=18")
          register_cvar("sv_awp2scout","1")
          return PLUGIN_CONTINUE
      }
