Guest User

Christmass System v2.1

a guest
Nov 26th, 2014
1,063
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 73.91 KB | None | 0 0
  1. /* Christmas System v 2.1
  2. By Adrian Petre
  3. Colaboratori:
  4. Known
  5. Ph0eniX
  6. Va rog nu stergeti creditele!
  7. */
  8. #define FILTERSCRIPT // Definirea de Filescript.
  9.  
  10. #include <a_samp>
  11. #include <sscanf2>
  12. #include <foreach>
  13. #include <streamer>
  14. //#include <Double-O-Icons> // Asta lasatil asa.
  15.  
  16. #define COLOR_LIME 0x00FF00DC //Culoarea LIME(verde mai deschis) pentru caciula de mos craciun
  17. #define GREY 0xAFAFAFAA // Culoarea gri
  18. #define LIGHTGREEN 0x9ACD32AA //Culoarea verde deschis.
  19. #define COLOR_GREY 0xAFAFAFAA //Culoarea Gri
  20. #define COLOR_WHITE 0xFFFFFFAA //Culoarea alba
  21. #define COLOR_YELLOW 0xFFFF00AA//Culoarea galben
  22. #define COLOR_ORANGE 0xFFAA00FF// Culoarea portocaliu
  23. #define RocketHeight 50 // Inaltimea obiectului in cazul nostru artificiul..
  24. #define RocketSpread 30 // Raza de vedere a artificiului.
  25. #define MAX_LAUNCH 20 //Altceva...
  26. #define MAX_FIREWORKS 100 // Maximul de artificii
  27. #define MAX_GIFTS (500) // Maximul de cadouri
  28. #define MAX_ZONE_NAME 28 // Zonele pentru cadouri
  29. #if defined FILTERSCRIPT // Definirea de Filescript.
  30.  
  31.  
  32. #define F_MAX_OBJECTS 1000 //Ai posibilitatea de a pune 1000 de obiecte create(de comanda /brad) pe server
  33. #define UpdateTime 300 //Update la timp pentru brazi
  34. #define ObjectsToStream 300 // 300 obiecte pe streamer..
  35. #define StreamRange 300.0 // Distanta in care vei vedea brazii.
  36. #pragma dynamic 30000 // O chestie importanta.
  37. #define MAX_XMASTREES 100 // Maximul de brazi pe server este de 100 pentru a nu se creea lag.
  38. //---------------------Cadouri----------------------------------
  39. forward GetPlayerGiftFounds(playerid);
  40. forward GetPlayerGiftReceiveds(playerid);
  41.  
  42. new giftCounter;
  43. new Gift[MAX_GIFTS];
  44. new Picked[MAX_PLAYERS];
  45. new RandomModel[5][1] = {
  46. {19054},
  47. {19055},
  48. {19056},
  49. {19057},
  50. {19058}
  51. };
  52.  
  53. enum PlayerInfo
  54. {
  55. aGift,
  56. gFound,
  57. pExp
  58. };
  59. new pInfo[MAX_PLAYERS][PlayerInfo];
  60. forward Zones_Update();
  61.  
  62. enum SAZONE_MAIN {
  63. SAZONE_NAME[28],
  64. Float:SAZONE_AREA[6]
  65. };
  66.  
  67. static const gSAZones[][SAZONE_MAIN] = {
  68. // NAME AREA (Xmin,Ymin,Zmin,Xmax,Ymax,Zmax)
  69. {"The Big Ear", {-410.00,1403.30,-3.00,-137.90,1681.20,200.00}},
  70. {"Aldea Malvada", {-1372.10,2498.50,0.00,-1277.50,2615.30,200.00}},
  71. {"Angel Pine", {-2324.90,-2584.20,-6.10,-1964.20,-2212.10,200.00}},
  72. {"Arco del Oeste", {-901.10,2221.80,0.00,-592.00,2571.90,200.00}},
  73. {"Avispa Country Club", {-2646.40,-355.40,0.00,-2270.00,-222.50,200.00}},
  74. {"Avispa Country Club", {-2831.80,-430.20,-6.10,-2646.40,-222.50,200.00}},
  75. {"Avispa Country Club", {-2361.50,-417.10,0.00,-2270.00,-355.40,200.00}},
  76. {"Avispa Country Club", {-2667.80,-302.10,-28.80,-2646.40,-262.30,71.10}},
  77. {"Avispa Country Club", {-2470.00,-355.40,0.00,-2270.00,-318.40,46.10}},
  78. {"Avispa Country Club", {-2550.00,-355.40,0.00,-2470.00,-318.40,39.70}},
  79. {"Back o Beyond", {-1166.90,-2641.10,0.00,-321.70,-1856.00,200.00}},
  80. {"Battery Point", {-2741.00,1268.40,-4.50,-2533.00,1490.40,200.00}},
  81. {"Bayside", {-2741.00,2175.10,0.00,-2353.10,2722.70,200.00}},
  82. {"Bayside Marina", {-2353.10,2275.70,0.00,-2153.10,2475.70,200.00}},
  83. {"Beacon Hill", {-399.60,-1075.50,-1.40,-319.00,-977.50,198.50}},
  84. {"Blackfield", {964.30,1203.20,-89.00,1197.30,1403.20,110.90}},
  85. {"Blackfield", {964.30,1403.20,-89.00,1197.30,1726.20,110.90}},
  86. {"Blackfield Chapel", {1375.60,596.30,-89.00,1558.00,823.20,110.90}},
  87. {"Blackfield Chapel", {1325.60,596.30,-89.00,1375.60,795.00,110.90}},
  88. {"Blackfield Intersection", {1197.30,1044.60,-89.00,1277.00,1163.30,110.90}},
  89. {"Blackfield Intersection", {1166.50,795.00,-89.00,1375.60,1044.60,110.90}},
  90. {"Blackfield Intersection", {1277.00,1044.60,-89.00,1315.30,1087.60,110.90}},
  91. {"Blackfield Intersection", {1375.60,823.20,-89.00,1457.30,919.40,110.90}},
  92. {"Blueberry", {104.50,-220.10,2.30,349.60,152.20,200.00}},
  93. {"Blueberry", {19.60,-404.10,3.80,349.60,-220.10,200.00}},
  94. {"Blueberry Acres", {-319.60,-220.10,0.00,104.50,293.30,200.00}},
  95. {"Caligula's Palace", {2087.30,1543.20,-89.00,2437.30,1703.20,110.90}},
  96. {"Caligula's Palace", {2137.40,1703.20,-89.00,2437.30,1783.20,110.90}},
  97. {"Calton Heights", {-2274.10,744.10,-6.10,-1982.30,1358.90,200.00}},
  98. {"Chinatown", {-2274.10,578.30,-7.60,-2078.60,744.10,200.00}},
  99. {"City Hall", {-2867.80,277.40,-9.10,-2593.40,458.40,200.00}},
  100. {"Come-A-Lot", {2087.30,943.20,-89.00,2623.10,1203.20,110.90}},
  101. {"Commerce", {1323.90,-1842.20,-89.00,1701.90,-1722.20,110.90}},
  102. {"Commerce", {1323.90,-1722.20,-89.00,1440.90,-1577.50,110.90}},
  103. {"Commerce", {1370.80,-1577.50,-89.00,1463.90,-1384.90,110.90}},
  104. {"Commerce", {1463.90,-1577.50,-89.00,1667.90,-1430.80,110.90}},
  105. {"Commerce", {1583.50,-1722.20,-89.00,1758.90,-1577.50,110.90}},
  106. {"Commerce", {1667.90,-1577.50,-89.00,1812.60,-1430.80,110.90}},
  107. {"Conference Center", {1046.10,-1804.20,-89.00,1323.90,-1722.20,110.90}},
  108. {"Conference Center", {1073.20,-1842.20,-89.00,1323.90,-1804.20,110.90}},
  109. {"Cranberry Station", {-2007.80,56.30,0.00,-1922.00,224.70,100.00}},
  110. {"Creek", {2749.90,1937.20,-89.00,2921.60,2669.70,110.90}},
  111. {"Dillimore", {580.70,-674.80,-9.50,861.00,-404.70,200.00}},
  112. {"Doherty", {-2270.00,-324.10,-0.00,-1794.90,-222.50,200.00}},
  113. {"Doherty", {-2173.00,-222.50,-0.00,-1794.90,265.20,200.00}},
  114. {"Downtown", {-1982.30,744.10,-6.10,-1871.70,1274.20,200.00}},
  115. {"Downtown", {-1871.70,1176.40,-4.50,-1620.30,1274.20,200.00}},
  116. {"Downtown", {-1700.00,744.20,-6.10,-1580.00,1176.50,200.00}},
  117. {"Downtown", {-1580.00,744.20,-6.10,-1499.80,1025.90,200.00}},
  118. {"Downtown", {-2078.60,578.30,-7.60,-1499.80,744.20,200.00}},
  119. {"Downtown", {-1993.20,265.20,-9.10,-1794.90,578.30,200.00}},
  120. {"Downtown Los Santos", {1463.90,-1430.80,-89.00,1724.70,-1290.80,110.90}},
  121. {"Downtown Los Santos", {1724.70,-1430.80,-89.00,1812.60,-1250.90,110.90}},
  122. {"Downtown Los Santos", {1463.90,-1290.80,-89.00,1724.70,-1150.80,110.90}},
  123. {"Downtown Los Santos", {1370.80,-1384.90,-89.00,1463.90,-1170.80,110.90}},
  124. {"Downtown Los Santos", {1724.70,-1250.90,-89.00,1812.60,-1150.80,110.90}},
  125. {"Downtown Los Santos", {1370.80,-1170.80,-89.00,1463.90,-1130.80,110.90}},
  126. {"Downtown Los Santos", {1378.30,-1130.80,-89.00,1463.90,-1026.30,110.90}},
  127. {"Downtown Los Santos", {1391.00,-1026.30,-89.00,1463.90,-926.90,110.90}},
  128. {"Downtown Los Santos", {1507.50,-1385.20,110.90,1582.50,-1325.30,335.90}},
  129. {"East Beach", {2632.80,-1852.80,-89.00,2959.30,-1668.10,110.90}},
  130. {"East Beach", {2632.80,-1668.10,-89.00,2747.70,-1393.40,110.90}},
  131. {"East Beach", {2747.70,-1668.10,-89.00,2959.30,-1498.60,110.90}},
  132. {"East Beach", {2747.70,-1498.60,-89.00,2959.30,-1120.00,110.90}},
  133. {"East Los Santos", {2421.00,-1628.50,-89.00,2632.80,-1454.30,110.90}},
  134. {"East Los Santos", {2222.50,-1628.50,-89.00,2421.00,-1494.00,110.90}},
  135. {"East Los Santos", {2266.20,-1494.00,-89.00,2381.60,-1372.00,110.90}},
  136. {"East Los Santos", {2381.60,-1494.00,-89.00,2421.00,-1454.30,110.90}},
  137. {"East Los Santos", {2281.40,-1372.00,-89.00,2381.60,-1135.00,110.90}},
  138. {"East Los Santos", {2381.60,-1454.30,-89.00,2462.10,-1135.00,110.90}},
  139. {"East Los Santos", {2462.10,-1454.30,-89.00,2581.70,-1135.00,110.90}},
  140. {"Easter Basin", {-1794.90,249.90,-9.10,-1242.90,578.30,200.00}},
  141. {"Easter Basin", {-1794.90,-50.00,-0.00,-1499.80,249.90,200.00}},
  142. {"Easter Bay Airport", {-1499.80,-50.00,-0.00,-1242.90,249.90,200.00}},
  143. {"Easter Bay Airport", {-1794.90,-730.10,-3.00,-1213.90,-50.00,200.00}},
  144. {"Easter Bay Airport", {-1213.90,-730.10,0.00,-1132.80,-50.00,200.00}},
  145. {"Easter Bay Airport", {-1242.90,-50.00,0.00,-1213.90,578.30,200.00}},
  146. {"Easter Bay Airport", {-1213.90,-50.00,-4.50,-947.90,578.30,200.00}},
  147. {"Easter Bay Airport", {-1315.40,-405.30,15.40,-1264.40,-209.50,25.40}},
  148. {"Easter Bay Airport", {-1354.30,-287.30,15.40,-1315.40,-209.50,25.40}},
  149. {"Easter Bay Airport", {-1490.30,-209.50,15.40,-1264.40,-148.30,25.40}},
  150. {"Easter Bay Chemicals", {-1132.80,-768.00,0.00,-956.40,-578.10,200.00}},
  151. {"Easter Bay Chemicals", {-1132.80,-787.30,0.00,-956.40,-768.00,200.00}},
  152. {"El Castillo del Diablo", {-464.50,2217.60,0.00,-208.50,2580.30,200.00}},
  153. {"El Castillo del Diablo", {-208.50,2123.00,-7.60,114.00,2337.10,200.00}},
  154. {"El Castillo del Diablo", {-208.50,2337.10,0.00,8.40,2487.10,200.00}},
  155. {"El Corona", {1812.60,-2179.20,-89.00,1970.60,-1852.80,110.90}},
  156. {"El Corona", {1692.60,-2179.20,-89.00,1812.60,-1842.20,110.90}},
  157. {"El Quebrados", {-1645.20,2498.50,0.00,-1372.10,2777.80,200.00}},
  158. {"Esplanade East", {-1620.30,1176.50,-4.50,-1580.00,1274.20,200.00}},
  159. {"Esplanade East", {-1580.00,1025.90,-6.10,-1499.80,1274.20,200.00}},
  160. {"Esplanade East", {-1499.80,578.30,-79.60,-1339.80,1274.20,20.30}},
  161. {"Esplanade North", {-2533.00,1358.90,-4.50,-1996.60,1501.20,200.00}},
  162. {"Esplanade North", {-1996.60,1358.90,-4.50,-1524.20,1592.50,200.00}},
  163. {"Esplanade North", {-1982.30,1274.20,-4.50,-1524.20,1358.90,200.00}},
  164. {"Fallen Tree", {-792.20,-698.50,-5.30,-452.40,-380.00,200.00}},
  165. {"Fallow Bridge", {434.30,366.50,0.00,603.00,555.60,200.00}},
  166. {"Fern Ridge", {508.10,-139.20,0.00,1306.60,119.50,200.00}},
  167. {"Financial", {-1871.70,744.10,-6.10,-1701.30,1176.40,300.00}},
  168. {"Fisher's Lagoon", {1916.90,-233.30,-100.00,2131.70,13.80,200.00}},
  169. {"Flint Intersection", {-187.70,-1596.70,-89.00,17.00,-1276.60,110.90}},
  170. {"Flint Range", {-594.10,-1648.50,0.00,-187.70,-1276.60,200.00}},
  171. {"Fort Carson", {-376.20,826.30,-3.00,123.70,1220.40,200.00}},
  172. {"Foster Valley", {-2270.00,-430.20,-0.00,-2178.60,-324.10,200.00}},
  173. {"Foster Valley", {-2178.60,-599.80,-0.00,-1794.90,-324.10,200.00}},
  174. {"Foster Valley", {-2178.60,-1115.50,0.00,-1794.90,-599.80,200.00}},
  175. {"Foster Valley", {-2178.60,-1250.90,0.00,-1794.90,-1115.50,200.00}},
  176. {"Frederick Bridge", {2759.20,296.50,0.00,2774.20,594.70,200.00}},
  177. {"Gant Bridge", {-2741.40,1659.60,-6.10,-2616.40,2175.10,200.00}},
  178. {"Gant Bridge", {-2741.00,1490.40,-6.10,-2616.40,1659.60,200.00}},
  179. {"Ganton", {2222.50,-1852.80,-89.00,2632.80,-1722.30,110.90}},
  180. {"Ganton", {2222.50,-1722.30,-89.00,2632.80,-1628.50,110.90}},
  181. {"Garcia", {-2411.20,-222.50,-0.00,-2173.00,265.20,200.00}},
  182. {"Garcia", {-2395.10,-222.50,-5.30,-2354.00,-204.70,200.00}},
  183. {"Garver Bridge", {-1339.80,828.10,-89.00,-1213.90,1057.00,110.90}},
  184. {"Garver Bridge", {-1213.90,950.00,-89.00,-1087.90,1178.90,110.90}},
  185. {"Garver Bridge", {-1499.80,696.40,-179.60,-1339.80,925.30,20.30}},
  186. {"Glen Park", {1812.60,-1449.60,-89.00,1996.90,-1350.70,110.90}},
  187. {"Glen Park", {1812.60,-1100.80,-89.00,1994.30,-973.30,110.90}},
  188. {"Glen Park", {1812.60,-1350.70,-89.00,2056.80,-1100.80,110.90}},
  189. {"Green Palms", {176.50,1305.40,-3.00,338.60,1520.70,200.00}},
  190. {"Greenglass College", {964.30,1044.60,-89.00,1197.30,1203.20,110.90}},
  191. {"Greenglass College", {964.30,930.80,-89.00,1166.50,1044.60,110.90}},
  192. {"Hampton Barns", {603.00,264.30,0.00,761.90,366.50,200.00}},
  193. {"Hankypanky Point", {2576.90,62.10,0.00,2759.20,385.50,200.00}},
  194. {"Harry Gold Parkway", {1777.30,863.20,-89.00,1817.30,2342.80,110.90}},
  195. {"Hashbury", {-2593.40,-222.50,-0.00,-2411.20,54.70,200.00}},
  196. {"Hilltop Farm", {967.30,-450.30,-3.00,1176.70,-217.90,200.00}},
  197. {"Hunter Quarry", {337.20,710.80,-115.20,860.50,1031.70,203.70}},
  198. {"Idlewood", {1812.60,-1852.80,-89.00,1971.60,-1742.30,110.90}},
  199. {"Idlewood", {1812.60,-1742.30,-89.00,1951.60,-1602.30,110.90}},
  200. {"Idlewood", {1951.60,-1742.30,-89.00,2124.60,-1602.30,110.90}},
  201. {"Idlewood", {1812.60,-1602.30,-89.00,2124.60,-1449.60,110.90}},
  202. {"Idlewood", {2124.60,-1742.30,-89.00,2222.50,-1494.00,110.90}},
  203. {"Idlewood", {1971.60,-1852.80,-89.00,2222.50,-1742.30,110.90}},
  204. {"Jefferson", {1996.90,-1449.60,-89.00,2056.80,-1350.70,110.90}},
  205. {"Jefferson", {2124.60,-1494.00,-89.00,2266.20,-1449.60,110.90}},
  206. {"Jefferson", {2056.80,-1372.00,-89.00,2281.40,-1210.70,110.90}},
  207. {"Jefferson", {2056.80,-1210.70,-89.00,2185.30,-1126.30,110.90}},
  208. {"Jefferson", {2185.30,-1210.70,-89.00,2281.40,-1154.50,110.90}},
  209. {"Jefferson", {2056.80,-1449.60,-89.00,2266.20,-1372.00,110.90}},
  210. {"Julius Thruway East", {2623.10,943.20,-89.00,2749.90,1055.90,110.90}},
  211. {"Julius Thruway East", {2685.10,1055.90,-89.00,2749.90,2626.50,110.90}},
  212. {"Julius Thruway East", {2536.40,2442.50,-89.00,2685.10,2542.50,110.90}},
  213. {"Julius Thruway East", {2625.10,2202.70,-89.00,2685.10,2442.50,110.90}},
  214. {"Julius Thruway North", {2498.20,2542.50,-89.00,2685.10,2626.50,110.90}},
  215. {"Julius Thruway North", {2237.40,2542.50,-89.00,2498.20,2663.10,110.90}},
  216. {"Julius Thruway North", {2121.40,2508.20,-89.00,2237.40,2663.10,110.90}},
  217. {"Julius Thruway North", {1938.80,2508.20,-89.00,2121.40,2624.20,110.90}},
  218. {"Julius Thruway North", {1534.50,2433.20,-89.00,1848.40,2583.20,110.90}},
  219. {"Julius Thruway North", {1848.40,2478.40,-89.00,1938.80,2553.40,110.90}},
  220. {"Julius Thruway North", {1704.50,2342.80,-89.00,1848.40,2433.20,110.90}},
  221. {"Julius Thruway North", {1377.30,2433.20,-89.00,1534.50,2507.20,110.90}},
  222. {"Julius Thruway South", {1457.30,823.20,-89.00,2377.30,863.20,110.90}},
  223. {"Julius Thruway South", {2377.30,788.80,-89.00,2537.30,897.90,110.90}},
  224. {"Julius Thruway West", {1197.30,1163.30,-89.00,1236.60,2243.20,110.90}},
  225. {"Julius Thruway West", {1236.60,2142.80,-89.00,1297.40,2243.20,110.90}},
  226. {"Juniper Hill", {-2533.00,578.30,-7.60,-2274.10,968.30,200.00}},
  227. {"Juniper Hollow", {-2533.00,968.30,-6.10,-2274.10,1358.90,200.00}},
  228. {"K.A.C.C. Military Fuels", {2498.20,2626.50,-89.00,2749.90,2861.50,110.90}},
  229. {"Kincaid Bridge", {-1339.80,599.20,-89.00,-1213.90,828.10,110.90}},
  230. {"Kincaid Bridge", {-1213.90,721.10,-89.00,-1087.90,950.00,110.90}},
  231. {"Kincaid Bridge", {-1087.90,855.30,-89.00,-961.90,986.20,110.90}},
  232. {"King's", {-2329.30,458.40,-7.60,-1993.20,578.30,200.00}},
  233. {"King's", {-2411.20,265.20,-9.10,-1993.20,373.50,200.00}},
  234. {"King's", {-2253.50,373.50,-9.10,-1993.20,458.40,200.00}},
  235. {"LVA Freight Depot", {1457.30,863.20,-89.00,1777.40,1143.20,110.90}},
  236. {"LVA Freight Depot", {1375.60,919.40,-89.00,1457.30,1203.20,110.90}},
  237. {"LVA Freight Depot", {1277.00,1087.60,-89.00,1375.60,1203.20,110.90}},
  238. {"LVA Freight Depot", {1315.30,1044.60,-89.00,1375.60,1087.60,110.90}},
  239. {"LVA Freight Depot", {1236.60,1163.40,-89.00,1277.00,1203.20,110.90}},
  240. {"Las Barrancas", {-926.10,1398.70,-3.00,-719.20,1634.60,200.00}},
  241. {"Las Brujas", {-365.10,2123.00,-3.00,-208.50,2217.60,200.00}},
  242. {"Las Colinas", {1994.30,-1100.80,-89.00,2056.80,-920.80,110.90}},
  243. {"Las Colinas", {2056.80,-1126.30,-89.00,2126.80,-920.80,110.90}},
  244. {"Las Colinas", {2185.30,-1154.50,-89.00,2281.40,-934.40,110.90}},
  245. {"Las Colinas", {2126.80,-1126.30,-89.00,2185.30,-934.40,110.90}},
  246. {"Las Colinas", {2747.70,-1120.00,-89.00,2959.30,-945.00,110.90}},
  247. {"Las Colinas", {2632.70,-1135.00,-89.00,2747.70,-945.00,110.90}},
  248. {"Las Colinas", {2281.40,-1135.00,-89.00,2632.70,-945.00,110.90}},
  249. {"Las Payasadas", {-354.30,2580.30,2.00,-133.60,2816.80,200.00}},
  250. {"Las Venturas Airport", {1236.60,1203.20,-89.00,1457.30,1883.10,110.90}},
  251. {"Las Venturas Airport", {1457.30,1203.20,-89.00,1777.30,1883.10,110.90}},
  252. {"Las Venturas Airport", {1457.30,1143.20,-89.00,1777.40,1203.20,110.90}},
  253. {"Las Venturas Airport", {1515.80,1586.40,-12.50,1729.90,1714.50,87.50}},
  254. {"Last Dime Motel", {1823.00,596.30,-89.00,1997.20,823.20,110.90}},
  255. {"Leafy Hollow", {-1166.90,-1856.00,0.00,-815.60,-1602.00,200.00}},
  256. {"Liberty City", {-1000.00,400.00,1300.00,-700.00,600.00,1400.00}},
  257. {"Lil' Probe Inn", {-90.20,1286.80,-3.00,153.80,1554.10,200.00}},
  258. {"Linden Side", {2749.90,943.20,-89.00,2923.30,1198.90,110.90}},
  259. {"Linden Station", {2749.90,1198.90,-89.00,2923.30,1548.90,110.90}},
  260. {"Linden Station", {2811.20,1229.50,-39.50,2861.20,1407.50,60.40}},
  261. {"Little Mexico", {1701.90,-1842.20,-89.00,1812.60,-1722.20,110.90}},
  262. {"Little Mexico", {1758.90,-1722.20,-89.00,1812.60,-1577.50,110.90}},
  263. {"Los Flores", {2581.70,-1454.30,-89.00,2632.80,-1393.40,110.90}},
  264. {"Los Flores", {2581.70,-1393.40,-89.00,2747.70,-1135.00,110.90}},
  265. {"Los Santos International", {1249.60,-2394.30,-89.00,1852.00,-2179.20,110.90}},
  266. {"Los Santos International", {1852.00,-2394.30,-89.00,2089.00,-2179.20,110.90}},
  267. {"Los Santos International", {1382.70,-2730.80,-89.00,2201.80,-2394.30,110.90}},
  268. {"Los Santos International", {1974.60,-2394.30,-39.00,2089.00,-2256.50,60.90}},
  269. {"Los Santos International", {1400.90,-2669.20,-39.00,2189.80,-2597.20,60.90}},
  270. {"Los Santos International", {2051.60,-2597.20,-39.00,2152.40,-2394.30,60.90}},
  271. {"Marina", {647.70,-1804.20,-89.00,851.40,-1577.50,110.90}},
  272. {"Marina", {647.70,-1577.50,-89.00,807.90,-1416.20,110.90}},
  273. {"Marina", {807.90,-1577.50,-89.00,926.90,-1416.20,110.90}},
  274. {"Market", {787.40,-1416.20,-89.00,1072.60,-1310.20,110.90}},
  275. {"Market", {952.60,-1310.20,-89.00,1072.60,-1130.80,110.90}},
  276. {"Market", {1072.60,-1416.20,-89.00,1370.80,-1130.80,110.90}},
  277. {"Market", {926.90,-1577.50,-89.00,1370.80,-1416.20,110.90}},
  278. {"Market Station", {787.40,-1410.90,-34.10,866.00,-1310.20,65.80}},
  279. {"Martin Bridge", {-222.10,293.30,0.00,-122.10,476.40,200.00}},
  280. {"Missionary Hill", {-2994.40,-811.20,0.00,-2178.60,-430.20,200.00}},
  281. {"Montgomery", {1119.50,119.50,-3.00,1451.40,493.30,200.00}},
  282. {"Montgomery", {1451.40,347.40,-6.10,1582.40,420.80,200.00}},
  283. {"Montgomery Intersection", {1546.60,208.10,0.00,1745.80,347.40,200.00}},
  284. {"Montgomery Intersection", {1582.40,347.40,0.00,1664.60,401.70,200.00}},
  285. {"Mulholland", {1414.00,-768.00,-89.00,1667.60,-452.40,110.90}},
  286. {"Mulholland", {1281.10,-452.40,-89.00,1641.10,-290.90,110.90}},
  287. {"Mulholland", {1269.10,-768.00,-89.00,1414.00,-452.40,110.90}},
  288. {"Mulholland", {1357.00,-926.90,-89.00,1463.90,-768.00,110.90}},
  289. {"Mulholland", {1318.10,-910.10,-89.00,1357.00,-768.00,110.90}},
  290. {"Mulholland", {1169.10,-910.10,-89.00,1318.10,-768.00,110.90}},
  291. {"Mulholland", {768.60,-954.60,-89.00,952.60,-860.60,110.90}},
  292. {"Mulholland", {687.80,-860.60,-89.00,911.80,-768.00,110.90}},
  293. {"Mulholland", {737.50,-768.00,-89.00,1142.20,-674.80,110.90}},
  294. {"Mulholland", {1096.40,-910.10,-89.00,1169.10,-768.00,110.90}},
  295. {"Mulholland", {952.60,-937.10,-89.00,1096.40,-860.60,110.90}},
  296. {"Mulholland", {911.80,-860.60,-89.00,1096.40,-768.00,110.90}},
  297. {"Mulholland", {861.00,-674.80,-89.00,1156.50,-600.80,110.90}},
  298. {"Mulholland Intersection", {1463.90,-1150.80,-89.00,1812.60,-768.00,110.90}},
  299. {"North Rock", {2285.30,-768.00,0.00,2770.50,-269.70,200.00}},
  300. {"Ocean Docks", {2373.70,-2697.00,-89.00,2809.20,-2330.40,110.90}},
  301. {"Ocean Docks", {2201.80,-2418.30,-89.00,2324.00,-2095.00,110.90}},
  302. {"Ocean Docks", {2324.00,-2302.30,-89.00,2703.50,-2145.10,110.90}},
  303. {"Ocean Docks", {2089.00,-2394.30,-89.00,2201.80,-2235.80,110.90}},
  304. {"Ocean Docks", {2201.80,-2730.80,-89.00,2324.00,-2418.30,110.90}},
  305. {"Ocean Docks", {2703.50,-2302.30,-89.00,2959.30,-2126.90,110.90}},
  306. {"Ocean Docks", {2324.00,-2145.10,-89.00,2703.50,-2059.20,110.90}},
  307. {"Ocean Flats", {-2994.40,277.40,-9.10,-2867.80,458.40,200.00}},
  308. {"Ocean Flats", {-2994.40,-222.50,-0.00,-2593.40,277.40,200.00}},
  309. {"Ocean Flats", {-2994.40,-430.20,-0.00,-2831.80,-222.50,200.00}},
  310. {"Octane Springs", {338.60,1228.50,0.00,664.30,1655.00,200.00}},
  311. {"Old Venturas Strip", {2162.30,2012.10,-89.00,2685.10,2202.70,110.90}},
  312. {"Palisades", {-2994.40,458.40,-6.10,-2741.00,1339.60,200.00}},
  313. {"Palomino Creek", {2160.20,-149.00,0.00,2576.90,228.30,200.00}},
  314. {"Paradiso", {-2741.00,793.40,-6.10,-2533.00,1268.40,200.00}},
  315. {"Pershing Square", {1440.90,-1722.20,-89.00,1583.50,-1577.50,110.90}},
  316. {"Pilgrim", {2437.30,1383.20,-89.00,2624.40,1783.20,110.90}},
  317. {"Pilgrim", {2624.40,1383.20,-89.00,2685.10,1783.20,110.90}},
  318. {"Pilson Intersection", {1098.30,2243.20,-89.00,1377.30,2507.20,110.90}},
  319. {"Pirates in Men's Pants", {1817.30,1469.20,-89.00,2027.40,1703.20,110.90}},
  320. {"Playa del Seville", {2703.50,-2126.90,-89.00,2959.30,-1852.80,110.90}},
  321. {"Prickle Pine", {1534.50,2583.20,-89.00,1848.40,2863.20,110.90}},
  322. {"Prickle Pine", {1117.40,2507.20,-89.00,1534.50,2723.20,110.90}},
  323. {"Prickle Pine", {1848.40,2553.40,-89.00,1938.80,2863.20,110.90}},
  324. {"Prickle Pine", {1938.80,2624.20,-89.00,2121.40,2861.50,110.90}},
  325. {"Queens", {-2533.00,458.40,0.00,-2329.30,578.30,200.00}},
  326. {"Queens", {-2593.40,54.70,0.00,-2411.20,458.40,200.00}},
  327. {"Queens", {-2411.20,373.50,0.00,-2253.50,458.40,200.00}},
  328. {"Randolph Industrial Estate", {1558.00,596.30,-89.00,1823.00,823.20,110.90}},
  329. {"Redsands East", {1817.30,2011.80,-89.00,2106.70,2202.70,110.90}},
  330. {"Redsands East", {1817.30,2202.70,-89.00,2011.90,2342.80,110.90}},
  331. {"Redsands East", {1848.40,2342.80,-89.00,2011.90,2478.40,110.90}},
  332. {"Redsands West", {1236.60,1883.10,-89.00,1777.30,2142.80,110.90}},
  333. {"Redsands West", {1297.40,2142.80,-89.00,1777.30,2243.20,110.90}},
  334. {"Redsands West", {1377.30,2243.20,-89.00,1704.50,2433.20,110.90}},
  335. {"Redsands West", {1704.50,2243.20,-89.00,1777.30,2342.80,110.90}},
  336. {"Regular Tom", {-405.70,1712.80,-3.00,-276.70,1892.70,200.00}},
  337. {"Richman", {647.50,-1118.20,-89.00,787.40,-954.60,110.90}},
  338. {"Richman", {647.50,-954.60,-89.00,768.60,-860.60,110.90}},
  339. {"Richman", {225.10,-1369.60,-89.00,334.50,-1292.00,110.90}},
  340. {"Richman", {225.10,-1292.00,-89.00,466.20,-1235.00,110.90}},
  341. {"Richman", {72.60,-1404.90,-89.00,225.10,-1235.00,110.90}},
  342. {"Richman", {72.60,-1235.00,-89.00,321.30,-1008.10,110.90}},
  343. {"Richman", {321.30,-1235.00,-89.00,647.50,-1044.00,110.90}},
  344. {"Richman", {321.30,-1044.00,-89.00,647.50,-860.60,110.90}},
  345. {"Richman", {321.30,-860.60,-89.00,687.80,-768.00,110.90}},
  346. {"Richman", {321.30,-768.00,-89.00,700.70,-674.80,110.90}},
  347. {"Robada Intersection", {-1119.00,1178.90,-89.00,-862.00,1351.40,110.90}},
  348. {"Roca Escalante", {2237.40,2202.70,-89.00,2536.40,2542.50,110.90}},
  349. {"Roca Escalante", {2536.40,2202.70,-89.00,2625.10,2442.50,110.90}},
  350. {"Rockshore East", {2537.30,676.50,-89.00,2902.30,943.20,110.90}},
  351. {"Rockshore West", {1997.20,596.30,-89.00,2377.30,823.20,110.90}},
  352. {"Rockshore West", {2377.30,596.30,-89.00,2537.30,788.80,110.90}},
  353. {"Rodeo", {72.60,-1684.60,-89.00,225.10,-1544.10,110.90}},
  354. {"Rodeo", {72.60,-1544.10,-89.00,225.10,-1404.90,110.90}},
  355. {"Rodeo", {225.10,-1684.60,-89.00,312.80,-1501.90,110.90}},
  356. {"Rodeo", {225.10,-1501.90,-89.00,334.50,-1369.60,110.90}},
  357. {"Rodeo", {334.50,-1501.90,-89.00,422.60,-1406.00,110.90}},
  358. {"Rodeo", {312.80,-1684.60,-89.00,422.60,-1501.90,110.90}},
  359. {"Rodeo", {422.60,-1684.60,-89.00,558.00,-1570.20,110.90}},
  360. {"Rodeo", {558.00,-1684.60,-89.00,647.50,-1384.90,110.90}},
  361. {"Rodeo", {466.20,-1570.20,-89.00,558.00,-1385.00,110.90}},
  362. {"Rodeo", {422.60,-1570.20,-89.00,466.20,-1406.00,110.90}},
  363. {"Rodeo", {466.20,-1385.00,-89.00,647.50,-1235.00,110.90}},
  364. {"Rodeo", {334.50,-1406.00,-89.00,466.20,-1292.00,110.90}},
  365. {"Royal Casino", {2087.30,1383.20,-89.00,2437.30,1543.20,110.90}},
  366. {"San Andreas Sound", {2450.30,385.50,-100.00,2759.20,562.30,200.00}},
  367. {"Santa Flora", {-2741.00,458.40,-7.60,-2533.00,793.40,200.00}},
  368. {"Santa Maria Beach", {342.60,-2173.20,-89.00,647.70,-1684.60,110.90}},
  369. {"Santa Maria Beach", {72.60,-2173.20,-89.00,342.60,-1684.60,110.90}},
  370. {"Shady Cabin", {-1632.80,-2263.40,-3.00,-1601.30,-2231.70,200.00}},
  371. {"Shady Creeks", {-1820.60,-2643.60,-8.00,-1226.70,-1771.60,200.00}},
  372. {"Shady Creeks", {-2030.10,-2174.80,-6.10,-1820.60,-1771.60,200.00}},
  373. {"Sobell Rail Yards", {2749.90,1548.90,-89.00,2923.30,1937.20,110.90}},
  374. {"Spinybed", {2121.40,2663.10,-89.00,2498.20,2861.50,110.90}},
  375. {"Starfish Casino", {2437.30,1783.20,-89.00,2685.10,2012.10,110.90}},
  376. {"Starfish Casino", {2437.30,1858.10,-39.00,2495.00,1970.80,60.90}},
  377. {"Starfish Casino", {2162.30,1883.20,-89.00,2437.30,2012.10,110.90}},
  378. {"Temple", {1252.30,-1130.80,-89.00,1378.30,-1026.30,110.90}},
  379. {"Temple", {1252.30,-1026.30,-89.00,1391.00,-926.90,110.90}},
  380. {"Temple", {1252.30,-926.90,-89.00,1357.00,-910.10,110.90}},
  381. {"Temple", {952.60,-1130.80,-89.00,1096.40,-937.10,110.90}},
  382. {"Temple", {1096.40,-1130.80,-89.00,1252.30,-1026.30,110.90}},
  383. {"Temple", {1096.40,-1026.30,-89.00,1252.30,-910.10,110.90}},
  384. {"The Camel's Toe", {2087.30,1203.20,-89.00,2640.40,1383.20,110.90}},
  385. {"The Clown's Pocket", {2162.30,1783.20,-89.00,2437.30,1883.20,110.90}},
  386. {"The Emerald Isle", {2011.90,2202.70,-89.00,2237.40,2508.20,110.90}},
  387. {"The Farm", {-1209.60,-1317.10,114.90,-908.10,-787.30,251.90}},
  388. {"The Four Dragons Casino", {1817.30,863.20,-89.00,2027.30,1083.20,110.90}},
  389. {"The High Roller", {1817.30,1283.20,-89.00,2027.30,1469.20,110.90}},
  390. {"The Mako Span", {1664.60,401.70,0.00,1785.10,567.20,200.00}},
  391. {"The Panopticon", {-947.90,-304.30,-1.10,-319.60,327.00,200.00}},
  392. {"The Pink Swan", {1817.30,1083.20,-89.00,2027.30,1283.20,110.90}},
  393. {"The Sherman Dam", {-968.70,1929.40,-3.00,-481.10,2155.20,200.00}},
  394. {"The Strip", {2027.40,863.20,-89.00,2087.30,1703.20,110.90}},
  395. {"The Strip", {2106.70,1863.20,-89.00,2162.30,2202.70,110.90}},
  396. {"The Strip", {2027.40,1783.20,-89.00,2162.30,1863.20,110.90}},
  397. {"The Strip", {2027.40,1703.20,-89.00,2137.40,1783.20,110.90}},
  398. {"The Visage", {1817.30,1863.20,-89.00,2106.70,2011.80,110.90}},
  399. {"The Visage", {1817.30,1703.20,-89.00,2027.40,1863.20,110.90}},
  400. {"Unity Station", {1692.60,-1971.80,-20.40,1812.60,-1932.80,79.50}},
  401. {"Valle Ocultado", {-936.60,2611.40,2.00,-715.90,2847.90,200.00}},
  402. {"Verdant Bluffs", {930.20,-2488.40,-89.00,1249.60,-2006.70,110.90}},
  403. {"Verdant Bluffs", {1073.20,-2006.70,-89.00,1249.60,-1842.20,110.90}},
  404. {"Verdant Bluffs", {1249.60,-2179.20,-89.00,1692.60,-1842.20,110.90}},
  405. {"Verdant Meadows", {37.00,2337.10,-3.00,435.90,2677.90,200.00}},
  406. {"Verona Beach", {647.70,-2173.20,-89.00,930.20,-1804.20,110.90}},
  407. {"Verona Beach", {930.20,-2006.70,-89.00,1073.20,-1804.20,110.90}},
  408. {"Verona Beach", {851.40,-1804.20,-89.00,1046.10,-1577.50,110.90}},
  409. {"Verona Beach", {1161.50,-1722.20,-89.00,1323.90,-1577.50,110.90}},
  410. {"Verona Beach", {1046.10,-1722.20,-89.00,1161.50,-1577.50,110.90}},
  411. {"Vinewood", {787.40,-1310.20,-89.00,952.60,-1130.80,110.90}},
  412. {"Vinewood", {787.40,-1130.80,-89.00,952.60,-954.60,110.90}},
  413. {"Vinewood", {647.50,-1227.20,-89.00,787.40,-1118.20,110.90}},
  414. {"Vinewood", {647.70,-1416.20,-89.00,787.40,-1227.20,110.90}},
  415. {"Whitewood Estates", {883.30,1726.20,-89.00,1098.30,2507.20,110.90}},
  416. {"Whitewood Estates", {1098.30,1726.20,-89.00,1197.30,2243.20,110.90}},
  417. {"Willowfield", {1970.60,-2179.20,-89.00,2089.00,-1852.80,110.90}},
  418. {"Willowfield", {2089.00,-2235.80,-89.00,2201.80,-1989.90,110.90}},
  419. {"Willowfield", {2089.00,-1989.90,-89.00,2324.00,-1852.80,110.90}},
  420. {"Willowfield", {2201.80,-2095.00,-89.00,2324.00,-1989.90,110.90}},
  421. {"Willowfield", {2541.70,-1941.40,-89.00,2703.50,-1852.80,110.90}},
  422. {"Willowfield", {2324.00,-2059.20,-89.00,2541.70,-1852.80,110.90}},
  423. {"Willowfield", {2541.70,-2059.20,-89.00,2703.50,-1941.40,110.90}},
  424. {"Yellow Bell Station", {1377.40,2600.40,-21.90,1492.40,2687.30,78.00}},
  425. // Main Zones
  426. {"Los Santos", {44.60,-2892.90,-242.90,2997.00,-768.00,900.00}},
  427. {"Las Venturas", {869.40,596.30,-242.90,2997.00,2993.80,900.00}},
  428. {"Bone County", {-480.50,596.30,-242.90,869.40,2993.80,900.00}},
  429. {"Tierra Robada", {-2997.40,1659.60,-242.90,-480.50,2993.80,900.00}},
  430. {"Tierra Robada", {-1213.90,596.30,-242.90,-480.50,1659.60,900.00}},
  431. {"San Fierro", {-2997.40,-1115.50,-242.90,-1213.90,1659.60,900.00}},
  432. {"Red County", {-1213.90,-768.00,-242.90,2997.00,596.30,900.00}},
  433. {"Flint County", {-1213.90,-2892.90,-242.90,44.60,-768.00,900.00}},
  434. {"Whetstone", {-2997.40,-2892.90,-242.90,-1213.90,-1115.50,900.00}}
  435. };
  436.  
  437. //--------------------------------Brazi---------------------------
  438. forward F_ObjectUpdate(bool:DontCheckDistance);
  439. forward F_StartUpdate();
  440. //----------------Textdraw Craciun!------
  441. new Text:Textdraw0;
  442. new Text:Textdraw1;
  443. new Text:Textdraw2;
  444. //-------------------Sistem artificii------------------
  445. new Rocket[MAX_LAUNCH];
  446. new RocketLight[MAX_LAUNCH];
  447. new RocketSmoke[MAX_LAUNCH];
  448. new RocketExplosions[MAX_LAUNCH];
  449. new Float:rx[MAX_LAUNCH];
  450. new Float:ry[MAX_LAUNCH];
  451. new Float:rz[MAX_LAUNCH];
  452. new FireworkTotal;
  453. new Fired;
  454.  
  455. forward Firework(i);
  456. public Firework(i)
  457. {
  458. new Float:x, Float:y, Float:z;
  459. x = rx[i];
  460. y = ry[i];
  461. z = rz[i];
  462. z += RocketHeight;
  463. if (RocketExplosions[i] == 0)
  464. {
  465. DestroyDynamicObject(Rocket[i]);
  466. DestroyDynamicObject(RocketLight[i]);
  467. DestroyDynamicObject(RocketSmoke[i]);
  468. CreateExplosion(x ,y, z, 4, 10);
  469. CreateExplosion(x ,y, z, 5, 10);
  470. CreateExplosion(x ,y, z, 6, 10);
  471. }
  472. else if (RocketExplosions[i] >= MAX_FIREWORKS)
  473. {
  474. for (new j = 0; j <= RocketSpread; j++)
  475. {
  476. CreateExplosion(x + float(j - (RocketSpread / 2)), y, z, 7, 10);
  477. CreateExplosion(x, y + float(j - (RocketSpread / 2)), z, 7, 10);
  478. CreateExplosion(x, y, z + float(j - (RocketSpread / 2)), 7, 10);
  479. }
  480. RocketExplosions[i] = -1;
  481. FireworkTotal = 0;
  482. Fired = 0;
  483. return 1;
  484. }
  485. else
  486. {
  487. x += float(random(RocketSpread) - (RocketSpread / 2));
  488. y += float(random(RocketSpread) - (RocketSpread / 2));
  489. z += float(random(RocketSpread) - (RocketSpread / 2));
  490. CreateExplosion(x, y, z, 7, 10);
  491. }
  492. RocketExplosions[i]++;
  493. SetTimerEx("Firework", 250, 0, "i", i);
  494. return 1;
  495. }
  496. //--------------Sistem ninsoare------------------------
  497. new
  498. bool:snowOn[ 54 char ],
  499. snowObject[ 54 ][ 5 ],
  500. updateTimer [ 54 char ]
  501. ;
  502. //------------------Sistem brazi----------------------
  503. enum XmasTrees
  504. {
  505. XmasTreeX,
  506. Float:XmasX,
  507. Float:XmasY,
  508. Float:XmasZ,
  509. XmasObject1,
  510. XmasObject2,
  511. XmasObject3,
  512. XmasObject4,
  513. XmasObject5,
  514. XmasObject6,
  515. XmasObject7,
  516. XmasObject8,
  517. XmasObject9,
  518. XmasObject10,
  519.  
  520. };
  521. new Treepos[MAX_XMASTREES][XmasTrees];
  522.  
  523. enum OInfo
  524. {
  525. ModelID,
  526. ObjectID[MAX_PLAYERS],
  527. Float:ox,
  528. Float:oy,
  529. Float:oz,
  530. Float:orox,
  531. Float:oroy,
  532. Float:oroz,
  533. Float:ovdist,
  534. bool:ObjectCreated[MAX_PLAYERS],
  535. };
  536. new ObjectInfo[F_MAX_OBJECTS][OInfo];
  537. new bool:ObjectUpdatetRunning;
  538. new bool:CantCreateMore;
  539. new bool:RefreshObjects[MAX_PLAYERS];
  540. new Float:OldX[MAX_PLAYERS], Float:OldY[MAX_PLAYERS], Float:OldZ[MAX_PLAYERS];
  541.  
  542. //-------------------Colinde romanesti-------------------------------
  543. enum
  544. {
  545. DIALOG_MP3
  546. };
  547. public OnFilterScriptInit()
  548. {
  549. print("\n--------------------------------------");
  550. print(" Christmass System by Adrian Pere ");
  551. print("--------------------------------------\n");
  552. //----------------------------Textdraw Craciun ------------------------
  553. Textdraw0 = TextDrawCreate(523.000000, 438.000000, "~w~-");
  554. TextDrawBackgroundColor(Textdraw0, 255);
  555. TextDrawFont(Textdraw0, 1);
  556. TextDrawLetterSize(Textdraw0, 8.419996, 1.100000);
  557. TextDrawColor(Textdraw0, -1);
  558. TextDrawSetOutline(Textdraw0, 1);
  559. TextDrawSetProportional(Textdraw0, 1);
  560.  
  561. Textdraw1 = TextDrawCreate(535.000000, 429.000000, "~r~Craciun ~g~Fericit");
  562. TextDrawBackgroundColor(Textdraw1, 255);
  563. TextDrawFont(Textdraw1, 0);
  564. TextDrawLetterSize(Textdraw1, 0.500000, 1.300000);
  565. TextDrawColor(Textdraw1, -1);
  566. TextDrawSetOutline(Textdraw1, 1);
  567. TextDrawSetProportional(Textdraw1, 1);
  568.  
  569. Textdraw2 = TextDrawCreate(522.000000, 421.000000, "~w~-");
  570. TextDrawBackgroundColor(Textdraw2, 255);
  571. TextDrawFont(Textdraw2, 1);
  572. TextDrawLetterSize(Textdraw2, 8.419996, 1.100000);
  573. TextDrawColor(Textdraw2, -1);
  574. TextDrawSetOutline(Textdraw2, 1);
  575. TextDrawSetProportional(Textdraw2, 1);
  576. return 1;
  577. }
  578.  
  579. public OnFilterScriptExit()
  580. {
  581. return 1;
  582. }
  583.  
  584. public OnPlayerConnect( playerid )
  585. {
  586. CreateSnow( playerid );
  587. return 1;
  588. }
  589.  
  590. public OnPlayerCommandText(playerid, cmdtext[])
  591. {
  592. if(!strcmp(cmdtext, "/chelp", true))
  593. {
  594. SendClientMessage(playerid, COLOR_GREY,"{6EF83C}---------------------------------------------------------------------------");
  595. SendClientMessage(playerid, COLOR_GREY,"{0049FF}[Artificii]:{FFFFFF} /artificii | /lanseaza");
  596. SendClientMessage(playerid, COLOR_GREY,"{0049FF}[Brad]:{FFFFFF} /brad | /scoatebrad | /scoatetotibrazii");
  597. SendClientMessage(playerid, COLOR_GREY,"{0049FF}[Santa Hat]{FFFFFF} /caciula | /scoatecaciula");
  598. SendClientMessage(playerid, COLOR_GREY,"{0049FF}[Anul Nou]{FFFFFF} /anulnou");
  599. SendClientMessage(playerid, COLOR_GREY,"{0049FF}[Colinde]{FFFFFF} /colinde");
  600. SendClientMessage(playerid, COLOR_GREY,"{0049FF}[Cadouri]{FFFFFF} /adaugacadou | /cadouadmin |");
  601. return SendClientMessage(playerid, COLOR_GREY,"{6EF83C}--------------------------------------------------------------------");
  602. }
  603. if (strcmp("/admincadou", cmdtext, true, 10) == 0 || strcmp("/cadouadmin", cmdtext, true, 10) == 0)
  604. {
  605. new string[128];
  606. if(IsPlayerAdmin(playerid))
  607. {
  608. for(new i = 0; i < MAX_PLAYERS; i++)
  609. {
  610. if(IsPlayerConnected(i))
  611. {
  612. switch(random(5))
  613. {
  614. case 0: {
  615. GivePlayerWeapon(playerid, 29, 50);
  616. format(string, sizeof(string), "~r~Craciun Fericit!~n~~w~Ai primit ~g~o arma!");
  617. GameTextForPlayer(playerid, string, 4000, 3);
  618. format(string, sizeof(string), "{FF3C00}Craciun Fericit!! {FFFFFF}Ai primit o arma! {FF3C00}!");
  619. SendClientMessage(playerid, COLOR_WHITE, string);
  620. }
  621. case 1: {
  622. new rand = (5000 + random(40000));
  623. GivePlayerMoney(i, rand);
  624. format(string, sizeof(string), "~r~Craciun Fericit!~n~~w~Ai primit ~g~$%d", rand);
  625. GameTextForPlayer(i, string, 4000, 3);
  626. }
  627. case 2: {
  628. SetPlayerHealth(i, 99);
  629. format(string, sizeof(string), "~r~Craciun Fericit!~n~~w~Ai primit ~y~A dulciuri");
  630. GameTextForPlayer(i, string, 4000, 3);
  631. }
  632. case 3: {
  633. SetPlayerArmour(i, 99);
  634. format(string, sizeof(string), "~r~Craciun Fericit!~n~~w~Ai primit ~y~Droguri");
  635. GameTextForPlayer(i, string, 4000, 3);
  636. }
  637. case 4: {
  638. new rand = (5000 + random(40000));
  639. GivePlayerMoney(i, rand);
  640. format(string, sizeof(string), "~r~Craciun Fericit!~n~~w~Ai primit ~g~$%d", rand);
  641. GameTextForPlayer(i, string, 4000, 3);
  642. }
  643. case 5: {
  644. new rand = (5000 + random(40000));
  645. GivePlayerMoney(i, rand);
  646. format(string, sizeof(string), "~r~Craciun Fericit!~n~~w~Ai primit ~g~$%d", rand);
  647. GameTextForPlayer(i, string, 4000, 3);
  648. }
  649. }
  650. pInfo[i][aGift]++;
  651. }
  652. }
  653. format(string, sizeof(string), "{FFAA00}Craciun Fericit! {FFFFFF} Ai deschis un cadou {FFAA00} pentru a proba {FFFFFF}daca merge sistemul.");
  654. SendClientMessageToAll(COLOR_WHITE, string);
  655. }
  656. else
  657. {
  658. return 0;
  659. }
  660. return 1;
  661. }
  662. if (strcmp("/adaugacadou", cmdtext, true, 10) == 0 || strcmp("/creazacadou", cmdtext, true, 10) == 0)
  663. {
  664. if(IsPlayerAdmin(playerid))
  665. {
  666. new Float:x, Float:y, Float:z;
  667. GetPlayerPos(playerid, x, y, z);
  668. new rand = random(sizeof(RandomModel));
  669. Gift[giftCounter] = CreatePickup(RandomModel[rand][0], 1, x + 3, y + 1, z, GetPlayerVirtualWorld(playerid));
  670. giftCounter++;
  671. new string[128 + MAX_ZONE_NAME], zone[MAX_ZONE_NAME];
  672. GetPlayer2DZone(playerid, zone, sizeof(zone));
  673. format(string, sizeof(string), "{FF0000}Un administrator {FFFFFF}a ascuns {FF3C00} un cadou {FFFFFF}in zona {0069FF}%s! {FFFFFF}Dute si i-al!", zone);
  674. SendClientMessageToAll(COLOR_WHITE, string);
  675. }
  676. else
  677. {
  678. return 0;
  679. }
  680. return 1;
  681. }
  682. if(!strcmp(cmdtext, "/colinde", true))
  683. {
  684. new xmass[ 2048 ];
  685.  
  686. strcat(xmass, "Astazi s-a nascut Hristos\n");
  687. strcat(xmass, "Cerul si Pamantul\n");
  688. strcat(xmass, "Deschide usa crestine\n");
  689. strcat(xmass, "O ce veste minunata\n");
  690. strcat(xmass, "La Vifleem colo-n jos\n");
  691. strcat(xmass, "Cana Galilei\n");
  692. strcat(xmass, "Domn,domn sa-naltam\n");
  693. strcat(xmass, "Steaua sus rasare\n");
  694. strcat(xmass, "Lerui, da lerui ler\n");
  695. strcat(xmass, "Florile dalbe\n");
  696. strcat(xmass, "Colinde, colinde\n");
  697. ShowPlayerDialog(playerid, DIALOG_MP3, DIALOG_STYLE_LIST, "xMass System", xmass, "Selecteaza", "Iesire");
  698. return 1;
  699. }
  700. if(!strcmp(cmdtext, "/anulnou", true))
  701. {
  702. new Ex_Timer[7],string[200];
  703. getdate(Ex_Timer[0], Ex_Timer[1], Ex_Timer[2]);gettime(Ex_Timer[4], Ex_Timer[5], Ex_Timer[6]);
  704.  
  705. switch(Ex_Timer[1])
  706. {
  707. case 1, 3, 5, 7, 8, 10, 12: Ex_Timer[3] = 31;
  708. case 2: { if(Ex_Timer[0]%4 == 0) { Ex_Timer[3] = 29; } else { Ex_Timer[3] = 28; } }
  709. case 4, 6, 9, 11: Ex_Timer[3] = 30;
  710. }
  711. Ex_Timer[1] = 12 - Ex_Timer[1]; Ex_Timer[2] = Ex_Timer[3] - Ex_Timer[3];
  712. Ex_Timer[4] = 24 - Ex_Timer[4]; if(Ex_Timer[4] == 24) { Ex_Timer[4] = 0; } if(Ex_Timer[5] != 0) { Ex_Timer[4]--; }
  713. Ex_Timer[5] = 60 - Ex_Timer[5]; if(Ex_Timer[5] == 60) { Ex_Timer[5] = 0; } if(Ex_Timer[6] != 0) { Ex_Timer[5]--; }
  714. Ex_Timer[6] = 60 - Ex_Timer[6]; if(Ex_Timer[6] == 60) { Ex_Timer[6] = 0; }
  715.  
  716. format(string, sizeof(string), "Anul 2015 va fi in:%02d luni %02d zile %02d ore %02d minute si %02d secunde!", Ex_Timer[1], Ex_Timer[2], Ex_Timer[4], Ex_Timer[5], Ex_Timer[6]);
  717. SendClientMessage(playerid,-1,string);
  718. return 1;
  719. }
  720. if(!strcmp(cmdtext, "/artificii", true))
  721. {
  722. if(FireworkTotal == MAX_LAUNCH)
  723. {
  724. SendClientMessage(playerid, COLOR_WHITE, "Ai cumparat numarul maxim de artificii!");
  725. return 1;
  726. }
  727. if(Fired == 1)
  728. {
  729. SendClientMessage(playerid, COLOR_WHITE, "Asteapta sa explodeze artificiul!");
  730. return 1;
  731. }
  732. new string[128];
  733. format(string, sizeof(string), "%s a aprins un artificiu.", GetPlayerNameEx(playerid));
  734. new Float:x, Float:y, Float:z, Float:a;
  735. GetPlayerPos(playerid, x, y, z);
  736. foreach(Player, i)
  737. {
  738. if(IsPlayerInRangeOfPoint(i, 30, x, y, z)) {
  739. SendClientMessage(i, COLOR_YELLOW, string);
  740. }
  741. }
  742. GetPlayerFacingAngle(playerid, a);
  743. x += (2 * floatsin(-a, degrees));
  744. y += (2 * floatcos(-a, degrees));
  745. Rocket[FireworkTotal] = CreateDynamicObject(3786, x, y, z, 0, 90, 0);
  746. RocketLight[FireworkTotal] = CreateDynamicObject(354, x, y, z + 1, 0, 90, 0);
  747. RocketSmoke[FireworkTotal] = CreateDynamicObject(18716, x, y, z - 4, 0, 0, 0);
  748. rx[FireworkTotal] = x;
  749. ry[FireworkTotal] = y;
  750. rz[FireworkTotal] = z;
  751. RocketExplosions[FireworkTotal] = 0;
  752. FireworkTotal++;
  753. return 1;
  754. }
  755.  
  756. if(!strcmp(cmdtext, "/lanseaza", true))
  757. {
  758. if(FireworkTotal == 0)
  759. {
  760. SendClientMessage(playerid, COLOR_WHITE, "Nu ai nici un artificiu!");
  761. return 1;
  762. }
  763. if(Fired == 1)
  764. {
  765. SendClientMessage(playerid, COLOR_WHITE, "Ai plasat deja focul de artificiu,asteapta sa explodeze!");
  766. return 1;
  767. }
  768. for(new i = 0; i < FireworkTotal; i++)
  769. {
  770. CreateExplosion(rx[i] ,ry[i], rz[i], 12, 5);
  771. new time = MoveDynamicObject(Rocket[i], rx[i] ,ry[i], rz[i] + RocketHeight, 10);
  772. MoveDynamicObject(RocketLight[i], rx[i] ,ry[i], rz[i] + 2 + RocketHeight, 10);
  773. MoveDynamicObject(RocketSmoke[i], rx[i] ,ry[i], rz[i] + RocketHeight, 10);
  774. SetTimerEx("Firework", time, 0, "i", i);
  775. }
  776. Fired = 1;
  777. return 1;
  778. }
  779. if(strcmp(cmdtext, "/brad", true) == 0)
  780. {
  781. new Float:plocx,Float:plocy,Float:plocz; // Ia niste float-uri.
  782. GetPlayerPos(playerid, plocx, plocy, plocz); // Se iau coordonatele playerului.
  783. SetXmasTree(plocx,plocy,plocz);// Se iau coordonatele bradului si se creeaza.
  784. SetPlayerPos(playerid, plocx-2.5, plocy+2.5, plocz);//La aceasta pozitie se va creea bradul
  785. SendClientMessage(playerid, LIGHTGREEN, "Ai creat un brad de craciun!Felicitari.");
  786. return 1;
  787.  
  788. }
  789. if(strcmp(cmdtext, "/scoatebrad", true) == 0)
  790. {
  791. DeleteClosestXmasTree(playerid);
  792. SendClientMessage(playerid, LIGHTGREEN, "Ai scos un brad de craciun!Sarbatori fericite!");
  793. return 1;
  794.  
  795. }
  796. if(!strcmp(cmdtext, "/caciula", true))
  797. {
  798. if( snowOn{ playerid } )
  799. {
  800. DeleteSnow( playerid );
  801. SendClientMessage( playerid, 0x00FF00AA, "{FF0000}Sarbatori fericite!{FFFFFF}Ai oprit ninsoarea!" );
  802. }
  803. else
  804. {
  805. CreateSnow( playerid );
  806. SendClientMessage( playerid, 0x00FF00AA, "{FF0000}Craciunul soseste!{FFFFFF}Ninge!" );
  807. }
  808. return ( 1 );
  809. }
  810. if(!strcmp(cmdtext, "/caciula", true))
  811. {
  812. SetPlayerAttachedObject(playerid, 3, 19065, 2, 0.120000, 0.040000, -0.003500, 0, 100, 100, 1.4, 1.4, 1.4);
  813. return SendClientMessage(playerid, 0x00FF00FF, "Ti-ai pus o caciula de Mos Craciun!Sarbatori fericite!");
  814. }
  815. if(!strcmp(cmdtext, "/scoatecaciula", true))
  816. {
  817. if(IsPlayerAttachedObjectSlotUsed(playerid, 3))
  818. {
  819. RemovePlayerAttachedObject(playerid, 3);
  820. SendClientMessage(playerid, 0x00FF00FF, "Ti-ai dat caciula de craciun jos!Sarbatori fericite!");
  821. }
  822. return 1;
  823. }
  824. if(strcmp(cmdtext, "/scoatetotibrazii", true) == 0)
  825. {
  826. DeleteAllXmasTree();
  827. SendClientMessage(playerid, LIGHTGREEN, "Ai scos toti brazii de pe server!Sarbatori fericite!");
  828. return 1;
  829.  
  830.  
  831. }
  832. return 0;
  833. }
  834. //--------------------Pentru Cadouri--------------------------------------
  835. public OnPlayerPickUpPickup(playerid, pickupid)
  836. {
  837. new string[128];
  838. for(new x = 0; x < MAX_GIFTS; x++)
  839. {
  840. if(pickupid == Gift[x] && Picked[playerid] == 0)
  841. {
  842. switch(random(5))
  843. {
  844. case 0: {
  845. GivePlayerWeapon(playerid, 29, 50);
  846. format(string, sizeof(string), "~r~Craciun Fericit!~n~~w~Ai primit ~g~o arma!");
  847. GameTextForPlayer(playerid, string, 4000, 3);
  848. format(string, sizeof(string), "{FF3C00}Craciun Fericit!! {FFFFFF}Ai primit{FF3C00}o arma");
  849. SendClientMessage(playerid, COLOR_WHITE, string);
  850. }
  851. case 1: {
  852. new rand = (5000 + random(40000));
  853. GivePlayerMoney(playerid, rand);
  854. format(string, sizeof(string), "~r~Craciun Fericit!~n~~w~Ai primit ~g~$%d", rand);
  855. GameTextForPlayer(playerid, string, 4000, 3);
  856. format(string, sizeof(string), "{FF3C00}Craciun Fericit!! {FFFFFF}You Have Received {FF3C00}$%d!", rand);
  857. SendClientMessage(playerid, COLOR_WHITE, string);
  858. }
  859. case 2: {
  860. SetPlayerHealth(playerid, 99);
  861. format(string, sizeof(string), "~r~Craciun Fericit!~n~~w~Ai primit ~y~dulciuri");
  862. GameTextForPlayer(playerid, string, 4000, 3);
  863. SendClientMessage(playerid, COLOR_WHITE, "Ai primit dulciuri {FF3C00}");
  864. }
  865. case 3: {
  866. SetPlayerArmour(playerid, 99);
  867. format(string, sizeof(string), "~r~Craciun Fericit!~n~~w~Ai primit cadou o arma ~y~Body Armour");
  868. GameTextForPlayer(playerid, string, 4000, 3);
  869. SendClientMessage(playerid, COLOR_WHITE, "Ai primit {FF3C00} o armura! {FFFFFF} {FF3C00}Ti-ai pus armura pe tine.");
  870. }
  871. case 4: {
  872. new rand = (5000 + random(40000));
  873. GivePlayerMoney(playerid, rand);
  874. format(string, sizeof(string), "~r~Craciun Fericit!~n~~w~Ai primit ~g~$%d", rand);
  875. GameTextForPlayer(playerid, string, 4000, 3);
  876. format(string, sizeof(string), "{FF3C00}Craciun Fericit! {FFFFFF}Ai primit {FF3C00}$%d!", rand);
  877. SendClientMessage(playerid, COLOR_WHITE, string);
  878. }
  879. case 5: {
  880. new rand = (5000 + random(40000));
  881. GivePlayerMoney(playerid, rand);
  882. format(string, sizeof(string), "~r~Craciun Fericit!~n~~w~Ai primit ~g~$%d", rand);
  883. GameTextForPlayer(playerid, string, 4000, 3);
  884. format(string, sizeof(string), "{FF3C00}Craciun Fericit! {FFFFFF}Ai primit {FF3C00}$%d!", rand);
  885. SendClientMessage(playerid, COLOR_WHITE, string);
  886. }
  887. }
  888. new zone[MAX_ZONE_NAME], pname[MAX_PLAYER_NAME];
  889. GetPlayer2DZone(playerid, zone, sizeof(zone));
  890. GetPlayerName(playerid, pname, sizeof(pname));
  891. format(string, sizeof(string), "%s a gasit un {FF3C00}cadou {FFFFFF}in zona {0069FF}%s!", pname, zone);
  892. SendClientMessageToAll(COLOR_WHITE, string);
  893. DestroyPickup(Gift[x]);
  894. pInfo[playerid][gFound]++;
  895. Picked[playerid] = 1;
  896. }
  897. }
  898. Picked[playerid] = 0;
  899. return 1;
  900. }
  901. //-------------------Pentru Colinde--------------------------------------
  902. public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
  903. {
  904. switch( listitem )
  905. {
  906. case DIALOG_MP3:
  907. {
  908. if ( !response )
  909. return ( 1 );
  910.  
  911. switch( listitem )
  912. {
  913. case 0: PlayAudioStreamForPlayer( playerid, "http://k003.kiwi6.com/hotlink/3fi7ftvrir/Astazi_s-a_nascut_HRISTOS_-_COLINDA.mp3" );
  914. case 1: PlayAudioStreamForPlayer( playerid, "http://k003.kiwi6.com/hotlink/80uxgt93ho/Cerul_si_Pamantul_-_Colind.mp3" );
  915. case 2: PlayAudioStreamForPlayer( playerid, "http://k003.kiwi6.com/hotlink/ffxk44yx17/Deschide_usa_crestine.mp3" );
  916. case 3: PlayAudioStreamForPlayer( playerid, "http://k003.kiwi6.com/hotlink/ivygxuttsf/INNA_-_O_ce_veste_minunata.mp3" );
  917. case 4: PlayAudioStreamForPlayer( playerid, "http://k003.kiwi6.com/hotlink/3l5u8yvir3/La_Vitleem_colo-n_jos.mpg.mp3" );
  918. case 5: PlayAudioStreamForPlayer( playerid, "http://k003.kiwi6.com/hotlink/p2bv4puopq/Fuego_-_Cana_Galilei.mp3" );
  919. case 6: PlayAudioStreamForPlayer( playerid, "http://k003.kiwi6.com/hotlink/mg4buoelcx/COLINDA_2_-_Domn_domn_sa-naltam.mp3" );
  920. case 7: PlayAudioStreamForPlayer( playerid, "http://k003.kiwi6.com/hotlink/ep8o6iutl8/Fuego_-_Steaua_sus_rasare.mp3" );
  921. case 8: PlayAudioStreamForPlayer( playerid, "http://k003.kiwi6.com/hotlink/f827t50i5z/Stefan_Hrusca_Leru_i_da_leru_i_ler.mp3" );
  922. case 9: PlayAudioStreamForPlayer( playerid, "http://k003.kiwi6.com/hotlink/dh08xnnrop/Stefan_Hrusca_-_Florile_dalbe.mp3" );
  923. case 10: PlayAudioStreamForPlayer( playerid, "http://k003.kiwi6.com/hotlink/iw71jddauq/Colinde_colinde.mp3" );
  924. }
  925. }
  926. }
  927. return 1;
  928. }
  929. //------------------------ Brazi-------------------------------------------
  930.  
  931. public F_StartUpdate()
  932. {
  933. SetTimer("F_ObjectUpdate", UpdateTime, 1);
  934. }
  935.  
  936. stock F_CreateObject(modelid, Float:x, Float:y, Float:z, Float:rox, Float:roy, Float:roz, Float:vdist=0.0)
  937. {
  938. if(ObjectUpdatetRunning == false)
  939. {
  940. SetTimer("F_StartUpdate", F_MAX_OBJECTS/2, 0);
  941. ObjectUpdatetRunning = true;
  942. }
  943.  
  944. new objectid;
  945.  
  946. if(CantCreateMore == false)
  947. {
  948. for(new i; i<F_MAX_OBJECTS; i++)
  949. {
  950. if(i == F_MAX_OBJECTS-1)
  951. {
  952. printf("Obiectele de la brazi (%i) au ajuns la limita!", F_MAX_OBJECTS);
  953. CantCreateMore = true;
  954. }
  955. if(ObjectInfo[i][ModelID] == 0)
  956. {
  957. objectid = i;
  958. break;
  959. }
  960. }
  961. }
  962. else
  963. {
  964. return -1;
  965. }
  966.  
  967. if(modelid == 0)
  968. {
  969. printf("Comanda invalida a obiectului (%i)", objectid);
  970. return -1;
  971. }
  972.  
  973. ObjectInfo[objectid][ModelID] = modelid;
  974. ObjectInfo[objectid][ox] = x;
  975. ObjectInfo[objectid][oy] = y;
  976. ObjectInfo[objectid][oz] = z;
  977. ObjectInfo[objectid][orox] = rox;
  978. ObjectInfo[objectid][oroy] = roy;
  979. ObjectInfo[objectid][oroz] = roz;
  980. ObjectInfo[objectid][ovdist] = vdist;
  981. return objectid;
  982. }
  983.  
  984. stock F_IsValidObject(objectid)
  985. {
  986. if(ObjectInfo[objectid][ModelID] == 0 || objectid == -1)
  987. {
  988. return 0;
  989. }
  990. return 1;
  991. }
  992.  
  993. stock F_DestroyObject(objectid)
  994. {
  995. if(F_IsValidObject(objectid))
  996. {
  997. for(new playerid; playerid<MAX_PLAYERS; playerid++)
  998. {
  999. if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid) && ObjectInfo[objectid][ObjectCreated][playerid] == true)
  1000. {
  1001. DestroyPlayerObject(playerid, ObjectInfo[objectid][ObjectID][playerid]);
  1002. ObjectInfo[objectid][ObjectCreated][playerid] = false;
  1003. }
  1004. }
  1005. ObjectInfo[objectid][ModelID] = 0;
  1006. return 1;
  1007. }
  1008. return 0;
  1009. }
  1010.  
  1011. stock F_MoveObject(objectid, Float:x, Float:y, Float:z, Float:speed)
  1012. {
  1013. if(F_IsValidObject(objectid))
  1014. {
  1015. new time;
  1016. for(new playerid; playerid<MAX_PLAYERS; playerid++)
  1017. {
  1018. if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid) && ObjectInfo[objectid][ObjectCreated][playerid] == true)
  1019. {
  1020. time = MovePlayerObject(playerid, ObjectInfo[objectid][ObjectID][playerid], x, y, z, speed);
  1021. }
  1022. }
  1023. return time;
  1024. }
  1025. return 0;
  1026. }
  1027.  
  1028. stock F_StopObject(objectid)
  1029. {
  1030. if(F_IsValidObject(objectid))
  1031. {
  1032. for(new playerid; playerid<MAX_PLAYERS; playerid++)
  1033. {
  1034. if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid) && ObjectInfo[objectid][ObjectCreated][playerid] == true)
  1035. {
  1036. StopPlayerObject(playerid, ObjectInfo[objectid][ObjectID][playerid]);
  1037. }
  1038. }
  1039. return 1;
  1040. }
  1041. return 0;
  1042. }
  1043.  
  1044. stock F_SetObjectPos(objectid, Float:x, Float:y, Float:z)
  1045. {
  1046. if(F_IsValidObject(objectid))
  1047. {
  1048. ObjectInfo[objectid][ox] = x;
  1049. ObjectInfo[objectid][oy] = y;
  1050. ObjectInfo[objectid][oz] = z;
  1051. for(new playerid; playerid<MAX_PLAYERS; playerid++)
  1052. {
  1053. if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid) && ObjectInfo[objectid][ObjectCreated][playerid] == true)
  1054. {
  1055. SetPlayerObjectPos(playerid, ObjectInfo[objectid][ObjectID][playerid], x, y, z);
  1056. }
  1057. }
  1058. return 1;
  1059. }
  1060. return 0;
  1061. }
  1062.  
  1063. stock F_GetObjectPos(objectid, &Float:x, &Float:y, &Float:z)
  1064. {
  1065. if(F_IsValidObject(objectid))
  1066. {
  1067. x = ObjectInfo[objectid][ox];
  1068. y = ObjectInfo[objectid][oy];
  1069. z = ObjectInfo[objectid][oz];
  1070. return 1;
  1071. }
  1072. else
  1073. {
  1074. return 0;
  1075. }
  1076. }
  1077.  
  1078. stock F_SetObjectRot(objectid, Float:rox, Float:roy, Float:roz)
  1079. {
  1080. if(F_IsValidObject(objectid))
  1081. {
  1082. ObjectInfo[objectid][orox] = rox;
  1083. ObjectInfo[objectid][oroy] = roy;
  1084. ObjectInfo[objectid][oroz] = roz;
  1085. for(new playerid; playerid<MAX_PLAYERS; playerid++)
  1086. {
  1087. if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid) && ObjectInfo[objectid][ObjectCreated][playerid] == true)
  1088. {
  1089. SetPlayerObjectRot(playerid, ObjectInfo[objectid][ObjectID][playerid], rox, roy, roz);
  1090. }
  1091. }
  1092. return 1;
  1093. }
  1094. return 0;
  1095. }
  1096.  
  1097. stock F_GetObjectRot(objectid, &Float:rox, &Float:roy, &Float:roz)
  1098. {
  1099. if(F_IsValidObject(objectid))
  1100. {
  1101. rox = ObjectInfo[objectid][orox];
  1102. roy = ObjectInfo[objectid][oroy];
  1103. roz = ObjectInfo[objectid][oroz];
  1104. return 1;
  1105. }
  1106. else
  1107. {
  1108. return 0;
  1109. }
  1110. }
  1111.  
  1112. stock F_RefreshObjects(playerid)
  1113. {
  1114. if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
  1115. {
  1116. RefreshObjects[playerid] = true;
  1117. new Float:x, Float:y, Float:z;
  1118. GetPlayerPos(playerid, x, y, z);
  1119. F_PlayerObjectUpdate(playerid, x, y, z);
  1120. return 1;
  1121. }
  1122. return 0;
  1123. }
  1124.  
  1125. stock F_Streamer_OnPlayerConnect(playerid)
  1126. {
  1127. for(new objectid; objectid<F_MAX_OBJECTS; objectid++)
  1128. {
  1129. ObjectInfo[objectid][ObjectCreated][playerid] = false;
  1130. }
  1131. OldX[playerid] = 999999999.99;
  1132. OldY[playerid] = 999999999.99;
  1133. OldZ[playerid] = 999999999.99;
  1134. RefreshObjects[playerid] = false;
  1135. return 1;
  1136. }
  1137.  
  1138. public F_ObjectUpdate(bool:DontCheckDistance)
  1139. {
  1140. new Float:ObjDistance[F_MAX_OBJECTS];
  1141. new Closest[ObjectsToStream];
  1142. new ObjectArr[F_MAX_OBJECTS];
  1143. new nr;
  1144. new bool:Firstloop;
  1145. new bool:DontDestroy[F_MAX_OBJECTS];
  1146.  
  1147. for(new playerid; playerid<MAX_PLAYERS; playerid++)
  1148. {
  1149. if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
  1150. {
  1151. if(!IsPlayerInRangeOfPoint(playerid, 1.0, OldX[playerid], OldY[playerid], OldZ[playerid]) || DontCheckDistance)
  1152. {
  1153. GetPlayerPos(playerid, OldX[playerid], OldY[playerid], OldZ[playerid]);
  1154.  
  1155. nr = 0;
  1156. for(new objectid; objectid<F_MAX_OBJECTS; objectid++)
  1157. {
  1158. if(F_IsValidObject(objectid))
  1159. {
  1160. 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));
  1161. if(floatcmp(ObjDistance[objectid], StreamRange) == -1)
  1162. {
  1163. ObjectArr[nr] = objectid;
  1164. nr++;
  1165. }
  1166. }
  1167. }
  1168.  
  1169. Closest = "";
  1170.  
  1171. if(nr > ObjectsToStream)
  1172. {
  1173. for(new loop; loop<ObjectsToStream; loop++)
  1174. {
  1175. Firstloop = true;
  1176. for(new objectid; objectid<nr; objectid++)
  1177. {
  1178. if((ObjDistance[ObjectArr[objectid]] != 999999999.99) && ((floatcmp(ObjDistance[ObjectArr[objectid]], ObjDistance[Closest[loop]]) == -1) || Firstloop))
  1179. {
  1180. Firstloop = false;
  1181. Closest[loop] = ObjectArr[objectid];
  1182. }
  1183. }
  1184. ObjDistance[Closest[loop]] = 999999999.99;
  1185. }
  1186. }
  1187. else
  1188. {
  1189. for(new objectid; objectid<nr; objectid++)
  1190. {
  1191. Closest[objectid] = ObjectArr[objectid];
  1192. }
  1193. }
  1194.  
  1195. for(new objectid; objectid<F_MAX_OBJECTS; objectid++) { DontDestroy[objectid] = false; }
  1196. for(new objectid; objectid<ObjectsToStream && objectid<nr; objectid++)
  1197. {
  1198. DontDestroy[Closest[objectid]] = true;
  1199. }
  1200.  
  1201. for(new objectid; objectid<F_MAX_OBJECTS; objectid++)
  1202. {
  1203. if(ObjectInfo[objectid][ObjectCreated][playerid] == true && DontDestroy[objectid] == false)
  1204. {
  1205. DestroyPlayerObject(playerid, ObjectInfo[objectid][ObjectID][playerid]);
  1206. ObjectInfo[objectid][ObjectCreated][playerid] = false;
  1207. }
  1208. }
  1209.  
  1210. for(new loop; loop<ObjectsToStream && loop<nr; loop++)
  1211. {
  1212. if(ObjectInfo[Closest[loop]][ObjectCreated][playerid] == false)
  1213. {
  1214. 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]);
  1215. ObjectInfo[Closest[loop]][ObjectCreated][playerid] = true;
  1216. }
  1217. }
  1218. }
  1219. }
  1220. }
  1221. }
  1222.  
  1223. stock F_ObjectUpdateForAll()
  1224. {
  1225. F_ObjectUpdate(true);
  1226. }
  1227.  
  1228. stock F_PlayerObjectUpdate(playerid, Float:x, Float:y, Float:z)
  1229. {
  1230. if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
  1231. {
  1232. OldX[playerid] = x;
  1233. OldY[playerid] = y;
  1234. OldZ[playerid] = z;
  1235.  
  1236. new nr;
  1237. new Float:ObjDistance[F_MAX_OBJECTS];
  1238. new ObjectArr[F_MAX_OBJECTS];
  1239. for(new objectid; objectid<F_MAX_OBJECTS; objectid++)
  1240. {
  1241. if(F_IsValidObject(objectid))
  1242. {
  1243. ObjDistance[objectid] = floatsqroot(floatpower(floatsub(ObjectInfo[objectid][ox],x),2)+floatpower(floatsub(ObjectInfo[objectid][oy],y),2)+floatpower(floatsub(ObjectInfo[objectid][oz],z),2));
  1244. if(floatcmp(ObjDistance[objectid], StreamRange) == -1)
  1245. {
  1246. ObjectArr[nr] = objectid;
  1247. nr++;
  1248. }
  1249. }
  1250. }
  1251.  
  1252. new Closest[ObjectsToStream];
  1253.  
  1254. if(nr > ObjectsToStream)
  1255. {
  1256. for(new loop; loop<ObjectsToStream; loop++)
  1257. {
  1258. new bool:Firstloop = true;
  1259. for(new objectid; objectid<nr; objectid++)
  1260. {
  1261. if((ObjDistance[ObjectArr[objectid]] != 999999999.99) && ((floatcmp(ObjDistance[ObjectArr[objectid]], ObjDistance[Closest[loop]]) == -1) || Firstloop))
  1262. {
  1263. Firstloop = false;
  1264. Closest[loop] = ObjectArr[objectid];
  1265. }
  1266. }
  1267. ObjDistance[Closest[loop]] = 999999999.99;
  1268. }
  1269. }
  1270. else
  1271. {
  1272. for(new objectid; objectid<nr; objectid++)
  1273. {
  1274. Closest[objectid] = ObjectArr[objectid];
  1275. }
  1276. }
  1277.  
  1278. new bool:DontDestroy[F_MAX_OBJECTS];
  1279. for(new objectid; objectid<ObjectsToStream && objectid<nr; objectid++)
  1280. {
  1281. DontDestroy[Closest[objectid]] = true;
  1282. }
  1283.  
  1284. for(new objectid; objectid<F_MAX_OBJECTS; objectid++)
  1285. {
  1286. if(ObjectInfo[objectid][ObjectCreated][playerid] == true && (DontDestroy[objectid] == false || RefreshObjects[playerid] == true))
  1287. {
  1288. DestroyPlayerObject(playerid, ObjectInfo[objectid][ObjectID][playerid]);
  1289. ObjectInfo[objectid][ObjectCreated][playerid] = false;
  1290. }
  1291. }
  1292. RefreshObjects[playerid] = false;
  1293.  
  1294. for(new loop; loop<ObjectsToStream && loop<nr; loop++)
  1295. {
  1296. if(ObjectInfo[Closest[loop]][ObjectCreated][playerid] == false)
  1297. {
  1298. 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]);
  1299. ObjectInfo[Closest[loop]][ObjectCreated][playerid] = true;
  1300. }
  1301. }
  1302. }
  1303. }
  1304. #define SetPlayerPos F_SetPlayerPos
  1305. stock F_SetPlayerPos(playerid, Float:x, Float:y, Float:z)
  1306. {
  1307. F_PlayerObjectUpdate(playerid, x, y, z);
  1308. SetPlayerPos(playerid, x, y, z);
  1309. }
  1310.  
  1311. stock SetXmasTree(Float:x,Float:y,Float:z)
  1312. {
  1313. for(new i = 0; i < sizeof(Treepos); i++)
  1314. {
  1315. if(Treepos[i][XmasTreeX] == 0)
  1316. {
  1317. Treepos[i][XmasTreeX]=1;
  1318. Treepos[i][XmasX]=x;
  1319. Treepos[i][XmasY]=y;
  1320. Treepos[i][XmasZ]=z;
  1321. Treepos[i][XmasObject1] = F_CreateObject(19076, x, y, z-1.0,0,0,300);//xmas tree
  1322. Treepos[i][XmasObject2] = F_CreateObject(19054, x, y+1.0, z-0.4,0,0,300);//XmasBox1
  1323. Treepos[i][XmasObject3] = F_CreateObject(19058, x+1.0, y, z-0.4,0,0,300);//XmasBox5
  1324. Treepos[i][XmasObject4] = F_CreateObject(19056, x, y-1.0, z-0.4,0,0,300);//XmasBox3
  1325. Treepos[i][XmasObject5] = F_CreateObject(19057, x-1.0, y, z-0.4,0,0,300);//XmasBox4
  1326. Treepos[i][XmasObject6] = F_CreateObject(19058, x-1.5, y+1.5, z-1.0,0,0,300);//XmasBox5
  1327. Treepos[i][XmasObject7] = F_CreateObject(19055, x+1.5, y-1.5, z-1.0,0,0,300);//XmasBox2
  1328. Treepos[i][XmasObject8] = F_CreateObject(19057, x+1.5, y+1.5, z-1.0,0,0,300);//XmasBox4
  1329. Treepos[i][XmasObject9] = F_CreateObject(19054, x-1.5, y-1.5, z-1.0,0,0,300);//XmasBox1
  1330. Treepos[i][XmasObject10] = F_CreateObject(3526, x, y, z-1.0,0,0,300);//Airportlight - for flashing affect
  1331. return 1;
  1332. }
  1333. }
  1334. return 0;
  1335. }
  1336.  
  1337. stock DeleteAllXmasTree()
  1338. {
  1339. for(new i = 0; i < sizeof(Treepos); i++)
  1340. {
  1341. if(Treepos[i][XmasTreeX] == 1)
  1342. {
  1343. Treepos[i][XmasTreeX]=0;
  1344. Treepos[i][XmasX]=0.0;
  1345. Treepos[i][XmasY]=0.0;
  1346. Treepos[i][XmasZ]=0.0;
  1347. F_DestroyObject(Treepos[i][XmasObject1]);
  1348. F_DestroyObject(Treepos[i][XmasObject2]);
  1349. F_DestroyObject(Treepos[i][XmasObject3]);
  1350. F_DestroyObject(Treepos[i][XmasObject4]);
  1351. F_DestroyObject(Treepos[i][XmasObject5]);
  1352. F_DestroyObject(Treepos[i][XmasObject6]);
  1353. F_DestroyObject(Treepos[i][XmasObject7]);
  1354. F_DestroyObject(Treepos[i][XmasObject8]);
  1355. F_DestroyObject(Treepos[i][XmasObject9]);
  1356. F_DestroyObject(Treepos[i][XmasObject10]);
  1357. }
  1358. }
  1359. return 0;
  1360. }
  1361.  
  1362. stock DeleteClosestXmasTree(playerid)
  1363. {
  1364. for(new i = 0; i < sizeof(Treepos); i++)
  1365. {
  1366. if(IsPlayerInRangeOfPoint(playerid, 3.0, Treepos[i][XmasX], Treepos[i][XmasY], Treepos[i][XmasZ]))
  1367. {
  1368. if(Treepos[i][XmasTreeX] == 1)
  1369. {
  1370. Treepos[i][XmasTreeX]=0;
  1371. Treepos[i][XmasX]=0.0;
  1372. Treepos[i][XmasY]=0.0;
  1373. Treepos[i][XmasZ]=0.0;
  1374. F_DestroyObject(Treepos[i][XmasObject1]);
  1375. F_DestroyObject(Treepos[i][XmasObject2]);
  1376. F_DestroyObject(Treepos[i][XmasObject3]);
  1377. F_DestroyObject(Treepos[i][XmasObject4]);
  1378. F_DestroyObject(Treepos[i][XmasObject5]);
  1379. F_DestroyObject(Treepos[i][XmasObject6]);
  1380. F_DestroyObject(Treepos[i][XmasObject7]);
  1381. F_DestroyObject(Treepos[i][XmasObject8]);
  1382. F_DestroyObject(Treepos[i][XmasObject9]);
  1383. F_DestroyObject(Treepos[i][XmasObject10]);
  1384. return 1;
  1385. }
  1386. }
  1387. }
  1388. return 0;
  1389. }
  1390. //------------------Sistem Ninsoare--------------------------------------
  1391. stock CreateSnow( playerid )
  1392. {
  1393. if( snowOn{ playerid } )
  1394. return ( 0 );
  1395.  
  1396. new Float:pPos[ 3 ];
  1397. GetPlayerPos( playerid, pPos[ 0 ], pPos[ 1 ], pPos[ 2 ] );
  1398.  
  1399. for( new i = 0; i < 5; i ++ )
  1400. snowObject[ playerid ][ i ] = CreateObject( 18864, pPos[ 0 ] + random( 25 ), pPos[ 1 ] + random ( 25 ), pPos[ 2 ] - 5, random( 100 ), random( 100 ), random( 100 ), -1, -1, playerid );
  1401.  
  1402. snowOn{ playerid } = true;
  1403. return ( 1 );
  1404. }
  1405.  
  1406. stock DeleteSnow( playerid )
  1407. {
  1408. if( !snowOn{ playerid } )
  1409. return ( 0 );
  1410.  
  1411. for( new i = 0; i < 5; i ++ )
  1412. DestroyObject( snowObject[ playerid ][ i ] );
  1413.  
  1414. KillTimer( updateTimer{ playerid } );
  1415. snowOn{ playerid } = false;
  1416. return ( 1 );
  1417. }
  1418. GetPlayerNameEx(playerid) {
  1419.  
  1420. new sz_playerName[MAX_PLAYER_NAME], i_pos;
  1421.  
  1422. GetPlayerName(playerid, sz_playerName, MAX_PLAYER_NAME);
  1423. while ((i_pos = strfind(sz_playerName, "_", false, i_pos)) != -1) sz_playerName[i_pos] = ' ';
  1424. return sz_playerName;
  1425. }
  1426. //----------------Sistem cadouri
  1427. stock IsPlayerInZone(playerid, zone[])
  1428. {
  1429. new TmpZone[MAX_ZONE_NAME];
  1430. GetPlayer3DZone(playerid, TmpZone, sizeof(TmpZone));
  1431. for(new i = 0; i != sizeof(gSAZones); i++)
  1432. {
  1433. if(strfind(TmpZone, zone, true) != -1)
  1434. return 1;
  1435. }
  1436. return 0;
  1437. }
  1438.  
  1439. stock GetPlayer2DZone(playerid, zone[], len)
  1440. {
  1441. new Float:x, Float:y, Float:z;
  1442. GetPlayerPos(playerid, x, y, z);
  1443. for(new i = 0; i != sizeof(gSAZones); i++ )
  1444. {
  1445. if(x >= gSAZones[i][SAZONE_AREA][0] && x <= gSAZones[i][SAZONE_AREA][3] && y >= gSAZones[i][SAZONE_AREA][1] && y <= gSAZones[i][SAZONE_AREA][4])
  1446. {
  1447. return format(zone, len, gSAZones[i][SAZONE_NAME], 0);
  1448. }
  1449. }
  1450. return 0;
  1451. }
  1452.  
  1453. stock GetPlayer3DZone(playerid, zone[], len)
  1454. {
  1455. new Float:x, Float:y, Float:z;
  1456. GetPlayerPos(playerid, x, y, z);
  1457. for(new i = 0; i != sizeof(gSAZones); i++ )
  1458. {
  1459. if(x >= gSAZones[i][SAZONE_AREA][0] && x <= gSAZones[i][SAZONE_AREA][3] && y >= gSAZones[i][SAZONE_AREA][1] && y <= gSAZones[i][SAZONE_AREA][4] && z >= gSAZones[i][SAZONE_AREA][2] && z <= gSAZones[i][SAZONE_AREA][5])
  1460. {
  1461. return format(zone, len, gSAZones[i][SAZONE_NAME], 0);
  1462. }
  1463. }
  1464. return 0;
  1465. }
  1466. #endif
Advertisement
Add Comment
Please, Sign In to add comment