
   /*********************************************************************
   *****
   * Usage:
   *  The way I have it set up is that i have 3 keys in CS bound to these
   * commands
   * ::   freefb   i use kp_home
   * ::   freehe   i use kp_uparrow
   * ::   freesn   i use kp_pgup
   *
   * The command to toggle the infinite nades is         nadetoggle
   * It seems to work perfect when you only have a knife, which is ok for
   * practice throwing
   * It works a little more funky when you have a pistol
   * Check it out and tell me what you think
   *
   *  One  other thing.  AMX actually registers the 4 commands in CS.  It
   will
   * say unknown command in console, but thats ok, its still working
   *
   * -Stinger :)
   * Thanks to everyone for much help and source code from these forums
   **********************************************************************
   ******/
   #include <amxmod>
   new gmsgCurWeapon
   new infinite = 0
   public give_fb(id){
   if (infinite == 1){
   give_item(id,"weapon_flashbang")
   curweapon_set(id,0,25,2)
   }
   }
   public give_he(id){
   if (infinite == 1){
   give_item(id,"weapon_hegrenade")
   curweapon_set(id,0,4,1)
   }
   }
   public give_sn(id){
   if (infinite == 1){
   give_item(id,"weapon_smokegrenade")
   curweapon_set(id,0,9,1)
   }
   }
   public toggle(){
   new checker = 1
   if (infinite == 0){
   infinite = 1
   set_hudmessage(0,  100,  0,  -1.0,  0.65, 2, 0.02, 10.0, 0.01, 0.1, 2)
   show_hudmessage(0,"Infinite nades ON")
   checker = 0
   }
   if (checker == 1)
   {
   if (infinite == 1){
   infinite = 0
   set_hudmessage(0,  100,  0,  -1.0,  0.65, 2, 0.02, 10.0, 0.01, 0.1, 2)
   show_hudmessage(0,"Infinite nades OFF")
   }
   }
   }
   public curweapon_set(id,selected,weaponid,ammo){
   message_begin( MSG_ONE, gmsgCurWeapon,{0,0,0},id)
   write_byte(selected)
   write_byte(weaponid)
   write_byte(ammo)
   message_end()
   }
   public plugin_init()
   {
   register_plugin("Free Nades", "1.0", "Stinger")
   gmsgCurWeapon = get_user_msgid("CurWeapon")
   register_clcmd("freefb","give_fb")
   register_clcmd("freehe","give_he")
   register_clcmd("freesn","give_sn")
   register_clcmd("nadetoggle","toggle")
   }
