#include <amxmodx>

public plugin_init() 
{ 
  register_plugin("RoundSound","1.0","PaintLancer")
  register_event("SendAudio", "t_win", "a", "2&%!MRAD_terwin")
  register_event("SendAudio", "ct_win", "a", "2&%!MRAD_ctwin")  
}

public t_win()
{
  new rand = random_num(1,27)

  client_cmd(0,"stopsound")

  switch(rand)
  {
    case 1: client_cmd(0,"spk misc/t-SoundTooN-1")
    case 2: client_cmd(0,"spk misc/t-SoundTooN-2")
    case 3: client_cmd(0,"spk misc/t-SoundTooN-3")
    case 4: client_cmd(0,"spk misc/t-SoundTooN-4")
    case 5: client_cmd(0,"spk misc/t-SoundTooN-5")
    case 6: client_cmd(0,"spk misc/t-SoundTooN-6")
    case 7: client_cmd(0,"spk misc/t-SoundTooN-7")
    case 8: client_cmd(0,"spk misc/t-SoundTooN-8")
    case 9: client_cmd(0,"spk misc/t-SoundTooN-9")
    case 10:client_cmd(0,"spk misc/t-SoundTooN-10")
    case 11:client_cmd(0,"spk misc/t-SoundTooN-11")
    case 12:client_cmd(0,"spk misc/t-SoundTooN-12")
    case 13:client_cmd(0,"spk misc/t-SoundTooN-13")
    case 14:client_cmd(0,"spk misc/t-SoundTooN-14")
    case 15:client_cmd(0,"spk misc/t-SoundTooN-15")
    case 16:client_cmd(0,"spk misc/t-SoundTooN-16")
    case 17:client_cmd(0,"spk misc/t-SoundTooN-17")
    case 18:client_cmd(0,"spk misc/t-SoundTooN-18")
    case 19:client_cmd(0,"spk misc/t-SoundTooN-19")
    case 20:client_cmd(0,"spk misc/t-SoundTooN-20")
    case 21:client_cmd(0,"spk misc/t-SoundTooN-21")
    case 22:client_cmd(0,"spk misc/t-SoundTooN-22")
    case 23:client_cmd(0,"spk misc/t-SoundTooN-23")
    case 24:client_cmd(0,"spk misc/t-SoundTooN-24")
    case 25:client_cmd(0,"spk misc/t-SoundTooN-25")
    case 26:client_cmd(0,"spk misc/t-SoundTooN-26")
    case 27:client_cmd(0,"spk misc/t-SoundTooN-27")
  }

  return PLUGIN_HANDLED
}

public ct_win()
{
  new rand = random_num(1,26)

  client_cmd(0,"stopsound")

  switch(rand)
  {
    case 1: client_cmd(0,"spk misc/ct-SoundTooN-1")
    case 2: client_cmd(0,"spk misc/ct-SoundTooN-2")
    case 3: client_cmd(0,"spk misc/ct-SoundTooN-3")
    case 4: client_cmd(0,"spk misc/ct-SoundTooN-4")
    case 5: client_cmd(0,"spk misc/ct-SoundTooN-5")
    case 6: client_cmd(0,"spk misc/ct-SoundTooN-6")
    case 7: client_cmd(0,"spk misc/ct-SoundTooN-7")
    case 8: client_cmd(0,"spk misc/ct-SoundTooN-8")
    case 9: client_cmd(0,"spk misc/ct-SoundTooN-9")
    case 10:client_cmd(0,"spk misc/ct-SoundTooN-10")
    case 11:client_cmd(0,"spk misc/ct-SoundTooN-11")
    case 12:client_cmd(0,"spk misc/ct-SoundTooN-12")
    case 13:client_cmd(0,"spk misc/ct-SoundTooN-13")
    case 14:client_cmd(0,"spk misc/ct-SoundTooN-14")
    case 15:client_cmd(0,"spk misc/ct-SoundTooN-15")
    case 16:client_cmd(0,"spk misc/ct-SoundTooN-16")
    case 17:client_cmd(0,"spk misc/ct-SoundTooN-17")
    case 18:client_cmd(0,"spk misc/ct-SoundTooN-18")
    case 19:client_cmd(0,"spk misc/ct-SoundTooN-19")
    case 20:client_cmd(0,"spk misc/ct-SoundTooN-20")
    case 21:client_cmd(0,"spk misc/ct-SoundTooN-21")
    case 22:client_cmd(0,"spk misc/ct-SoundTooN-22")
    case 23:client_cmd(0,"spk misc/ct-SoundTooN-23")
    case 24:client_cmd(0,"spk misc/ct-SoundTooN-24")
    case 25:client_cmd(0,"spk misc/ct-SoundTooN-25")
    case 26:client_cmd(0,"spk misc/ct-SoundTooN-26")
  }

  return PLUGIN_HANDLED
}

public plugin_precache() 
{
  precache_sound("misc/ct-SoundTooN-1.wav")
  precache_sound("misc/ct-SoundTooN-2.wav")
  precache_sound("misc/ct-SoundTooN-3.wav")
  precache_sound("misc/ct-SoundTooN-4.wav")
  precache_sound("misc/ct-SoundTooN-5.wav")
  precache_sound("misc/ct-SoundTooN-6.wav")
  precache_sound("misc/ct-SoundTooN-7.wav")
  precache_sound("misc/ct-SoundTooN-8.wav")
  precache_sound("misc/ct-SoundTooN-9.wav")
  precache_sound("misc/ct-SoundTooN-10.wav")
  precache_sound("misc/ct-SoundTooN-11.wav")
  precache_sound("misc/ct-SoundTooN-12.wav")
  precache_sound("misc/ct-SoundTooN-13.wav")
  precache_sound("misc/ct-SoundTooN-14.wav")
  precache_sound("misc/ct-SoundTooN-15.wav")
  precache_sound("misc/ct-SoundTooN-16.wav")
  precache_sound("misc/ct-SoundTooN-17.wav")
  precache_sound("misc/ct-SoundTooN-18.wav")
  precache_sound("misc/ct-SoundTooN-19.wav")
  precache_sound("misc/ct-SoundTooN-20.wav")
  precache_sound("misc/ct-SoundTooN-21.wav")
  precache_sound("misc/ct-SoundTooN-22.wav")
  precache_sound("misc/ct-SoundTooN-23.wav")
  precache_sound("misc/ct-SoundTooN-24.wav")
  precache_sound("misc/ct-SoundTooN-25.wav")
  precache_sound("misc/ct-SoundTooN-26.wav")
  precache_sound("misc/t-SoundTooN-1.wav")
  precache_sound("misc/t-SoundTooN-2.wav")
  precache_sound("misc/t-SoundTooN-3.wav")
  precache_sound("misc/t-SoundTooN-4.wav")
  precache_sound("misc/t-SoundTooN-5.wav")
  precache_sound("misc/t-SoundTooN-6.wav")
  precache_sound("misc/t-SoundTooN-7.wav")
  precache_sound("misc/t-SoundTooN-8.wav")
  precache_sound("misc/t-SoundTooN-9.wav")    
  precache_sound("misc/t-SoundTooN-10.wav")
  precache_sound("misc/t-SoundTooN-11.wav")
  precache_sound("misc/t-SoundTooN-12.wav")
  precache_sound("misc/t-SoundTooN-13.wav")
  precache_sound("misc/t-SoundTooN-14.wav")
  precache_sound("misc/t-SoundTooN-15.wav")
  precache_sound("misc/t-SoundTooN-16.wav")
  precache_sound("misc/t-SoundTooN-17.wav")
  precache_sound("misc/t-SoundTooN-18.wav")
  precache_sound("misc/t-SoundTooN-19.wav")
  precache_sound("misc/t-SoundTooN-20.wav")
  precache_sound("misc/t-SoundTooN-21.wav")
  precache_sound("misc/t-SoundTooN-22.wav")
  precache_sound("misc/t-SoundTooN-23.wav")
  precache_sound("misc/t-SoundTooN-24.wav")
  precache_sound("misc/t-SoundTooN-25.wav")
  precache_sound("misc/t-SoundTooN-26.wav")
  precache_sound("misc/t-SoundTooN-27.wav")

  return PLUGIN_CONTINUE
}
