03.03.2014, 17:16
The error here is that the stream is played regardless if it's already playing or not.
pawn Код:
new isPlaying[MAX_PLAYERS] = {0,...};
public OnPlayerUpdate(playerid)
{
if(GetPlayerInterior(playerid) == 6 && !isPlaying[playerid]) {
PlayAudioStreamForPlayer(playerid, "http://www.pamp3.site40.net/quake/doublekill.mp3", 2554.4253, 1417.2795, 7703.7041, 50.0, 1);
isPlaying[playerid] = 1;
}
else {
StopAudioStreamForPlayer(playerid);
isPlaying[playerid] = 0;
}
return 1;
}