#include <amxmodx>
#include <reapi>

#define SoundDuration 20.0 /* Ses kac saniye ise buraya onu yazin */

new const g_szAmbienceSoundFile[] = "Ambience.wav"; /* sound/Ambience.wav */

new bool:gFirst;

public plugin_init()
{
    register_plugin("Ambience Sound", "0.1", "LyNcH");

    RegisterHookChain(RG_CSGameRules_RestartRound, "RestartRound", .post = false);
}

public plugin_precache()
{
    precache_sound(g_szAmbienceSoundFile);
}

public RestartRound()
{
    if(!gFirst)
    {
        gFirst = true;

        rg_send_audio(0, g_szAmbienceSoundFile, PITCH_NORM);

        set_task(SoundDuration, "PlaySound", .flags = "b");
    } 
}

public PlaySound()
{
    rg_send_audio(0, g_szAmbienceSoundFile, PITCH_NORM);
}