Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- sAudio by Stu1
- contact me @ http://vandriverinternational.eu
- */
- #include <a_samp>
- #include <zcmd>
- //define
- #define SAUDIO_DIALOG 9997
- #define SAUDIOURL_DIALOG 9998
- //var
- new radio;
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print("sAudio Started");
- print("--------------------------------------\n");
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
- {
- switch (radio)
- {
- case 0: StopAudioStreamForPlayer(playerid);
- case 1: {PlayAudioStreamForPlayer(playerid, "http://www.radioseven.se/128.pls"); GameTextForPlayer(playerid,"~y~Radio Seven",2000,5);}
- case 2: {PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1377360"); GameTextForPlayer(playerid,"~y~HouseTime.FM",2000,5);}
- case 3: {PlayAudioStreamForPlayer(playerid, "http://tx.whatson.com/icecast.php?i=kerrang.mp3.m3u"); GameTextForPlayer(playerid,"~y~Kerrang Radio",2000,5);}
- case 4: {PlayAudioStreamForPlayer(playerid, "http://www.rgrfm.be/rgr1283.pls"); GameTextForPlayer(playerid,"~y~RGR FM",2000,5);}
- case 5: {PlayAudioStreamForPlayer(playerid, "http://listen.technobase.fm/dsl.pls"); GameTextForPlayer(playerid,"~y~TechnoBase",2000,5);}
- case 6: {PlayAudioStreamForPlayer(playerid, "http://radio.bigupradio.com.:8000/listen.pls"); GameTextForPlayer(playerid,"~y~Big Up Radio",2000,5);}
- }
- }
- if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
- {
- StopAudioStreamForPlayer(playerid);
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == 9997)
- {
- if(response)
- {
- if(listitem == 0)
- {
- PlayAudioStreamForPlayer(playerid, "http://www.radioseven.se/128.pls");
- GameTextForPlayer(playerid,"~y~Radio Seven",2000,5);
- radio = 1;
- }
- if(listitem == 1)
- {
- PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1377360");
- GameTextForPlayer(playerid,"~y~HouseTime.FM",2000,5);
- radio = 2;
- }
- if(listitem == 2)
- {
- PlayAudioStreamForPlayer(playerid, "http://tx.whatson.com/icecast.php?i=kerrang.mp3.m3u");
- GameTextForPlayer(playerid,"~y~Kerrang Radio",2000,5);
- radio = 3;
- }
- if(listitem == 3)
- {
- PlayAudioStreamForPlayer(playerid, "http://www.rgrfm.be/rgr1283.pls");
- GameTextForPlayer(playerid,"~y~RGR FM",2000,5);
- radio = 4;
- }
- if(listitem == 4)
- {
- PlayAudioStreamForPlayer(playerid, "http://listen.technobase.fm/dsl.pls");
- GameTextForPlayer(playerid,"~y~TechnoBase",2000,5);
- radio = 5;
- }
- if(listitem == 5)
- {
- PlayAudioStreamForPlayer(playerid, "http://radio.bigupradio.com.:8000/listen.pls");
- GameTextForPlayer(playerid,"~y~Big Up Radio",2000,5);
- radio = 6;
- }
- if(listitem == 6)
- {
- ShowPlayerDialog(playerid, SAUDIOURL_DIALOG, DIALOG_STYLE_INPUT, "{FFFFFF}Enter Station URL:","Enter the URl:\nEx. http://listen.technobase.fm/dsl.pls", "Confirm", "Close");
- }
- if(listitem == 7)
- {
- StopAudioStreamForPlayer(playerid);
- radio = 0;
- }
- }
- }
- if(dialogid == 9998)
- {
- if(response)
- {
- if(strlen(inputtext) > 0)
- {
- PlayAudioStreamForPlayer(playerid, inputtext);
- GameTextForPlayer(playerid,"~y~Custom URL",2000,5);
- }
- else
- {
- SendClientMessage(playerid,0xFFFFFFAA,"Not Valid");
- }
- }
- }
- }
- CMD:radio(playerid, params[])
- {
- if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1,"You can't use the radio on foot.");
- {
- new sAudio[1024];
- format(sAudio, sizeof(sAudio), "Radio Seven\nHouseTime.FM\nKerrang\nRGR FM\nTechnoBase\nBig Up Radio\n{00FF00}Enter URL\n{FF0040}Stop Radio");
- ShowPlayerDialog(playerid, SAUDIO_DIALOG, DIALOG_STYLE_LIST, "Choose Station:", sAudio, "Play", "Close");
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement