
   /*
   AMX Mod Script.
   Blunt plugin
   By ThorW, with help from duff, and EJ Thx
   Commands:
      Say /blunt
      Amx_blunt < nick >
   - Installation :
   Add the amx_blunt.amx to your plugins directory in the AMX folder.
   Then add the line "amx_blunt.amx" to your plugins.ini, then your done.
   Enjoy.
   version 0.2
   */
   #include <amxmod>
   #include <amxmisc>
   new smoke
   public admin_blunt(id,level,cid){

       if (!cmd_access(id,level,cid,2))
           return PLUGIN_HANDLED
           new arg[32]
           read_argv(1,arg,31)
        read_argv(2,arg[1],31)
           new player = find_player("lb",arg)
       if (!player) return PLUGIN_HANDLED
           new name[32], aname[32]
           get_user_name(player,name, 31)
           get_user_name(id,aname, 31)
           new aPlayer[1]
        aPlayer[0]= player
        has_blunt(id,player)
        set_task(0.6,"has_blunt",0,aPlayer[0],2,"a")
           client_print(player,print_chat,"* %s Has passed you the blunt,
   now you can relax",aname)
           console_print(id,"  The  Blunt  has  Been  Passed, you must be
   wasted")
           return PLUGIN_HANDLED
   }

   public blunt_pass(id) {
           new bname[32]
           get_user_name(id,bname, 31)
           client_print(0,print_chat,"*  %s  Has taken a long drag on the
   blunt, now you can relax",bname)
           console_print(id,"  The  Blunt  has  Been  Passed, you must be
   wasted")
           return PLUGIN_HANDLED
   }
   public has_blunt(id,player) {
       if(is_user_alive(player)){
           new vec[3]
           get_user_origin(player,vec)
           new a1,b1
           a1 = random_num(-30,30)
           b1 = random_num(-30,30)
           // blunt smoke
           message_begin( MSG_BROADCAST,SVC_TEMPENTITY )
           write_byte( 5 )
           write_coord(vec[0]+a1)
           write_coord(vec[1]+b1)
           write_coord(vec[2]+30)
           write_short( smoke )
           write_byte( 30 )
           write_byte( 10 )
           message_end()
       }
       return PLUGIN_CONTINUE
   }
   public plugin_precache(){
       smoke = precache_model("sprites/steam1.spr")

       return PLUGIN_CONTINUE
   }
   public plugin_init(){
           register_plugin("Admin_Blunt","0.2","Duff")
           register_concmd("amx_blunt","admin_blunt",ADMIN_LEVEL_A,"<
   nick >")
           register_clcmd("say /blunt","blunt_pass")
           register_clcmd("say /blunt","has_blunt")
      return PLUGIN_CONTINUE
   }
