SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 21/11/2012, 08:21 PM   #1
KingyKings
Big Clucker
 
Join Date: Aug 2011
Posts: 143
Reputation: 11
Default PlayAudioStreamForPlayer Help

Hi,

I want it so when the player goes near a point it will automatically play the music..

I put this under OnPlayerConnect but it just plays it where ever the player is.

Quote:
PlayAudioStreamForPlayer(playerid, "PlayAudioStreamForPlayer(playerid, "http://lackofstyle.com/mp3s/bing_lookalotlikexmas.mp3",1478.8761,-1666.3502,14.5532, 50.0, 0);",1478.8761,-1666.3502,14.5532, 50.0, 0);
Hmm, i know clearly im doing something wrong because it wouldn't make sense anyway in the script.

But can you help me? I would much appritiate it!
__________________
If you help me i always Rep


If I help you please rep <3
KingyKings is offline   Reply With Quote
Old 21/11/2012, 08:25 PM   #2
ScRaT
Big Clucker
 
ScRaT's Avatar
 
Join Date: Oct 2010
Location: Portugal
Posts: 122
Reputation: 78
Default Re: PlayAudioStreamForPlayer Help

You should read the wiki...
http://wiki.sa-mp.com/wiki/PlayAudioStreamForPlayer

pawn Code:
PlayAudioStreamForPlayer(playerid, "http://somafm.com/tags.pls", X, Y, Z, Distance, 1);
with...
http://wiki.sa-mp.com/wiki/IsPlayerInRangeOfPoint
Use it OnPlayerUpdate or with a timer.
Good Luck!
ScRaT is offline   Reply With Quote
Old 22/11/2012, 03:16 PM   #3
_chimera_
Big Clucker
 
_chimera_'s Avatar
 
Join Date: Feb 2012
Location: Nerito Di Crognaleto
Posts: 53
Reputation: 7
Default Re: PlayAudioStreamForPlayer Help

try this I have not tested

Quote:


public OnPlayerUpdate(playerid)
{
If(GetPlayerPos(playerid ,x,y,z) PlayAudioStreamForPlayer(playerid, "http://somafm.com/tags.pls");
return 1;
}
_chimera_ is offline   Reply With Quote
Old 22/11/2012, 03:17 PM   #4
-=Dar[K]Lord=-
Huge Clucker
 
-=Dar[K]Lord=-'s Avatar
 
Join Date: Oct 2012
Posts: 351
Reputation: 48
Default Re: PlayAudioStreamForPlayer Help

Quote:
Originally Posted by _chimera_ View Post
try this I have not tested
You are quite near otherwise you can also use IsPlayerInTheRangeOfPoint(playerid,...
__________________
Discussion is an exchange of knowledge; argument is an exchange of ignorance...- Robert Quillen

At times, it is better to keep your mouth shut and let people wonder if you are a fool than to open it and remove all their doubts - James Sinelair
-=Dar[K]Lord=- is offline   Reply With Quote
Old 22/11/2012, 03:29 PM   #5
_chimera_
Big Clucker
 
_chimera_'s Avatar
 
Join Date: Feb 2012
Location: Nerito Di Crognaleto
Posts: 53
Reputation: 7
Default Re: PlayAudioStreamForPlayer Help

Quote:
Originally Posted by -=Dar[K]Lord=- View Post
You are quite near otherwise you can also use IsPlayerInTheRangeOfPoint(playerid,...
I never used that function ..
_chimera_ is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[HELP] PlayAudioStreamForPlayer jamax Scripting Help 4 04/06/2012 10:07 AM
PlayAudioStreamForPlayer mati233 Scripting Help 4 01/06/2012 04:08 PM
PlayAudioStreamForPlayer Help! ShawnMiller1337 Scripting Help 3 05/01/2012 07:01 PM
PlayAudioStreamForPlayer help N0FeaR Scripting Help 5 30/12/2011 12:24 AM


All times are GMT. The time now is 07:29 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.