27.12.2012, 20:12
Quote:
How about this loop ?
pawn Код:
|
PHP код:
if(!BoomboxStream[playerid])
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(Boombox[i])
{
if(IsPlayerInRangeOfPoint(playerid, 30, bpos[i][0], bpos[i][1], bpos[i][2]))
{
PlayAudioStreamForPlayer(playerid, BoomboxURL[i], bpos[i][0], bpos[i][1], bpos[i][2], 30, 1);
BoomboxPlayer[playerid] = i;
BoomboxStream[playerid] = 1;
SendClientMessage(playerid, COLOR_GREY, " You are listening to music coming out of a nearby boombox.");
}
}
}
}
}
else
{
new i = BoomboxPlayer[playerid];
if(!IsPlayerInRangeOfPoint(playerid, 30, bpos[i][0], bpos[i][1], bpos[i][2]))
{
BoomboxStream[playerid] = 0;
BoomboxPlayer[playerid] = -1;
StopAudioStreamForPlayer(playerid);
SendClientMessage(playerid, COLOR_GREY, " You have went far away from the boombox.");
}
}