
   /* AMX Mod script.
   *
   *    Weapon Cloak by MMX
   *    This file is provided as is (no warranties).
   *
   *    For each weapon there is an aplha value for the player's model
   *    i.e. amx_invis_knife "80" means a player holding a knife
   *    will be moderately visible, whereas amx_invis_ak47 "200" would
   *    make anywone holding a knife be normal transparency.
   *
   *    If you want to alter values make a line in admin.cfg
   *    i.e. amx_invis_knife "80"
   *
   *    My first plugin so comments welcome
   */
   #include <amxmod>
   #include <amxmisc>
   public SetVisibility(id){
       new wepi = read_data(2)
       if(wepi == 1) AlterAlpha(id,get_cvar_num("amx_invis_p228"))
       if(wepi == 3) AlterAlpha(id,get_cvar_num("amx_invis_scout"))
       if(wepi == 4) AlterAlpha(id,get_cvar_num("amx_invis_hegrenade"))
       if(wepi == 5) AlterAlpha(id,get_cvar_num("amx_invis_xm"))
       if(wepi == 6) AlterAlpha(id,get_cvar_num("amx_invis_c4"))
       if(wepi == 7) AlterAlpha(id,get_cvar_num("amx_invis_mac"))
       if(wepi == 8) AlterAlpha(id,get_cvar_num("amx_invis_aug"))
       if(wepi == 9) AlterAlpha(id,get_cvar_num("amx_invis_smoke"))
       if(wepi == 10) AlterAlpha(id,get_cvar_num("amx_invis_elite"))
       if(wepi == 11) AlterAlpha(id,get_cvar_num("amx_invis_5seven"))
       if(wepi == 12) AlterAlpha(id,get_cvar_num("amx_invis_ump"))
       if(wepi == 13) AlterAlpha(id,get_cvar_num("amx_invis_sg550"))
       if(wepi == 16) AlterAlpha(id,get_cvar_num("amx_invis_usp"))
       if(wepi == 17) AlterAlpha(id,get_cvar_num("amx_invis_glock"))
       if(wepi == 18) AlterAlpha(id,get_cvar_num("amx_invis_awp"))
       if(wepi == 19) AlterAlpha(id,get_cvar_num("amx_invis_mp5navy"))
       if(wepi == 20) AlterAlpha(id,get_cvar_num("amx_invis_m249"))
       if(wepi == 21) AlterAlpha(id,get_cvar_num("amx_invis_m3"))
       if(wepi == 22) AlterAlpha(id,get_cvar_num("amx_invis_m4a1"))
       if(wepi == 23) AlterAlpha(id,get_cvar_num("amx_invis_tmp"))
       if(wepi == 24) AlterAlpha(id,get_cvar_num("amx_invis_g3sg1"))
       if(wepi == 25) AlterAlpha(id,get_cvar_num("amx_invis_flash"))
       if(wepi == 26) AlterAlpha(id,get_cvar_num("amx_invis_deagle"))
       if(wepi == 27) AlterAlpha(id,get_cvar_num("amx_invis_sg552"))
       if(wepi == 28) AlterAlpha(id,get_cvar_num("amx_invis_ak47"))
       if(wepi == 29) AlterAlpha(id,get_cvar_num("amx_invis_knife"))
       if(wepi == 30) AlterAlpha(id,get_cvar_num("amx_invis_p90"))
       return PLUGIN_HANDLED
   }
   public AlterAlpha(id,alphaVal)
   {
       set_user_rendering(id,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,a
   lphaVal)
       new name[33]
       get_user_name(id,name,32)
       set_hudmessage(200, 100, 0, -2.0, 0.20, 0, 6.0, 6.0, 0.5, 0.15, 1)

       show_hudmessage(id,
   "%s Visibility: %i",name,alphaVal)
   }
   public plugin_init()
   {
   register_plugin("Weapon Cloak","1","MMX")
   register_event("CurWeapon","SetVisibility","b","1=1")
   //cvars
   register_cvar("amx_invis_p228","80")
   register_cvar("amx_invis_scout","200")
   register_cvar("amx_invis_hegrenade","10")
   register_cvar("amx_invis_xm","200")
   register_cvar("amx_invis_c4","10")
   register_cvar("amx_invis_mac","200")
   register_cvar("amx_invis_aug","200")
   register_cvar("amx_invis_smoke","10")
   register_cvar("amx_invis_elite","80")
   register_cvar("amx_invis_5seven","80")
   register_cvar("amx_invis_ump","200")
   register_cvar("amx_invis_sg550","80")
   register_cvar("amx_invis_usp","80")
   register_cvar("amx_invis_glock","80")
   register_cvar("amx_invis_awp","200")
   register_cvar("amx_invis_mp5navy","200")
   register_cvar("amx_invis_m249","200")
   register_cvar("amx_invis_m3","200")
   register_cvar("amx_invis_m4a1","200")
   register_cvar("amx_invis_tmp","200")
   register_cvar("amx_invis_g3sg1","200")
   register_cvar("amx_invis_flash","10")
   register_cvar("amx_invis_deagle","80")
   register_cvar("amx_invis_sg552","200")
   register_cvar("amx_invis_ak47","200")
   register_cvar("amx_invis_knife","10")
   register_cvar("amx_invis_p90","200")
   return PLUGIN_CONTINUE
   }
