Audio Stream
#3

at your function you could try storing it in a variable like
pawn Code:
//Somewhere on top of your script
new IsPlayingAudio[MAX_PLAYERS];
//Where you have all your commands we make a command to start playing audio and we set the variable to 1 (true)
CMD:audio(playerid, params[])
{
     PlayAudioStreamForPlayer(playerid, "http://test.help");
     IsPlayingAudio[playerid] = 1;
     return 1;
}
//And we make a command to stop the audio and be set the variable to 0 (false)
CMD:stopaudio(playerid, params[])
{
     StopAudioStreamForPlayer(playerid);
     IsPlayingAudio[playerid] = 0;
     return 1;
}
//Then you can detect when the player is playing audio with something like this
public OnPlayerSpawn(playerid)
{
     if(IsPlayingAudio[playerid] = 1)//If the player is playing audio
     {
          SendClientMessage(playerid, -1, "type /stopaudio to stop listening to the music!"):
     }
     return 1;
}
Good luck!
Reply


Messages In This Thread
Audio Stream - by printer - 08.01.2014, 11:42
Re: Audio Stream - by offon - 08.01.2014, 11:48
Re: Audio Stream - by Voxel - 08.01.2014, 11:48

Forum Jump:


Users browsing this thread: 1 Guest(s)