_iLustcheR_

SAMP-IL Array music system v1.2 by LustcheR - English

Mar 28th, 2014
515
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.13 KB | None | 0 0
  1. #include <a_samp>
  2. #include "../include/gl_common.inc"
  3.  
  4. #define Dialog_Music 1
  5.  
  6. enum SInfo
  7. {
  8.     SongName[24],
  9.     SongURL[100]
  10. };
  11. new Songs[][SInfo] =
  12. {
  13.     {"SongName", "SongURL"},
  14.     {"SongName", "SongURL"},
  15.     {"SongName", "SongURL"},
  16.     {"SongName", "SongURL"},
  17.     {"SongName", "SongURL"}
  18. };
  19.  
  20. public OnPlayerCommandText(playerid, cmdtext[])
  21. {
  22.     new cmd[256], SMusic[24], idx;
  23.     cmd = strtok(cmdtext, idx);
  24.     if(strcmp(cmd, "/Music", true) == 0)
  25.     {
  26.         for(new i, j = sizeof(Songs); i < j; i++) format(SMusic, sizeof(SMusic), "%s\n", Songs[i][SongName]);
  27.         ShowPlayerDialog(playerid, Dialog_Music, DIALOG_STYLE_LIST, "{FFFF00}Music List", SMusic, "Play", "Cancel");
  28.         return 1;
  29.     }
  30.     if(strcmp(cmd, "/StopMusic", true) == 0) return StopAudioStreamForPlayer(playerid), SendClientMessage(playerid, 0xFF0000AA, "[MusicSystem] >> {FFFFFF}The song is stopped.");
  31.     return 0;
  32. }
  33.  
  34. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  35. {
  36.     if(dialogid == Dialog_Music && response) return PlayAudioStreamForPlayer(playerid, Songs[listitem][SongURL]);
  37.     return 1;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment