SA-MP Forums Archive
PlayAudioStream (OnPlayerRequestClass) Problem! - 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: PlayAudioStream (OnPlayerRequestClass) Problem! (/showthread.php?tid=629215)



PlayAudioStream (OnPlayerRequestClass) Problem! - adri[4]Life - 22.02.2017

Hi Guys I Have this Problem I've Added PlayAudioStreamForPlayer in OnPlayerRequestClass
The Problem in Class Selection when i Press the (right or left ) Button the SoundTrack Restart Again and The Server re-send me that Message "Audio Stream (and the link"
here is my Code :
Код:
public OnPlayerRequestClass(playerid, classid)
{
PlayAudioStreamForPlayer(playerid,"http://k003.kiwi6.com/hotlink/qz3op23ky2/Conflict_Desert_Storm_2__Menu_theme.mp3");
i Put it in the top of this variable then the cases and cam pos and player pos ....


Re: PlayAudioStream (OnPlayerRequestClass) Problem! - jlalt - 22.02.2017

Use a var and set it to 1 when runned song and check if its 0 before running song...
PHP код:
new runned_song[MAX_PLAYERS char]; // at top
// on p connect
runned_song{playerid} = 0;
//on req class
if(runned_song{playerid} == 0)
{
    
Run song
    runned_song
{playerid} = 1;
}
//on spawn
runned_song{playerid} = 0
Hope you got it. I can not explain well as I am on phone now.


Re: PlayAudioStream (OnPlayerRequestClass) Problem! - adri[4]Life - 22.02.2017

Quote:
Originally Posted by jlalt
Посмотреть сообщение
Use a var and set it to 1 when runned song and check if its 0 before running song...
PHP код:
new runned_song[MAX_PLAYERS char]; // at top
// on p connect
runned_song{playerid} = 0;
//on req class
if(runned_song{playerid} == 0)
{
    
Run song
    runned_song
{playerid} = 1;
}
//on spawn
runned_song{playerid} = 0
Hope you got it. I can not explain well as I am on phone now.
Thanks Very Much it works