#include <amxmodx>
#include <reapi>
new const Sounds[][] =
{
"elmusic4.wav",
"elmusic5.wav"
};
public plugin_init()
{
register_plugin("FreezeSound", "0.1", "LyNcH");
RegisterHookChain(RG_CSGameRules_RestartRound, "CSGameRules_RestartRound", .post = true);
RegisterHookChain(RG_CSGameRules_OnRoundFreezeEnd, "CSGameRules_OnRoundFreezeEnd", .post = true);
}
public plugin_precache()
{
for(new i = 0; i < sizeof(Sounds); i++)
{
precache_sound(Sounds[i]);
}
}
public CSGameRules_RestartRound()
{
new random = random_num(0,1);
random ? rg_send_audio(0, Sounds[0], PITCH_NORM):rg_send_audio(0, Sounds[1], PITCH_NORM);
}
public CSGameRules_OnRoundFreezeEnd()
{
for(new i = 0; i <= MaxClients; i++)
{
client_cmd(i, "stopsound");
}
}