Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ~~~~~~~~ Simple Radio System Made By Danilonba ~~~~~~~~
- ~~~~~~~~ Pls Do Net Remove My Credits! ~~~~~~~~
- ~~~~~~~~ Enjoy With You Radio ~~~~~~~~
- */
- #include <a_samp>
- #define DIALOG_MUSIC_RADIO 1
- #define COLOR_RED 0xAA3333AA
- #define red "{FF002B}"
- #define pink "{FF00D9}"
- #define purple "{DFA7F2}"
- #define blue "{A1C2FF}"
- #define green "{3DE3B1}"
- #define yellow "{FAF623}"
- #define black "{69670C}"
- #define orange "{F2C80C}"
- #define ice "{03F2FF}"
- #define lime "{00FF40}"
- public OnFilterScriptInit()
- {
- print("\n______________________________________");
- print(" Radio system by Danilonba LOADED!");
- print("______________________________________\n");
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/rcredits", cmdtext, true, 10) == 0)
- {
- SendClientMessage(playerid, 0xAA3333AA, "This Radio System Is Made By Danilonba Thanks For Using It!");
- }
- if (strcmp("/radio", cmdtext, true, 10) == 0)
- {
- if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xAA3333AA,"You must be in a vehicle.");
- ShowPlayerDialog(playerid, DIALOG_MUSIC_RADIO, DIALOG_STYLE_LIST, "Radio", "{FAF623}Hot 108 Jams\n{F2C80C}24/7 dubstep\n{3DE3B1}hardstyle\n{A1C2FF}electronic\n{FF00D9}Gay.Fm\n{DFA7F2}defjay.de", "play", "Cancel");
- return 1;
- }
- if (strcmp("/stopradio", cmdtext, true, 10) == 0)
- {
- StopAudioStreamForPlayer(playerid);
- return 1;
- }
- return 0;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_MUSIC_RADIO)
- {
- if(!response) return GameTextForPlayer(playerid, "You have canceled the radio menu ", 3000, 6);
- switch(listitem)
- {
- case 0: // R&B
- {
- PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=32999");
- GameTextForPlayer(playerid, "use /stopradio to stop the radio!", 3000, 6);
- }
- case 1: //DUBSTEP
- {
- PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=342570");
- GameTextForPlayer(playerid, "use /stopradio to stop the radio!", 3000, 6);
- }
- case 2: //hardstyle
- {
- PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=429606");
- GameTextForPlayer(playerid, "use /stopradio to stop the radio!", 3000, 6);
- }
- case 3: //electronic
- {
- PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1377200");
- GameTextForPlayer(playerid, "use /stopradio to stop the radio!", 3000, 6);
- }
- case 4: // gay.fm
- {
- PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=3093517");
- GameTextForPlayer(playerid, "use /stopradio to stop the radio!", 3000, 6);
- }
- case 5: // defjay.de
- {
- PlayAudioStreamForPlayer(playerid , "http://yp.shoutcast.com/sbin/tunein-station.pls?id=65456");
- GameTextForPlayer(playerid, "use /stopradio to stop the radio!", 3000, 6);
- }
- //to add more music do:
- /*
- case 6: // name to remeber what music it is
- {
- PlayAudioStreamForPlayer(playerid, "link of music");
- GameTextForPlayer(playerid "use /stopradio to stop the radio!", 3000, 6); // you can use also SandClientMessage(playerid, color, "text");
- }
- */
- }
- }
- return 1;
- }
- forward PlayMusicFromURLInVehicle(vehicleid,url[]);
- public PlayMusicFromURLInVehicle(vehicleid,url[])
- {
- for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
- {
- if(IsPlayerConnected(playerid))
- {
- if(GetPlayerVehicleID(playerid) == vehicleid)
- {
- PlayAudioStreamForPlayer(playerid,url);
- }
- }
- }
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
- {
- StopAudioStreamForPlayer(playerid);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement