SA-MP Forums Archive
PlayAudioSteamForPlayer 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: PlayAudioSteamForPlayer Question (/showthread.php?tid=311336)



PlayAudioSteamForPlayer Question - ShawnMiller1337 - 16.01.2012

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 ?


Re: PlayAudioSteamForPlayer Question - nmader - 16.01.2012

I would put it at the top of your script, and use something like:
pawn Код:
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!


Re: PlayAudioSteamForPlayer Question - ShawnMiller1337 - 16.01.2012

Quote:
Originally Posted by nmader
Посмотреть сообщение
I would put it at the top of your script, and use something like:
pawn Код:
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!
Hmm where would I put it in my script tho ?


Re: PlayAudioSteamForPlayer Question - nmader - 16.01.2012

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)


Re: PlayAudioSteamForPlayer Question - ShawnMiller1337 - 16.01.2012

Quote:
Originally Posted by nmader
Посмотреть сообщение
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

pawn Код:
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 ?


Re: PlayAudioSteamForPlayer Question - jamesbond007 - 17.01.2012

pawn Код:
public OnPlayerInteriorChange(playerid,newinteriorid,oldinteriorid)
{
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