SA-MP Forums Archive
How to stop sound id 1185 - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to stop sound id 1185 (/showthread.php?tid=651988)



How to stop sound id 1185 - 3417512908 - 01.04.2018

Hi guys
I use PlayerPlaySound(playerid,1185,0,0,0); on public OnPlayerConnect(playerid)
It is login music.But I don`t know how to stop it. Always cycle...
I tried use PlayerPlaySound(playerid, 0, 0.0, 0.0, 0.0);. But it does not work...
PHP код:
public OnPlayerConnect(playerid)
{
    
SetPlayerVirtualWorld(playerid999);
    
SetTimerEx("Login"3000false"i"playerid);
    new 
string[128], pName[MAX_PLAYER_NAME];
    
GetPlayerName(playeridpNameMAX_PLAYER_NAME);
    
format(stringsizeof(string), "{E0FFFF}* %s 进服!",pName);
    
PlayerPlaySound(playerid,1185,0,0,0);//this
    
SendClientMessageToAll(playeridstring);
    return 
1;

PHP код:
public OnPlayerSpawn(playerid)
{
    
PlayerPlaySound(playerid00.00.00.0);
    return 
1;




Re: How to stop sound id 1185 - kovac - 01.04.2018

There isn't a way to stop a sound as far as I know. You have to wait for sound to stop playing or simply remove/replace it.


Re: How to stop sound id 1185 - Maxandmov - 02.04.2018

There is a way to stop the sound, kovac is wrong.
Next time you have an issue with sounds you might want to direct sounds array here.
What I noticed myself is that if it's a looped sound, usually soundID+1 is the one to disable this looping sound.

It applies for your audio, too. Here's the quote from sounds array list I mentioned above:
Код:
{1185, !"", !"Bike school music"},
{1186, !"", !"Stop bike schoool music"},