SA-MP Forums Archive
Question - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Question (/showthread.php?tid=514851)



Question - JakeHunter1 - 23.05.2014

How can i make a song to be heard only in one region ?


Re : Question - S4t3K - 23.05.2014

PlayAudioStreamForPlayer with the parameters distance, and range.

Such as

PHP код:

for(new 0MAX_PLAYERSp++)
{
      if(!
IsPlayerConnected(p)) continue;
      
PlayAudioStreamForPlayer(i"your_sound_url"0.00.00.020.01);

Will play a sound for all the players in range of 20 unities from the center of the map (blueberry farm)


Re: Question - RajatPawar - 23.05.2014

https://sampwiki.blast.hk/wiki/PlayAudioStreamForPlayer

If you look closely at the parameters -



The 3rd, 4th and 5th parameters are the co-ordinates where you'd like the song to be heard, the 6th param is the distance & the 7th should be 'true' when you WANT to play it at the co-ordinates. (Make sure usepos IS true if you want the effect to even take place)

EDIT: Late


Re: Re : Question - JakeHunter1 - 23.05.2014

Quote:
Originally Posted by S4t3K
Посмотреть сообщение
PlayAudioStreamForPlayer with the parameters distance, and range.

Such as

PHP код:

for(new 0MAX_PLAYERSp++)
{
      if(!
IsPlayerConnected(p)) continue;
      
PlayAudioStreamForPlayer(i"your_sound_url"0.00.00.020.01);

Will play a sound for all the players in range of 20 unities from the center of the map (blueberry farm)
ty bro