01.10.2012, 14:12
Hey guys, I'm trying to stream some sounds when a player enters a specific area but each time I go to the area it crashes my game as soon as the audio file starts to play. What I have is below, any help would be great!
pawn Код:
#include <a_samp>
new MusicCheck;
public OnPlayerConnect(playerid)
{
MusicCheck = SetTimer("StartMusic", 1000, 1);
return 1;
}
forward StartMusic();
public StartMusic()
{
for(new i=0; i < MAX_PLAYERS; i++)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(i, X, Y, Z);
if(IsPlayerInRangeOfPoint(i, 60, -2805.3826,-1525.0806,139.7182))
{
new Float:Distance = 60;
PlayAudioStreamForPlayer(i, "http://ft.dtupload.com/Uo/Dark_Ambient.mp3", X, Y, Z, Distance, 1);
KillTimer(MusicCheck);
}
}
}