Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ////
- // RADIO DIALOG v1.0
- // by Lenny
- ////
- // CONFIGURATION
- //
- #define FILTERSCRIPT
- #define DIALOG_RADIO_CATEGORIES 6345 // Radio categories
- #define DIALOG_RADIO_STATIONS 6346 // Radio stations
- #define MAX_ST_TYPE 31
- #define MAX_ST_NAME 30
- #define MAX_ST_URL 130
- enum e_Audio_Stations
- {
- st_name[MAX_ST_NAME],
- st_type[MAX_ST_TYPE],
- st_url[MAX_ST_URL]
- };
- new Audio_Stations[][e_Audio_Stations] =
- {
- // STATION NAME // CATEGORY // URL
- { "Turn radio off", "{AA3333}Turn radio off{FFFFFF}", "Turn radio off" }, // Leave this one in to allow disabling the radio
- { "UK Top 40", "Pop", "http://www.181.fm/winamp.pls?station=181-uktop40&style=mp3&description=UK%20top%2040&file=181-uktop40.pls" },
- { "The Rock!", "Rock", "http://www.181.fm/winamp.pls?station=181-hardrock&style=&description=The%20Rock!%20(Hard%20Rock)&file=181-hardrock.pls" },
- { "Soul 181.fm", "Soul", "http://www.181.fm/winamp.pls?station=181-soul&style=mp3&description=Soul&file=181-soul.pls" },
- { "Classic Hits", "Classic Hits", "http://www.181.fm/winamp.pls?station=181-greatoldies&style=mp3&description=Classic%20Hits%20181&file=181-greatoldies.pls" },
- { "Super 70's", "Decades", "http://www.181.fm/winamp.pls?station=181-70s&style=mp3&description=Super%2070s&file=181-70s.pls" },
- { "Awesome 80's", "Decades", "http://www.181.fm/winamp.pls?station=181-awesome80s&style=&description=Awesome%2080's&file=181-awesome80s.pls" },
- { "Lite 80's", "Decades", "http://www.181.fm/winamp.pls?station=181-lite80s&style=&description=Lite%2080's&file=181-lite80s.pls" },
- { "Star 90's", "Decades", "http://www.181.fm/winamp.pls?station=181-star90s&style=&description=Star%2090's&file=181-star90s.pls" },
- { "Lite 90's", "Decades", "http://www.181.fm/winamp.pls?station=181-90scountry&style=&description=90's%20Country&file=181-90scountry.pls" },
- { "90's Alternative", "Decades", "http://www.181.fm/winamp.pls?station=181-90salt&style=&description=90's%20Alternative&file=181-90salt.pls" },
- { "Power 181 (Top 40)", "Pop", "http://www.181.fm/winamp.pls?station=181-power&style=mp3&description=Power%20181%20(Top%2040)&file=181-power.pls" },
- { "Old School HipHop/RnB", "Pop", "http://www.181.fm/winamp.pls?station=181-oldschool&style=mp3&description=Old%20School%20HipHop/RnB&file=181-oldschool.pls" },
- { "Party 181", "Pop", "http://www.181.fm/winamp.pls?station=181-party&style=&description=Party%20181&file=181-party.pls" },
- { "The mix", "Pop", "http://www.181.fm/winamp.pls?station=181-themix&style=&description=The%20Mix&file=181-themix.pls" },
- { "The Buzz (Alt. Rock)", "Rock", "http://www.181.fm/winamp.pls?station=181-buzz&style=mp3&description=The%20Buzz%20(Alt.%20Rock)&file=181-buzz.pls" },
- { "Rock 181", "Rock", "http://www.181.fm/winamp.pls?station=181-rock&style=&description=Rock%20181&file=181-rock.pls" },
- { "The Eagle (Classic)", "Rock", "http://www.181.fm/winamp.pls?station=181-eagle&style=&description=The%20Eagle%20(Classic)&file=181-eagle.pls" },
- { "The Point", "Rock", "http://www.181.fm/winamp.pls?station=181-thepoint&style=&description=The%20Point&file=181-thepoint.pls" },
- { "Kickin' Country", "Country", "http://www.181.fm/winamp.pls?station=181-kickincountry&style=mp3&description=Kickin'%20Country&file=181-kickincountry.pls" },
- { "Highway 181", "Country", "http://www.181.fm/winamp.pls?station=181-highway&style=&description=Highway%20181&file=181-highway.pls" },
- { "Real Country", "Country", "http://www.181.fm/winamp.pls?station=181-realcountry&style=&description=Real%20Country&file=181-realcountry.pls" },
- { "US 181", "Country", "http://www.181.fm/winamp.pls?station=181-us181&style=&description=US%20181&file=181-us181.pls" },
- { "The Beat", "HipHop/R&B", "http://www.181.fm/winamp.pls?station=181-beat&style=&description=The%20Beat%20(HipHop/R&B)&file=181-beat.pls" },
- { "Old School HipHop/RnB", "HipHop/R&B", "http://www.181.fm/winamp.pls?station=181-oldschool&style=mp3&description=Old%20School%20HipHop/RnB&file=181-oldschool.pls" },
- { "True R&B", "HipHop/R&B", "http://www.181.fm/winamp.pls?station=181-rnb&style=&description=True%20R&B&file=181-rnb.pls" },
- { "The Box (Urban)", "HipHop/R&B", "http://www.181.fm/winamp.pls?station=181-thebox&style=&description=The%20Box%20(Urban)&file=181-thebox.pls" },
- { "Jammin 181", "HipHop/R&B", "http://www.181.fm/winamp.pls?station=181-jammin&style=&description=Jammin%20181&file=181-jammin.pls" },
- { "Energy 98", "Dance/Techno", "http://www.181.fm/winamp.pls?station=181-energy98&style=mp3&description=Energy%2098&file=181-energy98.pls" },
- { "Energy 93 (Euro Dance)", "Dance/Techno", "http://www.181.fm/winamp.pls?station=181-energy93&style=&description=Energy%2093%20(Euro%20Dance)&file=181-energy93.pls" },
- { "Chilled Out", "Dance/Techno", "http://www.181.fm/winamp.pls?station=181-chilled&style=mp3&description=Chilled%20Out&file=181-chilled.pls" },
- { "Reggae Roots", "Latin/Tropical", "http://www.181.fm/winamp.pls?station=181-reggae&style=&description=Reggae%20Roots&file=181-reggae.pls" },
- { "Salsa", "Latin/Tropical", "http://www.181.fm/winamp.pls?station=181-salsa&style=&description=Salsa&file=181-salsa.pls" },
- { "Comedy Club", "Talk Radio", "http://www.181.fm/winamp.pls?station=181-comedy&style=&description=Comedy%20Club&file=181-comedy.pls" },
- { "Business Talk Radio", "Talk Radio", "http://www.181.fm/winamp.pls?station=181-businesstalk&style=mp3&description=Business%20Talk%20Radio&file=181-businesstalk.pls" },
- { "Lifestyle Talk Radio", "Talk Radio", "http://www.181.fm/winamp.pls?station=181-lifestyletalk&style=mp3&description=Lifestyle%20Talk%20Radio&file=181-lifestyletalk.pls" },
- { "Christmas Power", "Christmas", "http://www.181.fm/winamp.pls?station=181-xpower&style=&description=Christmas%20Power&file=181-xpower.pls" },
- { "Christmas R&B", "Christmas", "http://www.181.fm/winamp.pls?station=181-xtrue&style=&description=Christmas%20R&B&file=181-xtrue.pls" },
- { "Christmas Rock", "Christmas", "http://www.181.fm/winamp.pls?station=181-xrock&style=&description=Christmas%20Rock&file=181-xrock.pls" },
- { "Christmas Mix", "Christmas", "http://www.181.fm/winamp.pls?station=181-xmix&style=&description=Christmas%20Mix&file=181-xmix.pls" },
- { "Christmas Smooth Jazz", "Christmas", "http://www.181.fm/winamp.pls?station=181-xsmooth&style=&description=Christmas%20Smooth%20Jazz&file=181-xsmooth.pls" }
- };
- //
- // CONFIGURATION END
- #include <a_samp>
- #include <zcmd>
- #define COLOR_GREEN 0x33AA33AA
- CMD:radiostations(playerid, params[])
- {
- new
- szRadioCategories[500];
- for(new i; i < sizeof(Audio_Stations); i++)
- {
- if(strfind(szRadioCategories, Audio_Stations[i][st_type], true) != -1)
- continue;
- format(szRadioCategories, sizeof(szRadioCategories), "%s%s\n", szRadioCategories, Audio_Stations[i][st_type]);
- }
- ShowPlayerDialog(playerid, DIALOG_RADIO_CATEGORIES, DIALOG_STYLE_LIST, "Radio categories", szRadioCategories, "Select", "Close");
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_RADIO_CATEGORIES)
- {
- if(!response)
- return 0;
- if(!strcmp(inputtext, "Turn radio off"))
- {
- StopAudioStreamForPlayer(playerid);
- SendClientMessage(playerid, COLOR_GREEN, "Radio turned off.");
- return 1;
- }
- new
- szRadioStations[250];
- for(new i; i < sizeof(Audio_Stations); i++)
- {
- if(strfind(inputtext, Audio_Stations[i][st_type], true) == -1)
- continue;
- format(szRadioStations, sizeof(szRadioStations), "%s%s\n", szRadioStations, Audio_Stations[i][st_name]);
- }
- ShowPlayerDialog(playerid, DIALOG_RADIO_STATIONS, DIALOG_STYLE_LIST, "Radio stations", szRadioStations, "Tune in", "Close");
- return 1;
- }
- if(dialogid == DIALOG_RADIO_STATIONS)
- {
- if(!response)
- return 0;
- for(new i; i < sizeof(Audio_Stations); i++)
- {
- if(strfind(inputtext, Audio_Stations[i][st_name], true) == -1)
- continue;
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, Audio_Stations[i][st_url]);
- new
- szString[22 + MAX_ST_NAME];
- format(szString, sizeof(szString), "Tuned in to station: %s", Audio_Stations[i][st_name]);
- SendClientMessage(playerid, COLOR_GREEN, szString);
- cmd_radiostations(playerid, "");
- return 1;
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment