Help ambiental music
#1

public OnPlayerUpdate(playerid)
{
if (IsPlayerInRangeOfPoint(playerid, 10.0, -261.05, 2227.15, 58.45))
{
PlayAudioStreamForPlayer(playerid, "http://k003.kiwi6.com/hotlink/wos3db6jxt/The_XFiles_Theme.mp3",-261.05, 2227.15, 58.45, 2000.0, 1);
}
}
return 1;
}



When I'm at the point , the music start of many times


You can create a script that makes sure that when you're over there begins the music ?
Reply
#2

Код:
new PlayingMusic[MAX_PLAYERS];

public OnPlayerUpdate(playerid)
{
	if(IsPlayerInRangeOfPoint(playerid, 10.0, -261.05, 2227.15, 58.45) && !PlayingMusic[playerid])
	{
		PlayingMusic[playerid] = 1;
		PlayAudioStreamForPlayer(playerid, "http://k003.kiwi6.com/hotlink/wos3db6jxt/The_XFiles_Theme.mp3",-261.05, 2227.15, 58.45, 2000.0, 1);
	}
	
	return 1;
}
Of course you'll need to reset PlayingMusic[playerid] to 0 when the music stops playing. You could maybe use a timer for that.
Reply
#3

thank you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)