Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Creator:
- * --> *|Samp4Lifes|* <--
- * Do not remove this credits (haha wtf I know yo will Fuckin' Fuckd ._.
- * Edit:
- * --> Dominik 'MARV' Lisy
- * I cleaned up and rempve pragma tabsize 0.
- */
- #include <a_samp>
- #include <zcmd>
- #include <dini>
- #include <streamer>
- //------------------------------------------------------------------------------
- #define MAX_SONGS 20
- //------------------------------------------------------------------------------
- forward LoadSongs();
- //------------------------------------------------------------------------------
- new SongName[MAX_SONGS][256],
- SongLink[MAX_SONGS][256],
- TotalSongs,
- bool:SongExists[MAX_SONGS]= false,
- SongDialog = 100,
- iString[255];
- //------------------------------------------------------------------------------
- stock SongFile(SongID)
- {
- new song[256];
- format(song,256,"Songs/%d.ini",SongID);
- return song;
- }
- //------------------------------------------------------------------------------
- public LoadSongs()
- {
- for(new i = 0;i<MAX_SONGS;i++)
- {
- if(dini_Exists(SongFile(i))){
- SongExists[i] = true;
- TotalSongs++;
- SongLink[i] = dini_Get(SongFile(i),"Link");
- SongName[i] = dini_Get(SongFile(i),"Name");
- new Texto[128],Texto2[1500];
- format(Texto,128,"ID SONG - %d - NAME %s \nLINK %s\n",i,SongName[i],SongLink[i]);
- strcat(Texto2,Texto);
- print(Texto2);
- }
- }
- return printf("Total Songs Loaded %d",TotalSongs);
- }
- //------------------------------------------------------------------------------
- public OnFilterScriptInit()
- {
- LoadSongs();
- }
- //------------------------------------------------------------------------------
- public OnDialogResponse(playerid,dialogid,response,listitem,inputtext[])
- {
- if(dialogid == SongDialog+32 && response){
- if(!SongExists[listitem]) return SendClientMessage(playerid,-1,"{FF7777}La cancion no pudo ser cargada");
- PlayAudioStreamForPlayer(playerid,SongLink[listitem]);
- format(iString,256,"{77FF77} ((-> %s <-)) type /StopMusic to stop",SongName[listitem]);
- SendClientMessage(playerid,-1,iString);
- return 1;
- }
- return 0;
- }
- //------------------------------------------------------------------------------
- CMD:songlist(playerid,params[])
- {
- new Title[128],
- Texto[128],
- Total[1500]
- ;
- for(new i = 0;i<MAX_SONGS;i++)
- {
- if(SongExists[i] == true){
- if(TotalSongs == 0) return SendClientMessage(playerid,-1,"{FF7777}Sorry but there's not any song to reproduce");
- format(Texto,128,"{77FF77}ID SONG - {FFFFFF}%d - {77FF77}NAME {FFFFFF}%s\n",i,SongName[i]);
- format(Title,128,"{FF7777}Songs Loaded {FFFFFF}%d",TotalSongs);
- strcat(Total,Texto);
- }
- }
- return ShowPlayerDialog(playerid,SongDialog+32,2,Title,Total,"Play","Cancel");
- }
- //------------------------------------------------------------------------------
- CMD:stop(playerid,params[])
- {
- StopAudioStreamForPlayer(playerid);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement