
   /*********************************************************************
   ******/
   /*                    Unhidden Radio
   v0.22                                 */
   /*                                             by
   Downtown1                */
   /*********************************************************************
   ******/
   /*  This  plugin  allows  users  to bind to 'radio4' and use the radio
   commands */
   /*   that   the   new   versions   of  Counter-Strike  seemingly  left
   out.             */
   /*   Come   to   66.150.107.11   if   you   wish   to   try   it   out
   first.                */
   /*
   ========================= Version History
   ===================================
   *** 0.22 - fixed indentations so they are all the same
   ***  0.21  -  made  people  using  radio4  flash  on  radar  by  using
   +-voicecommand
   *** 0.2  - added icons above player's head -- thanks to EJ for letting
   me look
   ***        at his code :-)
   *** 0.13 - dead players can't use radio anymore
   *** 0.12 - changed one of the radio commands
   ***  0.11  -  now  uses  one  function  with parameters where the case
   statements are
   *** 0.1  - first version of plugin: features 'radio4'
            -  execs  speak  sound and sends a Name (RADIO) : msg! to the
   team
   */
   #include <amxmod>
   new get_rname[32]
   new get_numteam, get_rplayers[32]
   new radiosprite
   public radio4_showmenu(id)
     {
      if (!(is_user_alive(id)))
        {
         return PLUGIN_CONTINUE
        }
      new radio4menu[256]
      new get_team[32]
      get_user_name(id, get_rname, 31)
      get_user_team(id, get_team, 31)
      get_players(get_rplayers, get_numteam, "ace", get_team)
      format(radio4menu,256,"\yRadio   Menu:   %s^n\w^n1.  Circle  around
   back!^n2.  I'm  hit!.^n3.  Hit  and need assistance.^n4. I'll take the
   point.^n5.  Meet  at  the rendezvous.^n6. Follow my command.^n7. Let's
   get    outta    here.^n8.    Move    out.^n9.   Teammate   down!^n^n0.
   Cancel",get_rname)
      show_menu(id,(1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7
   )|(1<<8)|(1<<9),radio4menu)
      return PLUGIN_HANDLED
     }
   public radio4_result (wavfile[], printmsg[], id)
     {
      for (new i = 0; i < get_numteam; i++)
        {
         client_cmd(id, "+voicerecord")
         client_cmd(id, "-voicerecord")
         new radiomsg[128], wavexec[128]
         format (wavexec, 127, "speak radio/%s", wavfile)
         client_cmd(get_rplayers[i], wavexec)
         format (radiomsg, 127, "%s (RADIO): %s", get_rname, printmsg)
         client_print(get_rplayers[i], print_chat, radiomsg)
         radio4_icon(id, get_rplayers[i])
         client_cmd(id, "+voicerecord")
         client_cmd(id, "-voicerecord")
        }
     }
   public radio4_execmenu(id, key)
     {
      switch(key)
        {
         case 0:
                 {
                  radio4_result ("circleback.wav", "Circle around back!",
   id)
                 }
         case 1:
                 {
                  radio4_result ("ct_imhit.wav", "I'm hit!", id)
                 }
         case 2:
                 {
                  radio4_result    ("hitassist.wav",   "I'm   hit,   need
   assistance!", id)
                 }
         case 3:
                 {
                  radio4_result  ("ct_point.wav", "I'll take the point!",
   id)
                 }
         case 4:
                 {
                  radio4_result  ("meetme.wav",  "Meet  at the rendezvous
   point.", id)
                 }
         case 5:
                 {
                  radio4_result  ("com_followcom.wav", "Okay team, follow
   my command.", id)
                 }
         case 6:
                 {
                  radio4_result  ("getout.wav",  "Team,  let's get out of
   here!", id)
                 }
         case 7:
                 {
                  radio4_result  ("moveout.wav",  "All  right, let's move
   out!", id)
                 }
         case 8:
                 {
                  radio4_result ("matedown.wav", "Teammate down!", id)
                 }
        }
      return PLUGIN_HANDLED
     }
   public radio4_icon(id, player)
     {
      new i[3]
      message_begin( MSG_ONE , SVC_TEMPENTITY, i , player)
      write_byte(124)
      write_byte(id)
      write_coord(35)
      write_short(radiosprite)
      write_short(15)
      message_end()

      return PLUGIN_HANDLED
     }
   public plugin_precache()
     {
        radiosprite = precache_model("sprites/radio.spr")
     }
   public plugin_init()
     {
      register_plugin("Radio Unhidden","0.22","Downtown1")
      register_menucmd(register_menuid("\yRadio     Menu:    "),    1023,
   "radio4_execmenu")
      register_clcmd("radio4","radio4_showmenu",-1,"  - shows a menu of a
   hidden CS radio commands")
      return PLUGIN_CONTINUE
     }
