OtaconEvil

[FS] Christmas tree system with surprises. By OTACON

Dec 8th, 2014
725
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[MAX_PLAYERS];
  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"Gift of 'santa claus': "B"an average dirty.");}
  54.                 case 1: {SendClientMessage(playerid, -1, ""B"INFO: "R"Gift of 'santa claus': "B"false one hundred U.S. dollars.");}
  55.                 case 2: {SendClientMessage(playerid, -1, ""B"INFO: "R"Gift of 'santa claus': "B"a day like OTACON.");}
  56.                 case 3: {SendClientMessage(playerid, -1, ""B"INFO: "R"Gift of 'santa claus': "B"one broken stereo.");}
  57.                 case 4: {SendClientMessage(playerid, -1, ""B"INFO: "R"Gift of 'santa claus': "B"a prostitute for 99 years.");}
  58.                 case 5: {SendClientMessage(playerid, -1, ""B"INFO: "R"Gift of 'santa claus': "B"a bicycle with one wheel.");}
  59.                 case 6: {SendClientMessage(playerid, -1, ""B"INFO: "R"Gift of 'santa claus': "B"a kick in the ortho.");}
  60.                 case 7: {SendClientMessage(playerid, -1, ""B"INFO: "R"Gift of 'santa claus': "B"a very merry christmas.");}
  61.                 case 8: {SendClientMessage(playerid, -1, ""B"INFO: "R"Gift of 'santa claus': "B"one old nougat.");}
  62.                 case 9: {SendClientMessage(playerid, -1, ""B"INFO: "R"Gift of 'santa claus': "B"used a dildo.");}
  63.                 default: {SendClientMessage(playerid, -1, ""B"INFO: "R"Gift of 'santa claus': "B"nothing, do not want 'santa claus'.");}
  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/christmas_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"Use the command "B"/gifttoplayer [ID]");
  79.     if(params[0] == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, ""B"INFO: "R"The ID entered is invalid!.");
  80.     if(!IsPlayerConnected(params[0])) return SendClientMessage(playerid, -1, ""B"INFO: "R"The ID entered is not connected!.");
  81.     if(params[0] == playerid) return SendClientMessage(playerid, -1, ""B"INFO: "R"You can not give yourself gifts!.");
  82.     StopAudioStreamForPlayer(params[0]);
  83.     PlayAudioStreamForPlayer(params[0], "http://www.sonidosmp3gratis.com/sounds/christmas_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:christmas(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, "_"); //christmas 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.     return true;
  164. }
  165. public OnFilterScriptExit() {
  166.     for(new index=0; index<MAX_TREE; index++) \
  167.         TextDrawDestroy(TreeTD[index]);
  168.     return true;
  169. }
  170. public OnPlayerConnect(playerid) {
  171.     for(new index=0; index<MAX_TREE; index++) \
  172.         TextDrawHideForPlayer(playerid,TreeTD[index]);
  173.     KillTimer(LittletreeTDKillMovement[playerid]);
  174.     return true;
  175. }
  176. public OnPlayerDisconnect(playerid, reason) {
  177.     for(new index=0; index<MAX_TREE; index++) \
  178.         TextDrawHideForPlayer(playerid,TreeTD[index]);
  179.     KillTimer(LittletreeTDKillMovement[playerid]);
  180.     return true;
  181. }
  182. public OnPlayerSpawn(playerid) {
  183.     for(new index=0; index<MAX_TREE; index++) \
  184.         TextDrawShowForPlayer(playerid,TreeTD[index]);
  185.     KillTimer(LittletreeTDKillMovement[playerid]);
  186.     LittletreeTDKillMovement[playerid] = SetTimerEx("TreeTDMovement", 500, true, "d", playerid);
  187.     CallLocalFunction("OnPlayerCommandText", "is", playerid, "/christmas");
  188.     SendClientMessage(playerid, -1, ""B"INFO: "R"Use the command "B"/christmas "R"to hear the melody of Christmas"B"!.");
  189.     return true;
  190. }
  191. forward TreeTDMovement(playerid);
  192. public TreeTDMovement(playerid) {
  193.     for(new index=6; index<14; index++)  {
  194.         TextDrawHideForPlayer(playerid,TreeTD[index]);
  195.         switch(random(2)){
  196.             case 0: {TextDrawBackgroundColor(TreeTD[index], SetAlphaColor(0x000000FF, 0x00000055)); TextDrawColor(TreeTD[index], SetAlphaColor(0xFFFFFBFF, 0xFFFFFB55));}
  197.             case 1: {TextDrawBackgroundColor(TreeTD[index], SetAlphaColor(0xFFFFFB55, 0xFFFFFBFF)); TextDrawColor(TreeTD[index], SetAlphaColor(0x00000055, 0x000000FF));}
  198.         } TextDrawShowForPlayer(playerid,TreeTD[index]);
  199.     }
  200. }
  201. /*
  202.     * ## LEASE ATENTAMENTE PARA NO CONVERTIRSE EN LAMMER!!.: :D ##
  203.     *
  204.     * Estè Simple FILTERSCRIPT esta hecho especialmente para www.forum.sa-mp.com
  205.     * NO Publicar estè FILTERSCRIPT en Otros foros de SA-MP y hacerse pasar por el creador del CODE.
  206.     *
  207.     * Codigo Creado Por OTACON
  208.     *
  209.     * CREDITOS:
  210.     *     OTACON: Realizacion y Idea de creacion del code.
  211.     *     TÙ: Modificacion libremente respetando lo mencionado ;).
  212.     *
  213.     *    NOTA: Menos Creditos para los que me los critican.. JO'PUTAS! :D xD ;)
  214.     *
  215.     *                Prohibido TOTALMENTE el Robo de Créditos o la
  216.     *                  Publicación de este FILTERSCRIPT sin Mi Permiso.
  217. */
  218. /*
  219.     * ## READ CAREFULLY TO AVOID BECOMING LAMMER!.: :D ##
  220.     *
  221.     * This simple FILTERSCRIPT is made especially for www.forum.sa-mp.com
  222.     * DO NOT Post the FILTERSCRIPT in Other SAMP forums and impersonating the creator of the CODE.
  223.     *
  224.     * Code Created By OTACON
  225.     *
  226.     * CREDITS:
  227.     *     OTACON: Idea Making and code creation.
  228.     *     YOUR: Modification freely respecting the above ;).
  229.     *
  230.     *    NOTE: Less Credits for those who criticize me.. JO'PUTAS! :D xD ;)
  231.     *
  232.     *                        FULLY spaces Theft Credit or
  233.     *                 Publication of this FILTERSCRIPT without my permission.
  234. */
RAW Paste Data