Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Music Dialog v1.0
- * (c) Copyright 2011 by (Mattos)
- *
- * Author: Mateus Costa de Mattos (http://www.brasilwarzone.com)
- * Date: 9th december 2011
- *
- */
- #include <a_samp>
- #define MENUMUSICS 1
- #define ShowMusicDialog(%0) ShowPlayerDialog(%0, MENUMUSICS, DIALOG_STYLE_LIST, "MUSIC SYSTEM - {006600}By Mattos", "Turn Off Music\nEnter Music URL\nPop/Rock/Eletronica\nMetal\nClássic\nRap/Rip Hop\nDisco", "Select", "Cancel")
- new MusicOn[MAX_PLAYERS];
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(strcmp(cmdtext,"/music",true) == 0)
- {
- ShowMusicDialog(playerid);
- return 1;
- }
- return 0;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == MENUMUSICS && response)
- {
- switch(listitem)
- {
- case 0: // Turn Off Music
- {
- MusicOn[playerid] = 0;
- SendClientMessage(playerid, -1, "| Music off.");
- StopAudioStreamForPlayer(playerid);
- }
- case 1: // Enter Mussic URL
- {
- if(MusicOn[playerid] == 1) return SendClientMessage(playerid, -1, "| Turn off the music that is playing to listen to another.");
- ShowPlayerDialog(playerid, (MENUMUSICS + 1), DIALOG_STYLE_INPUT,"Enter Music URL", "Enter a URL of a song with the extension .mp3\nand beginning with http://", "Play", "Cancel");
- }
- case 2: // Pop/Rock/Eletronic
- {
- if(MusicOn[playerid] == 1) return SendClientMessage(playerid, -1, "| Turn off the music that is playing to listen to another.");
- ShowPlayerDialog(playerid, (MENUMUSICS + 2), DIALOG_STYLE_LIST, "Pop/Rock/Eletronica", "Example\nBack", "Select", "Cancel");
- }
- case 3: // Metal
- {
- if(MusicOn[playerid] == 1) return SendClientMessage(playerid, -1, "| Turn off the music that is playing to listen to another.");
- ShowPlayerDialog(playerid, (MENUMUSICS + 3), DIALOG_STYLE_LIST, "Metal", "Example\nBack", "Select", "Cancel");
- }
- case 4: // Clássic
- {
- if(MusicOn[playerid] == 1) return SendClientMessage(playerid, -1, "| Turn off the music that is playing to listen to another.");
- ShowPlayerDialog(playerid, (MENUMUSICS + 4), DIALOG_STYLE_LIST, "Clássica", "Example\nBack", "Select", "Cancel");
- }
- case 5: // Rap/Rip Hop
- {
- if(MusicOn[playerid] == 1) return SendClientMessage(playerid, -1, "| Turn off the music that is playing to listen to another.");
- ShowPlayerDialog(playerid, (MENUMUSICS + 5), DIALOG_STYLE_LIST, "Rap/Rip Hop", "Exemple\nBack", "Select", "Cancel");
- }
- case 6: // Disco
- {
- if(MusicOn[playerid] == 1) return SendClientMessage(playerid, -1, "| Turn off the music that is playing to listen to another.");
- ShowPlayerDialog(playerid, (MENUMUSICS + 6), DIALOG_STYLE_LIST, "Disco", "Example\nBack", "Select", "Cancel");
- }
- }
- return 1;
- }
- //==============================================================================
- // Enter Music URL
- //==============================================================================
- if(dialogid == (MENUMUSICS + 1) && response)
- {
- PlayAudioStreamForPlayer(playerid, inputtext);
- MusicOn[playerid] = 1;
- return 1;
- }
- //==============================================================================
- // Pop/Rock/Eletronic
- //==============================================================================
- if(dialogid == (MENUMUSICS + 2) && response)
- {
- switch(listitem)
- {
- case 0: PlayAudioStreamForPlayer(playerid, "http://example.mp3"), MusicOn[playerid] = 1;
- case 1: ShowMusicDialog(playerid);
- }
- return 1;
- }
- //==============================================================================
- // Metal
- //==============================================================================
- if(dialogid == (MENUMUSICS + 3) && response)
- {
- switch(listitem)
- {
- case 0: PlayAudioStreamForPlayer(playerid, "http://example.mp3"), MusicOn[playerid] = 1;
- case 1: ShowMusicDialog(playerid);
- }
- return 1;
- }
- //==============================================================================
- // Clássic
- //==============================================================================
- if(dialogid == (MENUMUSICS + 4) && response)
- {
- switch(listitem)
- {
- case 0: PlayAudioStreamForPlayer(playerid, "http://example.mp3"), MusicOn[playerid] = 1;
- case 1: ShowMusicDialog(playerid);
- }
- return 1;
- }
- //==============================================================================
- // Rap/Rip Hop
- //==============================================================================
- if(dialogid == (MENUMUSICS + 5) && response)
- {
- switch(listitem)
- {
- case 0: PlayAudioStreamForPlayer(playerid, "http://example.mp3"), MusicOn[playerid] = 1;
- case 1: ShowMusicDialog(playerid);
- }
- return 1;
- }
- //==============================================================================
- // Disco
- //==============================================================================
- if(dialogid == (MENUMUSICS + 6) && response)
- {
- switch(listitem)
- {
- case 0: PlayAudioStreamForPlayer(playerid, "http://example.mp3"), MusicOn[playerid] = 1;
- case 1: ShowMusicDialog(playerid);
- }
- return 1;
- }
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- MusicOn[playerid] = 0;
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment