Advertisement
_iLustcheR_

SAMP-IL Array music system v1.2 by LustcheR

Mar 11th, 2014
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.22 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.     {"כתובת השיר", "שם השיר"},
  14.     {"כתובת השיר", "שם השיר"},
  15.     {"כתובת השיר", "שם השיר"},
  16.     {"כתובת השיר", "שם השיר"},
  17.     {"כתובת השיר", "שם השיר"}
  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, "הפעל", "ביטול");
  28.         return 1;
  29.     }
  30.     if(strcmp(cmd, "/StopMusic", true) == 0) return StopAudioStreamForPlayer(playerid), SendClientMessage(playerid, 0xFF0000AA, "[MusicSystem] >> {FFFFFF}.השיר הופסק");
  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
Advertisement