Help needed - 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: Help needed (
/showthread.php?tid=353695)
Help needed -
Mr.1337 - 24.06.2012
Alright so, I'm working on my own stereo system. I've created commands to place/destroy stereos. The question I want to ask is.. How can I play AudioStream using this object? for example, the object is a boombox/stereo. Now, I want the music to be hear-able to the players around the boombox, how's that possible?
Thanks in advance!
Re: Help needed -
Jstylezzz - 24.06.2012
Well, make it like they can't do the command if thet are not in range of the object, and when they do the command, and it succeeds, then use the coords of the object and usepos = 1 of the playaudiostreamforplayer function, then set the range e.t.c
Something like this:
pawn Код:
CMD:stereoon(playerid,params[])
{
if(/*check if he is in rnage of object here*/)
{
PlayAudioStreamForPlayer(playerid,URL[],X,Y,Z,15.0,1);
}
return 1;
}
Re: Help needed -
Mr.1337 - 24.06.2012
Alright thanks, now the question is.. How can I make that when they go far away, they hear the music lower, and once they are close to the object they hear it loudly?
Re: Help needed -
Jstylezzz - 24.06.2012
Quote:
Originally Posted by Mr.1337
Alright thanks, now the question is.. How can I make that when they go far away, they hear the music lower, and once they are close to the object they hear it loudly?
|
It does that automatically when you use the usepos settings.
I made a example command in my edit