OtaconEvil

[FS] Sistema de árbol de Navidad con sorpresas. By OTACON

Dec 8th, 2014
482
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. #include <a_samp>
  36. #include <zcmd>
  37. #include <sscanf2>
  38.  
  39. #define B "{FFFFFF}" //white
  40. #define R "{D50000}" //red
  41. #define MAX_TREE (14)
  42. new Text:TreeTD[MAX_TREE],
  43. LittletreeTDKillMovement;
  44.  
  45. public OnPlayerClickTextDraw(playerid, Text:clickedid) {
  46.     for(new index=1; index<4; index++) {
  47.         if(clickedid == TreeTD[index]) {
  48.             StopAudioStreamForPlayer(playerid);
  49.             PlayAudioStreamForPlayer(playerid, "http://www.sonidosmp3gratis.com/sounds/007757826_prev");
  50.             CancelSelectTextDraw(playerid);
  51.             for(new msg=0; msg<32; msg++){SendClientMessage(playerid, -1, " ");}
  52.             switch(random(11)){
  53.                 case 0: {SendClientMessage(playerid, -1, ""B"INFO: "R"Regalo de 'santa claus': "B"una media sucia.");}
  54.                 case 1: {SendClientMessage(playerid, -1, ""B"INFO: "R"Regalo de 'santa claus': "B"cien dolares falsos.");}
  55.                 case 2: {SendClientMessage(playerid, -1, ""B"INFO: "R"Regalo de 'santa claus': "B"un dia como OTACON.");}
  56.                 case 3: {SendClientMessage(playerid, -1, ""B"INFO: "R"Regalo de 'santa claus': "B"un stereo roto.");}
  57.                 case 4: {SendClientMessage(playerid, -1, ""B"INFO: "R"Regalo de 'santa claus': "B"una prostituta de 99 años.");}
  58.                 case 5: {SendClientMessage(playerid, -1, ""B"INFO: "R"Regalo de 'santa claus': "B"una bicicleta con una sola rueda.");}
  59.                 case 6: {SendClientMessage(playerid, -1, ""B"INFO: "R"Regalo de 'santa claus': "B"una patada en el orto.");}
  60.                 case 7: {SendClientMessage(playerid, -1, ""B"INFO: "R"Regalo de 'santa claus': "B"una muy feliz navidad.");}
  61.                 case 8: {SendClientMessage(playerid, -1, ""B"INFO: "R"Regalo de 'santa claus': "B"un turron viejo.");}
  62.                 case 9: {SendClientMessage(playerid, -1, ""B"INFO: "R"Regalo de 'santa claus': "B"un consolador usado.");}
  63.                 default: {SendClientMessage(playerid, -1, ""B"INFO: "R"Regalo de 'santa claus': "B"nada,'santa claus' no te quiere.");}
  64.             }
  65.         }
  66.     } return true;
  67. }
  68. COMMAND:gifttoall(playerid, params[]) {
  69.     for(new player, user = GetMaxPlayers(); player != user; player++) {
  70.         if(!IsPlayerConnected(player)) continue;
  71.         StopAudioStreamForPlayer(player);
  72.         PlayAudioStreamForPlayer(player, "http://www.sonidosmp3gratis.com/sounds/Navidad_bells.mp3");
  73.         for(new msg=0; msg<32; msg++){SendClientMessage(player, -1, " ");}
  74.         SelectTextDraw(player, 0xFF0000FF); }
  75.     return true;
  76. }
  77. COMMAND:gifttoplayer(playerid, params[]) {
  78.     if(sscanf(params, "r", params[0])) return SendClientMessage(playerid, -1, ""B"INFO: "R"Utilice el comando "B"/gifttoplayer [ID]");
  79.     if(params[0] == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, ""B"INFO: "R"El ID ingresado no es válido!.");
  80.     if(!IsPlayerConnected(params[0])) return SendClientMessage(playerid, -1, ""B"INFO: "R"El ID introducido no está conectado!.");
  81.     if(params[0] == playerid) return SendClientMessage(playerid, -1, ""B"INFO: "R"No puede darse regalos!.");
  82.     StopAudioStreamForPlayer(params[0]);
  83.     PlayAudioStreamForPlayer(params[0], "http://www.sonidosmp3gratis.com/sounds/Navidad_bells.mp3");
  84.     for(new msg=0; msg<32; msg++){SendClientMessage(params[0], -1, " ");}
  85.     SelectTextDraw(params[0], 0xFF0000FF);
  86.     return true;
  87. }
  88. COMMAND:navidad(playerid, params[]) {
  89.     StopAudioStreamForPlayer(playerid);
  90.     PlayAudioStreamForPlayer(playerid, "http://www.sonidosmp3gratis.com/sounds/cajas-registradoras_5.mp3");
  91.     for(new msg=0; msg<32; msg++){SendClientMessage(playerid, -1, " ");}
  92.     return true;
  93. }
  94. stock SetAlphaColor(color , alpha) return ((color >>> 8) << 8) + alpha; // by Daniel-92
  95. public OnFilterScriptInit() {
  96.     TreeTD[0] = TextDrawCreate(380.000000, 214.000000, "_"); //tree
  97.     TextDrawBackgroundColor(TreeTD[0], 0x00B20000);
  98.     TextDrawFont(TreeTD[0], TEXT_DRAW_FONT_MODEL_PREVIEW);
  99.     TextDrawLetterSize(TreeTD[0], 3.599998, 2.000000);
  100.     TextDrawColor(TreeTD[0], -1);
  101.     TextDrawSetOutline(TreeTD[0], 0);
  102.     TextDrawSetProportional(TreeTD[0], 1);
  103.     TextDrawSetShadow(TreeTD[0], 1);
  104.     TextDrawUseBox(TreeTD[0], 1);
  105.     TextDrawBoxColor(TreeTD[0], 255);
  106.     TextDrawTextSize(TreeTD[0], 289.000000, 210.000000);
  107.     TextDrawSetPreviewModel(TreeTD[0], 19076);
  108.     TextDrawSetPreviewRot(TreeTD[0], -16.000000, 0.000000, -55.000000, 1.000000);
  109.     TextDrawSetSelectable(TreeTD[0], false);
  110.     TreeTD[5] = TextDrawCreate(394.000000, 298.000000, "_"); //bush
  111.     TextDrawSetPreviewModel(TreeTD[5], 826);
  112.     TextDrawSetPreviewRot(TreeTD[5], -16.000000, 0.000000, -55.000000, 1.000000);
  113.     TreeTD[1] = TextDrawCreate(490.000000, 383.000000, "_"); //gift 1
  114.     TextDrawSetPreviewModel(TreeTD[1], 19057);
  115.     TextDrawSetPreviewRot(TreeTD[1], -16.000000, 0.000000, -55.000000, 1.000000);
  116.     TreeTD[2] = TextDrawCreate(424.000000, 368.000000, "_"); //gift 2
  117.     TextDrawSetPreviewModel(TreeTD[2], 19055);
  118.     TextDrawSetPreviewRot(TreeTD[2], -16.000000, 0.000000, -55.000000, 1.000000);
  119.     TreeTD[3] = TextDrawCreate(556.000000, 368.000000, "_"); //gift 3
  120.     TextDrawSetPreviewModel(TreeTD[3], 19058);
  121.     TextDrawSetPreviewRot(TreeTD[3], -16.000000, 0.000000, -55.000000, 1.000000);
  122.     TreeTD[4] = TextDrawCreate(553.000000, 346.000000, "_"); //Navidad hat
  123.     TextDrawSetPreviewModel(TreeTD[4], 19065);
  124.     TextDrawSetPreviewRot(TreeTD[4], -16.000000, 30.000000, 2.000000, 1.000000);
  125.     for(new index=1; index<6; index++) {
  126.         TextDrawBackgroundColor(TreeTD[index], 0x00000000);
  127.         TextDrawFont(TreeTD[index], TEXT_DRAW_FONT_MODEL_PREVIEW);
  128.         TextDrawLetterSize(TreeTD[index], 0.500000, 1.000000);
  129.         TextDrawColor(TreeTD[index], -1);
  130.         TextDrawSetOutline(TreeTD[index], 0);
  131.         TextDrawSetProportional(TreeTD[index], 1);
  132.         TextDrawSetShadow(TreeTD[index], 1);
  133.         TextDrawUseBox(TreeTD[index], 1);
  134.         TextDrawBoxColor(TreeTD[index], 255);
  135.         TextDrawTextSize(TreeTD[index], 85.000000, 67.000000);
  136.         TextDrawSetSelectable(TreeTD[index], true); }
  137.     TextDrawSetSelectable(TreeTD[4], false);
  138.     TextDrawSetSelectable(TreeTD[5], false);
  139.     TextDrawTextSize(TreeTD[5], 260.000000, 222.000000);
  140.     TreeTD[6] = TextDrawCreate(478.000000, 245.000000, "]"); //starlets
  141.     TextDrawLetterSize(TreeTD[6], 0.509999, 1.699999);
  142.     TreeTD[7] = TextDrawCreate(451.000000, 260.000000, "]");
  143.     TextDrawLetterSize(TreeTD[7], 0.509999, 1.699999);
  144.     TreeTD[8] = TextDrawCreate(450.000000, 236.000000, "]");
  145.     TextDrawLetterSize(TreeTD[8], 0.509999, 1.699999);
  146.     TreeTD[9] = TextDrawCreate(563.000000, 267.000000, "]");
  147.     TextDrawLetterSize(TreeTD[9], 0.509999, 1.699999);
  148.     TreeTD[10] = TextDrawCreate(588.000000, 253.000000, "]");
  149.     TextDrawLetterSize(TreeTD[10], 0.509999, 1.699999);
  150.     TreeTD[11] = TextDrawCreate(594.000000, 278.000000, "]");
  151.     TextDrawLetterSize(TreeTD[11], 0.509999, 1.699999);
  152.     TreeTD[12] = TextDrawCreate(546.000000, 227.000000, "]");
  153.     TextDrawLetterSize(TreeTD[12], 0.820000, 2.899999);
  154.     TreeTD[13] = TextDrawCreate(484.000000, 219.000000, "]");
  155.     TextDrawLetterSize(TreeTD[13], 0.690000, 2.200000);
  156.     for(new index=6; index<14; index++) {
  157.         TextDrawBackgroundColor(TreeTD[index], 255);
  158.         TextDrawFont(TreeTD[index], 2);
  159.         TextDrawColor(TreeTD[index], -1);
  160.         TextDrawSetOutline(TreeTD[index], 1);
  161.         TextDrawSetProportional(TreeTD[index], 1);
  162.         TextDrawSetSelectable(TreeTD[index], false); }
  163.     KillTimer(LittletreeTDKillMovement);
  164.     LittletreeTDKillMovement = SetTimer("TreeTDMovement", 500, true);
  165.     return true;
  166. }
  167. public OnFilterScriptExit() {
  168.     for(new index=0; index<MAX_TREE; index++) \
  169.         TextDrawDestroy(TreeTD[index]);
  170.     KillTimer(LittletreeTDKillMovement);
  171.     return true;
  172. }
  173. public OnPlayerConnect(playerid) {
  174.     for(new index=0; index<MAX_TREE; index++) \
  175.         TextDrawHideForPlayer(playerid,TreeTD[index]);
  176.     return true;
  177. }
  178. public OnPlayerDisconnect(playerid, reason) {
  179.     for(new index=0; index<MAX_TREE; index++) \
  180.         TextDrawHideForPlayer(playerid,TreeTD[index]);
  181.     return true;
  182. }
  183. public OnPlayerSpawn(playerid) {
  184.     for(new index=0; index<MAX_TREE; index++) \
  185.         TextDrawShowForPlayer(playerid,TreeTD[index]);
  186.     CallLocalFunction("OnPlayerCommandText", "is", playerid, "/navidad");
  187.     SendClientMessage(playerid, -1, ""B"INFO: "R"Utilice el comando "B"/navidad "R"para escuchar la melodía de la Navidad"B"!.");
  188.     return true;
  189. }
  190. forward TreeTDMovement();
  191. public TreeTDMovement() {
  192.     for(new player, user = GetMaxPlayers(); player != user; player++) {
  193.         if(!IsPlayerConnected(player)) continue;
  194.         for(new index=6; index<14; index++)  {
  195.             TextDrawHideForPlayer(player,TreeTD[index]);
  196.             switch(random(2)){
  197.                 case 0: {TextDrawBackgroundColor(TreeTD[index], SetAlphaColor(0x000000FF, 0x00000055)); TextDrawColor(TreeTD[index], SetAlphaColor(0xFFFFFBFF, 0xFFFFFB55));}
  198.                 case 1: {TextDrawBackgroundColor(TreeTD[index], SetAlphaColor(0xFFFFFB55, 0xFFFFFBFF)); TextDrawColor(TreeTD[index], SetAlphaColor(0x00000055, 0x000000FF));}
  199.             } TextDrawShowForPlayer(player,TreeTD[index]);
  200.         }
  201.     }
  202. }
  203. /*
  204.     * ## LEASE ATENTAMENTE PARA NO CONVERTIRSE EN LAMMER!!.: :D ##
  205.     *
  206.     * Estè Simple FILTERSCRIPT esta hecho especialmente para www.forum.sa-mp.com
  207.     * NO Publicar estè FILTERSCRIPT en Otros foros de SA-MP y hacerse pasar por el creador del CODE.
  208.     *
  209.     * Codigo Creado Por OTACON
  210.     *
  211.     * CREDITOS:
  212.     *     OTACON: Realizacion y Idea de creacion del code.
  213.     *     TÙ: Modificacion libremente respetando lo mencionado ;).
  214.     *
  215.     *    NOTA: Menos Creditos para los que me los critican.. JO'PUTAS! :D xD ;)
  216.     *
  217.     *                Prohibido TOTALMENTE el Robo de Créditos o la
  218.     *                  Publicación de este FILTERSCRIPT sin Mi Permiso.
  219. */
  220. /*
  221.     * ## READ CAREFULLY TO AVOID BECOMING LAMMER!.: :D ##
  222.     *
  223.     * This simple FILTERSCRIPT is made especially for www.forum.sa-mp.com
  224.     * DO NOT Post the FILTERSCRIPT in Other SAMP forums and impersonating the creator of the CODE.
  225.     *
  226.     * Code Created By OTACON
  227.     *
  228.     * CREDITS:
  229.     *     OTACON: Idea Making and code creation.
  230.     *     YOUR: Modification freely respecting the above ;).
  231.     *
  232.     *    NOTE: Less Credits for those who criticize me.. JO'PUTAS! :D xD ;)
  233.     *
  234.     *                        FULLY spaces Theft Credit or
  235.     *                 Publication of this FILTERSCRIPT without my permission.
  236. */
RAW Paste Data