.sma:
#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(id)
{
new rand = random_num(0,2)
client_cmd(id,"stopsound")
switch(rand)
{
case 0: client_cmd(id,"spk misc/1")
case 1: client_cmd(id,"spk misc/2")
case 2: client_cmd(id,"spk misc/3")
case 3: client_cmd(id,"spk misc/4")
}
return PLUGIN_HANDLED
}
public ct_win(id)
{
new rand = random_num(0,2)
client_cmd(id,"stopsound")
switch(rand)
{
case 0: client_cmd(id,"spk misc/5")
case 1: client_cmd(id,"spk misc/6")
case 2: client_cmd(id,"spk misc/7")
case 3: client_cmd(id,"spk misc/8")
}
return PLUGIN_HANDLED
}
public plugin_precache()
{
precache_sound("misc/1.mp3")
precache_sound("misc/2.mp3")
precache_sound("misc/3.mp3")
precache_sound("misc/4.mp3")
precache_sound("misc/5.wav")
precache_sound("misc/6.mp3")
precache_sound("misc/7.mp3")
precache_sound("misc/8.mp3")
return PLUGIN_CONTINUE
}


Dodatki SourceMod












