OtaconEvil

[FS] Simple Utilidades Navideñas By OTACON

Dec 8th, 2014
365
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> //http://forum.sa-mp.com/showthread.php?t=91354
  37.  
  38. #define B "{FFFFFF}" //white
  39. #define R "{D50000}" //red
  40.  
  41. #define CHRISTMAS_ID   (1)
  42. #define TIMER_SNOW     (5*1000)
  43. #define OBJECT_GIFT    (19058)
  44. #define OBJECT_HAT     (19064)
  45. #define OBJECT_SNOW    (18864)
  46. #define BONE_USED      (2)
  47. #define SLOTS_USED     (2)
  48. #define SNOW_WEATHER   (20)
  49. #define MAX_TREE       (20)
  50. #define MAX_DRINKS     (20)
  51. #define MAX_FIREWORKS  (20)
  52. #define TABLES_DRINKS  (2764)
  53. #define BOTTLE_WINE    (1551)
  54.  
  55. static InfoChristmasVehicle[MAX_VEHICLES][2];
  56. enum info{
  57. CreateVehicleChristmas,
  58. FunctionChristmas[5],
  59. Float:DataEdition[9],
  60. bool:DataActivated[5],
  61. DataObjectsSnow[8],};
  62.  
  63. static InfoChristmas[MAX_PLAYERS][info],
  64. TreeObjects[MAX_TREE][10],
  65. CountingTreeObjects,
  66. DrinksObjects[MAX_DRINKS][10],
  67. CountingDrinksObjects;
  68.  
  69. static FireworksObjects[MAX_FIREWORKS][10],
  70. CountingFireworksObjects, KillUploaFireworks,
  71. bool:FireworksObjectsActivated[MAX_FIREWORKS],
  72. SaveFireworksObjects[MAX_PLAYERS],
  73. ObjectsFireworks[7]={
  74. (19295),(19296),(19297),(19298),(18716),(18848),(18716) };
  75.  
  76. //INFO COMMAND: to turn the machine fireworks.
  77. COMMAND:fireworks(playerid, params[]){
  78.     new Float:pos[3];
  79.     //if(!IsChristmasDay()) return SendClientMessage(playerid,-1,""B"INFO:"R"Solo puedes usar esta funcion solo en el dia de navidad"B"!.");
  80.     if(GetPlayerState(playerid)!=PLAYER_STATE_ONFOOT) return SendClientMessage(playerid,-1,""B"INFO:"R"Usted no se encuentra a pie"B"!.");
  81.     if(DistanceBetweenMachineAndPlayer(playerid, 3.5)){
  82.         if(!FireworksObjectsActivated[SaveFireworksObjects[playerid]]){
  83.             FireworksObjectsActivated[SaveFireworksObjects[playerid]]=true;
  84.             for(new slots=1,index=10;slots!=index;slots++) {DestroyObject(FireworksObjects[SaveFireworksObjects[playerid]][slots]);}
  85.             GetObjectPos(FireworksObjects[SaveFireworksObjects[playerid]][0], pos[0], pos[1], pos[2]);
  86.             FireworksObjects[SaveFireworksObjects[playerid]][1] = CreateObject(ObjectsFireworks[1],pos[0],pos[1],pos[2]+0.5,0,0,0,0);
  87.             FireworksObjects[SaveFireworksObjects[playerid]][2] = CreateObject(ObjectsFireworks[random(4)],pos[0],pos[1],pos[2]+0.5,0,0,0,0);
  88.             FireworksObjects[SaveFireworksObjects[playerid]][3] = CreateObject(ObjectsFireworks[6],pos[0],pos[1],pos[2]+0.5,0,0,0,0);
  89.             MoveObject(FireworksObjects[SaveFireworksObjects[playerid]][2],pos[0],pos[1],pos[2]+30, 10.0);
  90.             MoveObject(FireworksObjects[SaveFireworksObjects[playerid]][3],pos[0],pos[1],pos[2]+30, 10.0);
  91.             SendClientMessage(playerid,-1,""B"INFO:"R"Usted ha encendido la maquina de fuegos artificiales"B"!.");
  92.         }else{
  93.             FireworksObjectsActivated[SaveFireworksObjects[playerid]]=false;
  94.             for(new slots=1,index=10;slots!=index;slots++) {DestroyObject(FireworksObjects[SaveFireworksObjects[playerid]][slots]);}
  95.             SendClientMessage(playerid,-1,""B"INFO:"R"Usted ha apagado la maquina de fuegos artificiales"B"!.");
  96.         }
  97.     }else{SendClientMessage(playerid,-1,""B"INFO:"R"Usted no se encuentra cerca de una maquina de fuegos artificiales"B"!.");}
  98.     return true;
  99. }
  100. stock DistanceBetweenMachineAndPlayer(playerid, Float:dist){
  101. new Float:pos[3];
  102. for(new slots=0,idx=CountingFireworksObjects+1;slots!=idx;slots++){
  103.     GetObjectPos(FireworksObjects[slots][0], pos[0], pos[1], pos[2]);
  104.     if(IsPlayerInRangeOfPoint(playerid, dist, pos[0], pos[1], pos[2]))return SaveFireworksObjects[playerid]=slots;
  105. }return false;}
  106.  
  107. forward UploaFireworks();
  108. public UploaFireworks(){
  109.     new Float:pos[3];
  110.     for(new slots=0,index=MAX_FIREWORKS;slots!=index;slots++){
  111.         if(FireworksObjectsActivated[slots]==true){
  112.             if(!IsObjectMoving(FireworksObjects[slots][2])){
  113.                 GetObjectPos(FireworksObjects[slots][2], pos[0], pos[1], pos[2]);
  114.                 CreateExplosion(pos[0] + float(30 - (30 / 2)), pos[1], pos[2], 7, 10);
  115.                 CreateExplosion(pos[0], pos[1] + float(30 - (30 / 2)), pos[2], 7, 10);
  116.                 CreateExplosion(pos[0], pos[1], pos[2] + float(30 - (30 / 2)), 7, 10);
  117.                 GetObjectPos(FireworksObjects[slots][0], pos[0], pos[1], pos[2]);
  118.                 SetObjectPos(FireworksObjects[slots][2], pos[0], pos[1], pos[2]);
  119.                 SetObjectPos(FireworksObjects[slots][3], pos[0], pos[1], pos[2]);
  120.                 MoveObject(FireworksObjects[slots][2],pos[0],pos[1],pos[2]+30, 10.0);
  121.                 MoveObject(FireworksObjects[slots][3],pos[0],pos[1],pos[2]+30, 10.0);
  122.             }
  123.         }
  124.     }
  125. }
  126. //INFO COMMAND: to place the base of the fireworks.
  127. COMMAND:createfireworks(playerid, params[]){
  128.     new Float:pos[4],data[100];
  129.     //if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,""B"INFO:"R"Usted no esta autorizado a usar este comando"B"!.");
  130.     //if(!IsChristmasDay()) return SendClientMessage(playerid,-1,""B"INFO:"R"Solo puedes usar esta funcion solo en el dia de navidad"B"!.");
  131.     if(GetPlayerState(playerid)!=PLAYER_STATE_ONFOOT) return SendClientMessage(playerid,-1,""B"INFO:"R"Usted no se encuentra a pie"B"!.");
  132.     if(CountingFireworksObjects>=MAX_FIREWORKS) return SendClientMessage(playerid,-1,""B"INFO:"R"Hay demasiadas maquina de fuegos artificiales creadas"B"!.");
  133.     GetPlayerPos(playerid,pos[0],pos[1],pos[2]);
  134.     GetPlayerFacingAngle(playerid,pos[3]);
  135.     pos[0] = pos[0] + (3.0 * floatsin(-pos[3], degrees));
  136.     pos[1] = pos[1] + (3.0 * floatcos(-pos[3], degrees));
  137.     if(CountingFireworksObjects==0){KillTimer(KillUploaFireworks),KillUploaFireworks=SetTimer("UploaFireworks",2*1000,true);}
  138.     CountingFireworksObjects++;
  139.     FireworksObjects[CountingFireworksObjects][0] = CreateObject(ObjectsFireworks[5], pos[0],pos[1],pos[2]-1.5,0,0,pos[3],3000.0);
  140.     SetObjectMaterial(FireworksObjects[CountingFireworksObjects][0], 1, 18848, "milbase", "ws_oldpainted", -1);
  141.     SetObjectMaterial(FireworksObjects[CountingFireworksObjects][0], 4, 18848, "milbase", "ws_oldpainted", -1);
  142.     SetObjectMaterial(FireworksObjects[CountingFireworksObjects][0], 5, 18848, "milbase", "ws_oldpainted", -1);
  143.     SendClientMessage(playerid,-1,""B"INFO:"R"Usted ha creado una correctamente"B"!.");
  144.     format(data,sizeof(data),""B"INFO:"R"maquina de fuegos artificiales creadas: "B"[%02d/%02d]",CountingFireworksObjects,MAX_FIREWORKS);
  145.     SendClientMessage(playerid,-1,data);
  146.     return true;
  147. }
  148.  
  149. //INFO COMMAND: to remove created fireworks machines, counting from the most recently created.
  150. COMMAND:clearfireworks(playerid, params[]){
  151.     new data[100];
  152.     //if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,""B"INFO:"R"Usted no esta autorizado a usar este comando"B"!.");
  153.     //if(!IsChristmasDay()) return SendClientMessage(playerid,-1,""B"INFO:"R"Solo puedes usar esta funcion solo en el dia de navidad"B"!.");
  154.     if(GetPlayerState(playerid)!=PLAYER_STATE_ONFOOT) return SendClientMessage(playerid,-1,""B"INFO:"R"Usted no se encuentra a pie"B"!.");
  155.     if(CountingFireworksObjects<=0) return SendClientMessage(playerid,-1,""B"INFO:"R"No hay ninguna maquina de fuegos artificiales creada"B"!.");
  156.     for(new slots=0,index=10;slots!=index;slots++) {DestroyObject(FireworksObjects[CountingFireworksObjects][slots]);}
  157.     FireworksObjectsActivated[CountingFireworksObjects]=false;
  158.     CountingFireworksObjects--;
  159.     SendClientMessage(playerid,-1,""B"INFO:"R"Usted ha eliminado la ultima maquina de fuegos artificiales creada correctamente"B"!.");
  160.     format(data,sizeof(data),""B"INFO:"R"maquina de fuegos artificiales creadas: "B"[%02d/%02d]",CountingFireworksObjects,MAX_FIREWORKS);
  161.     SendClientMessage(playerid,-1,data);
  162.     return true;
  163. }
  164.  
  165. //INFO COMMAND: to eliminate all machines created fireworks.
  166. COMMAND:clearallfireworks(playerid, params[]){
  167.     new data[100];
  168.     //if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,""B"INFO:"R"Usted no esta autorizado a usar este comando"B"!.");
  169.     //if(!IsChristmasDay()) return SendClientMessage(playerid,-1,""B"INFO:"R"Solo puedes usar esta funcion solo en el dia de navidad"B"!.");
  170.     if(GetPlayerState(playerid)!=PLAYER_STATE_ONFOOT) return SendClientMessage(playerid,-1,""B"INFO:"R"Usted no se encuentra a pie"B"!.");
  171.     if(CountingFireworksObjects<=0) return SendClientMessage(playerid,-1,""B"INFO:"R"No hay ninguna maquina de fuegos artificiales creada"B"!.");
  172.     for(new slots=0,idx=CountingFireworksObjects+1;slots!=idx;slots++){
  173.     FireworksObjectsActivated[slots]=false;
  174.     for(new object=0,index=10;object!=index;object++){DestroyObject(FireworksObjects[slots][object]); CountingFireworksObjects=0;} }
  175.     KillTimer(KillUploaFireworks);
  176.     SendClientMessage(playerid,-1,""B"INFO:"R"Usted ha eliminado todas las maquinas de fuegos artificiales creadas correctamente"B"!.");
  177.     format(data,sizeof(data),""B"INFO:"R"maquina de fuegos artificiales creadas: "B"[%02d/%02d]",CountingFireworksObjects,MAX_FIREWORKS);
  178.     SendClientMessage(playerid,-1,data);
  179.     return true;
  180. }
  181.  
  182. //INFO COMMAND: hiding inside a gift
  183. COMMAND:stash(playerid, params[]){
  184.     //if(!IsChristmasDay()) return SendClientMessage(playerid,-1,""B"INFO:"R"Solo puedes usar esta funcion solo en el dia de navidad"B"!.");
  185.     if(InfoChristmas[playerid][DataActivated][4]==false){
  186.         InfoChristmas[playerid][DataActivated][4]=true;
  187.         new Float:pos[4]; GetPlayerPos(playerid,pos[0],pos[1],pos[2]);
  188.         DestroyVehicle(InfoChristmas[playerid][CreateVehicleChristmas]);
  189.         InfoChristmas[playerid][CreateVehicleChristmas]=CreateVehicle(571,pos[0],pos[1],pos[2]+3,0,0,0,99999);
  190.         PutPlayerInVehicle(playerid, InfoChristmas[playerid][CreateVehicleChristmas], 0);
  191.         DestroyObject(InfoChristmasVehicle[InfoChristmas[playerid][CreateVehicleChristmas]][1]);
  192.         InfoChristmasVehicle[InfoChristmas[playerid][CreateVehicleChristmas]][1]=CreateObject(OBJECT_GIFT,0,0,0,0,0,0);
  193.         AttachObjectToVehicle(InfoChristmasVehicle[InfoChristmas[playerid][CreateVehicleChristmas]][1],InfoChristmas[playerid][CreateVehicleChristmas],0,2,1,0,0,0);
  194.         LinkVehicleToInterior(InfoChristmas[playerid][CreateVehicleChristmas], 6);
  195.         SendClientMessage(playerid,-1,""B"INFO:"R"Usted se ha metido dentro de una caja de regalo"B"!.");
  196.     }else if(InfoChristmas[playerid][DataActivated][4]==true){
  197.         InfoChristmas[playerid][DataActivated][4]=false;
  198.         DestroyObject(InfoChristmasVehicle[InfoChristmas[playerid][CreateVehicleChristmas]][1]);
  199.         RemovePlayerFromVehicle(playerid);
  200.         DestroyVehicle(InfoChristmas[playerid][CreateVehicleChristmas]);
  201.         SendClientMessage(playerid,-1,""B"INFO:"R"Usted ha salido de adentro de una caja de regalo"B"!.");
  202.     } return true;
  203. }
  204.  
  205. //INFO COMMAND: to carry in hands or left in the ground a gift.
  206. COMMAND:gift(playerid, params[]){
  207.     //if(!IsChristmasDay()) return SendClientMessage(playerid,-1,""B"INFO:"R"Solo puedes usar esta funcion solo en el dia de navidad"B"!.");
  208.     if(GetPlayerState(playerid)!=PLAYER_STATE_ONFOOT) return SendClientMessage(playerid,-1,""B"INFO:"R"Usted no se encuentra a pie"B"!.");
  209.     if(InfoChristmas[playerid][DataActivated][3]==false){
  210.         InfoChristmas[playerid][DataActivated][3]=true;
  211.         DestroyObject(InfoChristmas[playerid][FunctionChristmas][1]);
  212.         DestroyPickup(InfoChristmas[playerid][FunctionChristmas][0]);
  213.         InfoChristmas[playerid][FunctionChristmas][1]=CreateObject(OBJECT_GIFT,0,0,0,0,0,0);
  214.         AttachObjectToPlayer(InfoChristmas[playerid][FunctionChristmas][1],playerid,0,1,1,0,0,0);
  215.         ApplyAnimation(playerid,"CARRY","null",0.0,0,0,0,0,0,0);
  216.         ApplyAnimation(playerid,"CARRY","crry_prtial",4.1,0,1,1,1,1,1);
  217.         KillTimer(InfoChristmas[playerid][FunctionChristmas][2]);
  218.         InfoChristmas[playerid][FunctionChristmas][2]=SetTimerEx("UploadWalk",1*1000,true,"d",playerid);
  219.         SendClientMessage(playerid,-1,""B"INFO:"R"Usted lleva en los brazos una caja de regalo"B"!.");
  220.     }else if(InfoChristmas[playerid][DataActivated][3]==true){
  221.         new Float:pos[4];
  222.         GetPlayerPos(playerid,pos[0],pos[1],pos[2]);
  223.         GetPlayerFacingAngle(playerid,pos[3]);
  224.         pos[0] = pos[0] + (3.0 * floatsin(-pos[3], degrees));
  225.         pos[1] = pos[1] + (3.0 * floatcos(-pos[3], degrees));
  226.         InfoChristmas[playerid][DataActivated][3]=false;
  227.         DestroyObject(InfoChristmas[playerid][FunctionChristmas][1]);
  228.         DestroyPickup(InfoChristmas[playerid][FunctionChristmas][0]);
  229.         InfoChristmas[playerid][FunctionChristmas][0]=CreatePickup(OBJECT_GIFT,1,pos[0],pos[1],pos[2]);
  230.         ApplyAnimation(playerid,"CARRY","null",0.0,0,0,0,0,0,0);
  231.         ApplyAnimation(playerid,"CARRY","putdwn",4.1,0,1,1,0,1,1);
  232.         KillTimer(InfoChristmas[playerid][FunctionChristmas][2]);
  233.         SendClientMessage(playerid,-1,""B"INFO:"R"Usted ha dejado en el suelo una caja de regalo"B"!.");
  234.     } return true;
  235. }
  236. forward UploadWalk(playerid);
  237. public UploadWalk(playerid){ApplyAnimation(playerid,"CARRY","crry_prtial",4.1,0,1,1,1,1,1);}
  238.  
  239. //INFO COMMAND: to create a table with drinks.
  240. COMMAND:drinks(playerid, params[]){
  241.     new Float:pos[4],data[100];
  242.     //if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,""B"INFO:"R"Usted no esta autorizado a usar este comando"B"!.");
  243.     //if(!IsChristmasDay()) return SendClientMessage(playerid,-1,""B"INFO:"R"Solo puedes usar esta funcion solo en el dia de navidad"B"!.");
  244.     if(GetPlayerState(playerid)!=PLAYER_STATE_ONFOOT) return SendClientMessage(playerid,-1,""B"INFO:"R"Usted no se encuentra a pie"B"!.");
  245.     if(CountingDrinksObjects>=MAX_DRINKS) return SendClientMessage(playerid,-1,""B"INFO:"R"Hay demasiadas mesas de bebidas creadas!");
  246.     GetPlayerPos(playerid,pos[0],pos[1],pos[2]);
  247.     GetPlayerFacingAngle(playerid,pos[3]);
  248.     pos[0] = pos[0] + (3.0 * floatsin(-pos[3], degrees));
  249.     pos[1] = pos[1] + (3.0 * floatcos(-pos[3], degrees));
  250.     CountingDrinksObjects++;
  251.     DrinksObjects[CountingDrinksObjects][0] = CreateObject(TABLES_DRINKS, pos[0],pos[1],pos[2]-0.5,0,0,0,3000.0);
  252.     DrinksObjects[CountingDrinksObjects][1] = CreateObject(BOTTLE_WINE, 0,0,0.0,0,0,3000.0);
  253.     DrinksObjects[CountingDrinksObjects][2] = CreateObject(BOTTLE_WINE, 0,0,0.0,0,0,3000.0);
  254.     DrinksObjects[CountingDrinksObjects][3] = CreateObject(BOTTLE_WINE, 0,0,0.0,0,0,3000.0);
  255.     DrinksObjects[CountingDrinksObjects][4] = CreateObject(BOTTLE_WINE, 0,0,0.0,0,0,3000.0);
  256.     DrinksObjects[CountingDrinksObjects][5] = CreateObject(BOTTLE_WINE, 0,0,0.0,0,0,3000.0);
  257.     DrinksObjects[CountingDrinksObjects][6] = CreateObject(BOTTLE_WINE, 0,0,0.0,0,0,3000.0);
  258.     DrinksObjects[CountingDrinksObjects][7] = CreateObject(BOTTLE_WINE, 0,0,0.0,0,0,3000.0);
  259.     DrinksObjects[CountingDrinksObjects][8] = CreateObject(BOTTLE_WINE, 0,0,0.0,0,0,3000.0);
  260.     DrinksObjects[CountingDrinksObjects][9] = CreateObject(BOTTLE_WINE, 0,0,0.0,0,0,3000.0);
  261.     AttachObjectToObject(DrinksObjects[CountingDrinksObjects][1], DrinksObjects[CountingDrinksObjects][0], 0.0, 0.2, 0.6, 0.0, 0.0, 0.0, 0);
  262.     AttachObjectToObject(DrinksObjects[CountingDrinksObjects][2], DrinksObjects[CountingDrinksObjects][0], 0.0, 0.4, 0.6, 0.0, 0.0, 0.0, 0);
  263.     AttachObjectToObject(DrinksObjects[CountingDrinksObjects][3], DrinksObjects[CountingDrinksObjects][0], 0.0, 0.2, 0.6, 0.0, 0.0, 0.0, 0);
  264.     AttachObjectToObject(DrinksObjects[CountingDrinksObjects][4], DrinksObjects[CountingDrinksObjects][0], 0.0, -0.4, 0.6, 0.0, 0.0, 0.0, 0);
  265.     AttachObjectToObject(DrinksObjects[CountingDrinksObjects][5], DrinksObjects[CountingDrinksObjects][0], 0.0, -0.2, 0.6, 0.0, 0.0, 0.0, 1);
  266.     AttachObjectToObject(DrinksObjects[CountingDrinksObjects][6], DrinksObjects[CountingDrinksObjects][0], 0.2, 0.0, 0.6, 0.0, 0.0, 0.0, 0);
  267.     AttachObjectToObject(DrinksObjects[CountingDrinksObjects][7], DrinksObjects[CountingDrinksObjects][0], 0.2, 0.0, 0.6, 0.0, 0.0, 0.0, 0);
  268.     AttachObjectToObject(DrinksObjects[CountingDrinksObjects][8], DrinksObjects[CountingDrinksObjects][0], -0.4, 0.0, 0.6, 0.0, 0.0, 0.0, 0);
  269.     AttachObjectToObject(DrinksObjects[CountingDrinksObjects][9], DrinksObjects[CountingDrinksObjects][0], -0.4, 0.0, 0.6, 0.0, 0.0, 0.0, 0);
  270.     SendClientMessage(playerid,-1,""B"INFO:"R"Usted ha creado una mesa de bebidas correctamente"B"!.");
  271.     format(data,sizeof(data),""B"INFO:"R"mesas de bebidas creadas: "B"[%02d/%02d]",CountingDrinksObjects,MAX_DRINKS);
  272.     SendClientMessage(playerid,-1,data);
  273.     return true;
  274. }
  275.  
  276. //INFO COMMAND: to remove tables created drink, counting from the last set.
  277. COMMAND:cleardrinks(playerid, params[]){
  278.     new data[100];
  279.     //if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,""B"INFO:"R"Usted no esta autorizado a usar este comando"B"!.");
  280.     //if(!IsChristmasDay()) return SendClientMessage(playerid,-1,""B"INFO:"R"Solo puedes usar esta funcion solo en el dia de navidad"B"!.");
  281.     if(GetPlayerState(playerid)!=PLAYER_STATE_ONFOOT) return SendClientMessage(playerid,-1,""B"INFO:"R"Usted no se encuentra a pie"B"!.");
  282.     if(CountingDrinksObjects<=0) return SendClientMessage(playerid,-1,""B"INFO:"R"No hay ninguna mesa de bebidas creada!");
  283.     for(new slots=0,index=10;slots!=index;slots++) {DestroyObject(DrinksObjects[CountingDrinksObjects][slots]);}
  284.     CountingDrinksObjects--;
  285.     SendClientMessage(playerid,-1,""B"INFO:"R"Usted ha eliminado la ultima mesa de bebidas creada correctamente"B"!.");
  286.     format(data,sizeof(data),""B"INFO:"R"mesas de bebidas creadas: "B"[%02d/%02d]",CountingDrinksObjects,MAX_DRINKS);
  287.     SendClientMessage(playerid,-1,data);
  288.     return true;
  289. }
  290.  
  291. //INFO COMMAND: to remove all tables created drinks.
  292. COMMAND:clearalldrinks(playerid, params[]){
  293.     new data[100];
  294.     //if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,""B"INFO:"R"Usted no esta autorizado a usar este comando"B"!.");
  295.     //if(!IsChristmasDay()) return SendClientMessage(playerid,-1,""B"INFO:"R"Solo puedes usar esta funcion solo en el dia de navidad"B"!.");
  296.     if(GetPlayerState(playerid)!=PLAYER_STATE_ONFOOT) return SendClientMessage(playerid,-1,""B"INFO:"R"Usted no se encuentra a pie"B"!.");
  297.     if(CountingDrinksObjects<=0) return SendClientMessage(playerid,-1,""B"INFO:"R"No hay ninguna mesa de bebidas creada!");
  298.     for(new slots=0,idx=CountingDrinksObjects+1;slots!=idx;slots++){
  299.     for(new object=0,index=10;object!=index;object++){DestroyObject(DrinksObjects[slots][object]); CountingDrinksObjects=0;} }
  300.     SendClientMessage(playerid,-1,""B"INFO:"R"Usted ha eliminado todas las mesas de bebidas creadas correctamente"B"!.");
  301.     format(data,sizeof(data),""B"INFO:"R"mesas de bebidas creadas: "B"[%02d/%02d]",CountingDrinksObjects,MAX_DRINKS);
  302.     SendClientMessage(playerid,-1,data);
  303.     return true;
  304. }
  305.  
  306. //INFO COMMAND: to obtain a bottle of wine.
  307. COMMAND:wine(playerid, params[]){
  308.     //if(!IsChristmasDay()) return SendClientMessage(playerid,-1,""B"INFO:"R"Solo puedes usar esta funcion solo en el dia de navidad"B"!.");
  309.     if(GetPlayerState(playerid)!=PLAYER_STATE_ONFOOT) return SendClientMessage(playerid,-1,""B"INFO:"R"Usted no se encuentra a pie"B"!.");
  310.     if(DistanceBetweenWineAndPlayer(playerid, 3.5)){
  311.     SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
  312.     switch(random(3)){
  313.         case 0:{SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_BEER); \
  314.         SendClientMessage(playerid,-1,""B"INFO:"R"Usted ha tomado una botela de cerveza de la mesa"B"!.");}
  315.         case 1:{SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_SPRUNK); \
  316.         SendClientMessage(playerid,-1,""B"INFO:"R"Usted ha tomado una botela de sprunk de la mesa"B"!.");}
  317.         case 2:{SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_WINE); \
  318.         SendClientMessage(playerid,-1,""B"INFO:"R"Usted ha tomado una botela de vino de la mesa"B"!.");}
  319.         default:{SendClientMessage(playerid,-1,""B"INFO:"R"No hay mas bebidas por el momento en esta mesa"B"!.");}
  320.     }
  321.     }else{SendClientMessage(playerid,-1,""B"INFO:"R"Usted no se encuentra cerca de una mesa de bebidas"B"!.");}
  322.     return true;
  323. }
  324. stock DistanceBetweenWineAndPlayer(playerid, Float:dist){
  325. new Float:pos[3];
  326. for(new slots=0,idx=CountingDrinksObjects+1;slots!=idx;slots++){
  327.     GetObjectPos(DrinksObjects[slots][0], pos[0], pos[1], pos[2]);
  328.     if(IsPlayerInRangeOfPoint(playerid, dist, pos[0], pos[1], pos[2]))return true;
  329. }return false;}
  330.  
  331. //INFO COMMAND: to send a Christmas greeting to all connected players.
  332. COMMAND:greeting(playerid, params[]){
  333.     //if(!IsChristmasDay()) return SendClientMessage(playerid,-1,""B"INFO:"R"Solo puedes usar esta funcion solo en el dia de navidad"B"!.");
  334.     new nombre[MAX_PLAYER_NAME+1], data[44+MAX_PLAYER_NAME];
  335.     for(new player, user = GetMaxPlayers(); player != user; player++){
  336.         if(IsPlayerConnected(player)){
  337.             GetPlayerName(playerid,nombre,sizeof(nombre));
  338.             format(data,sizeof(data),"~y~%s ~w~saluda: ~n~~r~Felices Fiestas!!!.", nombre);
  339.             GameTextForPlayer(player,data,5000,1);
  340.         }
  341.     } return true;
  342. }
  343.  
  344. //INFO COMMAND: to change the position of the object.
  345. COMMAND:modifyhat(playerid, params[]){
  346.     //if(!IsChristmasDay()) return SendClientMessage(playerid,-1,""B"INFO:"R"Solo puedes usar esta funcion solo en el dia de navidad"B"!.");
  347.     if(GetPlayerState(playerid)!=PLAYER_STATE_ONFOOT) return SendClientMessage(playerid,-1,""B"INFO:"R"Usted no se encuentra a pie"B"!.");
  348.     if(InfoChristmas[playerid][DataActivated][2]==true) return SendClientMessage(playerid,-1,""B"INFO:"R"You are already editing a christmas hat"B"!.");
  349.     SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
  350.     EditAttachedObject(playerid, SLOTS_USED+0);
  351.     InfoChristmas[playerid][DataActivated][2]=true;
  352.     SendClientMessage(playerid,-1,""B"INFO:"R"Usted ha comenzado la edicion del gorro de navidad"B"!.");
  353.     return true;
  354. }
  355. public OnPlayerEditAttachedObject(playerid, response, index, modelid, boneid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ){
  356.     if(InfoChristmas[playerid][DataActivated][2]==true && InfoChristmas[playerid][DataActivated][1]==true){
  357.         if(response){ //saved with 'SAVE'
  358.             InfoChristmas[playerid][DataEdition][0]=fOffsetX;
  359.             InfoChristmas[playerid][DataEdition][1]=fOffsetY;
  360.             InfoChristmas[playerid][DataEdition][2]=fOffsetZ;
  361.             InfoChristmas[playerid][DataEdition][3]=fRotX;
  362.             InfoChristmas[playerid][DataEdition][4]=fRotY;
  363.             InfoChristmas[playerid][DataEdition][5]=fRotZ;
  364.             InfoChristmas[playerid][DataEdition][6]=fScaleX;
  365.             InfoChristmas[playerid][DataEdition][7]=fScaleY;
  366.             InfoChristmas[playerid][DataEdition][8]=fScaleZ;
  367.             CancelEdit(playerid);
  368.             InfoChristmas[playerid][DataActivated][2]=false;
  369.             //SetPlayerAttachedObject(playerid, index, modelid, boneid, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ);
  370.             SendClientMessage(playerid,-1,""B"INFO:"R"Usted ha salido de la edicion del objeto, con la opcion 'SAVE'"B"!.");
  371.             //printf("[DEBUG 'SAVE']: %d,%d,%d,%d,%0.2f,%0.2f,%0.2f,%0.2f,%0.2f,%0.2f",playerid, index, modelid, boneid, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ);
  372.         }else{ //saved with 'ESC'
  373.             CancelEdit(playerid);
  374.             InfoChristmas[playerid][DataActivated][2]=false;
  375.             //SetPlayerAttachedObject(playerid, index, modelid, boneid, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ);
  376.             SendClientMessage(playerid,-1,""B"INFO:"R"Usted ha salido de la edicion del objeto, con la opcion 'ESC'"B"!.");
  377.             //printf("[DEBUG 'ESC']: %d,%d,%d,%d,%0.2f,%0.2f,%0.2f,%0.2f,%0.2f,%0.2f",playerid, index, modelid, boneid, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ);
  378.         }
  379.     } return true;
  380. }
  381.  
  382. //INFO COMMAND: to put a Christmas hat on his head.
  383. COMMAND:christmashat(playerid, params[]){
  384.     //if(!IsChristmasDay()) return SendClientMessage(playerid,-1,""B"INFO:"R"Solo puedes usar esta funcion solo en el dia de navidad"B"!.");
  385.     if(!IsPlayerAttachedObjectSlotUsed(playerid, SLOTS_USED+0) && InfoChristmas[playerid][DataActivated][1]==false){
  386.         InfoChristmas[playerid][DataActivated][1]=true;
  387.         RemovePlayerAttachedObject(playerid, SLOTS_USED+0);
  388.         SetPlayerAttachedObject(playerid, SLOTS_USED+0, OBJECT_HAT, BONE_USED, 0.122999,0.005999,0.016999,40.500019,72.699989,96.699966,1.111000,1.294000,1.000000);
  389.         SendClientMessage(playerid,-1,""B"INFO:"R"Usted se ha colocado un gorro de navidad en la cabeza"B"!.");
  390.         SendClientMessage(playerid,-1,""B"INFO:"R"Usa el comando /modifyhat para modificar lap osicon del gorro de navidad"B"!.");
  391.     }else if(IsPlayerAttachedObjectSlotUsed(playerid, SLOTS_USED+0) && InfoChristmas[playerid][DataActivated][1]==true){
  392.         InfoChristmas[playerid][DataActivated][1]=false;
  393.         RemovePlayerAttachedObject(playerid, SLOTS_USED+0);
  394.         SendClientMessage(playerid,-1,""B"INFO:"R"Usted se ha sacado el gorro de navidad de la cabeza"B"!.");
  395.     } return true;
  396. }
  397.  
  398. //INFO COMMAND: for your use with a christmas hat on his head all connected players
  399. COMMAND:christmashatall(playerid, params[]){
  400.     //if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,""B"INFO:"R"Usted no esta autorizado a usar este comando"B"!.");
  401.     //if(!IsChristmasDay()) return SendClientMessage(playerid,-1,""B"INFO:"R"Solo puedes usar esta funcion solo en el dia de navidad"B"!.");
  402.     for(new player, user = GetMaxPlayers(); player != user; player++){
  403.         if(IsPlayerConnected(player)){
  404.             InfoChristmas[player][DataActivated][1]=true;
  405.             RemovePlayerAttachedObject(player, SLOTS_USED+0);
  406.             SetPlayerAttachedObject(player, SLOTS_USED+0, OBJECT_HAT, BONE_USED, 0.122999,0.005999,0.016999,40.500019,72.699989,96.699966,1.111000,1.294000,1.000000);
  407.             SendClientMessage(player,-1,""B"INFO:"R"El administrador le ha colocado un gorro de navidad a todos los jugadores conectados"B"!.");
  408.             SendClientMessage(player,-1,""B"INFO:"R"Usa el comando /modifyhat para modificar lap osicon del gorro de navidadp"B"!.");
  409.         }
  410.     } SendClientMessage(playerid,-1,""B"INFO:"R"Usted le ha colocado un gorro de navidad a todos los jugadores conectados"B"!.");
  411.     return true;
  412. }
  413.  
  414. //INFO COMMAND: Single snow to put all players online.
  415. COMMAND:snowall(playerid, params[]){
  416.     //if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,""B"INFO:"R"Usted no esta autorizado a usar este comando"B"!.");
  417.     //if(!IsChristmasDay()) return SendClientMessage(playerid,-1,""B"INFO:"R"Solo puedes usar esta funcion solo en el dia de navidad"B"!.");
  418.     for(new player, user = GetMaxPlayers(); player != user; player++){
  419.         if(IsPlayerConnected(player) && !IsPlayerInAnyVehicle(player)){
  420.             InfoChristmas[player][DataActivated][0]=true;
  421.             SetPlayerWeather(player,SNOW_WEATHER);
  422.             new Float:pos[3]; GetPlayerPos(player,pos[0],pos[1],pos[2]);
  423.             for(new index=0; index<8; index++){DestroyPlayerObject(player,InfoChristmas[player][DataObjectsSnow][index]);}
  424.             for(new index=0; index<8; index++){InfoChristmas[player][DataObjectsSnow][index]=CreatePlayerObject(player,OBJECT_SNOW,pos[0]+random(25),pos[1]+random (25), pos[2]-5+random(10),random(280),random(280),0);}
  425.             KillTimer(InfoChristmas[player][FunctionChristmas][3]);
  426.             InfoChristmas[player][FunctionChristmas][3]=SetTimerEx("UploaSnow",TIMER_SNOW,true,"d",player);
  427.             SendClientMessage(player,-1,""B"INFO:"R"El administrador le ha activado la nieve individual a todos los jugadores conectados"B"!.");
  428.         }
  429.     } SendClientMessage(playerid,-1,""B"INFO:"R"Usted le ha activado la nieve individual a todos los jugadores conectados"B"!.");
  430.     return true;
  431. }
  432.  
  433. //INFO COMMAND: individually to put snow.
  434. COMMAND:snow(playerid, params[]){
  435.     //if(!IsChristmasDay()) return SendClientMessage(playerid,-1,""B"INFO:"R"Solo puedes usar esta funcion solo en el dia de navidad"B"!.");
  436.     if(!InfoChristmas[playerid][DataActivated][0]){
  437.         InfoChristmas[playerid][DataActivated][0]=true;
  438.         SetPlayerWeather(playerid,SNOW_WEATHER);
  439.         new Float:pos[3]; GetPlayerPos(playerid,pos[0],pos[1],pos[2]);
  440.         for(new index=0; index<8; index++){DestroyPlayerObject(playerid,InfoChristmas[playerid][DataObjectsSnow][index]);}
  441.         for(new index=0; index<8; index++){InfoChristmas[playerid][DataObjectsSnow][index]=CreatePlayerObject(playerid,OBJECT_SNOW,pos[0]+random(25),pos[1]+random (25), pos[2]-5+random(10),random(280),random(280),0);}
  442.         KillTimer(InfoChristmas[playerid][FunctionChristmas][3]);
  443.         InfoChristmas[playerid][FunctionChristmas][3]=SetTimerEx("UploaSnow",TIMER_SNOW,true,"d",playerid);
  444.         SendClientMessage(playerid,-1,""B"INFO:"R"Usted ha activado la nieve individual"B"!.");
  445.     }else{
  446.         InfoChristmas[playerid][DataActivated][0]=false;
  447.         SetPlayerWeather(playerid,GetWeather());
  448.         for(new index=0; index<8; index++){DestroyPlayerObject(playerid,InfoChristmas[playerid][DataObjectsSnow][index]);}
  449.         KillTimer(InfoChristmas[playerid][FunctionChristmas][3]);
  450.         SendClientMessage(playerid,-1,""B"INFO:"R"Usted ha desactivado la nieve individual"B"!.");
  451.     } return true;
  452. }
  453. forward UploaSnow(playerid);
  454. public UploaSnow(playerid){
  455. if(!IsPlayerConnected(playerid))return false;
  456. if(IsPlayerNPC(playerid))return false;
  457. new Float:pos[3]; GetPlayerPos(playerid,pos[0],pos[1],pos[2]);
  458. for(new index=0; index<8; index++){SetPlayerObjectPos(playerid,InfoChristmas[playerid][DataObjectsSnow][index],pos[0]+random(25),pos[1]+random(25),pos[2]-5+random(10));}
  459. return true;}
  460.  
  461. //INFO COMMAND: Christmas music to put in the position of the nearest tree, individually.
  462. COMMAND:christmas(playerid, params[]){
  463.     //if(!IsChristmasDay()) return SendClientMessage(playerid,-1,""B"INFO:"R"Solo puedes usar esta funcion solo en el dia de navidad"B"!.");
  464.     if(GetPlayerState(playerid)!=PLAYER_STATE_ONFOOT) return SendClientMessage(playerid,-1,""B"INFO:"R"Usted no se encuentra a pie"B"!.");
  465.     new Float:pos[3];
  466.     GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
  467.     if(DistanceBetweenTreeAndPlayer(playerid, 3.5)){
  468.         PlayAudioStreamForPlayer(playerid, "http://www.sonidosmp3gratis.com/sounds/cajas-registradoras_5.mp3",pos[0], pos[1], pos[2],20.0,1);
  469.         for(new player, user = GetMaxPlayers(); player != user; player++){
  470.             if(IsPlayerConnected(player) && !IsPlayerInAnyVehicle(player) && (player!=playerid)){
  471.             PlayAudioStreamForPlayer(player, "http://www.sonidosmp3gratis.com/sounds/cajas-registradoras_5.mp3",pos[0], pos[1], pos[2],20.0,1); }
  472.         } for(new msg=0; msg<32; msg++){SendClientMessage(playerid, -1, " ");}
  473.         SendClientMessage(playerid,-1,""B"INFO:"R"Usted ha colocado musica de navidad en la posicion del arbol cercano"B"!.");
  474.     }else{SendClientMessage(playerid,-1,""B"INFO:"R"Usted no se encuentra cerca de un arbol de navidad"B"!.");}
  475.     return true;
  476. }
  477. stock DistanceBetweenTreeAndPlayer(playerid, Float:dist){
  478. new Float:pos[3];
  479. for(new slots=0,idx=CountingTreeObjects+1;slots!=idx;slots++){
  480.     GetObjectPos(TreeObjects[slots][0], pos[0], pos[1], pos[2]);
  481.     if(IsPlayerInRangeOfPoint(playerid, dist, pos[0], pos[1], pos[2]))return true;
  482. }return false;}
  483.  
  484. //INFO COMMAND: to create a Christmas tree.
  485. COMMAND:createtree(playerid, params[]){
  486.     new Float:pos[4],data[100];
  487.     //if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,""B"INFO:"R"Usted no esta autorizado a usar este comando"B"!.");
  488.     //if(!IsChristmasDay()) return SendClientMessage(playerid,-1,""B"INFO:"R"Solo puedes usar esta funcion solo en el dia de navidad"B"!.");
  489.     if(GetPlayerState(playerid)!=PLAYER_STATE_ONFOOT) return SendClientMessage(playerid,-1,""B"INFO:"R"Usted no se encuentra a pie"B"!.");
  490.     if(CountingTreeObjects>=MAX_TREE) return SendClientMessage(playerid,-1,""B"INFO:"R"Hay demasiados arboles de navidas creados"B"!.");
  491.     GetPlayerPos(playerid,pos[0],pos[1],pos[2]);
  492.     GetPlayerFacingAngle(playerid,pos[3]);
  493.     pos[0] = pos[0] + (3.0 * floatsin(-pos[3], degrees));
  494.     pos[1] = pos[1] + (3.0 * floatcos(-pos[3], degrees));
  495.     CountingTreeObjects++;
  496.     TreeObjects[CountingTreeObjects][0] = CreateObject(19076, pos[0],pos[1],pos[2]-1.0,0.0,0.0,3000.0);
  497.     TreeObjects[CountingTreeObjects][1] = CreateObject(19054, pos[0],pos[1]+1.0, pos[2]-0.4,0,0,0.0,3000.0);
  498.     TreeObjects[CountingTreeObjects][2] = CreateObject(19058, pos[0]+1.0, pos[1], pos[2]-0.4,0,0,0.0,3000.0);
  499.     TreeObjects[CountingTreeObjects][3] = CreateObject(19056, pos[0], pos[1]-1.0, pos[2]-0.4,0,0,0.0,3000.0);
  500.     TreeObjects[CountingTreeObjects][4] = CreateObject(19057, pos[0]-1.0, pos[1], pos[2]-0.4,0,0,0.0,3000.0);
  501.     TreeObjects[CountingTreeObjects][5] = CreateObject(19058, pos[0]-1.5, pos[1]+1.5, pos[2]-1.0,0,0,0.0,3000.0);
  502.     TreeObjects[CountingTreeObjects][6] = CreateObject(19055, pos[0]+1.5, pos[1]-1.5, pos[2]-1.0,0,0,0.0,3000.0);
  503.     TreeObjects[CountingTreeObjects][7] = CreateObject(19057, pos[0]+1.5, pos[1]+1.5, pos[2]-1.0,0,0,0.0,3000.0);
  504.     TreeObjects[CountingTreeObjects][8] = CreateObject(19054, pos[0]-1.5, pos[1]-1.5, pos[2]-1.0,0,0,0.0,3000.0);
  505.     TreeObjects[CountingTreeObjects][9] = CreateObject(3526, pos[0],pos[1],pos[2]-1.0,0,0,3000.0);
  506.     SendClientMessage(playerid,-1,""B"INFO:"R"Usted ha creado un arbol de navidad correctamente"B"!.");
  507.     format(data,sizeof(data),""B"INFO:"R"arbol de navidad creados: "B"[%02d/%02d]",CountingTreeObjects,MAX_TREE);
  508.     SendClientMessage(playerid,-1,data);
  509.     return true;
  510. }
  511.  
  512. //INFO COMMAND: to remove a Christmas tree created, counting from the last one created.
  513. COMMAND:cleartree(playerid, params[]){
  514.     new data[100];
  515.     //if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,""B"INFO:"R"Usted no esta autorizado a usar este comando"B"!.");
  516.     //if(!IsChristmasDay()) return SendClientMessage(playerid,-1,""B"INFO:"R"Solo puedes usar esta funcion solo en el dia de navidad"B"!.");
  517.     if(GetPlayerState(playerid)!=PLAYER_STATE_ONFOOT) return SendClientMessage(playerid,-1,""B"INFO:"R"Usted no se encuentra a pie"B"!.");
  518.     if(CountingTreeObjects<=0) return SendClientMessage(playerid,-1,""B"INFO:"R"No hay ningun arbol de navidad creado"B"!.");
  519.     for(new slots=0,index=10;slots!=index;slots++) {DestroyObject(TreeObjects[CountingTreeObjects][slots]);}
  520.     CountingTreeObjects--;
  521.     SendClientMessage(playerid,-1,""B"INFO:"R"Usted a eliminado el ultimo arbol de navidad creado correctamente"B"!.");
  522.     format(data,sizeof(data),""B"INFO:"R"arbol de navidad creado: "B"[%02d/%02d]",CountingTreeObjects,MAX_TREE);
  523.     SendClientMessage(playerid,-1,data);
  524.     return true;
  525. }
  526.  
  527. //INFO COMMAND: to remove all Christmas trees created.
  528. COMMAND:clearalltree(playerid, params[]){
  529.     new data[100];
  530.     //if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,""B"INFO:"R"Usted no esta autorizado a usar este comando"B"!.");
  531.     //if(!IsChristmasDay()) return SendClientMessage(playerid,-1,""B"INFO:"R"Solo puedes usar esta funcion solo en el dia de navidad"B"!.");
  532.     if(GetPlayerState(playerid)!=PLAYER_STATE_ONFOOT) return SendClientMessage(playerid,-1,""B"INFO:"R"Usted no se encuentra a pie"B"!.");
  533.     if(CountingTreeObjects<=0) return SendClientMessage(playerid,-1,""B"INFO:"R"No hay ningun arbol de navidad creado"B"!.");
  534.     for(new slots=0,idx=CountingTreeObjects+1;slots!=idx;slots++){
  535.     for(new object=0,index=10;object!=index;object++){DestroyObject(TreeObjects[slots][object]); CountingTreeObjects=0;} }
  536.     SendClientMessage(playerid,-1,""B"INFO:"R"Usted a eliminado todos los arboles de navidad creados correctamente"B"!.");
  537.     format(data,sizeof(data),""B"INFO:"R"arbol de navidad creado: "B"[%02d/%02d]",CountingTreeObjects,MAX_TREE);
  538.     SendClientMessage(playerid,-1,data);
  539.     return true;
  540. }
  541.  
  542. COMMAND:utilities(playerid, params[]){
  543.     //if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,""B"INFO:"R"Usted no esta autorizado a usar este comando"B"!.");
  544.     new data[2000];
  545.     strcat(data,"1)-: ponerse en una caja de regalo \n");
  546.     strcat(data,"2)-: llevar una caja de regalo. \n");
  547.     strcat(data,"3)-: crear una mesa de bebidas. \n");
  548.     strcat(data,"4)-: eliminar una mesa de bebidas, contando desde la ultima creada \n");
  549.     strcat(data,"5)-: eliminar todas las mesas de bebidas creadas. \n");
  550.     strcat(data,"6)-: obtener una botella de bebida de una mesa creada. \n");
  551.     strcat(data,"7)-: mandas un manesaje navideño a todos los jugadores conectados. \n");
  552.     strcat(data,"8)-: cambiar la posicion del gorro de navidad colocado. \n");
  553.     strcat(data,"9)-: colocarse un gorro de navidad. \n");
  554.     strcat(data,"10)-: colocarle un gorro de navidad a todos los jugadores conectados. \n");
  555.     strcat(data,"11)-: activarles la nieve individual a todos los jugadores conectados. \n");
  556.     strcat(data,"12)-: activar/desactivar la nieve individual. \n");
  557.     strcat(data,"13)-: colocar musica de navidad en la posicion de un arbol cercano. \n");
  558.     strcat(data,"14)-: crear un arbol de navidad. \n");
  559.     strcat(data,"15)-: eliminar un arbol de navidad, contando desde el ultimo creado. \n");
  560.     strcat(data,"16)-: eliminar todosl os arboles de navidad creados. \n");
  561.     strcat(data,"17)-: crear una maquina de fuegos artificiales. \n");
  562.     strcat(data,"18)-: eliminar una maquina de fuegos artificiales, contando desde la ultima creada. \n");
  563.     strcat(data,"19)-: eliminar todas las maquina de fuegos artificiales creadas. \n");
  564.     strcat(data,"20)-: encender/apagar la maquina de fuegos artificiales cercana. ");
  565.     return ShowPlayerDialog(playerid, CHRISTMAS_ID+0, DIALOG_STYLE_LIST, ""B"INFO:"R"utilidades navideñas:", data, "Seleccionar", "Cancelar");
  566. }
  567. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){
  568.     switch(dialogid){
  569.         case CHRISTMAS_ID+0:{
  570.             if(response){
  571.                 switch(listitem){
  572.                     case 0:{CallLocalFunction("OnPlayerCommandText", "is", playerid, "/stash");}
  573.                     case 1:{CallLocalFunction("OnPlayerCommandText", "is", playerid, "/gift");}
  574.                     case 2:{CallLocalFunction("OnPlayerCommandText", "is", playerid, "/drinks");}
  575.                     case 3:{CallLocalFunction("OnPlayerCommandText", "is", playerid, "/cleardrinks");}
  576.                     case 4:{CallLocalFunction("OnPlayerCommandText", "is", playerid, "/clearalldrinks");}
  577.                     case 5:{CallLocalFunction("OnPlayerCommandText", "is", playerid, "/wine");}
  578.                     case 6:{CallLocalFunction("OnPlayerCommandText", "is", playerid, "/greeting");}
  579.                     case 7:{CallLocalFunction("OnPlayerCommandText", "is", playerid, "/modifyhat");}
  580.                     case 8:{CallLocalFunction("OnPlayerCommandText", "is", playerid, "/christmashat");}
  581.                     case 9:{CallLocalFunction("OnPlayerCommandText", "is", playerid, "/christmashatall");}
  582.                     case 10:{CallLocalFunction("OnPlayerCommandText", "is", playerid, "/snowall");}
  583.                     case 11:{CallLocalFunction("OnPlayerCommandText", "is", playerid, "/snow");}
  584.                     case 12:{CallLocalFunction("OnPlayerCommandText", "is", playerid, "/christmas");}
  585.                     case 13:{CallLocalFunction("OnPlayerCommandText", "is", playerid, "/createtree");}
  586.                     case 14:{CallLocalFunction("OnPlayerCommandText", "is", playerid, "/cleartree");}
  587.                     case 15:{CallLocalFunction("OnPlayerCommandText", "is", playerid, "/clearalltree");}
  588.                     case 16:{CallLocalFunction("OnPlayerCommandText", "is", playerid, "/createfireworks");}
  589.                     case 17:{CallLocalFunction("OnPlayerCommandText", "is", playerid, "/clearfireworks");}
  590.                     case 18:{CallLocalFunction("OnPlayerCommandText", "is", playerid, "/clearallfireworks");}
  591.                     case 19:{CallLocalFunction("OnPlayerCommandText", "is", playerid, "/fireworks");}
  592.                 }
  593.             }
  594.         }
  595.     } return false;
  596. }
  597. stock IsChristmasDay(){static date[3]; getdate(date[0],date[1],date[2]);if(date[0]==date[0] && date[1]==12 && date[2]==25) return true; return false;}
  598. stock GetWeather(){new weather[5]; GetServerVarAsString("weather", weather, sizeof(weather)); return strval(weather);}
  599. /*
  600.     * ## LEASE ATENTAMENTE PARA NO CONVERTIRSE EN LAMMER!!.: :D ##
  601.     *
  602.     * Estè Simple FILTERSCRIPT esta hecho especialmente para www.forum.sa-mp.com
  603.     * NO Publicar estè FILTERSCRIPT en Otros foros de SA-MP y hacerse pasar por el creador del CODE.
  604.     *
  605.     * Codigo Creado Por OTACON
  606.     *
  607.     * CREDITOS:
  608.     *     OTACON: Realizacion y Idea de creacion del code.
  609.     *     TÙ: Modificacion libremente respetando lo mencionado ;).
  610.     *
  611.     *    NOTA: Menos Creditos para los que me los critican.. JO'PUTAS! :D xD ;)
  612.     *
  613.     *                Prohibido TOTALMENTE el Robo de Créditos o la
  614.     *                  Publicación de este FILTERSCRIPT sin Mi Permiso.
  615. */
  616. /*
  617.     * ## READ CAREFULLY TO AVOID BECOMING LAMMER!.: :D ##
  618.     *
  619.     * This simple FILTERSCRIPT is made especially for www.forum.sa-mp.com
  620.     * DO NOT Post the FILTERSCRIPT in Other SAMP forums and impersonating the creator of the CODE.
  621.     *
  622.     * Code Created By OTACON
  623.     *
  624.     * CREDITS:
  625.     *     OTACON: Idea Making and code creation.
  626.     *     YOUR: Modification freely respecting the above ;).
  627.     *
  628.     *    NOTE: Less Credits for those who criticize me.. JO'PUTAS! :D xD ;)
  629.     *
  630.     *                        FULLY spaces Theft Credit or
  631.     *                 Publication of this FILTERSCRIPT without my permission.
  632. */
RAW Paste Data