Advertisement
S4T3K

Small Boombox v2 ~ [S4T3K]

Jan 10th, 2014
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 24.46 KB | None | 0 0
  1. /* -------------------------------------------------------------------
  2.  
  3. Présentation du filterscript :
  4.  
  5. Small Boombox system v2 a été créé par S4T3K pour la communauté SF-RP.
  6. Il permet d'utiliser le très apprécié système de boombox, la radio qui diffuse de la musique aux joueurs à proximité.
  7.  
  8. Commandes du filterscript :
  9.  
  10. • /boombox : Crée une radio et joue la station choisie
  11. • /acheterradio : Permet au joueur d'acheter une boombox si il est au 24/7
  12. • /boomboxoff : Détruit la radio que le joueur a posé
  13. • /changermusique : Change la station de radio actuellement jouée. Seul le joueur ayant posé la radio peut le faire.
  14. • /adestroyb [ID du propriétaire de la boombox] : Permet aux Administrateurs de niveau 2 ou plus de détruire une boombox gênante.
  15.  
  16. Crédits du filterscript :
  17.  
  18. • S4T3K (Jay/Mark/Soufiane) : Filterscript de radio de base
  19. • S4T3K (Jay/Mark/Soufiane) : Création et optimisation du filterscript à partir de celui de la radio
  20. • LordMan & FullDrive pour les fonctions ABroadCast et ProxDetector
  21. • La communauté française de SA-MP & Konstantinos : Optimisation/Débug/Aide/M'avoir fait réaliser que j'avais mon son à 0
  22.  
  23. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  24. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  25.  
  26. Changelog :
  27.  
  28. V1.0 :
  29.  
  30. • Création du filterscript (majoritairement buggé et très mal optimisé)
  31.  
  32. V2.0 :
  33.  
  34. • Ajout de la commande /changermusique
  35. • Ajout de la commande /boomboxoff
  36. • Ajout de la commande /adestroyb [ID du propriétaire de la boombox]
  37. • Ajout de l'option "Radio personnalisée"
  38. • Le nom de la personne ayant créé la boombox est affiché au dessus de celle-ci
  39. • Optimisation majeure (Création de la fonction createboombox pour remplacer ce code qui revenait régulièrement)
  40.  
  41. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  42. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  43.         /[---------------------------------------]
  44.         /[/!\ Conservez les crédits, merci :) /!\]
  45.         /[/!\ Conservez les crédits, merci :) /!\]
  46.         /[---------------------------------------]
  47.  
  48. ------------------------------------------------------------------- */
  49.  
  50.  
  51. // Section Includes
  52. // A modifier en conséquence si vous n'avez pas les includes
  53.  
  54. #include <a_samp>
  55. #include <core>
  56. #include <float>
  57. #include <time>
  58. #include <file>
  59. #include <dini>
  60. #include <utils>
  61. #include <morphinc>
  62. #include <time>
  63. #include "gl_common.inc"
  64. // Section defines
  65.  
  66. #define MAX_RADIO_SOL 100 // A modifier si trop lourd
  67. #define DIALOG_RADIOS 9510 // A modifier si déjà pris
  68. #define DIALOG_NRJ 9511 // A modifier si déjà pris
  69. #define DIALOG_CHOIX 9512 // A modifier si déjà pris
  70. #define COLOR_ACTION 0xC2A2DAFF
  71. #define COLOR_ME COLOR_ACTION // Modifier COLOR_ME par le nom de la couleur de votre /me si vous voulez pas remplacer COLOR_ACTION dans tout le GM. Sinon, effacer/commenter cette ligne.
  72.  
  73. // Section forwards
  74.  
  75. forward destroyboombox(playerid);
  76. forward createboombox(playerid);
  77. forward ABroadCast(color,const string[],level); // By LordMan
  78. forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5); // By LordMan
  79.  
  80. // Section new
  81.  
  82. new boombox[MAX_PLAYERS] = 0;
  83. new boomboxtotal;
  84. new Text3D:display[MAX_PLAYERS];
  85. new radio[700];
  86. new string[256];
  87.  
  88. // Enum
  89.  
  90. enum pInfo
  91. {
  92.     pRadio,
  93.     pAdmin,
  94. };
  95. new PlayerInfo[MAX_PLAYERS][pInfo];
  96.  
  97. // Autres
  98.  
  99. #pragma tabsize 0
  100.  
  101. // Mes callbacks
  102.  
  103. public createboombox(playerid)
  104. {
  105.     new playername[60];
  106.     GetPlayerName(playerid, playername, sizeof(playername));
  107.     new Float:x, Float:y, Float:z, Float:distance;
  108.     GetPlayerPos(playerid, x, y, z);
  109.     distance = 50.0;
  110.     new string[256];
  111.         for(new i = 0; i < MAX_PLAYERS; i++)
  112.         {
  113.             StopAudioStreamForPlayer(i);
  114.             PlayAudioStreamForPlayer(i, radio, x, y, z, distance);
  115.             SetPVarInt(playerid, "RadioON", 1);
  116.             format(string, sizeof(string), "Boombox [%s] [%d]", playername, playerid);
  117.         new bitem[MAX_PLAYERS] = random(1) + 1;
  118.             switch(bitem[playerid])
  119.             {
  120.                 case 1:
  121.                 {
  122.                 boombox[playerid] = CreateObject(2103, x, y, z, 0.0, 0.0, 0.0);
  123.                 }
  124.                 case 2:
  125.                 {
  126.                 boombox[playerid] = CreateObject(2102, x, y, z, 0.0, 0.0, 0.0);
  127.                 }
  128.                 default:
  129.                 {
  130.                 boombox[playerid] = CreateObject(3030, x, y, z, 0.0, 0.0, 0.0);
  131.                 }
  132.             }
  133.             display[playerid] = Create3DTextLabel(string, COLOR_ACTION, x, y, z+1, 15.0, GetPlayerVirtualWorld(playerid), 0);
  134.         }
  135. return 1;
  136. }
  137.  
  138. public destroyboombox(playerid)
  139. {
  140.     for(new i = 0; i < MAX_PLAYERS; i++)
  141.     {
  142.     new Float:bx, Float:by, Float:bz;
  143.     GetObjectPos(boombox[playerid], bx, by, bz);
  144.     DestroyObject(boombox[playerid]);
  145.     SendClientMessage(playerid, -1, "{9ACD32}[Information]{FFFFFF} Vous avez retiré votre boombox du sol ! Vous pouvez la reposer quand vous voulez !");
  146.     Delete3DTextLabel(Text3D:display[playerid]);
  147.     boomboxtotal--;
  148.     DeletePVar(playerid, "RadioON");
  149.     if(IsPlayerInRangeOfPoint(i, 50.0, bx, by, bz))
  150.     {
  151.     StopAudioStreamForPlayer(i);
  152.     }
  153.     }
  154.  
  155.     return 1;
  156. }
  157.  
  158. // ABroadCast by LordMan //
  159.  
  160. public ABroadCast(color,const string[],level)
  161. {
  162.     for(new i = 0; i < MAX_PLAYERS; i++)
  163.     {
  164.         if(IsPlayerConnected(i))
  165.         {
  166.             if (PlayerInfo[i][pAdmin] >= level)
  167.             {
  168.                 SendClientMessage(i, color, string);
  169.                 printf("%s", string);
  170.             }
  171.         }
  172.     }
  173.     return 1;
  174. }
  175.  
  176.  
  177. // ProxDetector by LordMan //
  178.  
  179. public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
  180. {
  181.     if(IsPlayerConnected(playerid))
  182.     {
  183.         new Float:posx, Float:posy, Float:posz;
  184.         new Float:oldposx, Float:oldposy, Float:oldposz;
  185.         new Float:tempposx, Float:tempposy, Float:tempposz;
  186.         GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  187.         //radi = 2.0; //Trigger Radius
  188.         for(new i = 0; i < MAX_PLAYERS; i++)
  189.         {
  190.             if(IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
  191.             {
  192.                     GetPlayerPos(i, posx, posy, posz);
  193.                     tempposx = (oldposx -posx);
  194.                     tempposy = (oldposy -posy);
  195.                     tempposz = (oldposz -posz);
  196.                     //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
  197.                     if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
  198.                     {
  199.                         SendClientMessage(i, col1, string);
  200.                     }
  201.                     else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
  202.                     {
  203.                         SendClientMessage(i, col2, string);
  204.                     }
  205.                     else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
  206.                     {
  207.                         SendClientMessage(i, col3, string);
  208.                     }
  209.                     else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
  210.                     {
  211.                         SendClientMessage(i, col4, string);
  212.                     }
  213.                     else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  214.                     {
  215.                         SendClientMessage(i, col5, string);
  216.                     }
  217.             }
  218.         }
  219.     }//not connected
  220.     return 1;
  221. }
  222.  
  223. // Callback officielles
  224.  
  225. main()
  226. {
  227.     print("----------------------------");
  228.     print("-Advanced Boombox System 2.0");
  229.     print("By S4T3K (Mark/Jay/Soufiane)");
  230.     print("----------------------------");
  231.     return 1;
  232. }
  233.  
  234.  
  235. public OnPlayerCommandText(playerid, cmdtext[])
  236. {
  237. new tmp[30];
  238. new idx;
  239.  
  240.         if(strcmp("/boombox", cmdtext, true, 6) == 0)
  241.         {
  242.             if(PlayerInfo[playerid][pRadio] == 1)
  243.             {
  244.             if(GetPVarInt(playerid, "RadioON") != 0)
  245.             {
  246.                 new Float:x, Float:y, Float:z;
  247.                 GetObjectPos(boombox[playerid], x, y, z);
  248.                 SetPlayerCheckpoint(playerid, x, y, z, 5.0);
  249.                 SendClientMessage(playerid, -1, "{FF0000}[Erreur]{FFFFFF} Vous avez déjà posé une radio ! Si vous avez oublié sa position, elle a été marquée sur votre radar !");
  250.             }
  251.             if(boomboxtotal + 1 < MAX_RADIO_SOL)
  252.             {
  253.                 ShowPlayerDialog(playerid, DIALOG_RADIOS, DIALOG_STYLE_LIST, "Radios", "Skyrock\nNRJ\nFun Radio\nVirgin Radio\nRadio personnalisée\n", "Mettre", "Quitter");
  254.                 return 1;
  255.             }
  256.             else
  257.             {
  258.                 SendClientMessage(playerid, -1, "{FF0000}[Erreur]{FFFFFF} Il y a déjà trop de radios posées au sol ! Réessayez dans quelques minutes !");
  259.             }
  260.             }
  261.             else
  262.             {
  263.                 SendClientMessage(playerid, -1, "{FF0000}[Erreur]{FFFFFF} Vous n'avez pas de radio ! Allez en acheter une au 24/7 !");
  264.             }
  265.         return 1;
  266.         }
  267.  
  268.         if(strcmp("/acheterradio", cmdtext, true, 13) == 0)
  269.         {
  270.             if(IsPlayerInRangeOfPoint(playerid, 10.0, 0.0, 0.0, 0.0)) // Position du 24/7
  271.             {
  272.                 if(GetPlayerMoney(playerid) < 0)
  273.                 {
  274.                     SendClientMessage(playerid, -1, "{FF0000}[Erreur]{FFFFFF} Vous n'avez pas assez d'argent ! (Prix d'une radio : 0$)");
  275.                 }
  276.                 if(PlayerInfo[playerid][pRadio] == 1)
  277.                 {
  278.                     SendClientMessage(playerid, -1, "{FF0000}[Erreur]{FFFFFF} Vous avez déjà une radio ! Utilisez /boombox pour l'utiliser !");
  279.                 }
  280.                 PlayerInfo[playerid][pRadio] = 1;
  281.                 GivePlayerMoney(playerid, 0);
  282.                 SendClientMessage(playerid, -1, "{9ACD32}[Information]{FFFFFF} Vous avez acheté une radio ! Utilisez /boombox pour la poser et l'utiliser !");
  283.             }
  284.             else
  285.             {
  286.                 SendClientMessage(playerid, -1, "{FF0000}[Erreur]{FFFFFF] Vous n'êtes pas au 24/7 !");
  287.             }
  288.             return 1;
  289.         }
  290.         if(strcmp("/adestroyb", cmdtext, true, 10) == 0)
  291.         {
  292.             if(PlayerInfo[playerid][pAdmin] < 2)
  293.             {
  294.                 SendClientMessage(playerid, -1, "{FF0000}[Erreur]{FFFFFF} Vous n'avez pas accès à cette commande !");
  295.             }
  296.                 tmp = strtok(cmdtext, idx);
  297.                         if(!strlen(tmp))
  298.                         {
  299.                                 SendClientMessage(playerid, -1, "{33CCFF}Utilisation : {FFFFFF} /adestroyb [ID du propriétaire de la boombox]");
  300.                                 return 1;
  301.                         }
  302.             new giveplayer;
  303.             new giveplayername[MAX_PLAYER_NAME] = 0;
  304.             new playername[MAX_PLAYER_NAME] = 0;
  305.             giveplayer = ReturnUser(tmp);
  306.             GetPlayerName(playerid, playername, sizeof(playername));
  307.             GetPlayerName(giveplayer, giveplayername, sizeof(giveplayername));
  308.             new Float:bx, Float:by, Float:bz;
  309.             GetObjectPos(boombox[giveplayer], bx, by, bz);
  310.             if(!IsPlayerInRangeOfPoint(playerid, 5.0, bx, by, bz))
  311.             {
  312.                 SendClientMessage(playerid, -1, "{FF0000}[Erreur]{FFFFFF} Vous n'êtes pas à la position de la boombox de ce joueur !");
  313.             }
  314.             DestroyObject(boombox[giveplayer]);
  315.             Delete3DTextLabel(Text3D:display[giveplayer]);
  316.             boomboxtotal--;
  317.             DeletePVar(giveplayer, "RadioON");
  318.             format(string, sizeof(string), "{9ACD32}[Information]{FFFFFF} Vous avez détruit la boombox de %s", giveplayername);
  319.             SendClientMessage(playerid, -1, string);
  320.             format(string, sizeof(string), "{9ACD32}[Information]{FFFFFF} Votre boombox a été détruite par l'Admin %s", playername);
  321.             SendClientMessage(giveplayer, -1, string);
  322.             format(string, sizeof(string), "{9ACD32}[Information]{FFFFFF} L'Admin %s a détruit la boombox de %s", playername, giveplayername);
  323.             ABroadCast(-1, string, 1);
  324.         return 1;
  325.         }
  326.  
  327.  
  328.         if(strcmp("/boomboxoff", cmdtext, true, 11) == 0)
  329.         {
  330.             if(GetPVarInt(playerid, "RadioON") != 1)
  331.             {
  332.                 SendClientMessage(playerid, -1, "{FF0000}[Erreur]{FFFFFF} Vous n'avez posé aucune boombox !");
  333.             }
  334.             new Float:bx, Float:by, Float:bz;
  335.             GetObjectPos(boombox[playerid], bx, by, bz);
  336.             if(!IsPlayerInRangeOfPoint(playerid, 5.0, bx, by, bz))
  337.             {
  338.                 SendClientMessage(playerid, -1, "{FF0000}[Erreur]{FFFFFF} Vous n'êtes pas près de votre boombox ! Si vous avez oublié sa position, elle a été marquée sur votre radar !");
  339.                 SetPlayerCheckpoint(playerid, bx, by, bz, 5.0);
  340.             }
  341.             destroyboombox(playerid);
  342.         }
  343.  
  344.         if(strcmp("/changermusique", cmdtext, true, 15) == 0)
  345.         {
  346.             new playername[60];
  347.             GetPlayerName(playerid, playername, sizeof(playername));
  348.             if(GetPVarInt(playerid, "RadioON") != 1)
  349.             {
  350.                 SendClientMessage(playerid, -1, "{FF0000}[Erreur]{FFFFFF} Vous n'avez posé aucune boombox !");
  351.             }
  352.             new Float:bx, Float:by, Float:bz;
  353.             GetObjectPos(boombox[playerid], bx, by, bz);
  354.             if(!IsPlayerInRangeOfPoint(playerid, 5.0, bx, by, bz))
  355.             {
  356.                 SendClientMessage(playerid, -1, "{FF0000}[Erreur]{FFFFFF} Vous n'êtes pas à proximité de votre boombox !");
  357.             }
  358.             ShowPlayerDialog(playerid, DIALOG_RADIOS, DIALOG_STYLE_LIST, "Radios", "Skyrock\nNRJ\nFun Radio\nVirgin Radio\nRadio personnalisée\n", "Mettre", "Quitter");
  359.             format(string, sizeof(string), "%s s'approche de la boombox et change la station", playername);
  360.             ProxDetector(15.0, playerid, string,COLOR_ACTION,COLOR_ACTION,COLOR_ACTION,COLOR_ACTION,COLOR_ACTION);
  361.         return 1;
  362.         }
  363.  
  364. return 0;
  365. }
  366.  
  367. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  368. {
  369.         if(dialogid == DIALOG_RADIOS)
  370.         {
  371.             if(!response)
  372.             {
  373.                 ShowPlayerDialog(playerid, -1, DIALOG_STYLE_MSGBOX, "Fermer", "Fermer le dialog", "Ok", "Ok");
  374.                 }
  375.                 else
  376.                 {
  377.  
  378.                         if(listitem == 0)
  379.                         {
  380.                         format(radio, sizeof(radio), "http://player.skyrock.fm/V4/skyrock/skyrock.m3u");
  381.                         createboombox(playerid);
  382.                         SendClientMessage(playerid, -1, "{9ACD32}Vous avez mit Skyrock sur la boombox !");
  383.                         }
  384.                         if(listitem == 1)
  385.                         {
  386.                                 new sz_Info[433] = "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\n";
  387.                                 strcat(sz_Info, "NRJ New York\nNRJ Next\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");
  388.                                 ShowPlayerDialog(playerid, DIALOG_NRJ, DIALOG_STYLE_LIST, "NRJ", sz_Info, "Jouer", "Retour");
  389.                         }
  390.                         if(listitem == 2)
  391.                         {
  392.                             format(radio, sizeof(radio), "http://icecast.funradio.fr/fun-1-44-128.m3u");
  393.                             createboombox(playerid);
  394.                             SendClientMessage(playerid, -1, "{9ACD32}[Information]{FFFFFF} Vous avez mit Fun Radio sur la boombox !");
  395.                         }
  396.                         if(listitem == 3)
  397.                         {
  398.                             format(radio, sizeof(radio), "tream5.nrj.yacast.net/virginradio.m3u");
  399.                             createboombox(playerid);
  400.                             SendClientMessage(playerid, -1, "{9ACD32}[Information]{FFFFFF} Vous avez mit Virgin Radio à la radio !");
  401.                         }
  402.                         if(listitem == 4)
  403.                         {
  404.                             ShowPlayerDialog(playerid, DIALOG_CHOIX, DIALOG_STYLE_INPUT, "Radio personnalisée", "Mettez le lien de votre musique/playlist personnalisée (formats actuellement supportés : mp3, ogg, m3u, pls)", "Jouer", "Retour");
  405.                         }
  406.                 }
  407.         return 1;
  408.         }
  409.  
  410.  
  411.         if(dialogid == DIALOG_NRJ)
  412.         {
  413.             if(!response)
  414.             {
  415.                     ShowPlayerDialog(playerid, DIALOG_RADIOS, DIALOG_STYLE_LIST, "Radios", "Skyrock\nNRJ\nFun Radio\nVirgin Radio\nProposez vos idées (avec le lien en .m3u)\n", "Mettre", "Quitter");
  416.                 }
  417.                 else
  418.                 {
  419.                         if(listitem == 0)
  420.                         {
  421.                             format(radio, sizeof(radio), "http://mp3.live.tv-radio.com/nrj/all/nrj_113225.mp3");
  422.                             createboombox(playerid);
  423.                         }
  424.                         if(listitem == 1)
  425.                         {
  426.                             format(radio, sizeof(radio), "http://mp3.live.tv-radio.com/nrj_by_disney/all/nrj_152411.mp3");
  427.                             createboombox(playerid);
  428.                         }
  429.                         if(listitem == 2)
  430.                         {
  431.                             format(radio, sizeof(radio), "http://mp3.live.tv-radio.com/nrj_clubbin/all/nrj_153250.mp3");
  432.                             createboombox(playerid);
  433.                         }
  434.                         if(listitem == 3)
  435.                         {
  436.                             format(radio, sizeof(radio), "http://mp3.live.tv-radio.com/nrj_dance/all/nrj_151505.mp3");
  437.                             createboombox(playerid);
  438.                         }
  439.                         if(listitem == 4)
  440.                         {
  441.                             format(radio, sizeof(radio), "http://mp3.live.tv-radio.com/nrj_french/all/nrj_155913.mp3");
  442.                             createboombox(playerid);
  443.                         }
  444.                         if(listitem == 5)
  445.                         {
  446.                             format(radio, sizeof(radio), "http://mp3.live.tv-radio.com/nrj_french/all/nrj_155913.mp3");
  447.                             createboombox(playerid);
  448.                         }
  449.                         if(listitem == 6)
  450.                         {
  451.                             format(radio, sizeof(radio), "http://mp3.live.tv-radio.com/nrj_girl/all/nrj_153716.mp3");
  452.                             createboombox(playerid);
  453.                         }
  454.                         if(listitem == 7)
  455.                         {
  456.                             format(radio, sizeof(radio), "http://mp3.live.tv-radio.com/nrj_hits/all/nrj_150726.mp3");
  457.                             createboombox(playerid);
  458.                         }
  459.                         if(listitem == 8)
  460.                         {
  461.                             format(radio, sizeof(radio), "http://mp3.live.tv-radio.com/nrj_ibiza/all/nrj_164849.mp3");
  462.                             createboombox(playerid);
  463.                         }
  464.                         if(listitem == 9)
  465.                         {
  466.                             format(radio, sizeof(radio), "http://mp3.live.tv-radio.com/nrj_in_bed/all/nrj_135650.mp3");
  467.                             createboombox(playerid);
  468.                         }
  469.                         if(listitem == 10)
  470.                         {
  471.                             format(radio, sizeof(radio), "http://mp3.live.tv-radio.com/nrj_itunes/all/nrj_153938.mp3");
  472.                             createboombox(playerid);
  473.                         }
  474.                         if(listitem == 11)
  475.                         {
  476.                             format(radio, sizeof(radio), "http://mp3.live.tv-radio.com/nrj_lady_gaga/all/nrj_152704.mp3");
  477.                             createboombox(playerid);
  478.                         }
  479.                         if(listitem == 12)
  480.                         {
  481.                             format(radio, sizeof(radio), "http://mp3.live.tv-radio.com/nrj_lounge/all/nrj_151750.mp3");
  482.                             createboombox(playerid);
  483.                         }
  484.                         if(listitem == 13)
  485.                         {
  486.                             format(radio, sizeof(radio), "http://mp3.live.tv-radio.com/nrj_mastermix/all/nrj_163522.mp3");
  487.                             createboombox(playerid);
  488.                         }
  489.                         if(listitem == 14)
  490.                         {
  491.                             format(radio, sizeof(radio), "http://mp3.live.tv-radio.com/nrj_michael_jackson/all/nrj_154634.mp3");
  492.                             createboombox(playerid);
  493.                         }
  494.                         if(listitem == 15)
  495.                         {
  496.                             format(radio, sizeof(radio), "http://mp3.live.tv-radio.com/nrj_new-york/all/nrj_140527.mp3");
  497.                             createboombox(playerid);
  498.                         }
  499.                         if(listitem == 16)
  500.                         {
  501.                             format(radio, sizeof(radio), "http://mp3.live.tv-radio.com/nrj_next/all/nrj_122336.mp3");
  502.                             createboombox(playerid);
  503.                         }
  504.                         if(listitem == 17)
  505.                         {
  506.                             format(radio, sizeof(radio), "http://mp3.live.tv-radio.com/nrj_nouveaute/all/nrj_161209.mp3");
  507.                             createboombox(playerid);
  508.                         }
  509.                         if(listitem == 18)
  510.                         {
  511.                             format(radio, sizeof(radio), "http://mp3.live.tv-radio.com/2051/nrj_party/nrj_190407.mp3");
  512.                             createboombox(playerid);
  513.                         }
  514.                         if(listitem == 19)
  515.                         {
  516.                             format(radio, sizeof(radio), "http://mp3.live.tv-radio.com/nrj_pop/all/nrj_151240.mp3");
  517.                             createboombox(playerid);
  518.                         }
  519.                         if(listitem == 20)
  520.                         {
  521.                             format(radio, sizeof(radio), "http://mp3.live.tv-radio.com/nrj_rap_fr/all/nrj_145338.mp3");
  522.                             createboombox(playerid);
  523.                         }
  524.                         if(listitem == 21)
  525.                         {
  526.                             format(radio, sizeof(radio), "http://mp3.live.tv-radio.com/nrj_rap_us/all/nrj_144854.mp3");
  527.                             createboombox(playerid);
  528.                         }
  529.                         if(listitem == 22)
  530.                         {
  531.                             format(radio, sizeof(radio), "http://mp3.live.tv-radio.com/nrj_rihanna/all/nrj_163955.mp3");
  532.                             createboombox(playerid);
  533.                         }
  534.                         if(listitem == 23)
  535.                         {
  536.                             format(radio, sizeof(radio), "http://mp3.live.tv-radio.com/nrj_rnb/all/nrj_151038.mp3");
  537.                             createboombox(playerid);
  538.                         }
  539.                         if(listitem == 24)
  540.                         {
  541.                             format(radio, sizeof(radio), "http://mp3.live.tv-radio.com/nrj_rock/all/nrj_161510.mp3");
  542.                             createboombox(playerid);
  543.                         }
  544.                         if(listitem == 25)
  545.                         {
  546.                             format(radio, sizeof(radio), "http://mp3.live.tv-radio.com/nrj_running/all/nrj_162813.mp3");
  547.                             createboombox(playerid);
  548.                         }
  549.                         if(listitem == 26)
  550.                         {
  551.                             format(radio, sizeof(radio), "http://mp3.live.tv-radio.com/nrj_shakira/all/nrj_144619.mp3");
  552.                             createboombox(playerid);
  553.                         }
  554.                         if(listitem == 27)
  555.                         {
  556.                             format(radio, sizeof(radio), "http://mp3.live.tv-radio.com/nrj_shop/all/nrj_121822.mp3");
  557.                             createboombox(playerid);
  558.                         }
  559.                         if(listitem == 28)
  560.                         {
  561.                             format(radio, sizeof(radio), "http://mp3.live.tv-radio.com/nrj_soleil/all/nrj_155103.mp3");
  562.                             createboombox(playerid);
  563.                         }
  564.                         if(listitem == 29)
  565.                         {
  566.                             format(radio, sizeof(radio), "http://mp3.live.tv-radio.com/nrj_black_eyed_peas/all/nrj_161845.mp3");
  567.                             createboombox(playerid);
  568.                         }
  569.                         if(listitem == 30)
  570.                         {
  571.                             format(radio, sizeof(radio), "http://mp3.live.tv-radio.com/nrj_usher/all/nrj_142337.mp3");
  572.                             createboombox(playerid);
  573.                         }
  574.                 return 1;
  575.                 }
  576.         return 1;
  577.         }
  578.  
  579.         if(dialogid == DIALOG_CHOIX)
  580.         {
  581.             if(!response)
  582.             {
  583.                 ShowPlayerDialog(playerid, DIALOG_RADIOS, DIALOG_STYLE_LIST, "Radios", "Skyrock\nNRJ\nFun Radio\nVirgin Radio\nRadio personnalisée\n", "Mettre", "Quitter");
  584.             }
  585.             else
  586.             {
  587.                 format(radio, sizeof(radio), inputtext);
  588.                 createboombox(playerid);
  589.                 format(string, sizeof(string), "{9ACD32}[Information]{FFFFFF} Vous avez mit votre radio personnalisée (%s) à la radio !", inputtext);
  590.             }
  591.         return 1;
  592.         }
  593.  
  594. return 0;
  595. }
  596.  
  597. public OnPlayerDisconnect(playerid, reason)
  598. {
  599.     if(GetPVarInt(playerid, "RadioON") != 0) { destroyboombox(playerid); return 1; }
  600.     SendClientMessage(playerid, -1, "{9ACD32}[Information]{FFFFFF} Vous vous êtes déconnecté. Votre boombox a été détruite.");
  601. return 0;
  602. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement