proking

pRadio v1.4

Feb 12th, 2012
487
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 7.95 KB | None | 0 0
  1. #if defined proking
  2.  
  3. ================================Made by proking=================================
  4. ================================================================================
  5. This filterscript is created by proking and He reserved all the copyrights ©.
  6. If you want to use this script, Please don't remove the credits.
  7. ================================================================================
  8.  
  9. ================================================================================
  10. Thanks to:
  11. Y_Less for his impressive foreach,
  12. ZeeX for his ZCMD,
  13. jueix for his tutorial.
  14. Babul for a dialog bug fixing.
  15. Ammo for testing the script.
  16. Shoutcast.com for links.
  17. ================================================================================
  18.  
  19. ================================================================================
  20. Version 1.4ß (Beta) Features:
  21. ------------------------------------------------------
  22. | Only work in vehicles.                               |
  23. | When you exit from vehicles radio stop automatically.|
  24. | Only Best Radio stations are selected.               |
  25. ------------------------------------------------------
  26. ================================================================================
  27. #endif
  28.  
  29. //================================[INCLUDES]====================================
  30. #include <a_samp>
  31. #include <ZCMD>
  32. #include <foreach>
  33. //==============================[COLORS DEFINES]================================
  34. #define color1 0xB4B5B7FF
  35. #define color2 0xBFC0C2FF
  36. #define color3 0xCBCCCEFF
  37.  
  38.  
  39. #define radcat 327
  40.  
  41. WasteDeAMXersTime()
  42. {
  43.    new b;
  44.    #emit load.pri b
  45.    #emit stor.pri b
  46. }
  47.  
  48. public OnFilterScriptInit()
  49. {
  50.    WasteDeAMXersTime();
  51.    print("=======================================");
  52.    print("Radio Filter Script by proking - LOADED");
  53.    print("=======================================");
  54.     return 1;
  55. }
  56.  
  57. public OnFilterScriptExit()
  58. {
  59.     print("==========================================");
  60.    print("Radio Filter Script by proking - UN-LOADED");
  61.    print("==========================================");
  62.     return 1;
  63. }
  64. //==============================[Radio Command]=================================
  65. CMD:radio(playerid, params[]) {
  66.    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, color2, "You must be in a car to use a car radio.");//Comment this line if you want to play and where. Also remove on playerkeystate.
  67.     ShowPlayerDialog(playerid, radcat, DIALOG_STYLE_INPUT, "{FFFF00}Online Car Radio","1.Radio HSL\n2.181.FM: The Buzz\n3.181.FM: Blues\n4.181.FM: Highway 181\n5.COOL93\n6.TechnoBase.FM\n7.Dubplate.FM\n8.Word of Truth Radio\n9.SKY.FM: New Age\n10..977 The Hitz Channel\n11.DEFJAY\n12.Stop MP3 Player\n\n","Ok","Exit");
  68.  
  69.     return 1;
  70. }
  71.  
  72.  
  73. //==============================[Dialog Response]===============================
  74. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  75. {
  76.        new string[128];
  77.        if(dialogid == radcat)
  78.        {
  79.                 if(response)
  80.                {
  81.                if(!strlen(inputtext)) return SendClientMessage(playerid, color1, "ERROR: You must enter the ID of a radio.!");
  82.                if(!IsNumeric(inputtext)) return SendClientMessage(playerid, color1, "ERROR: You must enter the Numeric ID of a radio.!");
  83.                 if(strcmp(inputtext, "1", true) == 0)
  84.                 {
  85.                 format(string, sizeof(string), "* Radio Station changes the station to Radio HSL");
  86.                 StopAudioStreamForPlayer(playerid);
  87.                 PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1268507");
  88.                 SendClientMessage(playerid, color2, string);
  89.                 }
  90.                 else if(strcmp(inputtext, "2", true) == 0)
  91.                 {
  92.                 format(string, sizeof(string), "* Radio Station changes the station to COOL93 Fahrenhieit");
  93.                 StopAudioStreamForPlayer(playerid);
  94.                 PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=74673");
  95.                 SendClientMessage(playerid, color2, string);
  96.                 }
  97.                 else if(strcmp(inputtext, "3", true) == 0)
  98.                 {
  99.                 format(string, sizeof(string), "* Radio Station changes the station to 1.FM - Blues.");
  100.                 StopAudioStreamForPlayer(playerid);
  101.                 PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1270282");
  102.                 SendClientMessage(playerid, color2, string);
  103.                 }
  104.                 else if(strcmp(inputtext, "4", true) == 0)
  105.                 {
  106.                 format(string, sizeof(string), "* Radio Station changes the station to 181.FM - POWER 181 -=[: The Hitz Channel:]-=");
  107.                 StopAudioStreamForPlayer(playerid);
  108.                 PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1283896");
  109.                 SendClientMessage(playerid, color2, string);
  110.                 }
  111.                 else if(strcmp(inputtext, "5", true) == 0)
  112.                 {
  113.                 format(string, sizeof(string), "* Radio Station changes the station to COOL93.");
  114.                 StopAudioStreamForPlayer(playerid);
  115.                 PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1756658");
  116.                 SendClientMessage(playerid, color2, string);
  117.                 }
  118.                 else if(strcmp(inputtext, "6", true) == 0)
  119.                 {
  120.                format(string, sizeof(string), "* Radio Station changes the station to TechnoBase.FM.");
  121.                 StopAudioStreamForPlayer(playerid);
  122.                 PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1377200");
  123.                 SendClientMessage(playerid, color2, string);
  124.                 }
  125.                 else if(strcmp(inputtext, "7", true) == 0)
  126.                 {
  127.                 format(string, sizeof(string), "* Radio Station changes the station to Dubplate.FM.");
  128.                 StopAudioStreamForPlayer(playerid);
  129.                 PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=2057197");
  130.                 SendClientMessage(playerid, color2, string);
  131.                 }
  132.                 else if(strcmp(inputtext, "8", true) == 0)
  133.                 {
  134.                 format(string, sizeof(string), "* Radio Station changes the station to Word of Truth Radio.");
  135.                 StopAudioStreamForPlayer(playerid);
  136.                 PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=18695");
  137.                 SendClientMessage(playerid, color2, string);
  138.                 }
  139.                 else if(strcmp(inputtext, "9", true) == 0)
  140.                 {
  141.                 format(string, sizeof(string), "* Radio Station changes the station to MyLesbianRadio.com");
  142.                 StopAudioStreamForPlayer(playerid);
  143.                 PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1275557");
  144.                 SendClientMessage(playerid, color2, string);
  145.                 }
  146.                 else if(strcmp(inputtext, "10", true) == 0)
  147.                 {
  148.                 format(string, sizeof(string), "* Radio Station changes the station to .977 The Hitz Channel.");
  149.                 StopAudioStreamForPlayer(playerid);
  150.                 PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1280356");
  151.                 SendClientMessage(playerid, color2, string);
  152.                 }
  153.                 else if(strcmp(inputtext, "11", true) == 0)
  154.                 {
  155.                 format(string, sizeof(string), "* Radio Station changes the station to DEFJAY.");
  156.                 StopAudioStreamForPlayer(playerid);
  157.                 PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=616366");
  158.                 SendClientMessage(playerid, color2, string);
  159.                }
  160.                 else if(strcmp(inputtext, "12", true) == 0)
  161.                 {
  162.                 StopAudioStreamForPlayer(playerid);
  163.                 }
  164.                 /*case 12:
  165.                 {
  166.                 SendClientMessage(playerid, color3, "Page 2 coming soon");
  167.                 //ShowPlayerDialog(playerid, radcat+1, DIALOG_STYLE_LIST, "{FFFF00}MP3 Player","1.Zara Dil Ko tham(Hindi)\n2.Love The way you lie-2\n3.\n4.\n5.\n6.\n7.\n8.\n9.\n10.\n11.Stop MP3 Player\n12.Next Page","Ok","Exit");
  168.                 }*/
  169.  
  170.         }
  171.     }
  172.         return 1;
  173. }
  174.  
  175. public OnPlayerStateChange(playerid, newstate, oldstate)
  176. {
  177.    if(newstate == PLAYER_STATE_ONFOOT)
  178.     {
  179.     StopAudioStreamForPlayer(playerid);
  180.     SendClientMessage(playerid, color3, "[Radio Stop]: You have to be in car for listening Music.");
  181.     }
  182.     return 1;
  183. }
  184.  
  185. IsNumeric(const string[])
  186. {
  187.    for (new i = 0, j = strlen(string); i < j; i++)
  188.    {
  189.        if (string[i] > '9' || string[i] < '0') return 0;
  190.    }
  191.    return 1;
  192. }
Advertisement
Add Comment
Please, Sign In to add comment