Advertisement
Guest User

//radio system made by danilonba!

a guest
Oct 19th, 2012
619
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 4.57 KB | None | 0 0
  1. /*
  2.   ~~~~~~~~ Simple Radio System Made By Danilonba ~~~~~~~~
  3.   ~~~~~~~~ Pls Do Net Remove My Credits! ~~~~~~~~
  4.   ~~~~~~~~ Enjoy With You Radio ~~~~~~~~
  5. */
  6.  
  7. #include <a_samp>
  8.  
  9. #define DIALOG_MUSIC_RADIO 1
  10.  
  11. #define COLOR_RED 0xAA3333AA
  12.  
  13. #define red "{FF002B}"
  14. #define pink "{FF00D9}"
  15. #define purple "{DFA7F2}"
  16. #define blue "{A1C2FF}"
  17. #define green "{3DE3B1}"
  18. #define yellow "{FAF623}"
  19. #define black "{69670C}"
  20. #define orange "{F2C80C}"
  21. #define ice "{03F2FF}"
  22. #define lime "{00FF40}"
  23.  
  24. public OnFilterScriptInit()
  25. {
  26.     print("\n______________________________________");
  27.     print("     Radio system by Danilonba LOADED!");
  28.     print("______________________________________\n");
  29.     return 1;
  30. }
  31.  
  32.  
  33. public OnPlayerCommandText(playerid, cmdtext[])
  34. {
  35.     if (strcmp("/rcredits", cmdtext, true, 10) == 0)
  36.     {
  37.         SendClientMessage(playerid, 0xAA3333AA, "This Radio System Is Made By Danilonba Thanks For Using It!");
  38.     }
  39.     if (strcmp("/radio", cmdtext, true, 10) == 0)
  40.     {
  41.         if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xAA3333AA,"You must be in a vehicle.");
  42.         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");
  43.         return 1;
  44.     }
  45.     if (strcmp("/stopradio", cmdtext, true, 10) == 0)
  46.     {
  47.         StopAudioStreamForPlayer(playerid);
  48.         return 1;
  49.     }
  50.     return 0;
  51. }
  52.  
  53. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  54. {
  55.     if(dialogid == DIALOG_MUSIC_RADIO)
  56.     {
  57.     if(!response) return GameTextForPlayer(playerid, "You have canceled the radio menu ", 3000, 6);
  58.     switch(listitem)
  59.                 {
  60.                     case 0: // R&B
  61.                                 {
  62.                                     PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=32999");
  63.                                     GameTextForPlayer(playerid, "use /stopradio to stop the radio!", 3000, 6);
  64.                                 }
  65.                                 case 1: //DUBSTEP
  66.                                 {
  67.                                     PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=342570");
  68.                                     GameTextForPlayer(playerid, "use /stopradio to stop the radio!", 3000, 6);
  69.                                 }
  70.                                 case 2: //hardstyle
  71.                                 {
  72.                                     PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=429606");
  73.                                     GameTextForPlayer(playerid, "use /stopradio to stop the radio!", 3000, 6);
  74.                                 }
  75.                                 case 3: //electronic
  76.                                 {
  77.                                     PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1377200");
  78.                                     GameTextForPlayer(playerid, "use /stopradio to stop the radio!", 3000, 6);
  79.                                 }
  80.                                 case 4: // gay.fm
  81.                                 {
  82.                                     PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=3093517");
  83.                                     GameTextForPlayer(playerid, "use /stopradio to stop the radio!", 3000, 6);
  84.                                 }
  85.                                 case 5: // defjay.de
  86.                                 {
  87.                                     PlayAudioStreamForPlayer(playerid , "http://yp.shoutcast.com/sbin/tunein-station.pls?id=65456");
  88.                                     GameTextForPlayer(playerid, "use /stopradio to stop the radio!", 3000, 6);
  89.                                 }
  90.                                 //to add more music do:
  91.                                 /*
  92.                                 case 6: // name to remeber what music it is
  93.                                 {
  94.                                     PlayAudioStreamForPlayer(playerid, "link of music");
  95.                                     GameTextForPlayer(playerid "use /stopradio to stop the radio!", 3000, 6); // you can use also SandClientMessage(playerid, color, "text");
  96.                                 }
  97.                                 */
  98.                 }
  99.         }
  100.     return 1;
  101. }
  102.  
  103. forward PlayMusicFromURLInVehicle(vehicleid,url[]);
  104. public PlayMusicFromURLInVehicle(vehicleid,url[])
  105. {
  106.     for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
  107.     {
  108.         if(IsPlayerConnected(playerid))
  109.         {
  110.             if(GetPlayerVehicleID(playerid) == vehicleid)
  111.             {
  112.                 PlayAudioStreamForPlayer(playerid,url);
  113.             }
  114.         }
  115.     }
  116.     return 1;
  117. }
  118.  
  119. public OnPlayerStateChange(playerid, newstate, oldstate)
  120. {
  121.  if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
  122.  {
  123.      StopAudioStreamForPlayer(playerid);
  124.  }
  125.  return 1;
  126. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement