Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #pragma tabsize 0
- #define DIALOG_RADIOS 11748 // Nombre au hasard, si déjà pris, changez le par un nombre pas encore pris
- #define DIALOG_NRJ 11784 // Idem
- #define DIALOG_PERSO 11785
- new bool:RadioON[MAX_PLAYERS] = false, phrase[512];
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- format(phrase, sizeof(phrase), "Skyrock\nNRJ\nFun Radio\nVirgin Radio\nRadio personnalisée");
- if (strcmp("/radio", cmdtext, true, 6) == 0)
- {
- ShowPlayerDialog(playerid, DIALOG_RADIOS, DIALOG_STYLE_LIST, "Radios", phrase, "Mettre", "Quitter");
- return 1;
- }
- if(strcmp("/stopradio", cmdtext, true, 10) == 0)
- {
- if(RadioON[playerid] == true)
- {
- StopAudioStreamForPlayer(playerid);
- SendClientMessage(playerid, -1, "{336699}[Information]{FFFFFF} Vous avez arrêté la radio.");
- RadioON[playerid] = false;
- }
- else
- {
- SendClientMessage(playerid, -1, "{FF0000}[Erreur]{FFFFFF} Vous ne pouvez pas arrêter la radio si vous ne l'écoutez pas !");
- }
- return 1;
- }
- return 0;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_RADIOS)
- {
- if(!response)
- {
- ShowPlayerDialog(playerid, -1, DIALOG_STYLE_MSGBOX, "Fermer", "Fermer le dialog", "Ok", "Ok");
- }
- else
- {
- if(listitem == 0)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://mp3.live.tv-radio.com/nrj/all/nrj_113225.mp3");
- SendClientMessage(playerid, -1, "{9ACD32}[Information]{FFFFFF} Vous écoutez maintenant Skyrock.");
- RadioON[playerid] = true;
- }
- if(listitem == 1)
- {
- new str[512];
- format(str,sizeof(str),"NRJ Normal\nNRJ by Disney\nNRJ Club\nNRJ Dance\nNRJ French\nNRJ Friendly\nNRJ Girl\nNRJ Hits\nNRJ Ibiza\nNRJ In Bed\n NRJ iTunes\nNRJ Spécial Lady Gaga\nNRJ Lounge\nNRJ Master Mix\nNRJ Spécial Mickael Jackson\nNRJ New York\nNRJ Next");
- strcat(str,"\nNRJ Nouveautés\nNRJ Party\nNRJ Pop\nNRJ Rap FR\nNRJ Rap US\nNRJ Spécial Rihanna\nNRJ RnB\nNRJ Rock\nNRJ Running\nNRJ Spécial Shakira\nNRJ Shop\nNRJ Sun\nNRJ Spécial Black Eyed Peas\nNRJ Spécial Usher");
- ShowPlayerDialog(playerid, DIALOG_NRJ, DIALOG_STYLE_LIST, "NRJ", str, "Jouer", "Retour");
- }
- if(listitem == 2)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://icecast.funradio.fr/fun-1-44-128.m3u");
- SendClientMessage(playerid, -1, "{9ACD32}[Information]{FFFFFF} Vous écoutez maintenant Fun Radio !");
- RadioON[playerid] = true;
- }
- if(listitem == 3)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://stream5.nrj.yacast.net/virginradio.m3u");
- SendClientMessage(playerid, -1, "{9ACD32}[Information]{FFFFFF} Vous écoutez maintenant Virgin Radio !");
- RadioON[playerid] = true;
- }
- if(listitem == 4)
- {
- ShowPlayerDialog(playerid, DIALOG_PERSO, DIALOG_STYLE_INPUT, "Radio personnalisée", "Entrez ci-dessous l'url de votre radio.\nElle doit se terminer par {727A7D}.mp3, .m3u, .ogg, .vbs, {FFFFFF}etc.", "Jouer", "Retour");
- }
- }
- return 1;
- }
- if(dialogid == DIALOG_NRJ)
- {
- if(!response)
- {
- ShowPlayerDialog(playerid, DIALOG_RADIOS, DIALOG_STYLE_LIST, "Radios", phrase, "Mettre", "Quitter");
- }
- else
- {
- if(listitem == 0)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://mp3.live.tv-radio.com/nrj/all/nrj_113225.mp3");
- RadioON[playerid] = true;
- }
- if(listitem == 1)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://mp3.live.tv-radio.com/nrj_by_disney/all/nrj_152411.mp3");
- RadioON[playerid] = true;
- }
- if(listitem == 2)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://mp3.live.tv-radio.com/nrj_clubbin/all/nrj_153250.mp3");
- RadioON[playerid] = true;
- }
- if(listitem == 3)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://mp3.live.tv-radio.com/nrj_dance/all/nrj_151505.mp3");
- RadioON[playerid] = true;
- }
- if(listitem == 4)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://mp3.live.tv-radio.com/nrj_french/all/nrj_155913.mp3");
- RadioON[playerid] = true;
- }
- if(listitem == 5)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://mp3.live.tv-radio.com/nrj_friendly/all/nrj_164207.mp3");
- RadioON[playerid] = true;
- }
- if(listitem == 6)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://mp3.live.tv-radio.com/nrj_girl/all/nrj_153716.mp3");
- RadioON[playerid] = true;
- }
- if(listitem == 7)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://mp3.live.tv-radio.com/nrj_hits/all/nrj_150726.mp3");
- RadioON[playerid] = true;
- }
- if(listitem == 8)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://mp3.live.tv-radio.com/nrj_ibiza/all/nrj_164849.mp3");
- RadioON[playerid] = true;
- }
- if(listitem == 9)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://mp3.live.tv-radio.com/nrj_in_bed/all/nrj_135650.mp3");
- RadioON[playerid] = true;
- }
- if(listitem == 10)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://mp3.live.tv-radio.com/nrj_itunes/all/nrj_153938.mp3");
- RadioON[playerid] = true;
- }
- if(listitem == 11)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://mp3.live.tv-radio.com/nrj_lady_gaga/all/nrj_152704.mp3");
- RadioON[playerid] = true;
- }
- if(listitem == 12)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://mp3.live.tv-radio.com/nrj_lounge/all/nrj_151750.mp3");
- RadioON[playerid] = true;
- }
- if(listitem == 13)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://mp3.live.tv-radio.com/nrj_mastermix/all/nrj_163522.mp3");
- RadioON[playerid] = true;
- }
- if(listitem == 14)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://mp3.live.tv-radio.com/nrj_michael_jackson/all/nrj_154634.mp3");
- RadioON[playerid] = true;
- }
- if(listitem == 15)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://mp3.live.tv-radio.com/nrj_new-york/all/nrj_140527.mp3");
- RadioON[playerid] = true;
- }
- if(listitem == 16)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://mp3.live.tv-radio.com/nrj_next/all/nrj_122336.mp3");
- RadioON[playerid] = true;
- }
- if(listitem == 17)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://mp3.live.tv-radio.com/nrj_nouveaute/all/nrj_161209.mp3");
- RadioON[playerid] = true;
- }
- if(listitem == 18)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://mp3.live.tv-radio.com/2051/nrj_party/nrj_190407.mp3");
- RadioON[playerid] = true;
- }
- if(listitem == 19)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://mp3.live.tv-radio.com/nrj_pop/all/nrj_151240.mp3");
- RadioON[playerid] = true;
- }
- if(listitem == 20)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://mp3.live.tv-radio.com/nrj_rap_fr/all/nrj_145338.mp3");
- RadioON[playerid] = true;
- }
- if(listitem == 21)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://mp3.live.tv-radio.com/nrj_rap_us/all/nrj_144854.mp3");
- RadioON[playerid] = true;
- }
- if(listitem == 22)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://mp3.live.tv-radio.com/nrj_rihanna/all/nrj_163955.mp3");
- RadioON[playerid] = true;
- }
- if(listitem == 23)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://mp3.live.tv-radio.com/nrj_rnb/all/nrj_151038.mp3");
- RadioON[playerid] = true;
- }
- if(listitem == 24)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://mp3.live.tv-radio.com/nrj_rock/all/nrj_161510.mp3");
- RadioON[playerid] = true;
- }
- if(listitem == 25)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://mp3.live.tv-radio.com/nrj_running/all/nrj_162813.mp3");
- RadioON[playerid] = true;
- }
- if(listitem == 26)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://mp3.live.tv-radio.com/nrj_shakira/all/nrj_144619.mp3");
- RadioON[playerid] = true;
- }
- if(listitem == 27)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://mp3.live.tv-radio.com/nrj_shop/all/nrj_121822.mp3");
- RadioON[playerid] = true;
- }
- if(listitem == 28)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://mp3.live.tv-radio.com/nrj_soleil/all/nrj_155103.mp3");
- RadioON[playerid] = true;
- }
- if(listitem == 29)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://mp3.live.tv-radio.com/nrj_black_eyed_peas/all/nrj_161845.mp3");
- RadioON[playerid] = true;
- }
- if(listitem == 30)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://mp3.live.tv-radio.com/nrj_usher/all/nrj_142337.mp3");
- RadioON[playerid] = true;
- }
- SendClientMessage(playerid, -1, "{9ACD32}[Information]{FFFFFF} Vous écoutez maintenant une radio NRJ.");
- }
- return 1;
- }
- if(dialogid == DIALOG_PERSO)
- {
- if(!response)
- {
- ShowPlayerDialog(playerid, DIALOG_RADIOS, DIALOG_STYLE_LIST, "Radios", phrase, "Jouer", "Fermer");
- }
- else
- {
- if(strfind(inputtext, "http://"))
- {
- if(strfind(inputtext, ".mp3") || strfind(inputtext, ".m3u") || strfind(inputtext, ".ogg") || strfind(inputtext, ".vbs"))
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, inputtext);
- }
- else
- {
- SendClientMessage(playerid, -1, "{FF0000}[Erreur]{FFFFFF} Lien invalide.");
- }
- }
- else
- {
- SendClientMessage(playerid, -1, "{FF0000}[Erreur]{FFFFFF} Lien invalide.");
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment