Sound

StopMicrophone

Sound.StopMicrophone( );

[EN] Used to stop Sound.PlayMicrophone. [RU] Π˜ΡΠΏΠΎΠ»ΡŒΠ·ΡƒΠ΅Ρ‚ΡΡ для остановки Π·Π²ΡƒΠΊΠ°.

PlayMicrophone

Parameters: path (has to be full path)

Sound.PlayMicrophone(path);

[EN] Plays a sound on microphone. [RU] Воспроизводит Π·Π²ΡƒΠΊ Π² ΠΌΠΈΠΊΡ€ΠΎΡ„ΠΎΠ½.

Play

Parameters: path

If you place the sound in ot/scripts/ folder, you would call it as below script shows:

function playSoundOnKill()
{
    localplayer_index = Entity.GetLocalPlayer();
    attacker = Event.GetInt("attacker");
    attacker_index = Entity.GetEntityFromUserID(attacker);

    if (attacker_index == localplayer_index)
    {
        Sound.Play("C:\\Program Files (x86)\\Steam\\steamapps\\common\\Counter-Strike Global Offensive\\ot\\scripts\\headshot.wav");
    }

}

Cheat.RegisterCallback("player_death", "playSoundOnKill");

[EN] Plays a sound. [RU] Воспроизводит Π·Π²ΡƒΠΊ.

Last updated