Advertisement
Guest User

Untitled

a guest
Jan 25th, 2015
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. new
  2.     listentoradio[MAX_PLAYERS];
  3.  
  4. public OnPlayerConnect(playerid){
  5.     listentoradio[playerid] =0;
  6.     return true;
  7. }
  8.  
  9. dcmd_radio(playerid, params[])
  10. {
  11.     #pragma unused params
  12.     if(listentoradio[playerid] == 0)
  13.     {
  14.         TextDrawShowForPlayer(playerid, radioTD1);
  15.         TextDrawShowForPlayer(playerid, radioTD2);
  16.         TextDrawShowForPlayer(playerid, radioTD3);
  17.         TextDrawShowForPlayer(playerid, radioTD4);
  18.         radioTD[playerid] =1;
  19.         radioTD0[playerid] =1;
  20.     }
  21.     else
  22.     {
  23.         StopAudioStreamForPlayer(playerid);
  24.         listentoradio[playerid] =0;
  25.         SCM(playerid, COLOR_YELLOW,"Radio is Now Off");
  26.     }
  27.     return 1;
  28. }
  29.  
  30. public OnPlayerText(playerid,text[]){
  31.  
  32.     if(radioTD[playerid] == 1)
  33.     {
  34.         if(!strcmp(text, "1", true))
  35.         {
  36.             PlayAudioStreamForPlayer(playerid,"http://cnr-radio.com/listen.m3u");
  37.             listentoradio[playerid] =1;
  38.             return 0;
  39.         }
  40.         if(!strcmp(text, "2", true))
  41.         {
  42.             PlayAudioStreamForPlayer(playerid,"http://cnr-radio.com/listeneuro.m3u");
  43.             listentoradio[playerid] =1;
  44.             return 0;
  45.         }
  46.         if(!strcmp(text, "3", true))
  47.         {
  48.             PlayAudioStreamForPlayer(playerid,"http://cnr-radio.com/listenasia.m3u");
  49.             listentoradio[playerid] =1;
  50.             return 0;
  51.         }
  52.         if(!strcmp(text, "4", true))
  53.         {
  54.             StopAudioStreamForPlayer(playerid);
  55.             listentoradio[playerid] =0;
  56.             SCM(playerid, COLOR_YELLOW,"Radio is Now Off");
  57.             return 0;
  58.         }
  59.         else
  60.         {
  61.             SCM(playerid, COLOR_RED,"Invalid Selection.");
  62.             return 0;
  63.         }
  64.     }
  65.     return true;
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement