Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ~Credits to Edgar
- ---------------------
- */
- //#define FILTERSCRIPT
- #include <a_samp>
- #include <zcmd>
- //Color Defines
- #define COLOR_RED 0xFF0000FF
- //Loose Indent Warning Removal
- #pragma tabsize 0
- public OnFilterScriptInit()
- {
- print("Radio Dialog System by Edgar");
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("Thanks for using my Radio Dialog System-Edgar");
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- StopAudioStreamForPlayer(playerid);
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- StopAudioStreamForPlayer(killerid);
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- StopAudioStreamForPlayer(playerid);
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == 700)
- {
- if(!response)
- {
- SendClientMessage(playerid, COLOR_RED, "You Canceled the Radio dialog.");
- }
- if(response)
- {
- //Station 1
- if(listitem == 0)
- {
- PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=32999");
- }
- //Station 2
- if(listitem == 1)
- {
- PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=65456");
- }
- //Station 3
- if(listitem == 2)
- {
- PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=1543115");
- }
- //Station 4
- if(listitem == 3)
- {
- PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=616366");
- }
- //Station 5
- if(listitem == 4)
- {
- PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=1280356");
- }
- //Set Own URL
- if(listitem == 5)
- {
- ShowPlayerDialog(playerid,701,DIALOG_STYLE_INPUT,"Input URL","Type your URL here.","Play","Cancel");
- }
- //Turn off Radio
- if(listitem == 6)
- {
- StopAudioStreamForPlayer(playerid);
- }
- }
- }
- if(dialogid == 701)
- {
- if(!response)
- {
- SendClientMessage(playerid, COLOR_RED, "You Canceled the insert URL dialog.");
- }
- if(strlen(inputtext) < 64 || strlen(inputtext) > 0)
- {
- PlayAudioStreamForPlayer(playerid, inputtext);
- }
- }
- return 1;
- }
- CMD:radio(playerid, params[])
- {
- if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "You are not in a vehicle!");
- ShowPlayerDialog(playerid, 700, DIALOG_STYLE_LIST, "Select a Station","{FFFFFF}Hot 108 Jamz\n{FFFFFF}Pop\n{FFFFFF}Rap\n{FFFFFF}R&B and Urban\n{FFFFFF}Rock\n{FFFFFF}Input a URL\n{FFFFFF}Turn Off Radio","Ok", "Cancel");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment