SA-MP Forums Archive
Audio play (loops) [Audio plugin] - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Audio play (loops) [Audio plugin] (/showthread.php?tid=277073)



Audio play (loops) [Audio plugin] - Amine_Mejrhirrou - 16.08.2011

i have a small problem with Audio_Play funtion
i don't know how to stop the loops
any one can help me !
i would like to make the audio play loops 8 time then stop them


Re: Audio play (loops) [Audio plugin] - [MG]Dimi - 16.08.2011

PHP Code:
new AudioPlayed;
AudioPlayed++;
if(
AudioPlayed == 8)
{
KillTimer or whatever you are using to repeat audio.
}
else
{
AudioPlayed++;
//play audio




Re : Audio play (loops) [Audio plugin] - Amine_Mejrhirrou - 16.08.2011

amm that's what i mad and don't work
i'm using a timer and a counter ! when the couter is on 60 the audio function is that
Code:
            for(new I = 0; I < MAX_PLAYERS; I++)
            {
                if(IsPlayerConnected(I)) 
                {
					Audio_Play(I, 23, false, true, false);
                    SetPlayerCheckpoint(I, 96.9595, 1920.3678, 17.0, 5.0);
					GameTextForPlayer(I,"~w~Run to ~r~the escort point~w~ before the explosion", 10000, 3);
                }
            }
and when the counter is on 100 that
Code:
            for(new I = 0; I < MAX_PLAYERS; I++)
            {
                if(IsPlayerConnected(I)) 
                {
					Audio_Stop(I, 23);
					DisablePlayerCheckpoint(I);
					SetPlayerCameraPos(I, 57.0130, 1904.2421, 29.7718);
					SetPlayerCameraLookAt(I, 57.8857, 1904.7380, 29.5418);
                }
            }



Re : Audio play (loops) [Audio plugin] - Amine_Mejrhirrou - 16.08.2011

so if i add somthing like
new X = 23 then
Audio_Play(I, X, false, true, false);
should work ?


- Amine_Mejrhirrou - 17.08.2011

thanks for helping me

works fine thank you again