SA-MP Forums Archive
Audio Streaming - 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: Audio Streaming (/showthread.php?tid=330077)



Audio Streaming - spd_sahil - 31.03.2012

If have a code something like this.. for audio streams.. now sometimes when im switching channels , i hear two streams.. but displays only for one.. and when enter command to completely stop streams.. i still hear the one which was stuck before.



pawn Код:
case 0:
                        {
                            for(new i;i<MAX_PLAYERS;i++)
                            {
                                if(IsPlayerConnected(i))
                                {
                                    StopAudioStreamForPlayer(i);
                                    PlayAudioStreamForPlayer(i,"http://somafm.com/tags.pls",-691.5498,934.7952,13.6328,25,1);
                                    Genre = 1;
                                }
                            }
                            SendClientMessage(playerid,COLOR_GREEN,"Radio Genre Activated");
                        }
                        case 1:
                        {
                            for(new i;i<MAX_PLAYERS;i++)
                            {
                                if(IsPlayerConnected(i))
                                {
                                    StopAudioStreamForPlayer(i);
                                    PlayAudioStreamForPlayer(i,"http://listen.di.fm/public3/dubstep.pls",-691.5498,934.7952,13.6328,25,1);
                                    Genre = 2;
                                }
                            }
                            SendClientMessage(playerid,COLOR_GREEN,"Radio Genre Activated");
                        }
                        case 2:
                        {
                            for(new i;i<MAX_PLAYERS;i++)
                            {
                                if(IsPlayerConnected(i))
                                {
                                    StopAudioStreamForPlayer(i);
                                    PlayAudioStreamForPlayer(i,"http://www.chronixradio.com/chronixaggression/listen/listen.pls",-691.5498,934.7952,13.6328,25,1);
                                    Genre = 3;
                                }
                            }
                            SendClientMessage(playerid,COLOR_GREEN,"Radio Genre Activated");
                        }
                        case 3:
                        {
                            for(new i;i<MAX_PLAYERS;i++)
                            {
                                if(IsPlayerConnected(i))
                                {
                                    StopAudioStreamForPlayer(i);
                                     PlayAudioStreamForPlayer(playerid,"http://www.defjay.de/listen.pls",-691.5498,934.7952,13.6328,25,1);
                                    Genre = 4;
                                }
                            }
                            SendClientMessage(playerid,COLOR_GREEN,"Radio Genre Activated");
                        }
                        case 4:
                        {
                            for(new i;i<MAX_PLAYERS;i++)
                            {
                                if(IsPlayerConnected(i))
                                {
                                    StopAudioStreamForPlayer(i);
                                     PlayAudioStreamForPlayer(playerid,"http://www.streamakaci.com/radios/4uclassicrock.asx",-691.5498,934.7952,13.6328,25,1);
                                    Genre = 4;
                                }
                            }
                            SendClientMessage(playerid,COLOR_GREEN,"Radio Genre Activated");
                        }
                        case 5:
                        {
                            for(new i;i<MAX_PLAYERS;i++)
                            {
                                if(IsPlayerConnected(i))
                                {
                                    StopAudioStreamForPlayer(i);
                                    PlayAudioStreamForPlayer(playerid,"http://www.acousticalternative.com/listen.pls",-691.5498,934.7952,13.6328,25,1);
                                    Genre = 4;
                                }
                            }
                            SendClientMessage(playerid,COLOR_GREEN,"Radio Genre Activated");
                        }



Re: Audio Streaming - spd_sahil - 31.03.2012

Anyone ?? any idea ?


Re: Audio Streaming - nmader - 31.03.2012

You should stop the stream before the next comes on, head to the SAMP wiki to find the exact code. (Don't use streaming too often)