OtaconEvil

[FS] radio SA | sprites/textdraw | By OTACON

Mar 3rd, 2017
502
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.     * ## LEASE ATENTAMENTE PARA NO CONVERTIRSE EN LAMMER!!.: :D ##
  3.     *
  4.     * Estè Simple FILTERSCRIPT esta hecho especialmente para www.forum.sa-mp.com
  5.     * NO Publicar estè FILTERSCRIPT en Otros foros de SA-MP y hacerse pasar por el creador del CODE.
  6.     *
  7.     * Codigo Creado Por OTACON
  8.     *
  9.     * CREDITOS:
  10.     *     OTACON: Realizacion y Idea de creacion del code.
  11.     *     TÙ: Modificacion libremente respetando lo mencionado ;).
  12.     *
  13.     *    NOTA: Menos Creditos para los que me los critican.. JO'PUTAS! :D xD ;)
  14.     *
  15.     *            Prohibido TOTALMENTE el Robo de Créditos o la
  16.     *              Publicación de este FILTERSCRIPT sin Mi Permiso.
  17. */
  18. /*
  19.     * ## READ CAREFULLY TO AVOID BECOMING LAMMER!.: :D ##
  20.     *
  21.     * This simple FILTERSCRIPT is made especially for www.forum.sa-mp.com
  22.     * DO NOT Post the FILTERSCRIPT in Other SAMP forums and impersonating the creator of the CODE.
  23.     *
  24.     * Code Created By OTACON
  25.     *
  26.     * CREDITS:
  27.     *     OTACON: Idea Making and code creation.
  28.     *     YOUR: Modification freely respecting the above ;).
  29.     *
  30.     *    NOTE: Less Credits for those who criticize me.. JO'PUTAS! :D xD ;)
  31.     *
  32.     *                    FULLY spaces Theft Credit or
  33.     *             Publication of this FILTERSCRIPT without my permission.
  34. */
  35.  
  36. /*
  37.  
  38.     http://i.imgur.com/OPd36TA.png
  39.     http://i.imgur.com/OPd36TA.png
  40.     http://i.imgur.com/OPd36TA.png
  41.     http://i.imgur.com/OPd36TA.png
  42.     http://i.imgur.com/OPd36TA.png
  43.    
  44.  
  45. */
  46.  
  47. #include <a_samp>
  48. #include <zcmd>
  49.  
  50. new
  51.     Text:radioSA[12],
  52.     Text:radioTDS[2],
  53.     bool:sRadioSA[MAX_PLAYERS],
  54.     bool:aRadioSA[MAX_PLAYERS]
  55. ;
  56.  
  57. new spritesRadioSA[][]={
  58.     {"radio_bounce"},
  59.     {"radio_csr"},
  60.     {"radio_KDST"},
  61.     {"radio_kjah"},
  62.     {"radio_krose"},
  63.     {"radio_mastersounds"},
  64.     {"radio_playback"},
  65.     {"radio_RADIOX"},
  66.     {"radio_RLS"},
  67.     {"radio_SFUR"},
  68.     {"radio_WCTR"},
  69.     {"radio_TPLAYER"}
  70. };
  71.  
  72. new stationRadioSA[][]={
  73.     {"http:///www.your.hosting/your_gamemode/scriptfiles/radioSA/radio_bounce.ogg"},
  74.     {"http:///www.your.hosting/your_gamemode/scriptfiles/radioSA/radio_csr.ogg"},
  75.     {"http:///www.your.hosting/your_gamemode/scriptfiles/radioSA/radio_KDST.ogg"},
  76.     {"http:///www.your.hosting/your_gamemode/scriptfiles/radioSA/radio_kjah.ogg"},
  77.     {"http:///www.your.hosting/your_gamemode/scriptfiles/radioSA/radio_krose.ogg"},
  78.     {"http:///www.your.hosting/your_gamemode/scriptfiles/radioSA/radio_mastersounds.ogg"},
  79.     {"http:///www.your.hosting/your_gamemode/scriptfiles/radioSA/radio_playback.ogg"},
  80.     {"http:///www.your.hosting/your_gamemode/scriptfiles/radioSA/radio_RADIOX.ogg"},
  81.     {"http:///www.your.hosting/your_gamemode/scriptfiles/radioSA/radio_RLS.ogg"},
  82.     {"http:///www.your.hosting/your_gamemode/scriptfiles/radioSA/radio_SFUR.ogg"},
  83.     {"http:///www.your.hosting/your_gamemode/scriptfiles/radioSA/radio_WCTR.ogg"},
  84.     {"http:///www.your.hosting/your_gamemode/scriptfiles/radioSA/radio_TPLAYER.ogg"}
  85. };
  86.  
  87. // Add your track list here
  88. new trackRadioSA[][]={
  89.     {"http://"},
  90.     {"http://"},
  91.     {"http://"},
  92.     {"http://"},
  93.     {"http://"},
  94.     {"http://"},
  95.     {"http://"},
  96.     {"http://"},
  97.     {"http://"},
  98.     {"http://"},
  99.     {"http://"},
  100.     {"http://"}
  101. };
  102.  
  103. public OnFilterScriptInit(){
  104.     new Float:sizeDEFAUT[13],Float:sizeADD;
  105.     sizeDEFAUT[0] = 18.399997;
  106.     sizeADD = 48.999996;
  107.    
  108.     for (new x=0; x<sizeof radioSA; x++){
  109.         if(x==0) radioSA[x] = TextDrawCreate(sizeDEFAUT[0], 359.893341, "LD_SPAC:white");
  110.         else{
  111.             sizeDEFAUT[x] += floatadd(floatadd(sizeDEFAUT[x-1], sizeDEFAUT[x]), sizeADD);
  112.             radioSA[x] = TextDrawCreate(sizeDEFAUT[x], 359.893341, "LD_SPAC:white");
  113.         }
  114.         TextDrawLetterSize(radioSA[x], 0.000000, 0.000000);
  115.         TextDrawTextSize(radioSA[x], 42.400005, 44.053314);
  116.         TextDrawAlignment(radioSA[x], 1);
  117.         TextDrawColor(radioSA[x], -1);
  118.         TextDrawSetShadow(radioSA[x], 0);
  119.         TextDrawSetOutline(radioSA[x], 0);
  120.         TextDrawFont(radioSA[x], 4);
  121.         TextDrawSetSelectable(radioSA[x], true);
  122.         new s[30];
  123.         format(s, sizeof s, "fronten1:%s", spritesRadioSA[x]);
  124.         TextDrawSetString(radioSA[x], s);
  125.     }
  126.  
  127.     radioTDS[0] = TextDrawCreate(638.799987, 346.459991, "usebox");
  128.     TextDrawLetterSize(radioTDS[0], 0.000000, 7.896667);
  129.     TextDrawTextSize(radioTDS[0], -2.000000, 0.000000);
  130.    
  131.     radioTDS[1] = TextDrawCreate(634.799987, 344.966674, "usebox");
  132.     TextDrawLetterSize(radioTDS[1], 0.000000, 8.228516);
  133.     TextDrawTextSize(radioTDS[1], 607.599975, 0.000000);
  134.    
  135.     for (new x=0; x<sizeof radioTDS; x++){
  136.         TextDrawAlignment(radioTDS[1], 1);
  137.         TextDrawColor(radioTDS[x], 0);
  138.         TextDrawUseBox(radioTDS[x], true);
  139.         TextDrawBoxColor(radioTDS[x], 102);
  140.         TextDrawSetShadow(radioTDS[x], 0);
  141.         TextDrawSetOutline(radioTDS[x], 0);
  142.         TextDrawFont(radioTDS[x], 0);
  143.         TextDrawSetSelectable(radioTDS[x], false);
  144.     }
  145.     return true;
  146. }
  147.  
  148. public OnPlayerClickTextDraw(playerid, Text:clickedid){
  149.     if(_:clickedid == INVALID_TEXT_DRAW && sRadioSA[playerid] == true && aRadioSA[playerid] == true) SelectTextDraw(playerid, 0x500000FF);
  150.     else CancelSelectTextDraw(playerid);
  151.    
  152.     new s[144];
  153.     for (new x=0; x<sizeof radioSA; x++){
  154.         if(clickedid == radioSA[x]){
  155.             StopAudioStreamForPlayer(playerid), PlayAudioStreamForPlayer(playerid, stationRadioSA[x]);
  156.             for (new c=0; c<32; c++)SendClientMessage(playerid, -1, " ");
  157.             format(s, sizeof s, "{FFFFFF}INFO: {FFAF00}reproduced the station of radio: {FFFFFF}'%s'",spritesRadioSA[x]);
  158.             SendClientMessage(playerid, -1, s);
  159.             break;
  160.         }
  161.     }
  162.     if(clickedid == radioSA[11]){
  163.         StopAudioStreamForPlayer(playerid), PlayAudioStreamForPlayer(playerid, trackRadioSA[random(sizeof trackRadioSA)]);
  164.         for (new c=0; c<32; c++)SendClientMessage(playerid, -1, " ");
  165.         format(s, sizeof s, "{FFFFFF}INFO: {FFAF00}reproduced the station of radio: {FFFFFF}'track player{FFAF00}(random){FFFFFF}'");
  166.         SendClientMessage(playerid, -1, s);
  167.     }
  168.     return true;
  169. }
  170.  
  171. COMMAND:radio(playerid, params[]){
  172.     new s[144];
  173.     if(!aRadioSA[playerid]){
  174.         StopAudioStreamForPlayer(playerid), PlayAudioStreamForPlayer(playerid, "https://upload.wikimedia.org/wikipedia/en/8/8d/GTA_V_Main_Theme.ogg");
  175.         for (new c=0; c<32; c++)SendClientMessage(playerid, -1, " ");
  176.         for (new x=0; x<sizeof radioSA; x++) TextDrawShowForPlayer(playerid,radioSA[x]);
  177.         for (new x=0; x<sizeof radioTDS; x++) TextDrawShowForPlayer(playerid,radioTDS[x]);
  178.         SelectTextDraw(playerid, 0x500000FF);
  179.         sRadioSA[playerid] = true;
  180.         aRadioSA[playerid] = true;
  181.         format(s, sizeof s, "{FFFFFF}INFO: {FFAF00}station of radio: {00D300}'ON'");
  182.         SendClientMessage(playerid, -1, s);
  183.     }else{
  184.         StopAudioStreamForPlayer(playerid), PlayAudioStreamForPlayer(playerid, "https://upload.wikimedia.org/wikipedia/en/8/8d/GTA_V_Main_Theme.ogg");
  185.         for (new c=0; c<32; c++)SendClientMessage(playerid, -1, " ");
  186.         for (new x=0; x<sizeof radioSA; x++) TextDrawHideForPlayer(playerid,radioSA[x]);
  187.         for (new x=0; x<sizeof radioTDS; x++) TextDrawHideForPlayer(playerid,radioTDS[x]);
  188.         CancelSelectTextDraw(playerid);
  189.         sRadioSA[playerid] = false;
  190.         aRadioSA[playerid] = false;
  191.         format(s, sizeof s, "{FFFFFF}INFO: {FFAF00}station of radio: {D20000}'OFF'");
  192.         SendClientMessage(playerid, -1, s);
  193.     }
  194.     return true;
  195. }
RAW Paste Data