muHamad-asYraf-aKmal

Best Simple Radio By [Ak]mal

Apr 5th, 2015
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.80 KB | None | 0 0
  1. // Original From Pro Scripter [Malaysia] [Ak]mal
  2.  
  3. #include <a_samp>
  4. #include <zcmd>
  5. #include <sscanf2>
  6.  
  7. public OnFilterScriptInit()
  8. {
  9.     print("\n- Best Simple Radio By [Ak]mal -\n");
  10.     return 1;
  11. }
  12.  
  13. public OnFilterScriptExit()
  14. {
  15.     return 1;
  16. }
  17.  
  18. public OnPlayerConnect(playerid)
  19. {
  20.     SendClientMessage(playerid, 0xFF00FFFF, ":: {FFFFFF}Best Simple Radio By [Ak]mal {FF00FF}::");
  21.     SendClientMessage(playerid, 0xFF00FFFF, ":: {FFFFFF}/radio, /stream, /music & /shh {FF00FF}::");
  22.     return 1;
  23. }
  24.  
  25. public OnPlayerDisconnect(playerid, reason)
  26. {
  27.     return 1;
  28. }
  29.  
  30. public OnPlayerSpawn(playerid)
  31. {
  32.     return 1;
  33. }
  34.  
  35. public OnPlayerDeath(playerid, killerid, reason)
  36. {
  37.     return 1;
  38. }
  39.  
  40. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  41. {
  42.     if(dialogid == 300)
  43.     {
  44.         if(response)
  45.         {
  46.             if(listitem == 0)
  47.             {
  48.                 PlayAudioStreamForPlayer(playerid, "http://bit.do/derip");
  49.             }
  50.             if(listitem == 1)
  51.             {
  52.                 PlayAudioStreamForPlayer(playerid, "http://somafm.com/tags.pls");
  53.             }
  54.             if(listitem == 2)
  55.             {
  56.                 // PlayAudioStreamForPlayer(playerid, "");
  57.             }
  58.             if(listitem == 3)
  59.             {
  60.                 // PlayAudioStreamForPlayer(playerid, "");
  61.             }
  62.             if(listitem == 4)
  63.             {
  64.                 StopAudioStreamForPlayer(playerid);
  65.             }
  66.         }
  67.     }
  68.     return 0;
  69. }
  70.  
  71. COMMAND:radio(playerid, params[])
  72. {
  73.     ShowPlayerDialog(playerid, 300, DIALOG_STYLE_LIST, ":: Radio ::", "{FFFFFF}Drift Tokyo\nSoma Fm\nRadio [1]\nRadio [2]\n{FF0000}Shh...", "Play", "Cancel");
  74.     return 1;
  75. }
  76.  
  77. COMMAND:stream(playerid, params[])
  78. {
  79.     if(IsPlayerAdmin(playerid))
  80.     {
  81.         new string[MAX_PLAYERS], url[MAX_PLAYERS];
  82.         if(sscanf(params, "s[500]", url)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /stream [url].mp3");
  83.         format(string, sizeof(string), "%s have been stream the music to all players online.", IsPlayerName(playerid));
  84.         SendClientMessageToAll(0xFFFF00FF, string);
  85.         for (new i = 0; i < MAX_PLAYERS; i++)
  86.         {
  87.             PlayAudioStreamForPlayer(i, url);
  88.         }
  89.     }
  90.     else SendClientMessage(playerid, 0xCC0000FF, "You must be a rcon administrator to use this command.");
  91.     return 1;
  92. }
  93.  
  94. COMMAND:music(playerid, params[])
  95. {
  96.     new string[MAX_PLAYERS], url[MAX_PLAYERS];
  97.     if(sscanf(params, "s[500]", url)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /music [url].mp3");
  98.     format(string, sizeof(string), "You have been stream the music %s", url);
  99.     SendClientMessage(playerid, 0xFFFF00FF, string);
  100.     PlayAudioStreamForPlayer(playerid, url);
  101.     return 1;
  102. }
  103.  
  104. COMMAND:shh(playerid, params[])
  105. {
  106.     StopAudioStreamForPlayer(playerid);
  107.     return 1;
  108. }
  109.  
  110. stock IsPlayerName(playerid)
  111. {
  112.     new name[MAX_PLAYER_NAME];
  113.     GetPlayerName(playerid, name, sizeof(name));
  114.     return name;
  115. }
Advertisement
Add Comment
Please, Sign In to add comment