Advertisement
BlueRey

Radio List V0.4 by BlueRey [ENG]

May 7th, 2012
714
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.65 KB | None | 0 0
  1. //
  2. //                     Radio List for SA-MP 0.3d+
  3. //                      By: BlueRey [Fxp.co.il]
  4. //
  5. //
  6. //                         Date: 09/05/2012
  7. //                         Version: 0.4 ENG
  8. //
  9.  
  10. #include <a_samp>
  11.  
  12. #define DEIALOG_ID 7777
  13.  
  14. new radiolist[][][] =
  15. {
  16.     {"http://scfire-ntc-aa04.stream.aol.com:80/stream/1071","HOT 108 JAMZ"},
  17.     {"http://scfire-mtc-aa05.stream.aol.com:80/stream/1003","Trance Channel"},
  18.     {"http://68.68.105.106:80","idobi Radio"},
  19.     {"http://80.237.153.76:21000","MUSIK.DRUMSTEP"},
  20.     {"http://scfire-mtc-aa04.stream.aol.com:80/stream/1023","181FM POP"},
  21.     {"http://scfire-dtc-aa05.stream.aol.com:80/stream/1074","977 The Hitz Channel"},
  22.     {"http://scfire-ntc-aa04.stream.aol.com:80/stream/1093","Energy 98"},
  23.     {"http://72.232.2.83:8000","DUBSTEP.FM"},
  24.     {"http://81.218.219.203:8000","Pulse-FM Israel"},
  25.     {"http://icecast.clickfm.co.il:8002/click2dance","Click2Dance IL"}
  26. };
  27. new bool:Radio[MAX_PLAYERS];
  28.  
  29. public OnPlayerCommandText(playerid, cmdtext[])
  30. {
  31.     if(!strcmp(cmdtext,"/radio",true))
  32.     {
  33.         new list[500];
  34.         for(new i; i <= sizeof(radiolist); i++)
  35.         {
  36.             if(i == sizeof(radiolist)) format(list,500,"%s\n \n{FF0000}Stop Lisenig",list);
  37.             else format(list,500,"%s\n{FAFAFA}%02d) {FF9900}%s",list,i+1,radiolist[i][1]);
  38.         }
  39.         ShowPlayerDialog(playerid,DEIALOG_ID,DIALOG_STYLE_LIST,"{00C8C8}Please select a Station",list,"Play","Close");
  40.         return 1;
  41.     }
  42.  
  43.     if(!strcmp(cmdtext,"/music-all-off",true) && IsPlayerAdmin(playerid))
  44.     {
  45.         for(new i,m=GetMaxPlayers(); i < m; i++) if(IsPlayerConnected(i) && Radio[i]) StopAudioStreamForPlayer(i),Radio[i] = false;
  46.         return 1;
  47.     }
  48.  
  49.     if(!strcmp(cmdtext,"/minfo",true)) return SendClientMessage(playerid,0xFFFFFFAA,"Radio List [V0.4] | By: BlueRey © Fxp.co.il"); // do not remove
  50.    
  51.     if(!strcmp(cmdtext,"/moff",true))
  52.     {
  53.         StopAudioStreamForPlayer(playerid);
  54.         Radio[playerid] = false;
  55.         return 1;
  56.     }
  57.     return 0;
  58. }
  59.  
  60. public OnPlayerConnect(playerid) Radio[playerid] = false;
  61.  
  62. public OnDialogResponse(playerid,dialogid,response,listitem,inputtext[])
  63. {
  64.     if(!response) return 1;
  65.     if(dialogid == DEIALOG_ID)
  66.     {
  67.         if(listitem == sizeof(radiolist)) return OnPlayerCommandText(playerid,"/radio");
  68.         if(listitem == sizeof(radiolist)+1) return StopAudioStreamForPlayer(playerid),Radio[playerid] = false;
  69.         StopAudioStreamForPlayer(playerid);
  70.         PlayAudioStreamForPlayer(playerid,radiolist[listitem][0]);
  71.         new str[50]; format(str,50,"Now listening to \"%s\"...",radiolist[listitem][1]);
  72.         SendClientMessage(playerid,0x33CCFFAA,str);
  73.         SendClientMessage(playerid,0xFFFFFFAA,"Stop listening: /MOFF");
  74.         Radio[playerid] = true;
  75.         return 1;
  76.     }
  77.     return 0;
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement