Raised This Month: $ Target: $400
 0% 

Problem with end round sound


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Milki
New Member
Join Date: May 2013
Old 05-17-2013 , 07:17   Re: Problem with end round sound
Reply With Quote #4

Quote:
Originally Posted by Shooting King View Post
Change
PHP Code:
new rand random_num(1,16
To
PHP Code:
new rand random_num(1,3
because you have only written code for rand = 1, 2, 3.
What do you think will happen if the rand is not equal to 1, 2, 3 i.e 11, 10, 14 ??
sorry for the double, but the sound still not plays..
the new code:
PHP Code:
#include <amxmodx>

public plugin_init() 

  
register_plugin("RoundSound","1.0","FastPanel")
  
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,3)

  
client_cmd(0,"stopsound")

  switch(
rand)
  {
    case 
1client_cmd(0,"spk misc/rs4")
    case 
2client_cmd(0,"spk misc/rs5")
    case 
3client_cmd(0,"spk misc/rs6")
  }

  return 
PLUGIN_HANDLED
}

public 
ct_win()
{
  new 
rand random_num(1,3)

  
client_cmd(0,"stopsound")

  switch(
rand)
  {
    case 
1client_cmd(0,"spk misc/rs1")
    case 
2client_cmd(0,"spk misc/rs2")
    case 
3client_cmd(0,"spk misc/rs3")
  }

  return 
PLUGIN_HANDLED
}

public 
plugin_precache() 
{
  
precache_sound("misc/rs1.wav")
  
precache_sound("misc/rs2.wav")
  
precache_sound("misc/rs3.wav")
  
precache_sound("misc/rs4.wav")
  
precache_sound("misc/rs5.wav")
  
precache_sound("misc/rs6.wav")
  return 
PLUGIN_CONTINUE

ty..
Milki is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:21.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode