Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include "../include/gl_common.inc" // for strtok usage
- // top of script
- #define D_RADIO 1258
- #define D_RADIOMUSIC 1259
- #define D_RADIO_PINPUT 1260
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Generic radio command");
- print(" kaisersouse - use it all you want");
- print("--------------------------------------\n");
- return 1;
- }
- //------------------------------------------------------------------------------
- public OnFilterScriptExit()
- {
- return 1;
- }
- //------------------------------------------------------------------------------
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new cmd[256+1];
- new idx;
- cmd = strtok(cmdtext, idx);
- if(strcmp("/radio", cmd, true) == 0)
- {
- ShowPlayerDialog(playerid, D_RADIO, DIALOG_STYLE_LIST, "Choose Radio Feed","-- TURN OFF RADIO --\n{33AA33}++Add Your URL{FFFFFF}\nMusic/News Radio","Listen","Exit");
- return 1;
- }
- return 0;
- }
- //------------------------------------------------------------------------------
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == D_RADIO && response)
- {
- switch(listitem)
- {
- case 0:
- {
- StopAudioStreamForPlayer(playerid);
- return SendClientMessage(playerid,-1,"You may have to exit/re-enter vehicle for stereo to work again");
- }
- case 1: ShowPlayerDialog(playerid, D_RADIO_PINPUT,DIALOG_STYLE_INPUT,"Enter stream URL","If you hear nothing, its a bad URL!","Play URL","Cancel");
- case 2: ShowPlayerDialog(playerid, D_RADIOMUSIC, DIALOG_STYLE_LIST, "Choose Music Radio",".977 Hitz\n90s Alternative\nTop 40\nDub Step\nHip Hop\nUnderground Rap\nRock and Roll\nOpera\nClassical\nBlues\nTechno\nTrip Hop\nBollywood\nVideo Game\nMovie\nMetal\nNews\n50s and 60s Oldies\nThe 70s\nThe 80s\nCrazyBob's CnR SAMP Radio\nBeat Basement ","Listen","Exit");
- }
- return 1;
- }
- else if (dialogid == D_RADIO_PINPUT && response)
- {
- if(strlen(inputtext) > 0)
- {
- PlayAudioStreamForPlayer(playerid,inputtext);
- }
- else
- {
- SendClientMessage(playerid,-1,"Your input was too short.");
- }
- }
- else if(dialogid == D_RADIOMUSIC && response)
- {
- switch(listitem) //music stations
- {
- case 0: PlayAudioStreamForPlayer(playerid,"http://7609.live.streamtheworld.com:80/977_HITS_SC"); //.977 hitz
- case 1: PlayAudioStreamForPlayer(playerid, "http://7639.live.streamtheworld.com:80/977_ALTERN_SC"); // alternative
- case 2: PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=38370"); // top 40
- case 3: PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=319038"); //dubstep
- case 4: PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=71829"); // hip-hop / rap
- case 5: PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=9054"); // underground rap
- case 6: PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=29469"); //rock
- case 7: PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=1269951"); //opera
- case 8: PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=403280"); //classical
- case 9: PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=205177"); //blues
- case 10: PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=1377200"); // techno
- case 11: PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=82343"); //trip hop
- case 12: PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=817801"); //bollywood
- case 13: PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=15706"); //video game music
- case 14: PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=5266"); //movie soundtracks
- case 15: PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=318248"); //metal
- case 16: PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=1279013"); //world news
- case 17: PlayAudioStreamForPlayer(playerid,"http://7659.live.streamtheworld.com:80/977_OLDIES_SC"); //50s 60s oldies
- case 18: PlayAudioStreamForPlayer(playerid,"http://7649.live.streamtheworld.com:80/977_CLASSROCK_SC"); //70s
- case 19: PlayAudioStreamForPlayer(playerid,"http://7649.live.streamtheworld.com:80/977_80_SC"); //80s
- case 20: PlayAudioStreamForPlayer(playerid,"http://cnr-radio.com/listen.m3u"); //CBs CnR
- case 21: PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=1377877");
- }
- }
- return 1;
- }
- //------------------------------------------------------------------------------
- public OnPlayerDisconnect(playerid, reason)
- {
- StopAudioStreamForPlayer(playerid);
- return 1;
- }
- //------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment