[FilterScript] Radio Stations v1.1 - With Menus
#1

Well i originally released the first version here and as i'm am going through my old releases and updating them.

I updated this so it will be easier to use while in the vehicle.

When you are in your vehicle and want a radio station to listen to then just press the key 'N' and a menu will appear, then use the arrow keys to navigate the menu, once you have decided your choice then click the 'W' key and it will select it and you can continue on with what you was doing.

Notice: If you like my work +rep, comment and share.

Features
  • 11 Radio Stations
  • Radio turns off when exiting the vehicle
  • Passenger can hear the radio
  • Menus (not Dialogs)
Radio Stations
  • Dubstep FM
  • Capital FM
  • Pulse Radio
  • Radio Klass Romania
  • Its a Trap Radio
  • Russian Hits Radio
  • Madein Hits Radio
  • Absolute Hits Radio (France)
  • DnB Pirate Radio
  • I Love To Dance Radio
  • Electronic Playground Radio
Screenshot


Its quite a simple script and should be easy to edit the stations

Download:


How To:
Edit Radios:
Find
Код:
        AddMenuItem(Radio, 0, "Dubstep FM");
	AddMenuItem(Radio, 0, "Capital FM");
	AddMenuItem(Radio, 0, "Pulse Radio");
	AddMenuItem(Radio, 0, "Radio Klass Romania");
	AddMenuItem(Radio, 0, "Its a Trap Radio");
	AddMenuItem(Radio, 0, "Russian Hits Radio");
	AddMenuItem(Radio, 0, "Madein Hits Radio");
	AddMenuItem(Radio, 0, "Absolute Hits Radio");
	AddMenuItem(Radio, 0, "DnB Pirate Radio");
	AddMenuItem(Radio, 0, "I Love To Dance Radio");
	AddMenuItem(Radio, 0, "Electronic Playground Radio");
	AddMenuItem(Radio, 0, "Turn Off");
Replace
Код:
        AddMenuItem(Radio, 0, "REPLACE ME"); // case 0
	AddMenuItem(Radio, 0, "REPLACE ME"); // case 1
	AddMenuItem(Radio, 0, "REPLACE ME"); // case 2
	AddMenuItem(Radio, 0, "REPLACE ME"); // case 3
	AddMenuItem(Radio, 0, "REPLACE ME"); // case 4
	AddMenuItem(Radio, 0, "REPLACE ME"); // case 5
	AddMenuItem(Radio, 0, "REPLACE ME"); // case 6
	AddMenuItem(Radio, 0, "REPLACE ME"); // case 7
	AddMenuItem(Radio, 0, "REPLACE ME"); // case 8
	AddMenuItem(Radio, 0, "REPLACE ME"); // case 9
	AddMenuItem(Radio, 0, "REPLACE ME"); // case 10
	AddMenuItem(Radio, 0, "Turn Off"); // case 11
Now find under OnPlayerSelectedMenuRow
pawn Код:
case 0:
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_PASSENGER)
    {
        IsRadioOn[playerid] = true;
        PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=40568");
        SendClientMessage(playerid, -1, "You are tuned into Dubstep FM");
    }
}
case 1:
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_PASSENGER)
    {
        IsRadioOn[playerid] = true;
        PlayAudioStreamForPlayer(playerid, "http://media-ice.musicradio.com/CapitalMP3.m3u");
        SendClientMessage(playerid, -1, "You are tuned into Capital FM");
    }
}
case 2:
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_PASSENGER)
    {
        IsRadioOn[playerid] = true;
        PlayAudioStreamForPlayer(playerid, "http://icy3.abacast.com/pulse87-pulse87mp3-64");
        SendClientMessage(playerid, -1, "You are tuned into Pulse 87");
    }
}
case 3:
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_PASSENGER)
    {
        IsRadioOn[playerid] = true;
        PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=7581");
        SendClientMessage(playerid, -1, "You are tuned into Radio Klass Romania");
    }
}
case 4:
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_PASSENGER)
    {
        IsRadioOn[playerid] = true;
        PlayAudioStreamForPlayer(playerid, "http://dir.xiph.org/listen/3146548/listen.m3u");
        SendClientMessage(playerid, -1, "You are tuned into Its a Trap Radio");
    }
}
case 5:
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_PASSENGER)
    {
        IsRadioOn[playerid] = true;
        PlayAudioStreamForPlayer(playerid, "http://dir.xiph.org/listen/1891409/listen.m3u");
        SendClientMessage(playerid, -1, "You are tuned into Russian Hits Radio");
    }
}
case 6:
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_PASSENGER)
    {
        IsRadioOn[playerid] = true;
        PlayAudioStreamForPlayer(playerid, "http://dir.xiph.org/listen/3064006/listen.m3u");
        SendClientMessage(playerid, -1, "You are tuned into Madein Hits Radio");
    }
}
case 7:
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_PASSENGER)
    {
        IsRadioOn[playerid] = true;
        PlayAudioStreamForPlayer(playerid, "http://dir.xiph.org/listen/3367058/listen.m3u");
        SendClientMessage(playerid, -1, "You are tuned into Absolute Hits Radio");
    }
}
case 8:
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_PASSENGER)
    {
        IsRadioOn[playerid] = true;
        PlayAudioStreamForPlayer(playerid, "http://dir.xiph.org/listen/3728175/listen.m3u");
        SendClientMessage(playerid, -1, "You are tuned into DnB Pirate Radio");
    }
}
case 9:
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_PASSENGER)
    {
        IsRadioOn[playerid] = true;
        PlayAudioStreamForPlayer(playerid, "http://dir.xiph.org/listen/3710153/listen.m3u");
        SendClientMessage(playerid, -1, "You are tuned into I Love To Dance Radio");
    }
}
case 10:
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_PASSENGER)
    {
        IsRadioOn[playerid] = true;
        PlayAudioStreamForPlayer(playerid, "http://dir.xiph.org/listen/3813588/listen.m3u");
        SendClientMessage(playerid, -1, "You are tuned into Electronic Playground Radio");
    }
}
case 11:
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_PASSENGER)
    {
        IsRadioOn[playerid] = false;
        StopAudioStreamForPlayer(playerid);
        SendClientMessage(playerid, -1,"Music off");
    }
}
EXAMPLE
pawn Код:
case 0:
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_PASSENGER)
    {
        IsRadioOn[playerid] = true;
        PlayAudioStreamForPlayer(playerid, "MUSIC URL");
        SendClientMessage(playerid, -1, "You are tuned into Dubstep FM");
    }
}
case 1:
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_PASSENGER)
    {
        IsRadioOn[playerid] = true;
        PlayAudioStreamForPlayer(playerid, "MUSIC URL");
        SendClientMessage(playerid, -1, "You are tuned into RADIO NAME");
    }
}
case 2:
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_PASSENGER)
    {
        IsRadioOn[playerid] = true;
        PlayAudioStreamForPlayer(playerid, "MUSIC URL");
        SendClientMessage(playerid, -1, "You are tuned into RADIO NAME");
    }
}
case 3:
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_PASSENGER)
    {
        IsRadioOn[playerid] = true;
        PlayAudioStreamForPlayer(playerid, "MUSIC URL");
        SendClientMessage(playerid, -1, "You are tuned into RADIO NAME");
    }
}
case 4:
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_PASSENGER)
    {
        IsRadioOn[playerid] = true;
        PlayAudioStreamForPlayer(playerid, "MUSIC URL");
        SendClientMessage(playerid, -1, "You are tuned into RADIO NAME");
    }
}
case 5:
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_PASSENGER)
    {
        IsRadioOn[playerid] = true;
        PlayAudioStreamForPlayer(playerid, "MUSIC URL");
        SendClientMessage(playerid, -1, "You are tuned into RADIO NAME");
    }
}
case 6:
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_PASSENGER)
    {
        IsRadioOn[playerid] = true;
        PlayAudioStreamForPlayer(playerid, "MUSIC URL");
        SendClientMessage(playerid, -1, "You are tuned into RADIO NAME");
    }
}
case 7:
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_PASSENGER)
    {
        IsRadioOn[playerid] = true;
        PlayAudioStreamForPlayer(playerid, "MUSIC URL");
        SendClientMessage(playerid, -1, "You are tuned into RADIO NAME");
    }
}
case 8:
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_PASSENGER)
    {
        IsRadioOn[playerid] = true;
        PlayAudioStreamForPlayer(playerid, "MUSIC URL");
        SendClientMessage(playerid, -1, "You are tuned into RADIO NAME");
    }
}
case 9:
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_PASSENGER)
    {
        IsRadioOn[playerid] = true;
        PlayAudioStreamForPlayer(playerid, "MUSIC URL");
        SendClientMessage(playerid, -1, "You are tuned into RADIO NAME");
    }
}
case 10:
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_PASSENGER)
    {
        IsRadioOn[playerid] = true;
        PlayAudioStreamForPlayer(playerid, "MUSIC URL");
        SendClientMessage(playerid, -1, "You are tuned into RADIO NAME");
    }
}
case 11:
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_PASSENGER)
    {
        IsRadioOn[playerid] = false;
        StopAudioStreamForPlayer(playerid);
        SendClientMessage(playerid, -1,"Music off");
    }
}
Comment and share if i helped you with what you was looking for.
Suggest if you think other things need adding.
Reply
#2

Nice
Reply
#3

Good Work
Reply
#4

Good job!
Reply
#5

Nice work!
Reply
#6

pastbin link please
Reply
#7

can i add my song?
Reply
#8

@tantri i have updated the topic to include a "How To:" section, so it should be easier for everyone to edit.
@Azula I will add pastebin soon

Thanks guys for the comments
Reply
#9

Nice work
Reply
#10

Nice.
Reply
#11

NICE
Reply
#12

Quote:
Originally Posted by LeXuZ
Посмотреть сообщение
Nice work
Quote:
Originally Posted by Smocky
Посмотреть сообщение
Nice.
Quote:
Originally Posted by Devon007
Посмотреть сообщение
NICE
Thanks guys
Reply
#13

Very Good job!
Reply
#14

Nice FS
Reply
#15

Thanks for the comments guys
Reply
#16

Good Job.
1 question.
How do I can change the buttons? I prefer R to open the menu and R to sellect.
Reply
#17

Thanks here is a link to the sa-mp keys here if you want to change the key used find the key I used in the .pwn file and change to the one you would like to use from the link I provided. If you have any other troubles feel free to leave me a comment and I will assist you with it
Reply
#18

Good job
Reply
#19

Nice!

I love how Dubstep FM is first.

I'd suggest you to make an array for all radio stations and also an automatic page-wrapper if the user wants more than 12 radio stations, also it's easier to insert new radio stations.
Reply
#20

Quote:
Originally Posted by UltraScripter
Посмотреть сообщение
Good job
Thanks mate.

Quote:
Originally Posted by NaS
Посмотреть сообщение
Nice!

I love how Dubstep FM is first.

I'd suggest you to make an array for all radio stations and also an automatic page-wrapper if the user wants more than 12 radio stations, also it's easier to insert new radio stations.
Dubstep FM is first as at the time Dubstep was trending, and a lot of people liked it so it made sense to keep that first, and thanks for your comment and I will look into doing that on my day off work. I really appreciate your comment.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)