22.02.2015, 19:52
pawn Код:
forward HouseAlarm();
public HouseAlarm()
{
foreach(i, Player)
{
if(NearAlarm[playerid] > 0 && HouseAlarm[NearAlarm[playerid]] == 1)
{
PlayAudioStreamForPlayer(i, "http://yourlisten.com/GrantAlexander/burglar-intruder-alarm-sound-effect", HouseEntX[NearAlarm[playerid]], HouseEntY[NearAlarm[playerid]], HouseEntZ[NearAlarm[playerid]], 50, 1);
}
if(NearAlarm[playerid] > 0 && HouseAlarm[NearAlarm[playerid]] == 2)
{
PlayAudioStreamForPlayer(i, "http://yourlisten.com/GrantAlexander/burglar-intruder-alarm-sound-effect", HouseEntX[NearAlarm[playerid]], HouseEntY[NearAlarm[playerid]], HouseEntZ[NearAlarm[playerid]], 100, 1);
}
if(NearAlarm[playerid] > 0 && HouseAlarm[NearAlarm[playerid]] == 3)
{
PlayAudioStreamForPlayer(i, "http://yourlisten.com/GrantAlexander/burglar-intruder-alarm-sound-effect", HouseEntX[NearAlarm[playerid]], HouseEntY[NearAlarm[playerid]], HouseEntZ[NearAlarm[playerid]], 150, 1);
}
}
}
How can I do it so I can make the sound play for any player when they are near the co-ordinates of the house without looping through all the players?