Guest User

RadioDialogSystem

a guest
May 17th, 2013
463
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.71 KB | None | 0 0
  1. /*
  2.  
  3.      ~Credits to Edgar
  4.  
  5. ---------------------
  6. */
  7. //#define FILTERSCRIPT
  8.  
  9. #include <a_samp>
  10. #include <zcmd>
  11.  
  12. //Color Defines
  13. #define COLOR_RED 0xFF0000FF
  14.  
  15. //Loose Indent Warning Removal
  16. #pragma tabsize 0
  17.  
  18. public OnFilterScriptInit()
  19. {
  20.     print("Radio Dialog System by Edgar");
  21.     return 1;
  22. }
  23.  
  24. public OnFilterScriptExit()
  25. {
  26.  print("Thanks for using my Radio Dialog System-Edgar");
  27.  return 1;
  28. }
  29.  
  30. public OnPlayerConnect(playerid)
  31. {
  32.     StopAudioStreamForPlayer(playerid);
  33.     return 1;
  34. }
  35.  
  36. public OnVehicleDeath(vehicleid, killerid)
  37. {
  38.     StopAudioStreamForPlayer(killerid);
  39.     return 1;
  40. }
  41.  
  42. public OnPlayerExitVehicle(playerid, vehicleid)
  43. {
  44.     StopAudioStreamForPlayer(playerid);
  45.     return 1;
  46. }
  47.  
  48. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  49. {
  50.     if(dialogid == 700)
  51.     {
  52.         if(!response)
  53.         {
  54.             SendClientMessage(playerid, COLOR_RED, "You Canceled the Radio dialog.");
  55.         }
  56.         if(response)
  57.         {
  58.             //Station 1
  59.             if(listitem == 0)
  60.             {
  61.                 PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=32999");
  62.             }
  63.             //Station 2
  64.             if(listitem == 1)
  65.             {
  66.                 PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=65456");
  67.             }
  68.             //Station 3
  69.             if(listitem == 2)
  70.             {
  71.                 PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=1543115");
  72.             }
  73.             //Station 4
  74.             if(listitem == 3)
  75.             {
  76.                 PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=616366");
  77.             }
  78.             //Station 5
  79.             if(listitem == 4)
  80.             {
  81.                 PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=1280356");
  82.             }
  83.             //Set Own URL
  84.             if(listitem == 5)
  85.             {
  86.                 ShowPlayerDialog(playerid,701,DIALOG_STYLE_INPUT,"Input URL","Type your URL here.","Play","Cancel");
  87.             }
  88.             //Turn off Radio
  89.             if(listitem == 6)
  90.             {
  91.                 StopAudioStreamForPlayer(playerid);
  92.             }
  93.         }
  94.      }
  95.      if(dialogid == 701)
  96.      {
  97.         if(!response)
  98.         {
  99.             SendClientMessage(playerid, COLOR_RED, "You Canceled the insert URL dialog.");
  100.         }
  101.         if(strlen(inputtext) < 64 || strlen(inputtext) > 0)
  102.         {
  103.             PlayAudioStreamForPlayer(playerid, inputtext);
  104.         }
  105.      }
  106.      return 1;
  107. }
  108.  
  109. CMD:radio(playerid, params[])
  110. {
  111.     if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "You are not in a vehicle!");
  112.     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");
  113.     return 1;
  114. }
Advertisement
Add Comment
Please, Sign In to add comment