04.02.2014, 12:47
Hey, i dont know how to make something like that. If player is in range of point it's streaming music for him. It's same like boombox but without commands. Anyone know how to do that?
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; }