new OneTimeOnly[MAX_PLAYERS];
public OnPlayerUpdate(playerid)
{
if(OneTimeOnly[playerid] == 0)
{
if(IsPlayerConnected(playerid) && IsPlayerInRangeOfPoint(playerid, range, x, y, z))
{
PlayAudioStreamForPlayer(playerid, www.music.com);
OneTimeOnly[playerid] = 1;
}
}
return 1;
}
#include <a_samp>
new OneTimeOnly[MAX_PLAYERS];
public OnPlayerUpdate(playerid)
{
if(OneTimeOnly[playerid] == 0)
{
if(IsPlayerConnected(playerid) && IsPlayerInRangeOfPoint(playerid, 20.0, x, y, z)
{
PlayAudioStreamForPlayer(playerid, "link");
OneTimeOnly[playerid] = 1;
}
else
{
StopAudioStreamForPlayer(playerid);
}
if(IsPlayerConnected(playerid) && IsPlayerInRangeOfPoint(playerid, 20.0, x, y, z))
{
PlayAudioStreamForPlayer(playerid, "link");
OneTimeOnly[playerid] = 1;
}
if(IsPlayerConnected(playerid) && IsPlayerInRangeOfPoint(playerid, 20.0, x, y, z)
{
PlayAudioStreamForPlayer(playerid, "link");
OneTimeOnly[playerid] = 1;
}
if(IsPlayerConnected(playerid) && IsPlayerInRangeOfPoint(playerid, 20.0, x, y, z)
{
PlayAudioStreamForPlayer(playerid, "link");
OneTimeOnly[playerid] = 1;
}
if(IsPlayerConnected(playerid) && IsPlayerInRangeOfPoint(playerid, 20.0, x, y, z))
{
PlayAudioStreamForPlayer(playerid, "link");
OneTimeOnly[playerid] = 1;
}
}
return 1;
}
|
Try doing it with the dynamic area feature of the streamer plugin. OnPlayerUpdate doesn't seem quite fit for this purpose.
|