Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //MP3 Simple System By VanGans
- #include <a_samp>
- #include <zcmd>
- _____________ DIALOGS ___________________
- #define DIALOG_MP3 15
- #define DIALOG_RAP 16
- #define DIALOG_ELETRONIC 17
- #define DIALOG_URBAN 18
- _________________________________________
- CMD:rfone(playerid)
- {
- if(IsPlayerAttachedObjectSlotUsed(playerid, 2)) RemovePlayerAttachedObject(playerid, 2); //menghapus hanya headset, tetapi tidak menghentikan musik.
- StopAudioStreamForPlayer(playerid);
- return 1;
- }
- CMD:mp3(playerid)
- {
- if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "{FF4A4A}ERROR:{FFFFFF} Anda tidak berada di dalam kendaraan!");
- ShowPlayerDialog(playerid, DIALOG_MP3, DIALOG_STYLE_LIST, "MP3", "Rap\nEletronic\nUrban\nDesligar mp3", "Select", "Cancel");
- return 1;
- }
- //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.
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_MP3)
- {
- if(response)
- {
- if(listitem == 0)
- ShowPlayerDialog(playerid, DIALOG_RAP, DIALOG_STYLE_LIST, "Rap", "Rap Vol.1\nRap Vol.2\nRap 24/7\n", "Tocar", "Voltar");
- if(listitem == 1)
- ShowPlayerDialog(playerid, DIALOG_ELETRONIC, DIALOG_STYLE_LIST, "Eletronic", "Eletronic Vol.1\nEletronic Vol.2\nEletronic 24/7\n", "Tocar", "Voltar");
- if(listitem == 2)
- ShowPlayerDialog(playerid, DIALOG_URBAN, DIALOG_STYLE_LIST, "Urban", "Urban Vol.1\nUrban Vol.2\nUrban 24/7\n", "Tocar", "Voltar");
- if(listitem == 3)
- {
- StopAudioStreamForPlayer(playerid);
- GameTextForPlayer(playerid, "~r~mp3 inativo!", 1000, 4);
- }
- }
- }
- if(dialogid == DIALOG_RAP)
- {
- if(!response) return ShowPlayerDialog(playerid, DIALOG_MP3, DIALOG_STYLE_LIST, "MP3", "Rap\nEletronic\nUrban\nDesligar mp3", "Selecionar", "Cancelar");
- if(response)
- {
- if(listitem == 0)
- {
- PlayAudioStreamForPlayer(playerid, "http://149.56.157.81:8569");
- GameTextForPlayer(playerid, "~g~mp3 ativo!", 1000, 4);
- SendClientMessage(playerid, -1, "{6857FF}RADIO:{FFFFFF} Voce escolheu a estacao Rap Vol.1!");
- 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);
- }
- if(listitem == 1)
- {
- PlayAudioStreamForPlayer(playerid, "http://149.56.175.167:5461");
- GameTextForPlayer(playerid, "~g~mp3 ativo!", 1000, 4);
- SendClientMessage(playerid, -1, "{6857FF}RADIO:{FFFFFF} Voce escolheu a estacao Rap Vol.2!");
- 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);
- }
- if(listitem == 2)
- {
- PlayAudioStreamForPlayer(playerid, "http://149.56.157.81:5024");
- GameTextForPlayer(playerid, "~g~mp3 ativo!", 1000, 4);
- SendClientMessage(playerid, -1, "{6857FF}RADIO:{FFFFFF} Voce escolheu a estacao Rap 24/7!");
- 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);
- }
- }
- }
- if(dialogid == DIALOG_ELETRONIC)
- {
- if(!response) return ShowPlayerDialog(playerid, DIALOG_MP3, DIALOG_STYLE_LIST, "MP3", "Rap\nEletronic\nUrban\nDesligar mp3", "Selecionar", "Cancelar");
- if(response)
- {
- if(listitem == 0)
- {
- PlayAudioStreamForPlayer(playerid, "http://51.15.177.152:8060");
- GameTextForPlayer(playerid, "~g~mp3 ativo!", 1000, 4);
- SendClientMessage(playerid, -1, "{6857FF}RADIO:{FFFFFF} Voce escolheu a estacao Eletronic Vol.1!");
- 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);
- }
- if(listitem == 1)
- {
- PlayAudioStreamForPlayer(playerid, "http://78.31.65.20:8080");
- GameTextForPlayer(playerid, "~g~mp3 ativo!", 1000, 4);
- SendClientMessage(playerid, -1, "{6857FF}RADIO:{FFFFFF} Voce escolheu a estacao Eletronic Vol.2!");
- 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);
- }
- if(listitem == 2)
- {
- PlayAudioStreamForPlayer(playerid, "http://206.223.161.107:80");
- GameTextForPlayer(playerid, "~g~mp3 ativo!", 1000, 4);
- SendClientMessage(playerid, -1, "{6857FF}RADIO:{FFFFFF} Voce escolheu a estacao Eletronic 24/7!");
- 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);
- }
- }
- }
- if(dialogid == DIALOG_URBAN)
- {
- if(!response) ShowPlayerDialog(playerid, DIALOG_MP3, DIALOG_STYLE_LIST, "MP3", "Rap\nEletronic\nUrban\nDesligar mp3", "Selecionar", "Cancelar");
- if(response)
- {
- if(listitem == 0)
- {
- PlayAudioStreamForPlayer(playerid, "http://192.99.8.192:3132");
- GameTextForPlayer(playerid, "~g~mp3 ativo!", 1000, 4);
- SendClientMessage(playerid, -1, "{6857FF}RADIO:{FFFFFF} Voce escolheu a estacao Urban Vol.1!");
- 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);
- }
- if(listitem == 1)
- {
- PlayAudioStreamForPlayer(playerid, "http://66.85.88.174:80");
- GameTextForPlayer(playerid, "~g~mp3 ativo!", 1000, 4);
- SendClientMessage(playerid, -1, "{6857FF}RADIO:{FFFFFF} Voce escolheu a estacao Urban vol.2!");
- 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);
- }
- if(listitem == 2)
- {
- PlayAudioStreamForPlayer(playerid, "http://212.83.150.15:8843");
- GameTextForPlayer(playerid, "~g~mp3 ativo!", 1000, 4);
- SendClientMessage(playerid, -1, "{6857FF}RADIO:{FFFFFF} Voce escolheu a estacao Urban 24/7!");
- if(IsPlayerAttachedObjectSlotUsed(playerid, 6)) RemovePlayerAttachedObject(playerid, 6);
- 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);
- }
- }
- }
- return 1;
- }
Add Comment
Please, Sign In to add comment