Stock Music - 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: Stock Music (
/showthread.php?tid=347897)
Stock Music -
Victim - 03.06.2012
Is there a way to play the music that came with the game (Car radio) when someone enters an area? I've found something called PlayAudioStreamForPlayer, but I can't figure it out.
Re: Stock Music -
Sandiel - 03.06.2012
Easy, very easy
pawn Код:
public OnGameModeInit()
{
SetTimer("Music", 1000, true);
return 1;
}
forward Music();
public Music()
{
for(new i = 0; i < MAX_PLAYERS; i++)
if(IsPlayerInRangeOfPoint(i, 5, x, y, z))
{
PlayAudioStreamForPlayer(i, URL, 0, 0, 0, 50.0, 0);
}
}
Change "x, y, z" to whatever you like....
Also change "URL" with the URL of the song (must be a .mp3 link)
And that's it, good luck, any issues, PM me.