Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <zcmd>
- #define DIALOG_PLAYLIST 1
- new str[512];
- new Music[][][] = {
- {"Music name","http://yourwebsite.com/"}
- };
- public OnFilterScriptInit() return print("Music library - Loaded...");
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
- if(dialogid == DIALOG_PLAYLIST) {
- if(response) {
- PlayAudioStreamForPlayer(playerid, Music[listitem][1]);
- }
- }
- return 1;
- }
- CMD:sm(playerid) return cmd_stopmusic(playerid);
- CMD:stopmusic(playerid) {
- StopAudioStreamForPlayer(playerid);
- return 1;
- }
- CMD:playlist(playerid) {
- new output[1024] = EOS;
- for(new i = 0; i < sizeof(Music); i++) {
- strcat(output, Music[i][0]);
- strcat(output, "\n");
- }
- ShowPlayerDialog(playerid, DIALOG_PLAYLIST, DIALOG_STYLE_LIST, "Music list",output,"Play","Close");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment