PlayAudioStreamForPlayer Help
#1

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!
Reply
#2

You should read the wiki...
https://sampwiki.blast.hk/wiki/PlayAudioStreamForPlayer

pawn Code:
PlayAudioStreamForPlayer(playerid, "http://somafm.com/tags.pls", X, Y, Z, Distance, 1);
with...
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Use it OnPlayerUpdate or with a timer.
Good Luck!
Reply
#3

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;
}

Reply
#4

Quote:
Originally Posted by _chimera_
View Post
try this I have not tested
You are quite near otherwise you can also use IsPlayerInTheRangeOfPoint(playerid,...
Reply
#5

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 ..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)