PDA

View Full Version : PlayAudioSteamForPlayer Question


ShawnMiller1337
16/01/2012, 07:14 AM
Would it be possible if a player is within a certain area such as a x.y.z without having to type a command to engage the PlayAudioSteamForPlayer ? Example.... Let's say I enter the interior of jizzy's club how would I make it start PlayAudioSteamForPlayer ? What would it go under ?

nmader
16/01/2012, 07:26 AM
I would put it at the top of your script, and use something like:
If(IsPlayerInRangeOfPoint(playerid, X Cord, Y Cord, Z Cord);
{
//Your Audio stream file shit
}
else
{
//Stopping the Audio Stream File once your leave the area
}

If I helped, feel free to rep me!:D

ShawnMiller1337
16/01/2012, 07:31 AM
I would put it at the top of your script, and use something like:
If(IsPlayerInRangeOfPoint(playerid, X Cord, Y Cord, Z Cord);
{
//Your Audio stream file shit
}
else
{
//Stopping the Audio Stream File once your leave the area
}

If I helped, feel free to rep me!:D

Hmm where would I put it in my script tho ?

nmader
16/01/2012, 07:42 AM
I personally, would stick it under all your defines, as I don't believe it falls under any callback, so near the top, above on GameModeInit. (or FilterScriptInit if you are making it a filterscript)

ShawnMiller1337
16/01/2012, 11:06 PM
I personally, would stick it under all your defines, as I don't believe it falls under any callback, so near the top, above on GameModeInit. (or FilterScriptInit if you are making it a filterscript)

I put this on my OnGameModeInit


foreach(Player, i)
{
if(IsPlayerInRangeOfPoint(i, 30.0, -2062.4739,487.5359,139.7422))
{
PlayAudioStreamForPlayer(i, "http://ifitsgood.files.wordpress.com/2008/05/16-come-fly-with-me.mp3");
}
}


Whats wrong with this ?

jamesbond007
17/01/2012, 02:20 AM
public OnPlayerInteriorChange(playerid,newinteriorid,oldi nteriorid)
{
if(newinteriorid==/*[Enter Jezzy's interior here]*/)
{
PlayAudioStreamForPlayer(playerid, "http://ifitsgood.files.wordpress.com/2008/05/16-come-fly-with-me.mp3");
}
return 1;
}


then do when oldinteriorid == Jezzy's do Stop player Audio