How to stop sound id 1185
#1

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;

Reply
#2

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.
Reply
#3

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"},
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)