Audio Streaming
#1

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");
                        }
Reply
#2

Anyone ?? any idea ?
Reply
#3

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)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)