Advertisement
alexcordeiro

[FS] Fazenda Natalina

Nov 7th, 2012
856
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 59.24 KB | None | 0 0
  1. //===================================================================================================================//
  2. //==============                             Créditos                                                  ===============//
  3. //==============                                                                                       ===============//
  4. //============== [RO]Nicusor: http://forum.sa-mp.com/showthread.php?t=301149                           ===============//
  5. //==============  Killa[DGZ] Palaa: http://forum.sa-mp.com/showthread.php?t=198006&highlight=xmas+tree ===============//
  6. //============== [TSSA]Tiego: http://forum.sa-mp.com/member.php?u=26080                                ===============//
  7. //==============  alexcordeiro http://forum.sa-mp.com/member.php?u=139939                              ===============//
  8. //====================================================================================================================//
  9. #define FILTERSCRIPT
  10. #include <a_samp>
  11. #include <cpstream>
  12. #include <Double-O-Icons> // < dont ask why Este is here but leave it
  13.  
  14. #define COR_3DLABEL              0xF68E00F6
  15. #define GREY 0xAFAFAFAA
  16. #define LIGHTGREEN 0x9ACD32AA
  17. #if defined FILTERSCRIPT
  18.  
  19. #define F_MAX_OBJECTS   1000
  20. #define UpdateTime  300     //update time in ms (milliseconds).
  21. #define ObjectsToStream 300
  22. #define StreamRange 300.0
  23. #pragma dynamic 30000
  24. #define MAX_XMASTREES 100
  25.  
  26. forward F_ObjectUpdate(bool:DontCheckDistance);
  27. forward F_StartUpdate();
  28.  
  29. enum XmasTrees
  30. {
  31.     XmasTreeX,
  32.     Float:XmasX,
  33.     Float:XmasY,
  34.     Float:XmasZ,
  35.     XmasObject1,
  36.     XmasObject2,
  37.     XmasObject3,
  38.     XmasObject4,
  39.     XmasObject5,
  40.     XmasObject6,
  41.     XmasObject7,
  42.     XmasObject8,
  43.     XmasObject9,
  44.     XmasObject10,
  45.  
  46. };
  47. new Treepos[MAX_XMASTREES][XmasTrees];
  48.  
  49. enum OInfo
  50. {
  51.     ModelID,
  52.     ObjectID[MAX_PLAYERS],
  53.     Float:ox,
  54.     Float:oy,
  55.     Float:oz,
  56.     Float:orox,
  57.     Float:oroy,
  58.     Float:oroz,
  59.     Float:ovdist,
  60.     bool:ObjectCreated[MAX_PLAYERS],
  61. };
  62. new ObjectInfo[F_MAX_OBJECTS][OInfo];
  63. new bool:ObjectUpdatetRunning;
  64. new bool:CantCreateMore;
  65. new bool:RefreshObjects[MAX_PLAYERS];
  66. new Float:OldX[MAX_PLAYERS], Float:OldY[MAX_PLAYERS], Float:OldZ[MAX_PLAYERS];
  67.  
  68. forward TempoNeve();
  69.  
  70. new Spawnado[MAX_PLAYERS];
  71.  
  72. forward Mensagens();
  73.  
  74. new pontomapa;
  75.  
  76. new cp;
  77. new cppresente;
  78.  
  79. new Menu:Natal;
  80.  
  81. new bool:UsandoGorro[MAX_PLAYERS];
  82.  
  83. stock DarGorro(playerid)
  84. {
  85.     SetPlayerAttachedObject(playerid, 2, 19065, 15, -0.025, -0.04, 0.23, 0, 0, 270, 2, 2, 2);
  86.     return 1;
  87. }
  88.  
  89. stock RemoverGorro(playerid)
  90. {
  91.     RemovePlayerAttachedObject(playerid, 2);
  92.     return 1;
  93. }
  94. //===================================================================================================================
  95. public OnPlayerConnect(playerid)
  96. {
  97.     SendClientMessage(playerid, LIGHTGREEN," ");
  98.     SendClientMessage(playerid, GREY,"* {FF0000}M{FFFFFF}E{008000}R{FF0000}R{FFFFFF}Y {008000}X{FF0000}M{FFFFFF}A{008000}S{FFFFFF} *");
  99.     SendClientMessage(playerid, LIGHTGREEN,"*  Use: /natalinfo para mais informação  *");
  100. //===================================================================================================================
  101.     SendClientMessage(playerid,0xFFFFFFAA, "[Natal] Esse server usa o FilterScript Natal 0.5 by [TSSA]Tiego");
  102.     SendClientMessage(playerid,0xFFFFFFAA, "[Natal] Para ver o Menu de Natal vá até a Prefeitura");
  103.     for(new o=0; o<60; o++) CreatePlayerObject(playerid,354,0,0,0,0,0,0);
  104.     Spawnado[playerid] = 0;
  105.     return 1;
  106. }
  107. //===================================================================================================================
  108. public OnPlayerSpawn(playerid)
  109. {
  110.     AntiDeAMX();
  111.     Spawnado[playerid] = 1;
  112.     return 1;
  113. }
  114. //===================================================================================================================
  115. public OnPlayerDeath(playerid, killerid, reason)
  116. {
  117.     Spawnado[playerid] = 0;
  118.     return 1;
  119. }
  120. //===================================================================================================================
  121. public OnFilterScriptInit()
  122. {
  123.     Create3DTextLabel("Menu de Natal\nAperte Enter Para Ver", COR_3DLABEL, 1469.750122, -1767.667236, 18.795755, 25, 0, 50);//Menu de Natal
  124.     AddStaticPickup(1276, 1, 1469.750122, -1767.667236, 18.795755); //Menu de Natal
  125.     Create3DTextLabel("Arena Battlefield\nAperte Enter Para Entrar", COR_3DLABEL, -1160.480224, -1219.690551, 129.218750, 25, 0, 50);//Entrada Arena Battlefield
  126.     Create3DTextLabel("Arena Battlefield\nAperte Enter Para Sair", COR_3DLABEL, -1128.513793, 1066.245849, 1345.742675, 25, 0, 50);//Saida Arena Battlefield
  127.     AddStaticPickup(19132, 1, -1160.480224, -1219.690551, 129.218750); //Entrada Arena X1
  128.     AddStaticPickup(19132, 1, -1128.513793, 1066.245849, 1345.742675); //Saida Arena X1
  129.     Create3DTextLabel("Club Dance Fazenda\nAperte Enter Para Entrar", COR_3DLABEL, -1104.886840, -1267.576782, 129.307022, 25, 0, 50);//Entrada Club Fazenda
  130.     Create3DTextLabel("Club Dance Fazenda\nAperte Enter Para Sair", COR_3DLABEL, 493.430938, -24.339445, 1000.679687, 25, 0, 50);//Saida Club Fazenda
  131.     AddStaticPickup(19132, 1, -1104.9026,-1267.2914,129.3068); //Entrada Club Fazenda
  132.     AddStaticPickup(19132, 1, 493.430938, -24.339445, 1000.679687); //Saida Club Fazenda
  133.  
  134.     SetTimer("MensagemNatal", 1000, true);
  135.     SetTimer("TempoNeve",10000,1);
  136.  
  137.     cppresente = CPS_AddCheckpoint(-685.2733,917.0217,12.0935, 3.0, 40); //CP Presente
  138.  
  139.     SetTimer("Mensagens",50000,1);
  140.  
  141.     Natal = CreateMenu("~p~Feliz ~r~Natal ~g~!!!", 1, 5, 150, 300);
  142.     SetMenuColumnHeader(Natal, 0, "~b~Menu~w~ de~p~ Natal");
  143.     AddMenuItem(Natal, 0, "Ir na Fazenda de natal");
  144.     AddMenuItem(Natal, 0, "Desejar Feliz Natal");
  145.     AddMenuItem(Natal, 0, "Buscar Presente de natal");
  146.     AddMenuItem(Natal, 0, "Colocar Gorro de Natal");
  147.     AddMenuItem(Natal, 0, "Retirar Gorro de Natal");
  148.     AddMenuItem(Natal, 0, "[Sair]");
  149. //===================================================================================================================
  150.     CreateObject(3917, -1190.63635254, -1199.75781250, 121.90628815, 0.00000000, 0.00000000, 180.00000000);
  151.     CreateObject(3917, -1180.33801270, -1199.92028809, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  152.     CreateObject(3917, -1190.68798828, -1186.91918945, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  153.     CreateObject(3917, -1180.36157227, -1186.83300781, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  154.     CreateObject(3917, -1180.53723145, -1173.71997070, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  155.     CreateObject(3917, -1190.53710938, -1173.82226562, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  156.     CreateObject(3917, -1190.67663574, -1160.51269531, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  157.     CreateObject(3917, -1180.42578125, -1160.40759277, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  158.     CreateObject(3917, -1180.53491211, -1149.98754883, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  159.     CreateObject(3917, -1180.60595703, -1142.98730469, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  160.     CreateObject(3917, -1190.42736816, -1147.45141602, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  161.     CreateObject(3917, -1190.23120117, -1142.84619141, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  162.     CreateObject(3917, -1170.07080078, -1142.84497070, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  163.     CreateObject(3917, -1170.11499023, -1155.90515137, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  164.     CreateObject(3917, -1170.40771484, -1168.93994141, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  165.     CreateObject(3917, -1170.20312500, -1182.02465820, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  166.     CreateObject(3917, -1170.44799805, -1192.04992676, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  167.     CreateObject(3917, -1170.44433594, -1199.58752441, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  168.     CreateObject(3917, -1159.93969727, -1199.69628906, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  169.     CreateObject(3917, -1159.94030762, -1187.42443848, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  170.     CreateObject(3917, -1159.98608398, -1175.90051270, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  171.     CreateObject(3917, -1159.97094727, -1163.37902832, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  172.     CreateObject(3917, -1159.91052246, -1150.10900879, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  173.     CreateObject(3917, -1159.96630859, -1142.83251953, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  174.     CreateObject(3917, -1150.47045898, -1143.05004883, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  175.     CreateObject(3917, -1150.76806641, -1156.04345703, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  176.     CreateObject(3917, -1151.06018066, -1168.78674316, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  177.     CreateObject(3917, -1151.34643555, -1181.28002930, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  178.     CreateObject(3917, -1151.61535645, -1193.02355957, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  179.     CreateObject(3917, -1151.77014160, -1199.77014160, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  180.     CreateObject(3917, -1142.77392578, -1199.97607422, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  181.     CreateObject(3917, -1142.48657227, -1187.48168945, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  182.     CreateObject(3917, -1142.20520020, -1175.23742676, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  183.     CreateObject(3917, -1141.91247559, -1162.49353027, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  184.     CreateObject(3917, -1141.61950684, -1149.74938965, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  185.     CreateObject(3917, -1141.45849609, -1142.75244141, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  186.     CreateObject(3917, -1131.21301270, -1142.98718262, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  187.     CreateObject(3917, -1131.50549316, -1155.73010254, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  188.     CreateObject(3917, -1131.80895996, -1168.97302246, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  189.     CreateObject(3917, -1132.11267090, -1182.21618652, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  190.     CreateObject(3917, -1132.38195801, -1193.96008301, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  191.     CreateObject(3917, -1132.51379395, -1199.70715332, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  192.     CreateObject(3917, -1072.61938477, -1213.97875977, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  193.     CreateObject(3917, -1083.166015625, -1213.9052734375, 121.90628814697, 0, 0, 179.99450683594);
  194.     CreateObject(3917, -1093.71289062, -1213.83203125, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  195.     CreateObject(3917, -1097.69726562, -1214.18359375, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  196.     CreateObject(3917, -1097.68261719, -1225.72656250, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  197.     CreateObject(3917, -1090.64404297, -1225.85839844, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  198.     CreateObject(3917, -1083.83203125, -1226.26123047, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  199.     CreateObject(3917, -1073.76123047, -1226.62695312, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  200.     CreateObject(3917, -1073.01367188, -1226.56103516, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  201.     CreateObject(3917, -1084.44677734, -1236.35302734, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  202.     CreateObject(3917, -1092.16601562, -1237.03369141, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  203.     CreateObject(3917, -1097.89355469, -1237.53857422, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  204.     CreateObject(3917, -1072.99121094, -1235.34082031, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  205.     CreateObject(3917, -1076.47753906, -1235.64843750, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  206.     CreateObject(3917, -1072.99707031, -1201.02832031, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  207.     CreateObject(3917, -1082.52587891, -1201.11621094, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  208.     CreateObject(3917, -1091.05810547, -1201.11621094, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  209.     CreateObject(3917, -1101.01586914, -1200.77880859, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  210.     CreateObject(3917, -1073.01428223, -1187.66052246, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  211.     CreateObject(3917, -1082.72241211, -1187.73315430, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  212.     CreateObject(3917, -1092.63537598, -1187.94860840, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  213.     CreateObject(3917, -1101.64721680, -1188.14477539, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  214.     CreateObject(3917, -1112.25646973, -1188.23718262, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  215.     CreateObject(3917, -1111.52868652, -1199.31799316, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  216.     CreateObject(3917, -1121.79016113, -1199.47180176, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  217.     CreateObject(3917, -1123.44653320, -1196.66406250, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  218.     CreateObject(3917, -1122.31201172, -1188.24682617, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  219.     CreateObject(3917, -1122.58666992, -1175.62866211, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  220.     CreateObject(3917, -1114.47473145, -1175.45104980, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  221.     CreateObject(3917, -1105.31896973, -1175.45861816, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  222.     CreateObject(3917, -1096.24414062, -1174.91333008, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  223.     CreateObject(3917, -1085.42919922, -1174.67724609, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  224.     CreateObject(3917, -1086.04357910, -1175.10632324, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  225.     CreateObject(3917, -1076.27246094, -1174.68432617, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  226.     CreateObject(3917, -1073.07739258, -1174.89135742, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  227.     CreateObject(3917, -1073.81860352, -1161.98388672, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  228.     CreateObject(3917, -1080.73059082, -1161.78930664, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  229.     CreateObject(3917, -1091.17419434, -1161.76708984, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  230.     CreateObject(3917, -1100.78637695, -1162.09350586, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  231.     CreateObject(3917, -1107.16870117, -1163.32421875, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  232.     CreateObject(3917, -1116.52636719, -1162.32897949, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  233.     CreateObject(3917, -1121.56457520, -1162.75683594, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  234.     CreateObject(3917, -1120.82043457, -1151.18029785, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  235.     CreateObject(3917, -1120.79162598, -1142.91381836, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  236.     CreateObject(3917, -1113.02416992, -1142.90979004, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  237.     CreateObject(3917, -1112.02209473, -1150.73999023, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  238.     CreateObject(3917, -1105.03515625, -1151.18701172, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  239.     CreateObject(3917, -1105.22399902, -1142.40563965, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  240.     CreateObject(3917, -1097.17199707, -1149.68579102, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  241.     CreateObject(3917, -1096.70812988, -1142.44970703, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  242.     CreateObject(3917, -1088.10937500, -1149.01318359, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  243.     CreateObject(3917, -1087.69360352, -1142.52539062, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  244.     CreateObject(3917, -1077.96240234, -1143.14904785, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  245.     CreateObject(3917, -1078.34570312, -1149.13671875, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  246.     CreateObject(3917, -1073.61657715, -1148.69836426, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  247.     CreateObject(3917, -1072.87927246, -1143.10705566, 121.90628815, 0.00000000, 0.00000000, 179.99450684);
  248.     CreateObject(687, -1036.21630859, -1351.61950684, 128.49894714, 0.00000000, 0.00000000, 0.00000000);
  249.     CreateObject(687, -1067.7275390625, -1339.0986328125, 128.49894714355, 0, 0, 0);
  250.     CreateObject(3472, -1067.73339844, -1338.97900391, 126.96295166, 0.00000000, 0.00000000, 0.00000000);
  251.     CreateObject(3472, -1067.73339844, -1338.97851562, 126.96295166, 0.00000000, 0.00000000, 173.99597168);
  252.     CreateObject(3472, -1067.73339844, -1338.97851562, 126.96295166, 0.00000000, 0.00000000, 89.99597168);
  253.     CreateObject(3472, -1067.73339844, -1338.97851562, 132.71295166, 0.00000000, 0.00000000, 89.99450684);
  254.     CreateObject(3472, -1067.73339844, -1338.97851562, 132.71295166, 0.00000000, 0.00000000, 231.99453735);
  255.     CreateObject(3472, -1067.73339844, -1338.97851562, 132.71295166, 0.00000000, 0.00000000, 33.99279785);
  256.     CreateObject(3472, -1067.73339844, -1338.97851562, 132.71295166, 0.00000000, 0.00000000, 67.99169922);
  257.     CreateObject(3472, -1067.73339844, -1338.97851562, 136.96295166, 0.00000000, 0.00000000, 97.98889160);
  258.     CreateObject(3472, -1067.73339844, -1338.97851562, 136.96295166, 0.00000000, 0.00000000, 55.98706055);
  259.     CreateObject(3472, -1067.63122559, -1338.75036621, 136.96295166, 0.00000000, 0.00000000, 119.98632812);
  260.     CreateObject(3472, -1036.04211426, -1351.59606934, 136.96295166, 0.00000000, 0.00000000, 119.98168945);
  261.     CreateObject(3472, -1036.04199219, -1351.59570312, 136.96295166, 0.00000000, 0.00000000, 265.98168945);
  262.     CreateObject(3472, -1036.04199219, -1351.59570312, 136.96295166, 0.00000000, 0.00000000, 329.97900391);
  263.     CreateObject(3472, -1036.04199219, -1351.59570312, 133.46295166, 0.00000000, 0.00000000, 53.97436523);
  264.     CreateObject(3472, -1036.04199219, -1351.59570312, 133.46295166, 0.00000000, 0.00000000, 125.97033691);
  265.     CreateObject(3472, -1036.04199219, -1351.59570312, 133.46295166, 0.00000000, 0.00000000, 219.96923828);
  266.     CreateObject(3472, -1036.04199219, -1351.59570312, 128.21295166, 0.00000000, 0.00000000, 219.96826172);
  267.     CreateObject(3472, -1036.04199219, -1351.59570312, 128.21295166, 0.00000000, 0.00000000, 13.96826172);
  268.     CreateObject(3472, -1036.04199219, -1351.59570312, 128.21295166, 0.00000000, 0.00000000, 113.96118164);
  269.     CreateObject(18102, -1099.3994140625, -1241.099609375, 135, 358.00048828125, 357.98950195313, 169.92553710938);
  270.     CreateObject(18102, -1110.3000488281, -1246.3000488281, 135, 358.00048828125, 357.98950195313, 5.9295654296875);
  271.     CreateObject(3472, -1036.04199219, -1351.59570312, 128.21295166, 0.00000000, 0.00000000, 67.96118164);
  272.     CreateObject(3472, -1067.73339844, -1338.97851562, 126.96295166, 0.00000000, 0.00000000, 149.99597168);
  273.     CreateObject(3666, -1065.15795898, -1290.16271973, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  274.     CreateObject(3666, -1065.11682129, -1286.20910645, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  275.     CreateObject(3666, -1065.21496582, -1282.71008301, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  276.     CreateObject(3666, -1065.28833008, -1279.20996094, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  277.     CreateObject(3666, -1065.37731934, -1274.95996094, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  278.     CreateObject(3666, -1065.45043945, -1271.45996094, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  279.     CreateObject(3666, -1065.52893066, -1267.70996094, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  280.     CreateObject(3666, -1065.62280273, -1263.20996094, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  281.     CreateObject(3666, -1065.69555664, -1259.70996094, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  282.     CreateObject(3666, -1065.78979492, -1255.20996094, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  283.     CreateObject(3666, -1069.28906250, -1255.28344727, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  284.     CreateObject(3666, -1073.03906250, -1255.36193848, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  285.     CreateObject(3666, -1077.03906250, -1255.44531250, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  286.     CreateObject(3666, -1081.28906250, -1255.53454590, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  287.     CreateObject(3666, -1085.28906250, -1255.61816406, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  288.     CreateObject(3666, -1088.78906250, -1255.69165039, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  289.     CreateObject(3666, -1088.86779785, -1251.94140625, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  290.     CreateObject(3666, -1088.95117188, -1247.94140625, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  291.     CreateObject(3666, -1088.28002930, -1244.15698242, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  292.     CreateObject(3666, -1088.33874512, -1241.38757324, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  293.     CreateObject(3666, -1088.65673828, -1238.14282227, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  294.     CreateObject(3666, -1088.47534180, -1234.86853027, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  295.     CreateObject(3666, -1087.81018066, -1233.08898926, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  296.     CreateObject(3666, -1088.51843262, -1220.55761719, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  297.     CreateObject(3666, -1033.65856934, -1219.31774902, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  298.     CreateObject(3666, -1033.18408203, -1222.94055176, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  299.     CreateObject(3666, -1033.20922852, -1230.69409180, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  300.     CreateObject(3666, -1032.90429688, -1234.62988281, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  301.     CreateObject(3666, -1033.68652344, -1239.06176758, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  302.     CreateObject(3666, -1033.08898926, -1242.72302246, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  303.     CreateObject(3666, -1033.05957031, -1246.47265625, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  304.     CreateObject(3666, -1033.02246094, -1251.22265625, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  305.     CreateObject(3666, -1032.98535156, -1255.97265625, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  306.     CreateObject(3666, -1032.94628906, -1260.97265625, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  307.     CreateObject(3666, -1032.91308594, -1265.22265625, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  308.     CreateObject(3666, -1032.87597656, -1269.97265625, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  309.     CreateObject(3666, -1032.83886719, -1274.72265625, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  310.     CreateObject(3666, -1032.79980469, -1279.72265625, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  311.     CreateObject(3666, -1032.76269531, -1284.47265625, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  312.     CreateObject(3666, -1032.72558594, -1289.22265625, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  313.     CreateObject(3666, -1032.68457031, -1294.47265625, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  314.     CreateObject(3666, -1032.64355469, -1299.72265625, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  315.     CreateObject(3666, -1032.59863281, -1305.47265625, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  316.     CreateObject(3666, -1032.55175781, -1311.47265625, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  317.     CreateObject(3666, -1032.37805176, -1314.73059082, 129.85032654, 0.00000000, 0.00000000, 0.00000000);
  318.     CreateObject(1262, -1068.38781738, -1300.62451172, 128.97836304, 0.00000000, 0.00000000, 278.00000000);
  319.     CreateObject(1262, -1068.38769531, -1300.62402344, 130.72836304, 0.00000000, 0.00000000, 277.99804688);
  320.     CreateObject(1262, -1068.61108398, -1296.88134766, 132.72836304, 0.00000000, 0.00000000, 277.99804688);
  321.     CreateObject(1262, -1068.77453613, -1301.09411621, 128.97836304, 0.00000000, 0.00000000, 277.99804688);
  322.     CreateObject(1262, -1068.77441406, -1301.09375000, 130.47836304, 0.00000000, 0.00000000, 277.99804688);
  323.     CreateObject(1262, -1062.19970703, -1231.57263184, 128.97836304, 0.00000000, 0.00000000, 0.00000000);
  324.     CreateObject(1262, -1064.18457031, -1231.32714844, 128.97836304, 0.00000000, 0.00000000, 0.00000000);
  325.     CreateObject(1262, -1067.16259766, -1230.95947266, 128.97836304, 0.00000000, 0.00000000, 0.00000000);
  326.     CreateObject(1262, -1070.14013672, -1230.59130859, 128.97836304, 0.00000000, 0.00000000, 0.00000000);
  327.     CreateObject(1262, -1072.12500000, -1230.34570312, 128.97836304, 0.00000000, 0.00000000, 0.00000000);
  328.     CreateObject(1262, -1074.91613770, -1230.50500488, 128.97836304, 0.00000000, 0.00000000, 0.00000000);
  329.     CreateObject(1262, -1077.76843262, -1231.16052246, 128.97836304, 0.00000000, 0.00000000, 0.00000000);
  330.     CreateObject(1262, -1080.86816406, -1231.78515625, 128.97836304, 0.00000000, 0.00000000, 0.00000000);
  331.     CreateObject(1262, -1084.43444824, -1232.10070801, 128.97836304, 0.00000000, 0.00000000, 0.00000000);
  332.     CreateObject(1262, -1088.27868652, -1232.63366699, 128.97836304, 0.00000000, 0.00000000, 0.00000000);
  333.     CreateObject(1262, -1087.58276367, -1220.87695312, 128.97836304, 0.00000000, 0.00000000, 188.00000000);
  334.     CreateObject(1262, -1085.59667969, -1221.12207031, 128.97836304, 0.00000000, 0.00000000, 187.99804688);
  335.     CreateObject(1262, -1082.61865234, -1221.48974609, 128.97836304, 0.00000000, 0.00000000, 187.99804688);
  336.     CreateObject(1262, -1081.06787109, -1221.17675781, 128.97836304, 0.00000000, 0.00000000, 187.99804688);
  337.     CreateObject(1262, -1079.33020020, -1221.39123535, 128.97836304, 0.00000000, 0.00000000, 187.99804688);
  338.     CreateObject(1262, -1076.84838867, -1221.69702148, 128.97836304, 0.00000000, 0.00000000, 187.99804688);
  339.     CreateObject(1262, -1073.37329102, -1222.12524414, 128.97836304, 0.00000000, 0.00000000, 187.99804688);
  340.     CreateObject(1262, -1069.89868164, -1222.55395508, 128.97836304, 0.00000000, 0.00000000, 187.99804688);
  341.     CreateObject(1262, -1067.16857910, -1222.89074707, 128.97836304, 0.00000000, 0.00000000, 187.99804688);
  342.     CreateObject(1262, -1064.43811035, -1223.22766113, 128.97836304, 0.00000000, 0.00000000, 187.99804688);
  343.     CreateObject(1262, -1061.70764160, -1223.56457520, 128.97836304, 0.00000000, 0.00000000, 187.99804688);
  344.     CreateObject(9078, -1128.7890625, -1173.0283203125, 124.58159637451, 0, 0, 25.999145507813);
  345.     CreateObject(8620, -1091.4248046875, -1226.3581542969, 115.2222366333, 0, 0, 90);
  346.     CreateObject(664, -1151.88476562, -1174.30664062, 126.38721466, 0.00000000, 0.00000000, 0.00000000);
  347.     CreateObject(3096, -1173.20080566, -1177.91247559, 141.87153625, 0.00000000, 0.00000000, 0.00000000);
  348.     CreateObject(3096, -1169.67114258, -1163.59423828, 141.87153625, 0.00000000, 0.00000000, 0.00000000);
  349.     CreateObject(3096, -1154.60815430, -1156.65649414, 142.12153625, 0.00000000, 0.00000000, 0.00000000);
  350.     CreateObject(3096, -1139.33203125, -1159.65039062, 142.12153625, 0.00000000, 0.00000000, 0.00000000);
  351.     CreateObject(3096, -1131.57128906, -1169.04809570, 142.12153625, 0.00000000, 0.00000000, 0.00000000);
  352.     CreateObject(3096, -1132.92846680, -1182.88232422, 142.12153625, 0.00000000, 0.00000000, 0.00000000);
  353.     CreateObject(3096, -1147.50976562, -1191.15380859, 142.12153625, 0.00000000, 0.00000000, 0.00000000);
  354.     CreateObject(3096, -1162.60595703, -1189.35949707, 142.12153625, 0.00000000, 0.00000000, 0.00000000);
  355.     CreateObject(3472, -1151.73950195, -1174.29028320, 154.52488708, 0.00000000, 0.00000000, 0.00000000);
  356.     CreateObject(3472, -1151.73925781, -1174.29003906, 154.52488708, 0.00000000, 0.00000000, 170.00000000);
  357.     CreateObject(3472, -1151.73925781, -1174.29003906, 149.77488708, 0.00000000, 314.00000000, 169.99694824);
  358.     CreateObject(3472, -1151.73925781, -1174.29003906, 149.77488708, 0.00000000, 349.99468994, 169.99145508);
  359.     CreateObject(3472, -1151.73925781, -1174.29003906, 149.77488708, 318.78033447, 346.64096069, 161.09759521);
  360.     CreateObject(3472, -1151.73925781, -1174.29003906, 149.77488708, 47.03942871, 345.22506714, 180.91130066);
  361.     CreateObject(3472, -1151.73925781, -1174.29003906, 149.77488708, 10.36413574, 80.52099609, 122.84490967);
  362.     CreateObject(3472, -1151.73925781, -1174.29003906, 149.77488708, 10.36010742, 80.51879883, 172.84375000);
  363.     CreateObject(3472, -1151.73925781, -1174.29003906, 149.77488708, 44.95755005, 25.88012695, 219.03923035);
  364.     CreateObject(3472, -1151.83325195, -1175.53637695, 149.77488708, 44.95605469, 25.87829590, 265.03448486);
  365.     CreateObject(3472, -1151.83300781, -1175.53613281, 149.77488708, 64.74838257, 46.38702393, 298.44284058);
  366.     CreateObject(3472, -1151.83300781, -1175.53613281, 149.77488708, 64.74792480, 46.38427734, 2.43807983);
  367.     CreateObject(3472, -1149.78845215, -1174.59790039, 149.77488708, 64.74243164, 46.37878418, 76.43344116);
  368.     CreateObject(3534, -1149.70471191, -1174.71679688, 136.84570312, 0.00000000, 0.00000000, 0.00000000);
  369.     CreateObject(3534, -1152.95410156, -1174.66601562, 136.84570312, 0.00000000, 0.00000000, 0.00000000);
  370.     CreateObject(3534, -1151.46582031, -1175.43945312, 136.84570312, 0.00000000, 0.00000000, 0.00000000);
  371.     CreateObject(3534, -1151.42675781, -1172.93945312, 136.84570312, 0.00000000, 0.00000000, 0.00000000);
  372.     CreateObject(3877, -1151.08776855, -1174.43359375, 143.92984009, 87.17187500, 314.98300171, 44.98211670);
  373.     CreateObject(3877, -1151.08691406, -1174.43359375, 142.17984009, 87.17102051, 314.97802734, 44.97802734);
  374.     CreateObject(3877, -1151.08691406, -1174.43359375, 139.17984009, 87.17102051, 314.97802734, 44.97802734);
  375.     CreateObject(3877, -1151.58300781, -1174.49584961, 139.17984009, 87.17105103, 314.97787476, 322.97817993);
  376.     CreateObject(3877, -1151.58300781, -1174.49511719, 141.17984009, 87.17102051, 314.97253418, 322.97607422);
  377.     CreateObject(3877, -1151.58300781, -1174.49511719, 142.42984009, 87.17102051, 314.97253418, 322.97607422);
  378.     CreateObject(3877, -1151.58300781, -1174.49511719, 145.92984009, 87.17102051, 314.97253418, 322.97607422);
  379.     CreateObject(3877, -1151.58300781, -1174.49511719, 146.92984009, 87.17105103, 314.97256470, 210.97602844);
  380.     CreateObject(3877, -1151.58300781, -1174.49511719, 144.17984009, 87.17102051, 314.97253418, 210.97595215);
  381.     CreateObject(3877, -1151.58300781, -1174.49511719, 140.42984009, 87.17102051, 314.97253418, 210.97595215);
  382.     CreateObject(3877, -1151.58300781, -1174.49511719, 137.92984009, 87.17102051, 314.97253418, 210.97595215);
  383.     CreateObject(3877, -1151.58300781, -1174.49511719, 137.92984009, 87.17105103, 314.97256470, 130.97589111);
  384.     CreateObject(3877, -1151.58300781, -1174.49511719, 140.17984009, 87.17102051, 314.97253418, 130.97351074);
  385.     CreateObject(3877, -1151.58300781, -1174.49511719, 143.17984009, 87.17102051, 314.97253418, 130.97351074);
  386.     CreateObject(3877, -1151.58300781, -1174.49511719, 147.17984009, 87.17102051, 314.97253418, 130.97351074);
  387.     CreateObject(3877, -1151.58300781, -1174.49511719, 149.67984009, 87.17102051, 314.97253418, 130.97351074);
  388.     CreateObject(7666, -1151.62731934, -1174.65588379, 175.60897827, 0.00000000, 0.00000000, 0.00000000);
  389.     CreateObject(7666, -1151.62695312, -1174.65527344, 175.60897827, 0.00000000, 0.00000000, 84.00000000);
  390.     CreateObject(7666, -1151.62695312, -1174.65527344, 175.60897827, 0.00000000, 0.00000000, 131.99597168);
  391.     CreateObject(7666, -1151.62695312, -1174.65527344, 175.60897827, 0.00000000, 0.00000000, 205.99523926);
  392.     CreateObject(7666, -1151.62695312, -1174.65527344, 175.60897827, 0.00000000, 0.00000000, 231.99365234);
  393.     CreateObject(8882, -1235.4000244141, -1186.0999755859, 146.10000610352, 0, 0, 208);
  394.     CreateObject(8881, -1195.5, -1127.4000244141, 139.60000610352, 0, 0, 116);
  395.     CreateObject(6994, -1110.69921875, -1247.2998046875, 137, 0, 0, 270);
  396.     CreateObject(16442, -1075.5999755859, -1252.1999511719, 129.60000610352, 0, 0, 341.99829101563);
  397.     CreateObject(16442, -1063, -1240.9000244141, 129.60000610352, 0, 0, 223.99340820313);
  398.     CreateObject(16442, -1077.4000244141, -1243.9000244141, 129.89999389648, 0, 0, 29.993408203125);
  399.     CreateObject(6299, -1060.0999755859, -1213, 130, 0, 0, 0);
  400.     CreateObject(5716, -1109.8000488281, -1276.9000244141, 141.60000610352, 0, 0, 180);
  401.     CreateObject(2898, -1090.1999511719, -1258.6999511719, 128.30000305176, 0, 0, 0);
  402.     CreateObject(2898, -1094.0999755859, -1258.6999511719, 128.30000305176, 0, 0, 0);
  403.     CreateObject(2898, -1098.0999755859, -1258.6999511719, 128.30000305176, 0, 0, 0);
  404.     CreateObject(16146, -1156.9000244141, -1229.0999755859, 131.60000610352, 0, 0, 270);
  405.     CreateObject(10150, -1161.3000488281, -1220.5999755859, 130.30000305176, 0, 0, 90);
  406. //===================================================================================================================
  407.  
  408.     print("\n---------------------------------------");
  409.     print(" FilterScript ~ Natal De [BMV]Alex_Staff");
  410.     print("---------------------------------------\n");
  411.  
  412.     return 1;
  413. }
  414. //===================================================================================================================
  415. public OnPlayerEnterCheckpoint(playerid)
  416. {
  417.  
  418.     cp = CPS_GetPlayerCheckpoint(playerid);
  419.  
  420.     if(cp == cppresente)
  421.     {
  422.  
  423.         SpawnPlayer(playerid);
  424.         new string[256];
  425.         new pname[MAX_PLAYER_NAME];
  426.         GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
  427.         format(string, sizeof(string), "[Natal] %s acaba de achar o Presente de Natal [Menu na Prefeitura]", pname);
  428.         SendClientMessageToAll(0xFF4500AA, string);     SetPlayerFacingAngle(playerid, 270);
  429.         GameTextForPlayer(playerid,"~y~P~g~R~b~E~y~S~g~E~b~N~y~T~g~E", 1000, 1);
  430.         SendClientMessage(playerid,0xFFFFFFAA, "[Natal] Aqui está seu Presente! Feliz Natal!");
  431.         GivePlayerMoney(playerid, 50000);
  432.         DisablePlayerCheckpoint(playerid);
  433.         DisablePlayerCheckpoint(pontomapa);
  434.         TogglePlayerControllable(playerid, 1);
  435.     }
  436.     return 1;
  437. }
  438. //===================================================================================================================
  439. public OnPlayerCommandText(playerid, cmdtext[])
  440. {
  441.     if (strcmp(cmdtext,"/natalinfo",true) == 0)
  442.     {
  443.  
  444.         SendClientMessage(playerid, LIGHTGREEN,"            *   Árvores de Natal   *");
  445.         SendClientMessage(playerid, GREY,"*  Use: /criararvore para criar uma arvore de natal  *");
  446.         SendClientMessage(playerid, GREY,"*  Use: /deletararvore para deletar a arvore de natal mais proxima  *");
  447.         //        SendClientMessage(playerid, GREY,"*  Use: /deletartodasarvores para deletar todas arvores de natal  *");// not unless you want ppl deleting your trees
  448.         SendClientMessage(playerid, GREY,"*  Use: /natalcreditos para os creditos deste FS  *");
  449.         return 1;
  450.     }
  451.     if (strcmp(cmdtext,"/natalcreditos",true) == 0)
  452.     {
  453.  
  454.         SendClientMessage(playerid, LIGHTGREEN,"            *   Créditos Árvores de Natal  *");
  455.         SendClientMessage(playerid, GREY,"*  Agradecimento especial para o para a equipe de SA-MP por novos objetos  *");
  456.         SendClientMessage(playerid, GREY,"*  Árvores de Natal[FS] Foi criado por Killa[DGZ] 11-12-2010  *");
  457.         SendClientMessage(playerid, GREY,"*  Este [FS] usa Streamer Fallout objeto criado por Fallout  *");
  458.         SendClientMessage(playerid, GREY,"*  Este [FS] também usa Double-O-Icons por Double-O-Seven  *");
  459.         return 1;
  460.     }
  461.     if(strcmp(cmdtext, "/criararvore", true) == 0)
  462.     {
  463.  
  464.         new Float:plocx,Float:plocy,Float:plocz;
  465.         GetPlayerPos(playerid, plocx, plocy, plocz);
  466.         SetXmasTree(plocx,plocy,plocz);
  467.         SetPlayerPos(playerid, plocx-2.5, plocy+2.5, plocz);//so you dont get stuck in the presents
  468.  
  469.         return 1;
  470.     }
  471.     if(strcmp(cmdtext, "/deletararvore", true) == 0)
  472.     {
  473.  
  474.         DeleteClosestXmasTree(playerid);
  475.         return 1;
  476.     }
  477.     if(strcmp(cmdtext, "/deletartodasarvores", true) == 0)
  478.     {
  479.         if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "(*) Você não é um administrador conectado na RCON.");
  480.         DeleteAllXmasTree();
  481.         return 1;
  482.     }
  483. //===================================================================================================================
  484.     if(strcmp(cmdtext,"/NatalBMV",true)==0)
  485.     {
  486.  
  487.         if(IsPlayerInRangeOfPoint(playerid, 2.0, 1469.750122, -1767.667236, 18.795755))
  488.         {
  489.  
  490.             TogglePlayerControllable(playerid, 0);
  491.             ShowMenuForPlayer(Natal,playerid);
  492.             SendClientMessage(playerid,0xFFFFFFAA, "Use: Também /natalinfo e /natalcreditos!");
  493.             return 1;
  494.         }
  495.     }
  496. //===================================================================================================================
  497.     if (strcmp("/entrarclub", cmdtext, true, 10) == 0)
  498.     {
  499.  
  500.         if(IsPlayerInRangeOfPoint(playerid, 2.0, -1104.886840, -1267.576782, 129.307022))
  501.         {
  502.  
  503.             PlayAudioStreamForPlayer(playerid, "http://174.36.241.224:10018");
  504.             GameTextForPlayer(playerid, "~w~Club Dance~g~ Fazenda", 5000, 6);
  505.             SetPlayerPos(playerid, 493.144287, -24.260700, 1000.679687);
  506.             SetPlayerFacingAngle(playerid, 356.986358);
  507.             SetPlayerInterior(playerid, 17);
  508.             return 1;
  509.         }
  510.     }
  511. //===================================================================================================================
  512.     if (strcmp("/sairclub", cmdtext, true, 10) == 0)
  513.     {
  514.  
  515.         if(IsPlayerInRangeOfPoint(playerid, 2.0, 493.430938, -24.339445, 1000.679687))
  516.         {
  517.  
  518.             StopAudioStreamForPlayer(playerid);
  519.             SetPlayerPos(playerid, -1104.9213,-1268.2100,129.3077);
  520.             SetPlayerFacingAngle(playerid, 7.0520);
  521.             SetPlayerInterior(playerid, 0);
  522.             return 1;
  523.         }
  524.     }
  525. //===================================================================================================================
  526.     if (strcmp("/entrararenax1", cmdtext, true, 10) == 0)
  527.     {
  528.  
  529.         if(IsPlayerInRangeOfPoint(playerid, 2.0, -1160.480224, -1219.690551, 129.218750))
  530.         {
  531.  
  532.             PlayAudioStreamForPlayer(playerid, "http://cdn.battlefieldheroes.com/static/20120820100012/images/audio/battlefield-heroes-theme.mp3");
  533.             GameTextForPlayer(playerid, "~w~Arena~g~ Battlefield", 5000, 6);
  534.             SetPlayerPos(playerid, -1127.7219,1066.4594,1345.7377);
  535.             SetPlayerFacingAngle(playerid, 273.1107);
  536.             SetPlayerInterior(playerid, 10);
  537.             GivePlayerWeapon(playerid, 24, 999);
  538.             GivePlayerWeapon(playerid, 25, 999);
  539.             GivePlayerWeapon(playerid, 31, 999);
  540.             GivePlayerWeapon(playerid, 29, 999);
  541.             GivePlayerWeapon(playerid, 34, 999);
  542.             SetPlayerArmour(playerid, 100);
  543.             SetPlayerHealth(playerid, 100);
  544.             return 1;
  545.         }
  546.     }
  547. //===================================================================================================================
  548.     if (strcmp("/sortearplayer", cmdtext, true, 10) == 0)
  549.     {
  550.         if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "(*) Você não é um administrador conectado na RCON.");
  551.         new string[256];
  552.         new onlineids[MAX_PLAYERS]; // to store all online playerids
  553.         new playersonline; // to store the amount of current online players
  554.         new pname[MAX_PLAYER_NAME]; // to store the chosen player's name
  555.  
  556.         for(new i=0; i<MAX_PLAYERS; i++) // loop through max amount of players (hopefully redefined from default!)
  557.         {
  558.  
  559.             if(IsPlayerConnected(i)) // check to see if current id in the loop is connected
  560.             {
  561.  
  562.                 onlineids[playersonline] = i; // store the current id into the onlineids variable
  563.                 playersonline++; // increase the playersonline by 1
  564.             }
  565.         }
  566.  
  567.         GetPlayerName(onlineids[random(playersonline)], pname, sizeof(string)); // use the random function to randomly select a store online id
  568.         format(string, sizeof(string), "[Natal] %s Ganhou Conta Vip por 1 Mês]", pname);
  569.         SendClientMessageToAll(0xFF4500AA, string);
  570.         return 1;
  571.     }
  572. //===================================================================================================================
  573.     if (strcmp("/sairarenax1", cmdtext, true, 10) == 0)
  574.     {
  575.  
  576.         if(IsPlayerInRangeOfPoint(playerid, 2.0, -1128.513793, 1066.245849, 1345.742675))
  577.         {
  578.  
  579.             StopAudioStreamForPlayer(playerid);
  580.             SetPlayerPos(playerid, -1160.3730,-1219.0618,129.2188);
  581.             SetPlayerFacingAngle(playerid, 3.1986);
  582.             SetPlayerInterior(playerid, 0);
  583.             ResetPlayerWeapons(playerid);
  584.             return 1;
  585.         }
  586.     }
  587.     return 0;
  588. }
  589. //===================================================================================================================
  590. public OnPlayerSelectedMenuRow(playerid, row)
  591. {
  592.     new string[256];
  593.     new Menu:current;
  594.     current = GetPlayerMenu(playerid);
  595.  
  596.     if(current == Natal)
  597.     {
  598.  
  599.         switch(row)
  600.         {
  601.  
  602.             case 0:
  603.             {
  604.  
  605.                 TogglePlayerControllable(playerid, 1);
  606.                 new pname[MAX_PLAYER_NAME];
  607.                 GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
  608.                 format(string, sizeof(string), "[Natal] %s foi Festejar o Natal na Fazenda vá você também[Menu na Prefeitura]", pname);
  609.                 SendClientMessageToAll(0xFF4500AA, string);
  610.                 SetPlayerPos(playerid,-1052.6349,-1346.8374,130.0952);
  611.                 GameTextForPlayer(playerid,"~y~Bem ~g~vindo(a) ~y~a ~g~Fazenda ~r~Natalina ~w~!", 1000, 1);
  612.                 SendClientMessage(playerid,0xFFFFFFAA, "[Natal] Bem vindo(a) à Fazenda Natalina!");
  613.             }
  614.             case 1:
  615.             {
  616.  
  617.                 TogglePlayerControllable(playerid, 1);
  618.                 new pname[MAX_PLAYER_NAME];
  619.                 GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
  620.                 format(string, sizeof(string), "[Natal] %s deseja um Feliz Natal à todos do server BMV!", pname);
  621.                 SendClientMessageToAll(0xFF4500AA, string);
  622.             }
  623.             case 2:
  624.             {
  625.  
  626.                 TogglePlayerControllable(playerid, 1);
  627.                 new pname[MAX_PLAYER_NAME];
  628.                 GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
  629.                 format(string, sizeof(string), "[Natal] %s foi procurar pelo presente de Natal! [Menu na Prefeitura]", pname);
  630.                 SendClientMessageToAll(0xFF4500AA, string);
  631.                 pontomapa = SetPlayerCheckpoint(playerid,-685.2733,917.0217,12.0935,2.0);
  632.                 SendClientMessage(playerid,0xFFFFFFAA, "[Natal] Vá até o ponto vermelho do Mapa para conseguir seu presente!");
  633.             }
  634.             case 3:
  635.             {
  636.  
  637.                 TogglePlayerControllable(playerid, 1);
  638.                 new pname[MAX_PLAYER_NAME];
  639.                 GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
  640.                 format(string, sizeof(string), "[Natal] %s Colocou um gorro de Natal! [Menu na Prefeitura]", pname);
  641.                 SendClientMessageToAll(0xFF4500AA, string);
  642.                 if(UsandoGorro[playerid]) return SendClientMessage(playerid, -1, "[Natal] Você já está usando o gorro!");
  643.                 SendClientMessage(playerid, -1, "Agora você está usando o gorro!");
  644.                 DarGorro(playerid);
  645.                 UsandoGorro[playerid] = true;
  646.             }
  647.             case 4:
  648.             {
  649.  
  650.                 TogglePlayerControllable(playerid, 1);
  651.                 new pname[MAX_PLAYER_NAME];
  652.                 GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
  653.                 format(string, sizeof(string), "[Natal] %s Retirou o gorro de Natal! [Menu na Prefeitura]", pname);
  654.                 SendClientMessageToAll(0xFF4500AA, string);
  655.                 if(!UsandoGorro[playerid]) return SendClientMessage(playerid, -1, "[Natal] Você não está usando o gorro!");
  656.                 SendClientMessage(playerid, -1, "Agora você não está mais usando o gorro!");
  657.                 RemoverGorro(playerid);
  658.                 UsandoGorro[playerid] = false;
  659.             }
  660.             case 5:
  661.             {
  662.  
  663.                 OnPlayerExitedMenu(playerid);
  664.             }
  665.         }
  666.     }
  667.     return 1;
  668. }
  669. //===================================================================================================================
  670. public OnPlayerExitedMenu(playerid)
  671. {
  672.     TogglePlayerControllable(playerid, 1);
  673.     return 1;
  674. }
  675. //===================================================================================================================
  676. public Mensagens()
  677. {
  678.  
  679.     new Mensagem=random(2);
  680.  
  681.     if (Mensagem == 0)
  682.     {
  683.  
  684.     }
  685.     else if (Mensagem == 1)
  686.     {
  687.  
  688.         SendClientMessageToAll(0xFFFFFFAA, "[Natal] Para ver o Menu de Natal vá até a Prefeitura");
  689.     }
  690.     return 1;
  691. }
  692. //===================================================================================================================
  693. public TempoNeve()
  694. {
  695.     for(new i=0; i<MAX_PLAYERS; i++) if(IsPlayerConnected(i) && Spawnado[i] == 1)
  696.     {
  697.         SetWorldTime(24);
  698.         new Float:Pos[3],Float:pObjectPos[3];
  699.         GetPlayerPos(i,Pos[0],Pos[1],Pos[2]);
  700.         for(new b=0; b<60; b++)
  701.         {
  702.             if(b < 20) SetPlayerObjectPos(i,b,Pos[0]+random(40)-4,Pos[1],Pos[2]+30);
  703.             if(b < 40 && b > 20) SetPlayerObjectPos(i,b,Pos[0]-random(30)+3,Pos[1],Pos[2]+30);
  704.             if(b < 50 && b > 40) SetPlayerObjectPos(i,b,Pos[0],Pos[1]+random(37)-2,Pos[2]+30);
  705.             if(b > 50) SetPlayerObjectPos(i,b,Pos[0],Pos[1]-random(39)+2,Pos[2]+30);
  706.             GetPlayerObjectPos(i,b,pObjectPos[0],pObjectPos[1],pObjectPos[2]);
  707.             MovePlayerObject(i,b,pObjectPos[0],pObjectPos[1],Pos[2],5);
  708.         }
  709.     }
  710.     return 1;
  711. }
  712. //===================================================================================================================
  713. forward MensagemNatal();
  714. public MensagemNatal()
  715. {
  716.     new Tempo[6];
  717.     getdate(Tempo[0], Tempo[1], Tempo[2]);
  718.     gettime(Tempo[3], Tempo[4], Tempo[5]);
  719.     if(Tempo[1] == 12 && Tempo[2] == 24)
  720.     for(new i = 0; i < MAX_PLAYERS; i++){
  721.  
  722.         if(Tempo[3] == 23 && Tempo[4] == 59 && Tempo[5] == 59)
  723.         {
  724.             ResetPlayerWeapons(i);
  725.             RemovePlayerFromVehicle(i);
  726.             SetPlayerAttachedObject(i, 2, 19065, 15, -0.025, -0.04, 0.23, 0, 0, 270, 2, 2, 2);
  727.             PlayAudioStreamForPlayer(i, "http://www.musicacomrequinte.com.br/modules/mp3player/cd/O%20Senhor%20esta%20aqui/9-noite%20feliz.mp3");
  728.             SetPlayerPos(i, -1097.4542,-1168.0835,129.2188);
  729.             GameTextForAll("~g~~h~FELIZ NATAL E UM PROSPERO ANO-NOVO !", 5000, 6);
  730.         }
  731.     }
  732.     return true;
  733. }
  734. //===================================================================================================================
  735. public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
  736. {
  737.     if ((newkeys==KEY_SECONDARY_ATTACK)) // Key ( F / Enter )
  738.     {
  739.         OnPlayerCommandText(playerid,"/NatalBMV"); // Ao Apertar "F" Funcionará o Comando Do Lado.
  740.         OnPlayerCommandText(playerid,"/entrarclub"); // Ao Apertar "F" Funcionará o Comando Do Lado.
  741.         OnPlayerCommandText(playerid,"/sairclub"); // Ao Apertar "F" Funcionará o Comando Do Lado.
  742.         OnPlayerCommandText(playerid,"/entrararenax1"); // Ao Apertar "F" Funcionará o Comando Do Lado.
  743.         OnPlayerCommandText(playerid,"/sairarenax1"); // Ao Apertar "F" Funcionará o Comando Do Lado.
  744.         // Se Quiser Colocar mais, a vontade.
  745.     }
  746. }
  747. //===================================================================================================================
  748. AntiDeAMX()
  749. {
  750.     new a[][] =
  751.     {
  752.  
  753.         "Unarmed (Fist)",
  754.         "Brass K"
  755.     };
  756.     #pragma unused a
  757. }
  758. //===================================================================================================================
  759. public F_StartUpdate()
  760. {
  761.     SetTimer("F_ObjectUpdate", UpdateTime, 1);
  762. }
  763.  
  764. stock F_CreateObject(modelid, Float:x, Float:y, Float:z, Float:rox, Float:roy, Float:roz, Float:vdist=0.0)
  765. {
  766.     if(ObjectUpdatetRunning == false)
  767.     {
  768.         SetTimer("F_StartUpdate", F_MAX_OBJECTS/2, 0);
  769.         ObjectUpdatetRunning = true;
  770.     }
  771.  
  772.     new objectid;
  773.  
  774.     if(CantCreateMore == false)
  775.     {
  776.         for(new i; i<F_MAX_OBJECTS; i++)
  777.         {
  778.             if(i == F_MAX_OBJECTS-1)
  779.             {
  780.                 printf("Only the first %i objects could be created - object limit exceeded.", F_MAX_OBJECTS);
  781.                 CantCreateMore = true;
  782.             }
  783.             if(ObjectInfo[i][ModelID] == 0)
  784.             {
  785.                 objectid = i;
  786.                 break;
  787.             }
  788.         }
  789.     }
  790.     else
  791.     {
  792.         return -1;
  793.     }
  794.  
  795.     if(modelid == 0)
  796.     {
  797.         printf("Invalid modelid for object %i", objectid);
  798.         return -1;
  799.     }
  800.  
  801.     ObjectInfo[objectid][ModelID] = modelid;
  802.     ObjectInfo[objectid][ox] = x;
  803.     ObjectInfo[objectid][oy] = y;
  804.     ObjectInfo[objectid][oz] = z;
  805.     ObjectInfo[objectid][orox] = rox;
  806.     ObjectInfo[objectid][oroy] = roy;
  807.     ObjectInfo[objectid][oroz] = roz;
  808.     ObjectInfo[objectid][ovdist] = vdist;
  809.     return objectid;
  810. }
  811.  
  812. stock F_IsValidObject(objectid)
  813. {
  814.     if(ObjectInfo[objectid][ModelID] == 0 || objectid == -1)
  815.     {
  816.         return 0;
  817.     }
  818.     return 1;
  819. }
  820.  
  821. stock F_DestroyObject(objectid)
  822. {
  823.     if(F_IsValidObject(objectid))
  824.     {
  825.         for(new playerid; playerid<MAX_PLAYERS; playerid++)
  826.         {
  827.             if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid) && ObjectInfo[objectid][ObjectCreated][playerid] == true)
  828.             {
  829.                 DestroyPlayerObject(playerid, ObjectInfo[objectid][ObjectID][playerid]);
  830.                 ObjectInfo[objectid][ObjectCreated][playerid] = false;
  831.             }
  832.         }
  833.         ObjectInfo[objectid][ModelID] = 0;
  834.         return 1;
  835.     }
  836.     return 0;
  837. }
  838.  
  839. stock F_MoveObject(objectid, Float:x, Float:y, Float:z, Float:speed)
  840. {
  841.     if(F_IsValidObject(objectid))
  842.     {
  843.         new time;
  844.         for(new playerid; playerid<MAX_PLAYERS; playerid++)
  845.         {
  846.             if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid) && ObjectInfo[objectid][ObjectCreated][playerid] == true)
  847.             {
  848.                 time = MovePlayerObject(playerid, ObjectInfo[objectid][ObjectID][playerid], x, y, z, speed);
  849.             }
  850.         }
  851.         return time;
  852.     }
  853.     return 0;
  854. }
  855.  
  856. stock F_StopObject(objectid)
  857. {
  858.     if(F_IsValidObject(objectid))
  859.     {
  860.         for(new playerid; playerid<MAX_PLAYERS; playerid++)
  861.         {
  862.             if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid) && ObjectInfo[objectid][ObjectCreated][playerid] == true)
  863.             {
  864.                 StopPlayerObject(playerid,  ObjectInfo[objectid][ObjectID][playerid]);
  865.             }
  866.         }
  867.         return 1;
  868.     }
  869.     return 0;
  870. }
  871.  
  872. stock F_SetObjectPos(objectid, Float:x, Float:y, Float:z)
  873. {
  874.     if(F_IsValidObject(objectid))
  875.     {
  876.         ObjectInfo[objectid][ox] = x;
  877.         ObjectInfo[objectid][oy] = y;
  878.         ObjectInfo[objectid][oz] = z;
  879.         for(new playerid; playerid<MAX_PLAYERS; playerid++)
  880.         {
  881.             if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid) && ObjectInfo[objectid][ObjectCreated][playerid] == true)
  882.             {
  883.                 SetPlayerObjectPos(playerid, ObjectInfo[objectid][ObjectID][playerid], x, y, z);
  884.             }
  885.         }
  886.         return 1;
  887.     }
  888.     return 0;
  889. }
  890.  
  891. stock F_GetObjectPos(objectid, &Float:x, &Float:y, &Float:z)
  892. {
  893.     if(F_IsValidObject(objectid))
  894.     {
  895.         x = ObjectInfo[objectid][ox];
  896.         y = ObjectInfo[objectid][oy];
  897.         z = ObjectInfo[objectid][oz];
  898.         return 1;
  899.     }
  900.     else
  901.     {
  902.         return 0;
  903.     }
  904. }
  905.  
  906. stock F_SetObjectRot(objectid, Float:rox, Float:roy, Float:roz)
  907. {
  908.     if(F_IsValidObject(objectid))
  909.     {
  910.         ObjectInfo[objectid][orox] = rox;
  911.         ObjectInfo[objectid][oroy] = roy;
  912.         ObjectInfo[objectid][oroz] = roz;
  913.         for(new playerid; playerid<MAX_PLAYERS; playerid++)
  914.         {
  915.             if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid) && ObjectInfo[objectid][ObjectCreated][playerid] == true)
  916.             {
  917.                 SetPlayerObjectRot(playerid, ObjectInfo[objectid][ObjectID][playerid], rox, roy, roz);
  918.             }
  919.         }
  920.         return 1;
  921.     }
  922.     return 0;
  923. }
  924.  
  925. stock F_GetObjectRot(objectid, &Float:rox, &Float:roy, &Float:roz)
  926. {
  927.     if(F_IsValidObject(objectid))
  928.     {
  929.         rox = ObjectInfo[objectid][orox];
  930.         roy = ObjectInfo[objectid][oroy];
  931.         roz = ObjectInfo[objectid][oroz];
  932.         return 1;
  933.     }
  934.     else
  935.     {
  936.         return 0;
  937.     }
  938. }
  939.  
  940. stock F_RefreshObjects(playerid)
  941. {
  942.     if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
  943.     {
  944.         RefreshObjects[playerid] = true;
  945.         new Float:x, Float:y, Float:z;
  946.         GetPlayerPos(playerid, x, y, z);
  947.         F_PlayerObjectUpdate(playerid, x, y, z);
  948.         return 1;
  949.     }
  950.     return 0;
  951. }
  952.  
  953. stock F_Streamer_OnPlayerConnect(playerid)
  954. {
  955.     for(new objectid; objectid<F_MAX_OBJECTS; objectid++)
  956.     {
  957.         ObjectInfo[objectid][ObjectCreated][playerid] = false;
  958.     }
  959.     OldX[playerid] = 999999999.99;
  960.     OldY[playerid] = 999999999.99;
  961.     OldZ[playerid] = 999999999.99;
  962.     RefreshObjects[playerid] = false;
  963.     return 1;
  964. }
  965.  
  966. public F_ObjectUpdate(bool:DontCheckDistance)
  967. {
  968.     new Float:ObjDistance[F_MAX_OBJECTS];
  969.     new Closest[ObjectsToStream];
  970.     new ObjectArr[F_MAX_OBJECTS];
  971.     new nr;
  972.     new bool:Firstloop;
  973.     new bool:DontDestroy[F_MAX_OBJECTS];
  974.  
  975.     for(new playerid; playerid<MAX_PLAYERS; playerid++)
  976.     {
  977.         if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
  978.         {
  979.             if(!IsPlayerInRangeOfPoint(playerid, 1.0, OldX[playerid], OldY[playerid], OldZ[playerid]) || DontCheckDistance)
  980.             {
  981.                 GetPlayerPos(playerid, OldX[playerid], OldY[playerid], OldZ[playerid]);
  982.  
  983.                 nr = 0;
  984.                 for(new objectid; objectid<F_MAX_OBJECTS; objectid++)
  985.                 {
  986.                     if(F_IsValidObject(objectid))
  987.                     {
  988.                         ObjDistance[objectid] = floatsqroot(floatpower(floatsub(ObjectInfo[objectid][ox],OldX[playerid]),2)+floatpower(floatsub(ObjectInfo[objectid][oy],OldY[playerid]),2)+floatpower(floatsub(ObjectInfo[objectid][oz],OldZ[playerid]),2));
  989.                         if(floatcmp(ObjDistance[objectid], StreamRange) == -1)
  990.                         {
  991.                             ObjectArr[nr] = objectid;
  992.                             nr++;
  993.                         }
  994.                     }
  995.                 }
  996.  
  997.                 Closest = "";
  998.  
  999.                 if(nr > ObjectsToStream)
  1000.                 {
  1001.                     for(new loop; loop<ObjectsToStream; loop++)
  1002.                     {
  1003.                         Firstloop = true;
  1004.                         for(new objectid; objectid<nr; objectid++)
  1005.                         {
  1006.                             if((ObjDistance[ObjectArr[objectid]] != 999999999.99) && ((floatcmp(ObjDistance[ObjectArr[objectid]], ObjDistance[Closest[loop]]) == -1) || Firstloop))
  1007.                             {
  1008.                                 Firstloop = false;
  1009.                                 Closest[loop] = ObjectArr[objectid];
  1010.                             }
  1011.                         }
  1012.                         ObjDistance[Closest[loop]] = 999999999.99;
  1013.                     }
  1014.                 }
  1015.                 else
  1016.                 {
  1017.                     for(new objectid; objectid<nr; objectid++)
  1018.                     {
  1019.                         Closest[objectid] = ObjectArr[objectid];
  1020.                     }
  1021.                 }
  1022.  
  1023.                 for(new objectid; objectid<F_MAX_OBJECTS; objectid++) { DontDestroy[objectid] = false; }
  1024.                 for(new objectid; objectid<ObjectsToStream && objectid<nr; objectid++)
  1025.                 {
  1026.                     DontDestroy[Closest[objectid]] = true;
  1027.                 }
  1028.  
  1029.                 for(new objectid; objectid<F_MAX_OBJECTS; objectid++)
  1030.                 {
  1031.                     if(ObjectInfo[objectid][ObjectCreated][playerid] == true && DontDestroy[objectid] == false)
  1032.                     {
  1033.                         DestroyPlayerObject(playerid, ObjectInfo[objectid][ObjectID][playerid]);
  1034.                         ObjectInfo[objectid][ObjectCreated][playerid] = false;
  1035.                     }
  1036.                 }
  1037.  
  1038.                 for(new loop; loop<ObjectsToStream && loop<nr; loop++)
  1039.                 {
  1040.                     if(ObjectInfo[Closest[loop]][ObjectCreated][playerid] == false)
  1041.                     {
  1042.                         ObjectInfo[Closest[loop]][ObjectID][playerid] = CreatePlayerObject(playerid, ObjectInfo[Closest[loop]][ModelID], ObjectInfo[Closest[loop]][ox], ObjectInfo[Closest[loop]][oy], ObjectInfo[Closest[loop]][oz], ObjectInfo[Closest[loop]][orox], ObjectInfo[Closest[loop]][oroy], ObjectInfo[Closest[loop]][oroz], ObjectInfo[Closest[loop]][ovdist]);
  1043.                         ObjectInfo[Closest[loop]][ObjectCreated][playerid] = true;
  1044.                     }
  1045.                 }
  1046.             }
  1047.         }
  1048.     }
  1049. }
  1050.  
  1051. stock F_ObjectUpdateForAll()
  1052. {
  1053.     F_ObjectUpdate(true);
  1054. }
  1055.  
  1056. stock F_PlayerObjectUpdate(playerid, Float:x, Float:y, Float:z)
  1057. {
  1058.     if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
  1059.     {
  1060.         OldX[playerid] = x;
  1061.         OldY[playerid] = y;
  1062.         OldZ[playerid] = z;
  1063.  
  1064.         new nr;
  1065.         new Float:ObjDistance[F_MAX_OBJECTS];
  1066.         new ObjectArr[F_MAX_OBJECTS];
  1067.         for(new objectid; objectid<F_MAX_OBJECTS; objectid++)
  1068.         {
  1069.             if(F_IsValidObject(objectid))
  1070.             {
  1071.                 ObjDistance[objectid] = floatsqroot(floatpower(floatsub(ObjectInfo[objectid][ox],x),2)+floatpower(floatsub(ObjectInfo[objectid][oy],y),2)+floatpower(floatsub(ObjectInfo[objectid][oz],z),2));
  1072.                 if(floatcmp(ObjDistance[objectid], StreamRange) == -1)
  1073.                 {
  1074.                     ObjectArr[nr] = objectid;
  1075.                     nr++;
  1076.                 }
  1077.             }
  1078.         }
  1079.  
  1080.         new Closest[ObjectsToStream];
  1081.  
  1082.         if(nr > ObjectsToStream)
  1083.         {
  1084.             for(new loop; loop<ObjectsToStream; loop++)
  1085.             {
  1086.                 new bool:Firstloop = true;
  1087.                 for(new objectid; objectid<nr; objectid++)
  1088.                 {
  1089.                     if((ObjDistance[ObjectArr[objectid]] != 999999999.99) && ((floatcmp(ObjDistance[ObjectArr[objectid]], ObjDistance[Closest[loop]]) == -1) || Firstloop))
  1090.                     {
  1091.                         Firstloop = false;
  1092.                         Closest[loop] = ObjectArr[objectid];
  1093.                     }
  1094.                 }
  1095.                 ObjDistance[Closest[loop]] = 999999999.99;
  1096.             }
  1097.         }
  1098.         else
  1099.         {
  1100.             for(new objectid; objectid<nr; objectid++)
  1101.             {
  1102.                 Closest[objectid] = ObjectArr[objectid];
  1103.             }
  1104.         }
  1105.  
  1106.         new bool:DontDestroy[F_MAX_OBJECTS];
  1107.         for(new objectid; objectid<ObjectsToStream && objectid<nr; objectid++)
  1108.         {
  1109.             DontDestroy[Closest[objectid]] = true;
  1110.         }
  1111.  
  1112.         for(new objectid; objectid<F_MAX_OBJECTS; objectid++)
  1113.         {
  1114.             if(ObjectInfo[objectid][ObjectCreated][playerid] == true && (DontDestroy[objectid] == false || RefreshObjects[playerid] == true))
  1115.             {
  1116.                 DestroyPlayerObject(playerid, ObjectInfo[objectid][ObjectID][playerid]);
  1117.                 ObjectInfo[objectid][ObjectCreated][playerid] = false;
  1118.             }
  1119.         }
  1120.         RefreshObjects[playerid] = false;
  1121.  
  1122.         for(new loop; loop<ObjectsToStream && loop<nr; loop++)
  1123.         {
  1124.             if(ObjectInfo[Closest[loop]][ObjectCreated][playerid] == false)
  1125.             {
  1126.                 ObjectInfo[Closest[loop]][ObjectID][playerid] = CreatePlayerObject(playerid, ObjectInfo[Closest[loop]][ModelID], ObjectInfo[Closest[loop]][ox], ObjectInfo[Closest[loop]][oy], ObjectInfo[Closest[loop]][oz], ObjectInfo[Closest[loop]][orox], ObjectInfo[Closest[loop]][oroy], ObjectInfo[Closest[loop]][oroz], ObjectInfo[Closest[loop]][ovdist]);
  1127.                 ObjectInfo[Closest[loop]][ObjectCreated][playerid] = true;
  1128.             }
  1129.         }
  1130.     }
  1131. }
  1132. #define SetPlayerPos F_SetPlayerPos
  1133. stock F_SetPlayerPos(playerid, Float:x, Float:y, Float:z)
  1134. {
  1135.     F_PlayerObjectUpdate(playerid, x, y, z);
  1136.     SetPlayerPos(playerid, x, y, z);
  1137. }
  1138.  
  1139. stock SetXmasTree(Float:x,Float:y,Float:z)
  1140. {
  1141.     for(new i = 0; i < sizeof(Treepos); i++)
  1142.     {
  1143.         if(Treepos[i][XmasTreeX] == 0)
  1144.         {
  1145.             Treepos[i][XmasTreeX]=1;
  1146.             Treepos[i][XmasX]=x;
  1147.             Treepos[i][XmasY]=y;
  1148.             Treepos[i][XmasZ]=z;
  1149.             Treepos[i][XmasObject1] = F_CreateObject(19076, x, y, z-1.0,0,0,300);//xmas tree
  1150.             Treepos[i][XmasObject2] = F_CreateObject(19054, x, y+1.0, z-0.4,0,0,300);//XmasBox1
  1151.             Treepos[i][XmasObject3] = F_CreateObject(19058, x+1.0, y, z-0.4,0,0,300);//XmasBox5
  1152.             Treepos[i][XmasObject4] = F_CreateObject(19056, x, y-1.0, z-0.4,0,0,300);//XmasBox3
  1153.             Treepos[i][XmasObject5] = F_CreateObject(19057, x-1.0, y, z-0.4,0,0,300);//XmasBox4
  1154.             Treepos[i][XmasObject6] = F_CreateObject(19058, x-1.5, y+1.5, z-1.0,0,0,300);//XmasBox5
  1155.             Treepos[i][XmasObject7] = F_CreateObject(19055, x+1.5, y-1.5, z-1.0,0,0,300);//XmasBox2
  1156.             Treepos[i][XmasObject8] = F_CreateObject(19057, x+1.5, y+1.5, z-1.0,0,0,300);//XmasBox4
  1157.             Treepos[i][XmasObject9] = F_CreateObject(19054, x-1.5, y-1.5, z-1.0,0,0,300);//XmasBox1
  1158.             Treepos[i][XmasObject10] = F_CreateObject(3526, x, y, z-1.0,0,0,300);//Airportlight - for flashing affect
  1159.             return 1;
  1160.         }
  1161.     }
  1162.     return 0;
  1163. }
  1164.  
  1165. stock DeleteAllXmasTree()
  1166. {
  1167.     for(new i = 0; i < sizeof(Treepos); i++)
  1168.     {
  1169.         if(Treepos[i][XmasTreeX] == 1)
  1170.         {
  1171.             Treepos[i][XmasTreeX]=0;
  1172.             Treepos[i][XmasX]=0.0;
  1173.             Treepos[i][XmasY]=0.0;
  1174.             Treepos[i][XmasZ]=0.0;
  1175.             F_DestroyObject(Treepos[i][XmasObject1]);
  1176.             F_DestroyObject(Treepos[i][XmasObject2]);
  1177.             F_DestroyObject(Treepos[i][XmasObject3]);
  1178.             F_DestroyObject(Treepos[i][XmasObject4]);
  1179.             F_DestroyObject(Treepos[i][XmasObject5]);
  1180.             F_DestroyObject(Treepos[i][XmasObject6]);
  1181.             F_DestroyObject(Treepos[i][XmasObject7]);
  1182.             F_DestroyObject(Treepos[i][XmasObject8]);
  1183.             F_DestroyObject(Treepos[i][XmasObject9]);
  1184.             F_DestroyObject(Treepos[i][XmasObject10]);
  1185.         }
  1186.     }
  1187.     return 0;
  1188. }
  1189.  
  1190. stock DeleteClosestXmasTree(playerid)
  1191. {
  1192.     for(new i = 0; i < sizeof(Treepos); i++)
  1193.     {
  1194.         if(IsPlayerInRangeOfPoint(playerid, 3.0, Treepos[i][XmasX], Treepos[i][XmasY], Treepos[i][XmasZ]))
  1195.         {
  1196.             if(Treepos[i][XmasTreeX] == 1)
  1197.             {
  1198.                 Treepos[i][XmasTreeX]=0;
  1199.                 Treepos[i][XmasX]=0.0;
  1200.                 Treepos[i][XmasY]=0.0;
  1201.                 Treepos[i][XmasZ]=0.0;
  1202.                 F_DestroyObject(Treepos[i][XmasObject1]);
  1203.                 F_DestroyObject(Treepos[i][XmasObject2]);
  1204.                 F_DestroyObject(Treepos[i][XmasObject3]);
  1205.                 F_DestroyObject(Treepos[i][XmasObject4]);
  1206.                 F_DestroyObject(Treepos[i][XmasObject5]);
  1207.                 F_DestroyObject(Treepos[i][XmasObject6]);
  1208.                 F_DestroyObject(Treepos[i][XmasObject7]);
  1209.                 F_DestroyObject(Treepos[i][XmasObject8]);
  1210.                 F_DestroyObject(Treepos[i][XmasObject9]);
  1211.                 F_DestroyObject(Treepos[i][XmasObject10]);
  1212.                 return 1;
  1213.             }
  1214.         }
  1215.     }
  1216.     return 0;
  1217. }
  1218. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement