VanGans

FS MP3 Simple System

Aug 28th, 2020 (edited)
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 7.11 KB | None | 0 0
  1. //MP3 Simple System By VanGans
  2. #include <a_samp>
  3. #include <zcmd>
  4.  
  5. _____________ DIALOGS ___________________
  6.  
  7. #define     DIALOG_MP3          15
  8. #define     DIALOG_RAP          16
  9. #define     DIALOG_ELETRONIC    17
  10. #define     DIALOG_URBAN        18
  11. _________________________________________
  12.  
  13. CMD:rfone(playerid)
  14. {
  15.     if(IsPlayerAttachedObjectSlotUsed(playerid, 2)) RemovePlayerAttachedObject(playerid, 2); //menghapus hanya headset, tetapi tidak menghentikan musik.
  16.     StopAudioStreamForPlayer(playerid);
  17.     return 1;
  18. }
  19.  
  20. CMD:mp3(playerid)
  21. {
  22.     if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "{FF4A4A}ERROR:{FFFFFF} Anda tidak berada di dalam kendaraan!");
  23.     ShowPlayerDialog(playerid, DIALOG_MP3, DIALOG_STYLE_LIST, "MP3", "Rap\nEletronic\nUrban\nDesligar mp3", "Select", "Cancel");
  24.     return 1;
  25. }
  26.  
  27. //untuk ganti url lihat saja kategorinya dan pilih ips http://1.1.1.1.1:80 atau url radio lainnya, saya pakai yang shoutcast, ada juga yang tidak 24/7, mungkin berhenti.
  28.  
  29. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  30. {
  31.     if(dialogid == DIALOG_MP3)
  32.     {
  33.         if(response)
  34.         {
  35.             if(listitem == 0)
  36.                 ShowPlayerDialog(playerid, DIALOG_RAP, DIALOG_STYLE_LIST, "Rap", "Rap Vol.1\nRap Vol.2\nRap 24/7\n", "Tocar", "Voltar");
  37.  
  38.             if(listitem == 1)
  39.                 ShowPlayerDialog(playerid, DIALOG_ELETRONIC, DIALOG_STYLE_LIST, "Eletronic", "Eletronic Vol.1\nEletronic Vol.2\nEletronic 24/7\n", "Tocar", "Voltar");
  40.  
  41.             if(listitem == 2)
  42.                 ShowPlayerDialog(playerid, DIALOG_URBAN, DIALOG_STYLE_LIST, "Urban", "Urban Vol.1\nUrban Vol.2\nUrban 24/7\n", "Tocar", "Voltar");
  43.  
  44.             if(listitem == 3)
  45.             {
  46.                 StopAudioStreamForPlayer(playerid);
  47.                 GameTextForPlayer(playerid, "~r~mp3 inativo!", 1000, 4);
  48.             }
  49.         }
  50.     }
  51.  
  52.     if(dialogid == DIALOG_RAP)
  53.     {
  54.         if(!response) return ShowPlayerDialog(playerid, DIALOG_MP3, DIALOG_STYLE_LIST, "MP3", "Rap\nEletronic\nUrban\nDesligar mp3", "Selecionar", "Cancelar");
  55.         if(response)
  56.         {
  57.             if(listitem == 0)
  58.             {
  59.                 PlayAudioStreamForPlayer(playerid, "http://149.56.157.81:8569");
  60.                 GameTextForPlayer(playerid, "~g~mp3 ativo!", 1000, 4);
  61.                 SendClientMessage(playerid, -1, "{6857FF}RADIO:{FFFFFF} Voce escolheu a estacao Rap Vol.1!");
  62.                 SetPlayerAttachedObject(playerid, 2, 19424, 2, 0.0509, -0.0219, -0.0019, -94.2998, 9.6999, -90.0000, 1.0000, 1.0000, 1.0000, 0xFF00BFFF, 0xFF00BFFF);
  63.             }
  64.             if(listitem == 1)
  65.             {
  66.                 PlayAudioStreamForPlayer(playerid, "http://149.56.175.167:5461");
  67.                 GameTextForPlayer(playerid, "~g~mp3 ativo!", 1000, 4);
  68.                 SendClientMessage(playerid, -1, "{6857FF}RADIO:{FFFFFF} Voce escolheu a estacao Rap Vol.2!");
  69.                 SetPlayerAttachedObject(playerid, 2, 19424, 2, 0.0509, -0.0219, -0.0019, -94.2998, 9.6999, -90.0000, 1.0000, 1.0000, 1.0000, 0xFF00BFFF, 0xFF00BFFF);
  70.             }
  71.             if(listitem == 2)
  72.             {
  73.                 PlayAudioStreamForPlayer(playerid, "http://149.56.157.81:5024");
  74.                 GameTextForPlayer(playerid, "~g~mp3 ativo!", 1000, 4);
  75.                 SendClientMessage(playerid, -1, "{6857FF}RADIO:{FFFFFF} Voce escolheu a estacao Rap 24/7!");
  76.                 SetPlayerAttachedObject(playerid, 2, 19424, 2, 0.0509, -0.0219, -0.0019, -94.2998, 9.6999, -90.0000, 1.0000, 1.0000, 1.0000, 0xFF00BFFF, 0xFF00BFFF);
  77.             }
  78.         }
  79.     }
  80.  
  81.     if(dialogid == DIALOG_ELETRONIC)
  82.     {
  83.         if(!response) return ShowPlayerDialog(playerid, DIALOG_MP3, DIALOG_STYLE_LIST, "MP3", "Rap\nEletronic\nUrban\nDesligar mp3", "Selecionar", "Cancelar");
  84.         if(response)
  85.         {
  86.             if(listitem == 0)
  87.             {
  88.                 PlayAudioStreamForPlayer(playerid, "http://51.15.177.152:8060");
  89.                 GameTextForPlayer(playerid, "~g~mp3 ativo!", 1000, 4);
  90.                 SendClientMessage(playerid, -1, "{6857FF}RADIO:{FFFFFF} Voce escolheu a estacao Eletronic Vol.1!");
  91.                 SetPlayerAttachedObject(playerid, 2, 19424, 2, 0.0509, -0.0219, -0.0019, -94.2998, 9.6999, -90.0000, 1.0000, 1.0000, 1.0000, 0xFF00BFFF, 0xFF00BFFF);
  92.             }
  93.             if(listitem == 1)
  94.             {
  95.                 PlayAudioStreamForPlayer(playerid, "http://78.31.65.20:8080");
  96.                 GameTextForPlayer(playerid, "~g~mp3 ativo!", 1000, 4);
  97.                 SendClientMessage(playerid, -1, "{6857FF}RADIO:{FFFFFF} Voce escolheu a estacao Eletronic Vol.2!");
  98.                 SetPlayerAttachedObject(playerid, 2, 19424, 2, 0.0509, -0.0219, -0.0019, -94.2998, 9.6999, -90.0000, 1.0000, 1.0000, 1.0000, 0xFF00BFFF, 0xFF00BFFF);
  99.             }
  100.  
  101.             if(listitem == 2)
  102.             {
  103.                 PlayAudioStreamForPlayer(playerid, "http://206.223.161.107:80");
  104.                 GameTextForPlayer(playerid, "~g~mp3 ativo!", 1000, 4);
  105.                 SendClientMessage(playerid, -1, "{6857FF}RADIO:{FFFFFF} Voce escolheu a estacao Eletronic 24/7!");
  106.                 SetPlayerAttachedObject(playerid, 2, 19424, 2, 0.0509, -0.0219, -0.0019, -94.2998, 9.6999, -90.0000, 1.0000, 1.0000, 1.0000, 0xFF00BFFF, 0xFF00BFFF);
  107.             }
  108.         }
  109.     }
  110.  
  111.     if(dialogid == DIALOG_URBAN)
  112.     {
  113.         if(!response) ShowPlayerDialog(playerid, DIALOG_MP3, DIALOG_STYLE_LIST, "MP3", "Rap\nEletronic\nUrban\nDesligar mp3", "Selecionar", "Cancelar");
  114.         if(response)
  115.         {
  116.             if(listitem == 0)
  117.             {
  118.                 PlayAudioStreamForPlayer(playerid, "http://192.99.8.192:3132");
  119.                 GameTextForPlayer(playerid, "~g~mp3 ativo!", 1000, 4);
  120.                 SendClientMessage(playerid, -1, "{6857FF}RADIO:{FFFFFF} Voce escolheu a estacao Urban Vol.1!");
  121.                 SetPlayerAttachedObject(playerid, 2, 19424, 2, 0.0509, -0.0219, -0.0019, -94.2998, 9.6999, -90.0000, 1.0000, 1.0000, 1.0000, 0xFF00BFFF, 0xFF00BFFF);
  122.             }
  123.             if(listitem == 1)
  124.             {
  125.                 PlayAudioStreamForPlayer(playerid, "http://66.85.88.174:80");
  126.                 GameTextForPlayer(playerid, "~g~mp3 ativo!", 1000, 4);
  127.                 SendClientMessage(playerid, -1, "{6857FF}RADIO:{FFFFFF} Voce escolheu a estacao Urban vol.2!");
  128.                 SetPlayerAttachedObject(playerid, 2, 19424, 2, 0.0509, -0.0219, -0.0019, -94.2998, 9.6999, -90.0000, 1.0000, 1.0000, 1.0000, 0xFF00BFFF, 0xFF00BFFF);
  129.             }
  130.             if(listitem == 2)
  131.             {
  132.                 PlayAudioStreamForPlayer(playerid, "http://212.83.150.15:8843");
  133.                 GameTextForPlayer(playerid, "~g~mp3 ativo!", 1000, 4);
  134.                 SendClientMessage(playerid, -1, "{6857FF}RADIO:{FFFFFF} Voce escolheu a estacao Urban 24/7!");
  135.                 if(IsPlayerAttachedObjectSlotUsed(playerid, 6)) RemovePlayerAttachedObject(playerid, 6);
  136.                 SetPlayerAttachedObject(playerid, 2, 19424, 2, 0.0509, -0.0219, -0.0019, -94.2998, 9.6999, -90.0000, 1.0000, 1.0000, 1.0000, 0xFF00BFFF, 0xFF00BFFF);
  137.             }
  138.         }
  139.     }
  140.     return 1;
  141. }
Add Comment
Please, Sign In to add comment