AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] Stoping a particular sound? (https://forums.alliedmods.net/showthread.php?t=277733)

Depresie 01-15-2016 10:35

[HELP] Stoping a particular sound?
 
Is there any way to stop a particular sound from playing?
For example I created a countdown plugin which has background music, but there are special cases when the round begins earlier, and I would like to stop the countdown's background music when the round starts.. I know about stopsound, but afaik it will stop all the sounds

siriusmd99 01-15-2016 12:36

Re: [HELP] Stoping a particular sound?
 
Quote:

Originally Posted by Depresie (Post 2383519)
Is there any way to stop a particular sound from playing?
For example I created a countdown plugin which has background music, but there are special cases when the round begins earlier, and I would like to stop the countdown's background music when the round starts.. I know about stopsound, but afaik it will stop all the sounds

Look here:

PHP Code:

#define STOP_SOUND_WAV  0
#define STOP_SOUND_MP3  1
#define STOP_SOUND_ALL  2
  
stock StopSound(pIdiType STOP_SOUND_ALL)
{
        switch (
iType)
        {
                case 
STOP_SOUND_WAVclient_cmd(pId"stopsound");
                case 
STOP_SOUND_MP3client_cmd(pId"mp3 stop");
                case 
STOP_SOUND_ALLclient_cmd(pId"stopsound;mp3 stop");
        }
         
        return 
1;
 


If one sound is wav and another is mp3 then you can stop one of them particulary , but if they are both mp3 or wav then it's impossible.

Depresie 01-15-2016 13:38

Re: [HELP] Stoping a particular sound?
 
Ah.. I see, thanks for your answer :)


All times are GMT -4. The time now is 09:27.

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