Help with radio script?
#5

Quote:
Originally Posted by Jari_Johnson*
Посмотреть сообщение
In your script, add under the includes: new Laststream[MAX_PLAYERS];
Then, go to OnDialogResponse, and add the id of the case to laststream.
pawn Код:
if(response) {
        switch(dialogid == 2)
        {
            case 1: {
                switch(listitem)
                {
                    case 0: {
                        StopAudioStreamForPlayer(playerid);
                        PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
                        PlayAudioStreamForPlayer(playerid, "http://stream.profm.ro:8012/profm.mp3");
                        SendClientMessage(playerid,0x00FFFAFF,"ProFM");
                        Laststream[playerid] = 0;
                        return 1;
                    }
                    case 1: {
                        StopAudioStreamForPlayer(playerid);
                        PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
                        PlayAudioStreamForPlayer(playerid, "http://radiotaraf.no-ip.biz:7100");
                        SendClientMessage(playerid,0x00FFFAFF,"Radio Taraf");
                        Laststream[playerid] = 1;
                        return 1;
                    }
                    case 2: {
                        StopAudioStreamForPlayer(playerid);
                        PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
                        PlayAudioStreamForPlayer(playerid, "http://srv04.bigstreams.de/bigfm-mp3-64");
                        SendClientMessage(playerid,0x00FFFAFF,"BigFM");
                        Laststream[playerid] = 2;
                        return 1;
                    }
I showed the first 3 cases, just do the same for the remaining cases.
Then, under OnPlayerStateChange, add something like this:
pawn Код:
if(Laststream[playerid] == 0)
{
//Play the audio stream from case 0
}
if(Laststream[playerid] == 1)
{
//play the audio stream from case 1
}
And so on.
I hope you get what I mean :P
And that will save the radio on the car , right?
Also how can I make it so everyone inside the car can hear the radio?
Reply


Messages In This Thread
Help with radio script? - by yooMx - 16.03.2013, 12:28
Re: Help with radio script? - by Jstylezzz - 16.03.2013, 12:33
Re: Help with radio script? - by yooMx - 16.03.2013, 12:41
Re: Help with radio script? - by Jstylezzz - 16.03.2013, 12:50
Re: Help with radio script? - by yooMx - 16.03.2013, 12:55
Re: Help with radio script? - by Jstylezzz - 16.03.2013, 12:59
Re: Help with radio script? - by yooMx - 16.03.2013, 13:13
Re: Help with radio script? - by yooMx - 16.03.2013, 14:08
Re: Help with radio script? - by Jstylezzz - 16.03.2013, 14:11
Re: Help with radio script? - by yooMx - 16.03.2013, 14:16

Forum Jump:


Users browsing this thread: 1 Guest(s)