Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define FILTERSCRIPT
- #include <a_samp>
- #include <zcmd>
- #define PRESSED(%0) \
- (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0))) //Detecting keys
- #define DIALOG_MUSIC 2018
- new Radio[MAX_PLAYERS];
- new listitems[] = "1\tDubstep FM\n\
- 2\tCapital FM\n\
- 3\tPulse Radio\n\
- 4\tRadio Klass Romania\n\
- 5\tIts a Trap Radio\n\
- 6\tRussian Hits Radio\n\
- 7\tMadein Hits Radio\n\
- 8\tAbsolute Hits Radio (France)\n\
- 9\tDnB Pirate Radio\n\
- 10\tI Love To Dance Radio\n\
- 11\tElectronic Playground Radio\n\
- 12\tRadio Gothic\n\
- 13\tTurn Off\n\";
- public OnPlayerConnect(playerid)
- {
- Radio[playerid] = 0;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- Radio[playerid] = 0;
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(PRESSED(KEY_NO))
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- ShowPlayerDialog(playerid,DIALOG_MUSIC,DIALOG_STYLE_LIST,"{33CCFF}List of Music Stations:",listitems,"Tune in","Close");
- }
- }
- }
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- if(oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT)
- {
- if(Radio[playerid] == 1)
- {
- Radio[playerid] = 0;
- StopAudioStreamForPlayer(playerid);
- }
- }
- if(oldstate == PLAYER_STATE_PASSENGER && newstate == PLAYER_STATE_ONFOOT)
- {
- if(Radio[playerid] == 1)
- {
- Radio[playerid] = 0;
- StopAudioStreamForPlayer(playerid);
- }
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_MUSIC)
- {
- if(response)
- {
- if(listitem == 0)
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_PASSENGER)
- {
- Radio[playerid] = 1;
- PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=40568");
- SendClientMessage(playerid, -1, "> You are tuned into Dubstep FM");
- }
- }
- else if(listitem == 1)
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_PASSENGER)
- {
- Radio[playerid] = 1;
- PlayAudioStreamForPlayer(playerid, "http://media-ice.musicradio.com/CapitalMP3.m3u");
- SendClientMessage(playerid, -1, "> You are tuned into Capital FM");
- }
- }
- else if(listitem == 2)
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_PASSENGER)
- {
- Radio[playerid] = 1;
- PlayAudioStreamForPlayer(playerid, "http://icy3.abacast.com/pulse87-pulse87mp3-64");
- SendClientMessage(playerid, -1, "> You are tuned into Pulse 87");
- }
- }
- else if(listitem == 3)
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_PASSENGER)
- {
- Radio[playerid] = 1;
- PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=7581");
- SendClientMessage(playerid, -1, "> You are tuned into Radio Klass Romania");
- }
- }
- else if(listitem == 4)
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_PASSENGER)
- {
- Radio[playerid] = 1;
- PlayAudioStreamForPlayer(playerid, "http://dir.xiph.org/listen/3146548/listen.m3u");
- SendClientMessage(playerid, -1, "> You are tuned into Its a Trap Radio");
- }
- }
- else if(listitem == 5)
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_PASSENGER)
- {
- Radio[playerid] = 1;
- PlayAudioStreamForPlayer(playerid, "http://dir.xiph.org/listen/1891409/listen.m3u");
- SendClientMessage(playerid, -1, "> You are tuned into Russian Hits Radio");
- }
- }
- else if(listitem == 6)
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_PASSENGER)
- {
- Radio[playerid] = 1;
- PlayAudioStreamForPlayer(playerid, "http://dir.xiph.org/listen/3064006/listen.m3u");
- SendClientMessage(playerid, -1, "> You are tuned into Madein Hits Radio");
- }
- }
- else if(listitem == 7)
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_PASSENGER)
- {
- Radio[playerid] = 1;
- PlayAudioStreamForPlayer(playerid, "http://dir.xiph.org/listen/3367058/listen.m3u");
- SendClientMessage(playerid, -1, "> You are tuned into Absolute Hits Radio");
- }
- }
- else if(listitem == 8)
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_PASSENGER)
- {
- Radio[playerid] = 1;
- PlayAudioStreamForPlayer(playerid, "http://dir.xiph.org/listen/3728175/listen.m3u");
- SendClientMessage(playerid, -1, "> You are tuned into DnB Pirate Radio");
- }
- }
- else if(listitem == 9)
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_PASSENGER)
- {
- Radio[playerid] = 1;
- PlayAudioStreamForPlayer(playerid, "http://dir.xiph.org/listen/3710153/listen.m3u");
- SendClientMessage(playerid, -1, "> You are tuned into I Love To Dance Radio");
- }
- }
- else if(listitem == 10)
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_PASSENGER)
- {
- Radio[playerid] = 1;
- PlayAudioStreamForPlayer(playerid, "http://dir.xiph.org/listen/3813588/listen.m3u");
- SendClientMessage(playerid, -1, "> You are tuned into Electronic Playground Radio");
- }
- }
- else if(listitem == 11)
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_PASSENGER)
- {
- Radio[playerid] = 1;
- PlayAudioStreamForPlayer(playerid, "http://dir.xiph.org/listen/3722320/listen.m3u");
- SendClientMessage(playerid, -1, "> You are tuned into Radio Gothic");
- }
- }
- else if(listitem == 12)
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_PASSENGER)
- {
- Radio[playerid] = 0;
- StopAudioStreamForPlayer(playerid);
- SendClientMessage(playerid, -1,"> Music off");
- }
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment