05.05.2012, 16:56
IsPlayerInRangeOfPoint has a set x,y,z
you should use the ones in your function xx, yy, zz
I removed the playerid argument as your looping threw all the players,
you should use the ones in your function xx, yy, zz
pawn Код:
forward PlayAudioStreamForPoint(url[], Float:range, Float:xx, Float:yy, Float:zz);
public PlayAudioStreamForPoint(url[], Float:range, Float:xx, Float:yy, Float:zz)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInRangeOfPoint(i, range, xx,yy,zz))
{
PlayAudioStreamForPlayer(i, url);
}
}
}
return 1;
}
//use it in a timer
SetTimerEx("PlayAudioStreamForPoint",1000,true,"sffff",url,xx,yy,zz);