halloween.pwn 61 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283
  1. #define FILTERSCRIPT
  2. #include <a_samp>
  3. #include <izcmd> // http://forum.sa-mp.com/showthread.php?t=576114
  4. #include <sqlitei> // http://forum.sa-mp.com/showthread.php?t=303682
  5. #include <sscanf2> // http://forum.sa-mp.com/showthread.php?t=602923
  6. #include <streamer> // http://forum.sa-mp.com/showthread.php?t=102865
  7. // internal defines
  8. #define MAX_ZONE_NAME (28)
  9. #define MAX_GIFT_BOXES (200)
  10. #define MAX_PUMPKINS (200)
  11. // event config
  12. #define I_WANT_HATS_DAMMIT // enables hats, remove/comment this line if you don't want people to have a witch hat
  13. #define PUMPKIN_DROPS // enables pumpkin drops on death, remove/comment this line if you don't want it
  14. #define ATTACH_INDEX (8) // for SetPlayerAttachedObject
  15. // gift box config
  16. #define GIFT_AMOUNT (3) // amount of gifts dropped on a timed drop (Default: 3)
  17. #define GIFT_INTERVAL (600) // drop gifts every x seconds (Default: 600)
  18. #define GIFT_LIFETIME (300) // a gift box will stay for x seconds (Default: 300)
  19. #define GIFT_MIN_MONEY (500)
  20. #define GIFT_MAX_MONEY (2000)
  21. #define GIFT_MIN_CANDY (3)
  22. #define GIFT_MAX_CANDY (9)
  23. // pumpkin config
  24. #define PUMPKIN_LIFETIME (120) // a dropped pumpkin will stay for x seconds (Default: 120)
  25. #define PUMPKIN_CANDY (3) // a pumpkin will contain x candies (Default: 3)
  26. // shop config
  27. #define MEDKIT_PRICE (5) // price of a medkit (Default: 5)
  28. #define ARMOR_PRICE (5) // price of a body armor (Default: 5)
  29. #define GIFT_PRICE (5000) // price of a gift box (Default: 5000)
  30. #define GIFT_PRICE_CANDY (10) // price of a gift box, in candy (Default: 10)
  31. enum _:E_DIALOG
  32. {
  33. DIALOG_UNUSED = 7785,
  34. DIALOG_CANDY_SHOP,
  35. DIALOG_BUY_GIFT,
  36. DIALOG_BUY_WEAPON
  37. }
  38. enum E_SHOP_WEAPONS
  39. {
  40. WeaponID,
  41. WeaponAmmo,
  42. WeaponPrice
  43. }
  44. enum E_SAZONE_MAIN
  45. {
  46. SAZONE_NAME[MAX_ZONE_NAME],
  47. Float: SAZONE_AREA[6]
  48. }
  49. enum E_HALLOWEEN
  50. {
  51. DropTimeLeft,
  52. EventTimer
  53. }
  54. enum E_GIFT_BOX_COORDS
  55. {
  56. Float: GiftBoxSpawnX,
  57. Float: GiftBoxSpawnY,
  58. Float: GiftBoxSpawnZ
  59. }
  60. enum E_GIFT_BOX
  61. {
  62. Float: GiftBoxX,
  63. Float: GiftBoxY,
  64. Float: GiftBoxZ,
  65. GiftBoxTimeLeft,
  66. GiftBoxPickup,
  67. Text3D: GiftBoxLabel,
  68. GiftBoxTimer,
  69. bool: GiftBoxExists
  70. }
  71. enum E_PUMPKIN
  72. {
  73. PumpkinTimeLeft,
  74. PumpkinPickup,
  75. Text3D: PumpkinLabel,
  76. PumpkinTimer,
  77. bool: PumpkinExists
  78. }
  79. new
  80. DB: HalloweenDB,
  81. DBStatement: LoadFromTable,
  82. DBStatement: InsertToTable,
  83. DBStatement: SaveToTable,
  84. DBStatement: TopCandies;
  85. new
  86. HalloweenData[E_HALLOWEEN];
  87. new
  88. GiftBoxData[MAX_GIFT_BOXES][E_GIFT_BOX];
  89. new
  90. PumpkinData[MAX_PUMPKINS][E_PUMPKIN];
  91. new
  92. Text: HalloweenText,
  93. Text: PumpkinIcon,
  94. Text: TimerText,
  95. Text: TimerIcon;
  96. new
  97. CandyCount[MAX_PLAYERS],
  98. PlayerText: CandyText[MAX_PLAYERS];
  99. static const
  100. ShopWeapons[][E_SHOP_WEAPONS] = {
  101. // weapon id, ammo, price (candy)
  102. {WEAPON_BAT, 1, 1},
  103. {WEAPON_KNIFE, 1, 1},
  104. {WEAPON_DEAGLE, 50, 20},
  105. {WEAPON_SHOTGUN, 25, 10},
  106. {WEAPON_AK47, 90, 15},
  107. {WEAPON_RIFLE, 25, 15},
  108. {WEAPON_MINIGUN, 100, 250}
  109. };
  110. static const
  111. GiftBoxCoords[][E_GIFT_BOX_COORDS] = {
  112. {2743.0, 1316.0, 8.0},
  113. {2168.66, 2267.96, 15.34},
  114. {2408.0, 1389.0, 22.0},
  115. {2034.0, 842.0, 10.0},
  116. {2096.0, 1287.0, 10.8},
  117. {1987.0, 1543.0, 16.0},
  118. {1854.0, 912.0, 10.8},
  119. {2540.38, 2527.85, 10.39},
  120. {1548.02, 1024.47, 10.39},
  121. {1592.91, 2053.83, 10.26},
  122. {1971.29, 2330.26, 10.41},
  123. {1700.74, 1792.7, 10.41},
  124. {2581.0, -1491.0, 24.0},
  125. {2296.0, -1696.0, 14.0},
  126. {2273.0, -1099.0, 38.0},
  127. {2716.0, -1048.0, 66.0},
  128. {2614.0, -2496.0, 33.0},
  129. {1183.85, -1250.68, 14.7},
  130. {1970.0, -1158.0, 21.0},
  131. {734.0, -1137.0, 18.0},
  132. {2553.76, -2464.31, 13.62},
  133. {1204.06, -1613.89, 13.28},
  134. {611.21, -1459.63, 14.01},
  135. {1116.67, -719.91, 100.17},
  136. {-1903.1, -466.44, 25.18},
  137. {-2657.0, -144.0, 4.0},
  138. {-2454.0, -166.0, 35.0},
  139. {-2009.0, 1227.0, 32.0},
  140. {-2120.0, 96.39, 39.0},
  141. {-2411.0, -334.0, 37.0},
  142. {-1690.0, 450.0, 13.0},
  143. {-1991.26, -1144.13, 29.69},
  144. {-2636.13, -492.83, 70.09},
  145. {-2022.68, 345.98, 35.17},
  146. {-2683.2, 784.13, 49.98},
  147. {-1820.67, -154.12, 9.4},
  148. {-736.0, 66.0, 24.0},
  149. {262.33, -149.12, 1.58},
  150. {1643.0, 264.0, 20.0},
  151. {601.98, 2150.38, 39.41},
  152. {-1407.0, -2039.0, 1.0},
  153. {-2156.0, -2371.0, 31.0},
  154. {-419.25, 1362.36, 12.21},
  155. {629.04, 2842.83, 25.21},
  156. {690.49, -209.59, 25.6},
  157. {88.82, -125.1, 0.85},
  158. {215.69, 1089.1, 16.4},
  159. {-2305.24, 2310.11, 4.98},
  160. {-213.61, 2717.44, 62.68}
  161. };
  162. // taken from here: http://forum.sa-mp.com/showthread.php?t=27598
  163. static const
  164. SAZones[][E_SAZONE_MAIN] = {
  165. {"The Big Ear", {-410.00,1403.30,-3.00,-137.90,1681.20,200.00}},
  166. {"Aldea Malvada", {-1372.10,2498.50,0.00,-1277.50,2615.30,200.00}},
  167. {"Angel Pine", {-2324.90,-2584.20,-6.10,-1964.20,-2212.10,200.00}},
  168. {"Arco del Oeste", {-901.10,2221.80,0.00,-592.00,2571.90,200.00}},
  169. {"Avispa Country Club", {-2646.40,-355.40,0.00,-2270.00,-222.50,200.00}},
  170. {"Avispa Country Club", {-2831.80,-430.20,-6.10,-2646.40,-222.50,200.00}},
  171. {"Avispa Country Club", {-2361.50,-417.10,0.00,-2270.00,-355.40,200.00}},
  172. {"Avispa Country Club", {-2667.80,-302.10,-28.80,-2646.40,-262.30,71.10}},
  173. {"Avispa Country Club", {-2470.00,-355.40,0.00,-2270.00,-318.40,46.10}},
  174. {"Avispa Country Club", {-2550.00,-355.40,0.00,-2470.00,-318.40,39.70}},
  175. {"Back o Beyond", {-1166.90,-2641.10,0.00,-321.70,-1856.00,200.00}},
  176. {"Battery Point", {-2741.00,1268.40,-4.50,-2533.00,1490.40,200.00}},
  177. {"Bayside", {-2741.00,2175.10,0.00,-2353.10,2722.70,200.00}},
  178. {"Bayside Marina", {-2353.10,2275.70,0.00,-2153.10,2475.70,200.00}},
  179. {"Beacon Hill", {-399.60,-1075.50,-1.40,-319.00,-977.50,198.50}},
  180. {"Blackfield", {964.30,1203.20,-89.00,1197.30,1403.20,110.90}},
  181. {"Blackfield", {964.30,1403.20,-89.00,1197.30,1726.20,110.90}},
  182. {"Blackfield Chapel", {1375.60,596.30,-89.00,1558.00,823.20,110.90}},
  183. {"Blackfield Chapel", {1325.60,596.30,-89.00,1375.60,795.00,110.90}},
  184. {"Blackfield Intersection", {1197.30,1044.60,-89.00,1277.00,1163.30,110.90}},
  185. {"Blackfield Intersection", {1166.50,795.00,-89.00,1375.60,1044.60,110.90}},
  186. {"Blackfield Intersection", {1277.00,1044.60,-89.00,1315.30,1087.60,110.90}},
  187. {"Blackfield Intersection", {1375.60,823.20,-89.00,1457.30,919.40,110.90}},
  188. {"Blueberry", {104.50,-220.10,2.30,349.60,152.20,200.00}},
  189. {"Blueberry", {19.60,-404.10,3.80,349.60,-220.10,200.00}},
  190. {"Blueberry Acres", {-319.60,-220.10,0.00,104.50,293.30,200.00}},
  191. {"Caligula's Palace", {2087.30,1543.20,-89.00,2437.30,1703.20,110.90}},
  192. {"Caligula's Palace", {2137.40,1703.20,-89.00,2437.30,1783.20,110.90}},
  193. {"Calton Heights", {-2274.10,744.10,-6.10,-1982.30,1358.90,200.00}},
  194. {"Chinatown", {-2274.10,578.30,-7.60,-2078.60,744.10,200.00}},
  195. {"City Hall", {-2867.80,277.40,-9.10,-2593.40,458.40,200.00}},
  196. {"Come-A-Lot", {2087.30,943.20,-89.00,2623.10,1203.20,110.90}},
  197. {"Commerce", {1323.90,-1842.20,-89.00,1701.90,-1722.20,110.90}},
  198. {"Commerce", {1323.90,-1722.20,-89.00,1440.90,-1577.50,110.90}},
  199. {"Commerce", {1370.80,-1577.50,-89.00,1463.90,-1384.90,110.90}},
  200. {"Commerce", {1463.90,-1577.50,-89.00,1667.90,-1430.80,110.90}},
  201. {"Commerce", {1583.50,-1722.20,-89.00,1758.90,-1577.50,110.90}},
  202. {"Commerce", {1667.90,-1577.50,-89.00,1812.60,-1430.80,110.90}},
  203. {"Conference Center", {1046.10,-1804.20,-89.00,1323.90,-1722.20,110.90}},
  204. {"Conference Center", {1073.20,-1842.20,-89.00,1323.90,-1804.20,110.90}},
  205. {"Cranberry Station", {-2007.80,56.30,0.00,-1922.00,224.70,100.00}},
  206. {"Creek", {2749.90,1937.20,-89.00,2921.60,2669.70,110.90}},
  207. {"Dillimore", {580.70,-674.80,-9.50,861.00,-404.70,200.00}},
  208. {"Doherty", {-2270.00,-324.10,-0.00,-1794.90,-222.50,200.00}},
  209. {"Doherty", {-2173.00,-222.50,-0.00,-1794.90,265.20,200.00}},
  210. {"Downtown", {-1982.30,744.10,-6.10,-1871.70,1274.20,200.00}},
  211. {"Downtown", {-1871.70,1176.40,-4.50,-1620.30,1274.20,200.00}},
  212. {"Downtown", {-1700.00,744.20,-6.10,-1580.00,1176.50,200.00}},
  213. {"Downtown", {-1580.00,744.20,-6.10,-1499.80,1025.90,200.00}},
  214. {"Downtown", {-2078.60,578.30,-7.60,-1499.80,744.20,200.00}},
  215. {"Downtown", {-1993.20,265.20,-9.10,-1794.90,578.30,200.00}},
  216. {"Downtown Los Santos", {1463.90,-1430.80,-89.00,1724.70,-1290.80,110.90}},
  217. {"Downtown Los Santos", {1724.70,-1430.80,-89.00,1812.60,-1250.90,110.90}},
  218. {"Downtown Los Santos", {1463.90,-1290.80,-89.00,1724.70,-1150.80,110.90}},
  219. {"Downtown Los Santos", {1370.80,-1384.90,-89.00,1463.90,-1170.80,110.90}},
  220. {"Downtown Los Santos", {1724.70,-1250.90,-89.00,1812.60,-1150.80,110.90}},
  221. {"Downtown Los Santos", {1370.80,-1170.80,-89.00,1463.90,-1130.80,110.90}},
  222. {"Downtown Los Santos", {1378.30,-1130.80,-89.00,1463.90,-1026.30,110.90}},
  223. {"Downtown Los Santos", {1391.00,-1026.30,-89.00,1463.90,-926.90,110.90}},
  224. {"Downtown Los Santos", {1507.50,-1385.20,110.90,1582.50,-1325.30,335.90}},
  225. {"East Beach", {2632.80,-1852.80,-89.00,2959.30,-1668.10,110.90}},
  226. {"East Beach", {2632.80,-1668.10,-89.00,2747.70,-1393.40,110.90}},
  227. {"East Beach", {2747.70,-1668.10,-89.00,2959.30,-1498.60,110.90}},
  228. {"East Beach", {2747.70,-1498.60,-89.00,2959.30,-1120.00,110.90}},
  229. {"East Los Santos", {2421.00,-1628.50,-89.00,2632.80,-1454.30,110.90}},
  230. {"East Los Santos", {2222.50,-1628.50,-89.00,2421.00,-1494.00,110.90}},
  231. {"East Los Santos", {2266.20,-1494.00,-89.00,2381.60,-1372.00,110.90}},
  232. {"East Los Santos", {2381.60,-1494.00,-89.00,2421.00,-1454.30,110.90}},
  233. {"East Los Santos", {2281.40,-1372.00,-89.00,2381.60,-1135.00,110.90}},
  234. {"East Los Santos", {2381.60,-1454.30,-89.00,2462.10,-1135.00,110.90}},
  235. {"East Los Santos", {2462.10,-1454.30,-89.00,2581.70,-1135.00,110.90}},
  236. {"Easter Basin", {-1794.90,249.90,-9.10,-1242.90,578.30,200.00}},
  237. {"Easter Basin", {-1794.90,-50.00,-0.00,-1499.80,249.90,200.00}},
  238. {"Easter Bay Airport", {-1499.80,-50.00,-0.00,-1242.90,249.90,200.00}},
  239. {"Easter Bay Airport", {-1794.90,-730.10,-3.00,-1213.90,-50.00,200.00}},
  240. {"Easter Bay Airport", {-1213.90,-730.10,0.00,-1132.80,-50.00,200.00}},
  241. {"Easter Bay Airport", {-1242.90,-50.00,0.00,-1213.90,578.30,200.00}},
  242. {"Easter Bay Airport", {-1213.90,-50.00,-4.50,-947.90,578.30,200.00}},
  243. {"Easter Bay Airport", {-1315.40,-405.30,15.40,-1264.40,-209.50,25.40}},
  244. {"Easter Bay Airport", {-1354.30,-287.30,15.40,-1315.40,-209.50,25.40}},
  245. {"Easter Bay Airport", {-1490.30,-209.50,15.40,-1264.40,-148.30,25.40}},
  246. {"Easter Bay Chemicals", {-1132.80,-768.00,0.00,-956.40,-578.10,200.00}},
  247. {"Easter Bay Chemicals", {-1132.80,-787.30,0.00,-956.40,-768.00,200.00}},
  248. {"El Castillo del Diablo", {-464.50,2217.60,0.00,-208.50,2580.30,200.00}},
  249. {"El Castillo del Diablo", {-208.50,2123.00,-7.60,114.00,2337.10,200.00}},
  250. {"El Castillo del Diablo", {-208.50,2337.10,0.00,8.40,2487.10,200.00}},
  251. {"El Corona", {1812.60,-2179.20,-89.00,1970.60,-1852.80,110.90}},
  252. {"El Corona", {1692.60,-2179.20,-89.00,1812.60,-1842.20,110.90}},
  253. {"El Quebrados", {-1645.20,2498.50,0.00,-1372.10,2777.80,200.00}},
  254. {"Esplanade East", {-1620.30,1176.50,-4.50,-1580.00,1274.20,200.00}},
  255. {"Esplanade East", {-1580.00,1025.90,-6.10,-1499.80,1274.20,200.00}},
  256. {"Esplanade East", {-1499.80,578.30,-79.60,-1339.80,1274.20,20.30}},
  257. {"Esplanade North", {-2533.00,1358.90,-4.50,-1996.60,1501.20,200.00}},
  258. {"Esplanade North", {-1996.60,1358.90,-4.50,-1524.20,1592.50,200.00}},
  259. {"Esplanade North", {-1982.30,1274.20,-4.50,-1524.20,1358.90,200.00}},
  260. {"Fallen Tree", {-792.20,-698.50,-5.30,-452.40,-380.00,200.00}},
  261. {"Fallow Bridge", {434.30,366.50,0.00,603.00,555.60,200.00}},
  262. {"Fern Ridge", {508.10,-139.20,0.00,1306.60,119.50,200.00}},
  263. {"Financial", {-1871.70,744.10,-6.10,-1701.30,1176.40,300.00}},
  264. {"Fisher's Lagoon", {1916.90,-233.30,-100.00,2131.70,13.80,200.00}},
  265. {"Flint Intersection", {-187.70,-1596.70,-89.00,17.00,-1276.60,110.90}},
  266. {"Flint Range", {-594.10,-1648.50,0.00,-187.70,-1276.60,200.00}},
  267. {"Fort Carson", {-376.20,826.30,-3.00,123.70,1220.40,200.00}},
  268. {"Foster Valley", {-2270.00,-430.20,-0.00,-2178.60,-324.10,200.00}},
  269. {"Foster Valley", {-2178.60,-599.80,-0.00,-1794.90,-324.10,200.00}},
  270. {"Foster Valley", {-2178.60,-1115.50,0.00,-1794.90,-599.80,200.00}},
  271. {"Foster Valley", {-2178.60,-1250.90,0.00,-1794.90,-1115.50,200.00}},
  272. {"Frederick Bridge", {2759.20,296.50,0.00,2774.20,594.70,200.00}},
  273. {"Gant Bridge", {-2741.40,1659.60,-6.10,-2616.40,2175.10,200.00}},
  274. {"Gant Bridge", {-2741.00,1490.40,-6.10,-2616.40,1659.60,200.00}},
  275. {"Ganton", {2222.50,-1852.80,-89.00,2632.80,-1722.30,110.90}},
  276. {"Ganton", {2222.50,-1722.30,-89.00,2632.80,-1628.50,110.90}},
  277. {"Garcia", {-2411.20,-222.50,-0.00,-2173.00,265.20,200.00}},
  278. {"Garcia", {-2395.10,-222.50,-5.30,-2354.00,-204.70,200.00}},
  279. {"Garver Bridge", {-1339.80,828.10,-89.00,-1213.90,1057.00,110.90}},
  280. {"Garver Bridge", {-1213.90,950.00,-89.00,-1087.90,1178.90,110.90}},
  281. {"Garver Bridge", {-1499.80,696.40,-179.60,-1339.80,925.30,20.30}},
  282. {"Glen Park", {1812.60,-1449.60,-89.00,1996.90,-1350.70,110.90}},
  283. {"Glen Park", {1812.60,-1100.80,-89.00,1994.30,-973.30,110.90}},
  284. {"Glen Park", {1812.60,-1350.70,-89.00,2056.80,-1100.80,110.90}},
  285. {"Green Palms", {176.50,1305.40,-3.00,338.60,1520.70,200.00}},
  286. {"Greenglass College", {964.30,1044.60,-89.00,1197.30,1203.20,110.90}},
  287. {"Greenglass College", {964.30,930.80,-89.00,1166.50,1044.60,110.90}},
  288. {"Hampton Barns", {603.00,264.30,0.00,761.90,366.50,200.00}},
  289. {"Hankypanky Point", {2576.90,62.10,0.00,2759.20,385.50,200.00}},
  290. {"Harry Gold Parkway", {1777.30,863.20,-89.00,1817.30,2342.80,110.90}},
  291. {"Hashbury", {-2593.40,-222.50,-0.00,-2411.20,54.70,200.00}},
  292. {"Hilltop Farm", {967.30,-450.30,-3.00,1176.70,-217.90,200.00}},
  293. {"Hunter Quarry", {337.20,710.80,-115.20,860.50,1031.70,203.70}},
  294. {"Idlewood", {1812.60,-1852.80,-89.00,1971.60,-1742.30,110.90}},
  295. {"Idlewood", {1812.60,-1742.30,-89.00,1951.60,-1602.30,110.90}},
  296. {"Idlewood", {1951.60,-1742.30,-89.00,2124.60,-1602.30,110.90}},
  297. {"Idlewood", {1812.60,-1602.30,-89.00,2124.60,-1449.60,110.90}},
  298. {"Idlewood", {2124.60,-1742.30,-89.00,2222.50,-1494.00,110.90}},
  299. {"Idlewood", {1971.60,-1852.80,-89.00,2222.50,-1742.30,110.90}},
  300. {"Jefferson", {1996.90,-1449.60,-89.00,2056.80,-1350.70,110.90}},
  301. {"Jefferson", {2124.60,-1494.00,-89.00,2266.20,-1449.60,110.90}},
  302. {"Jefferson", {2056.80,-1372.00,-89.00,2281.40,-1210.70,110.90}},
  303. {"Jefferson", {2056.80,-1210.70,-89.00,2185.30,-1126.30,110.90}},
  304. {"Jefferson", {2185.30,-1210.70,-89.00,2281.40,-1154.50,110.90}},
  305. {"Jefferson", {2056.80,-1449.60,-89.00,2266.20,-1372.00,110.90}},
  306. {"Julius Thruway East", {2623.10,943.20,-89.00,2749.90,1055.90,110.90}},
  307. {"Julius Thruway East", {2685.10,1055.90,-89.00,2749.90,2626.50,110.90}},
  308. {"Julius Thruway East", {2536.40,2442.50,-89.00,2685.10,2542.50,110.90}},
  309. {"Julius Thruway East", {2625.10,2202.70,-89.00,2685.10,2442.50,110.90}},
  310. {"Julius Thruway North", {2498.20,2542.50,-89.00,2685.10,2626.50,110.90}},
  311. {"Julius Thruway North", {2237.40,2542.50,-89.00,2498.20,2663.10,110.90}},
  312. {"Julius Thruway North", {2121.40,2508.20,-89.00,2237.40,2663.10,110.90}},
  313. {"Julius Thruway North", {1938.80,2508.20,-89.00,2121.40,2624.20,110.90}},
  314. {"Julius Thruway North", {1534.50,2433.20,-89.00,1848.40,2583.20,110.90}},
  315. {"Julius Thruway North", {1848.40,2478.40,-89.00,1938.80,2553.40,110.90}},
  316. {"Julius Thruway North", {1704.50,2342.80,-89.00,1848.40,2433.20,110.90}},
  317. {"Julius Thruway North", {1377.30,2433.20,-89.00,1534.50,2507.20,110.90}},
  318. {"Julius Thruway South", {1457.30,823.20,-89.00,2377.30,863.20,110.90}},
  319. {"Julius Thruway South", {2377.30,788.80,-89.00,2537.30,897.90,110.90}},
  320. {"Julius Thruway West", {1197.30,1163.30,-89.00,1236.60,2243.20,110.90}},
  321. {"Julius Thruway West", {1236.60,2142.80,-89.00,1297.40,2243.20,110.90}},
  322. {"Juniper Hill", {-2533.00,578.30,-7.60,-2274.10,968.30,200.00}},
  323. {"Juniper Hollow", {-2533.00,968.30,-6.10,-2274.10,1358.90,200.00}},
  324. {"K.A.C.C. Military Fuels", {2498.20,2626.50,-89.00,2749.90,2861.50,110.90}},
  325. {"Kincaid Bridge", {-1339.80,599.20,-89.00,-1213.90,828.10,110.90}},
  326. {"Kincaid Bridge", {-1213.90,721.10,-89.00,-1087.90,950.00,110.90}},
  327. {"Kincaid Bridge", {-1087.90,855.30,-89.00,-961.90,986.20,110.90}},
  328. {"King's", {-2329.30,458.40,-7.60,-1993.20,578.30,200.00}},
  329. {"King's", {-2411.20,265.20,-9.10,-1993.20,373.50,200.00}},
  330. {"King's", {-2253.50,373.50,-9.10,-1993.20,458.40,200.00}},
  331. {"LVA Freight Depot", {1457.30,863.20,-89.00,1777.40,1143.20,110.90}},
  332. {"LVA Freight Depot", {1375.60,919.40,-89.00,1457.30,1203.20,110.90}},
  333. {"LVA Freight Depot", {1277.00,1087.60,-89.00,1375.60,1203.20,110.90}},
  334. {"LVA Freight Depot", {1315.30,1044.60,-89.00,1375.60,1087.60,110.90}},
  335. {"LVA Freight Depot", {1236.60,1163.40,-89.00,1277.00,1203.20,110.90}},
  336. {"Las Barrancas", {-926.10,1398.70,-3.00,-719.20,1634.60,200.00}},
  337. {"Las Brujas", {-365.10,2123.00,-3.00,-208.50,2217.60,200.00}},
  338. {"Las Colinas", {1994.30,-1100.80,-89.00,2056.80,-920.80,110.90}},
  339. {"Las Colinas", {2056.80,-1126.30,-89.00,2126.80,-920.80,110.90}},
  340. {"Las Colinas", {2185.30,-1154.50,-89.00,2281.40,-934.40,110.90}},
  341. {"Las Colinas", {2126.80,-1126.30,-89.00,2185.30,-934.40,110.90}},
  342. {"Las Colinas", {2747.70,-1120.00,-89.00,2959.30,-945.00,110.90}},
  343. {"Las Colinas", {2632.70,-1135.00,-89.00,2747.70,-945.00,110.90}},
  344. {"Las Colinas", {2281.40,-1135.00,-89.00,2632.70,-945.00,110.90}},
  345. {"Las Payasadas", {-354.30,2580.30,2.00,-133.60,2816.80,200.00}},
  346. {"Las Venturas Airport", {1236.60,1203.20,-89.00,1457.30,1883.10,110.90}},
  347. {"Las Venturas Airport", {1457.30,1203.20,-89.00,1777.30,1883.10,110.90}},
  348. {"Las Venturas Airport", {1457.30,1143.20,-89.00,1777.40,1203.20,110.90}},
  349. {"Las Venturas Airport", {1515.80,1586.40,-12.50,1729.90,1714.50,87.50}},
  350. {"Last Dime Motel", {1823.00,596.30,-89.00,1997.20,823.20,110.90}},
  351. {"Leafy Hollow", {-1166.90,-1856.00,0.00,-815.60,-1602.00,200.00}},
  352. {"Liberty City", {-1000.00,400.00,1300.00,-700.00,600.00,1400.00}},
  353. {"Lil' Probe Inn", {-90.20,1286.80,-3.00,153.80,1554.10,200.00}},
  354. {"Linden Side", {2749.90,943.20,-89.00,2923.30,1198.90,110.90}},
  355. {"Linden Station", {2749.90,1198.90,-89.00,2923.30,1548.90,110.90}},
  356. {"Linden Station", {2811.20,1229.50,-39.50,2861.20,1407.50,60.40}},
  357. {"Little Mexico", {1701.90,-1842.20,-89.00,1812.60,-1722.20,110.90}},
  358. {"Little Mexico", {1758.90,-1722.20,-89.00,1812.60,-1577.50,110.90}},
  359. {"Los Flores", {2581.70,-1454.30,-89.00,2632.80,-1393.40,110.90}},
  360. {"Los Flores", {2581.70,-1393.40,-89.00,2747.70,-1135.00,110.90}},
  361. {"Los Santos International", {1249.60,-2394.30,-89.00,1852.00,-2179.20,110.90}},
  362. {"Los Santos International", {1852.00,-2394.30,-89.00,2089.00,-2179.20,110.90}},
  363. {"Los Santos International", {1382.70,-2730.80,-89.00,2201.80,-2394.30,110.90}},
  364. {"Los Santos International", {1974.60,-2394.30,-39.00,2089.00,-2256.50,60.90}},
  365. {"Los Santos International", {1400.90,-2669.20,-39.00,2189.80,-2597.20,60.90}},
  366. {"Los Santos International", {2051.60,-2597.20,-39.00,2152.40,-2394.30,60.90}},
  367. {"Marina", {647.70,-1804.20,-89.00,851.40,-1577.50,110.90}},
  368. {"Marina", {647.70,-1577.50,-89.00,807.90,-1416.20,110.90}},
  369. {"Marina", {807.90,-1577.50,-89.00,926.90,-1416.20,110.90}},
  370. {"Market", {787.40,-1416.20,-89.00,1072.60,-1310.20,110.90}},
  371. {"Market", {952.60,-1310.20,-89.00,1072.60,-1130.80,110.90}},
  372. {"Market", {1072.60,-1416.20,-89.00,1370.80,-1130.80,110.90}},
  373. {"Market", {926.90,-1577.50,-89.00,1370.80,-1416.20,110.90}},
  374. {"Market Station", {787.40,-1410.90,-34.10,866.00,-1310.20,65.80}},
  375. {"Martin Bridge", {-222.10,293.30,0.00,-122.10,476.40,200.00}},
  376. {"Missionary Hill", {-2994.40,-811.20,0.00,-2178.60,-430.20,200.00}},
  377. {"Montgomery", {1119.50,119.50,-3.00,1451.40,493.30,200.00}},
  378. {"Montgomery", {1451.40,347.40,-6.10,1582.40,420.80,200.00}},
  379. {"Montgomery Intersection", {1546.60,208.10,0.00,1745.80,347.40,200.00}},
  380. {"Montgomery Intersection", {1582.40,347.40,0.00,1664.60,401.70,200.00}},
  381. {"Mulholland", {1414.00,-768.00,-89.00,1667.60,-452.40,110.90}},
  382. {"Mulholland", {1281.10,-452.40,-89.00,1641.10,-290.90,110.90}},
  383. {"Mulholland", {1269.10,-768.00,-89.00,1414.00,-452.40,110.90}},
  384. {"Mulholland", {1357.00,-926.90,-89.00,1463.90,-768.00,110.90}},
  385. {"Mulholland", {1318.10,-910.10,-89.00,1357.00,-768.00,110.90}},
  386. {"Mulholland", {1169.10,-910.10,-89.00,1318.10,-768.00,110.90}},
  387. {"Mulholland", {768.60,-954.60,-89.00,952.60,-860.60,110.90}},
  388. {"Mulholland", {687.80,-860.60,-89.00,911.80,-768.00,110.90}},
  389. {"Mulholland", {737.50,-768.00,-89.00,1142.20,-674.80,110.90}},
  390. {"Mulholland", {1096.40,-910.10,-89.00,1169.10,-768.00,110.90}},
  391. {"Mulholland", {952.60,-937.10,-89.00,1096.40,-860.60,110.90}},
  392. {"Mulholland", {911.80,-860.60,-89.00,1096.40,-768.00,110.90}},
  393. {"Mulholland", {861.00,-674.80,-89.00,1156.50,-600.80,110.90}},
  394. {"Mulholland Intersection", {1463.90,-1150.80,-89.00,1812.60,-768.00,110.90}},
  395. {"North Rock", {2285.30,-768.00,0.00,2770.50,-269.70,200.00}},
  396. {"Ocean Docks", {2373.70,-2697.00,-89.00,2809.20,-2330.40,110.90}},
  397. {"Ocean Docks", {2201.80,-2418.30,-89.00,2324.00,-2095.00,110.90}},
  398. {"Ocean Docks", {2324.00,-2302.30,-89.00,2703.50,-2145.10,110.90}},
  399. {"Ocean Docks", {2089.00,-2394.30,-89.00,2201.80,-2235.80,110.90}},
  400. {"Ocean Docks", {2201.80,-2730.80,-89.00,2324.00,-2418.30,110.90}},
  401. {"Ocean Docks", {2703.50,-2302.30,-89.00,2959.30,-2126.90,110.90}},
  402. {"Ocean Docks", {2324.00,-2145.10,-89.00,2703.50,-2059.20,110.90}},
  403. {"Ocean Flats", {-2994.40,277.40,-9.10,-2867.80,458.40,200.00}},
  404. {"Ocean Flats", {-2994.40,-222.50,-0.00,-2593.40,277.40,200.00}},
  405. {"Ocean Flats", {-2994.40,-430.20,-0.00,-2831.80,-222.50,200.00}},
  406. {"Octane Springs", {338.60,1228.50,0.00,664.30,1655.00,200.00}},
  407. {"Old Venturas Strip", {2162.30,2012.10,-89.00,2685.10,2202.70,110.90}},
  408. {"Palisades", {-2994.40,458.40,-6.10,-2741.00,1339.60,200.00}},
  409. {"Palomino Creek", {2160.20,-149.00,0.00,2576.90,228.30,200.00}},
  410. {"Paradiso", {-2741.00,793.40,-6.10,-2533.00,1268.40,200.00}},
  411. {"Pershing Square", {1440.90,-1722.20,-89.00,1583.50,-1577.50,110.90}},
  412. {"Pilgrim", {2437.30,1383.20,-89.00,2624.40,1783.20,110.90}},
  413. {"Pilgrim", {2624.40,1383.20,-89.00,2685.10,1783.20,110.90}},
  414. {"Pilson Intersection", {1098.30,2243.20,-89.00,1377.30,2507.20,110.90}},
  415. {"Pirates in Men's Pants", {1817.30,1469.20,-89.00,2027.40,1703.20,110.90}},
  416. {"Playa del Seville", {2703.50,-2126.90,-89.00,2959.30,-1852.80,110.90}},
  417. {"Prickle Pine", {1534.50,2583.20,-89.00,1848.40,2863.20,110.90}},
  418. {"Prickle Pine", {1117.40,2507.20,-89.00,1534.50,2723.20,110.90}},
  419. {"Prickle Pine", {1848.40,2553.40,-89.00,1938.80,2863.20,110.90}},
  420. {"Prickle Pine", {1938.80,2624.20,-89.00,2121.40,2861.50,110.90}},
  421. {"Queens", {-2533.00,458.40,0.00,-2329.30,578.30,200.00}},
  422. {"Queens", {-2593.40,54.70,0.00,-2411.20,458.40,200.00}},
  423. {"Queens", {-2411.20,373.50,0.00,-2253.50,458.40,200.00}},
  424. {"Randolph Industrial Estate", {1558.00,596.30,-89.00,1823.00,823.20,110.90}},
  425. {"Redsands East", {1817.30,2011.80,-89.00,2106.70,2202.70,110.90}},
  426. {"Redsands East", {1817.30,2202.70,-89.00,2011.90,2342.80,110.90}},
  427. {"Redsands East", {1848.40,2342.80,-89.00,2011.90,2478.40,110.90}},
  428. {"Redsands West", {1236.60,1883.10,-89.00,1777.30,2142.80,110.90}},
  429. {"Redsands West", {1297.40,2142.80,-89.00,1777.30,2243.20,110.90}},
  430. {"Redsands West", {1377.30,2243.20,-89.00,1704.50,2433.20,110.90}},
  431. {"Redsands West", {1704.50,2243.20,-89.00,1777.30,2342.80,110.90}},
  432. {"Regular Tom", {-405.70,1712.80,-3.00,-276.70,1892.70,200.00}},
  433. {"Richman", {647.50,-1118.20,-89.00,787.40,-954.60,110.90}},
  434. {"Richman", {647.50,-954.60,-89.00,768.60,-860.60,110.90}},
  435. {"Richman", {225.10,-1369.60,-89.00,334.50,-1292.00,110.90}},
  436. {"Richman", {225.10,-1292.00,-89.00,466.20,-1235.00,110.90}},
  437. {"Richman", {72.60,-1404.90,-89.00,225.10,-1235.00,110.90}},
  438. {"Richman", {72.60,-1235.00,-89.00,321.30,-1008.10,110.90}},
  439. {"Richman", {321.30,-1235.00,-89.00,647.50,-1044.00,110.90}},
  440. {"Richman", {321.30,-1044.00,-89.00,647.50,-860.60,110.90}},
  441. {"Richman", {321.30,-860.60,-89.00,687.80,-768.00,110.90}},
  442. {"Richman", {321.30,-768.00,-89.00,700.70,-674.80,110.90}},
  443. {"Robada Intersection", {-1119.00,1178.90,-89.00,-862.00,1351.40,110.90}},
  444. {"Roca Escalante", {2237.40,2202.70,-89.00,2536.40,2542.50,110.90}},
  445. {"Roca Escalante", {2536.40,2202.70,-89.00,2625.10,2442.50,110.90}},
  446. {"Rockshore East", {2537.30,676.50,-89.00,2902.30,943.20,110.90}},
  447. {"Rockshore West", {1997.20,596.30,-89.00,2377.30,823.20,110.90}},
  448. {"Rockshore West", {2377.30,596.30,-89.00,2537.30,788.80,110.90}},
  449. {"Rodeo", {72.60,-1684.60,-89.00,225.10,-1544.10,110.90}},
  450. {"Rodeo", {72.60,-1544.10,-89.00,225.10,-1404.90,110.90}},
  451. {"Rodeo", {225.10,-1684.60,-89.00,312.80,-1501.90,110.90}},
  452. {"Rodeo", {225.10,-1501.90,-89.00,334.50,-1369.60,110.90}},
  453. {"Rodeo", {334.50,-1501.90,-89.00,422.60,-1406.00,110.90}},
  454. {"Rodeo", {312.80,-1684.60,-89.00,422.60,-1501.90,110.90}},
  455. {"Rodeo", {422.60,-1684.60,-89.00,558.00,-1570.20,110.90}},
  456. {"Rodeo", {558.00,-1684.60,-89.00,647.50,-1384.90,110.90}},
  457. {"Rodeo", {466.20,-1570.20,-89.00,558.00,-1385.00,110.90}},
  458. {"Rodeo", {422.60,-1570.20,-89.00,466.20,-1406.00,110.90}},
  459. {"Rodeo", {466.20,-1385.00,-89.00,647.50,-1235.00,110.90}},
  460. {"Rodeo", {334.50,-1406.00,-89.00,466.20,-1292.00,110.90}},
  461. {"Royal Casino", {2087.30,1383.20,-89.00,2437.30,1543.20,110.90}},
  462. {"San Andreas Sound", {2450.30,385.50,-100.00,2759.20,562.30,200.00}},
  463. {"Santa Flora", {-2741.00,458.40,-7.60,-2533.00,793.40,200.00}},
  464. {"Santa Maria Beach", {342.60,-2173.20,-89.00,647.70,-1684.60,110.90}},
  465. {"Santa Maria Beach", {72.60,-2173.20,-89.00,342.60,-1684.60,110.90}},
  466. {"Shady Cabin", {-1632.80,-2263.40,-3.00,-1601.30,-2231.70,200.00}},
  467. {"Shady Creeks", {-1820.60,-2643.60,-8.00,-1226.70,-1771.60,200.00}},
  468. {"Shady Creeks", {-2030.10,-2174.80,-6.10,-1820.60,-1771.60,200.00}},
  469. {"Sobell Rail Yards", {2749.90,1548.90,-89.00,2923.30,1937.20,110.90}},
  470. {"Spinybed", {2121.40,2663.10,-89.00,2498.20,2861.50,110.90}},
  471. {"Starfish Casino", {2437.30,1783.20,-89.00,2685.10,2012.10,110.90}},
  472. {"Starfish Casino", {2437.30,1858.10,-39.00,2495.00,1970.80,60.90}},
  473. {"Starfish Casino", {2162.30,1883.20,-89.00,2437.30,2012.10,110.90}},
  474. {"Temple", {1252.30,-1130.80,-89.00,1378.30,-1026.30,110.90}},
  475. {"Temple", {1252.30,-1026.30,-89.00,1391.00,-926.90,110.90}},
  476. {"Temple", {1252.30,-926.90,-89.00,1357.00,-910.10,110.90}},
  477. {"Temple", {952.60,-1130.80,-89.00,1096.40,-937.10,110.90}},
  478. {"Temple", {1096.40,-1130.80,-89.00,1252.30,-1026.30,110.90}},
  479. {"Temple", {1096.40,-1026.30,-89.00,1252.30,-910.10,110.90}},
  480. {"The Camel's Toe", {2087.30,1203.20,-89.00,2640.40,1383.20,110.90}},
  481. {"The Clown's Pocket", {2162.30,1783.20,-89.00,2437.30,1883.20,110.90}},
  482. {"The Emerald Isle", {2011.90,2202.70,-89.00,2237.40,2508.20,110.90}},
  483. {"The Farm", {-1209.60,-1317.10,114.90,-908.10,-787.30,251.90}},
  484. {"The Four Dragons Casino", {1817.30,863.20,-89.00,2027.30,1083.20,110.90}},
  485. {"The High Roller", {1817.30,1283.20,-89.00,2027.30,1469.20,110.90}},
  486. {"The Mako Span", {1664.60,401.70,0.00,1785.10,567.20,200.00}},
  487. {"The Panopticon", {-947.90,-304.30,-1.10,-319.60,327.00,200.00}},
  488. {"The Pink Swan", {1817.30,1083.20,-89.00,2027.30,1283.20,110.90}},
  489. {"The Sherman Dam", {-968.70,1929.40,-3.00,-481.10,2155.20,200.00}},
  490. {"The Strip", {2027.40,863.20,-89.00,2087.30,1703.20,110.90}},
  491. {"The Strip", {2106.70,1863.20,-89.00,2162.30,2202.70,110.90}},
  492. {"The Strip", {2027.40,1783.20,-89.00,2162.30,1863.20,110.90}},
  493. {"The Strip", {2027.40,1703.20,-89.00,2137.40,1783.20,110.90}},
  494. {"The Visage", {1817.30,1863.20,-89.00,2106.70,2011.80,110.90}},
  495. {"The Visage", {1817.30,1703.20,-89.00,2027.40,1863.20,110.90}},
  496. {"Unity Station", {1692.60,-1971.80,-20.40,1812.60,-1932.80,79.50}},
  497. {"Valle Ocultado", {-936.60,2611.40,2.00,-715.90,2847.90,200.00}},
  498. {"Verdant Bluffs", {930.20,-2488.40,-89.00,1249.60,-2006.70,110.90}},
  499. {"Verdant Bluffs", {1073.20,-2006.70,-89.00,1249.60,-1842.20,110.90}},
  500. {"Verdant Bluffs", {1249.60,-2179.20,-89.00,1692.60,-1842.20,110.90}},
  501. {"Verdant Meadows", {37.00,2337.10,-3.00,435.90,2677.90,200.00}},
  502. {"Verona Beach", {647.70,-2173.20,-89.00,930.20,-1804.20,110.90}},
  503. {"Verona Beach", {930.20,-2006.70,-89.00,1073.20,-1804.20,110.90}},
  504. {"Verona Beach", {851.40,-1804.20,-89.00,1046.10,-1577.50,110.90}},
  505. {"Verona Beach", {1161.50,-1722.20,-89.00,1323.90,-1577.50,110.90}},
  506. {"Verona Beach", {1046.10,-1722.20,-89.00,1161.50,-1577.50,110.90}},
  507. {"Vinewood", {787.40,-1310.20,-89.00,952.60,-1130.80,110.90}},
  508. {"Vinewood", {787.40,-1130.80,-89.00,952.60,-954.60,110.90}},
  509. {"Vinewood", {647.50,-1227.20,-89.00,787.40,-1118.20,110.90}},
  510. {"Vinewood", {647.70,-1416.20,-89.00,787.40,-1227.20,110.90}},
  511. {"Whitewood Estates", {883.30,1726.20,-89.00,1098.30,2507.20,110.90}},
  512. {"Whitewood Estates", {1098.30,1726.20,-89.00,1197.30,2243.20,110.90}},
  513. {"Willowfield", {1970.60,-2179.20,-89.00,2089.00,-1852.80,110.90}},
  514. {"Willowfield", {2089.00,-2235.80,-89.00,2201.80,-1989.90,110.90}},
  515. {"Willowfield", {2089.00,-1989.90,-89.00,2324.00,-1852.80,110.90}},
  516. {"Willowfield", {2201.80,-2095.00,-89.00,2324.00,-1989.90,110.90}},
  517. {"Willowfield", {2541.70,-1941.40,-89.00,2703.50,-1852.80,110.90}},
  518. {"Willowfield", {2324.00,-2059.20,-89.00,2541.70,-1852.80,110.90}},
  519. {"Willowfield", {2541.70,-2059.20,-89.00,2703.50,-1941.40,110.90}},
  520. {"Yellow Bell Station", {1377.40,2600.40,-21.90,1492.40,2687.30,78.00}},
  521. {"Los Santos", {44.60,-2892.90,-242.90,2997.00,-768.00,900.00}},
  522. {"Las Venturas", {869.40,596.30,-242.90,2997.00,2993.80,900.00}},
  523. {"Bone County", {-480.50,596.30,-242.90,869.40,2993.80,900.00}},
  524. {"Tierra Robada", {-2997.40,1659.60,-242.90,-480.50,2993.80,900.00}},
  525. {"Tierra Robada", {-1213.90,596.30,-242.90,-480.50,1659.60,900.00}},
  526. {"San Fierro", {-2997.40,-1115.50,-242.90,-1213.90,1659.60,900.00}},
  527. {"Red County", {-1213.90,-768.00,-242.90,2997.00,596.30,900.00}},
  528. {"Flint County", {-1213.90,-2892.90,-242.90,44.60,-768.00,900.00}},
  529. {"Whetstone", {-2997.40,-2892.90,-242.90,-1213.90,-1115.50,900.00}}
  530. };
  531. GetZoneName(Float: x, Float: y, Float: z)
  532. {
  533. new zone[28];
  534. for(new i = 0; i < sizeof(SAZones); i++)
  535. {
  536. if(x >= SAZones[i][SAZONE_AREA][0] && x <= SAZones[i][SAZONE_AREA][3] && y >= SAZones[i][SAZONE_AREA][1] && y <= SAZones[i][SAZONE_AREA][4] && z >= SAZones[i][SAZONE_AREA][2] && z <= SAZones[i][SAZONE_AREA][5])
  537. {
  538. strcat(zone, SAZones[i][SAZONE_NAME]);
  539. return zone;
  540. }
  541. }
  542. strcat(zone, "Unknown");
  543. return zone;
  544. }
  545. GetCityName(Float: x, Float: y, Float: z)
  546. {
  547. new city[28];
  548. for(new i = 356; i < sizeof(SAZones); i++)
  549. {
  550. if(x >= SAZones[i][SAZONE_AREA][0] && x <= SAZones[i][SAZONE_AREA][3] && y >= SAZones[i][SAZONE_AREA][1] && y <= SAZones[i][SAZONE_AREA][4] && z >= SAZones[i][SAZONE_AREA][2] && z <= SAZones[i][SAZONE_AREA][5])
  551. {
  552. strcat(city, SAZones[i][SAZONE_NAME]);
  553. return city;
  554. }
  555. }
  556. strcat(city, "San Andreas");
  557. return city;
  558. }
  559. RandomEx(min, max)
  560. return random(max - min) + min;
  561. ReturnPlayerName(playerid)
  562. {
  563. new name[MAX_PLAYER_NAME];
  564. GetPlayerName(playerid, name, sizeof(name));
  565. return name;
  566. }
  567. formatTime(time)
  568. {
  569. // http://forum.sa-mp.com/showpost.php?p=3223897&postcount=11
  570. new string[15];//-2000000000:00 could happen, so make the string 15 chars to avoid any errors
  571. format(string, sizeof(string), "%02d:%02d", time / 60, time % 60);
  572. return string;
  573. }
  574. /* Player Functions */
  575. Halloween_InitPlayer(playerid)
  576. {
  577. #if defined I_WANT_HATS_DAMMIT
  578. SetPlayerAttachedObject(playerid, ATTACH_INDEX, 19528, 2, 0.091, 0.025, 0.0, 0.0, 0.0, -26.1, 1.227, 1.395, 1.4);
  579. #endif
  580. TextDrawShowForPlayer(playerid, HalloweenText);
  581. TextDrawShowForPlayer(playerid, PumpkinIcon);
  582. TextDrawShowForPlayer(playerid, TimerText);
  583. TextDrawShowForPlayer(playerid, TimerIcon);
  584. CandyCount[playerid] = 0;
  585. CandyText[playerid] = CreatePlayerTextDraw(playerid, 499.000000, 98.000000, "000000000");
  586. PlayerTextDrawBackgroundColor(playerid, CandyText[playerid], 255);
  587. PlayerTextDrawFont(playerid, CandyText[playerid], 3);
  588. PlayerTextDrawLetterSize(playerid, CandyText[playerid], 0.580000, 2.199999);
  589. PlayerTextDrawColor(playerid, CandyText[playerid], 0x9158B6FF);
  590. PlayerTextDrawSetOutline(playerid, CandyText[playerid], 1);
  591. PlayerTextDrawSetProportional(playerid, CandyText[playerid], 1);
  592. PlayerTextDrawSetSelectable(playerid, CandyText[playerid], 0);
  593. PlayerTextDrawShow(playerid, CandyText[playerid]);
  594. // load from database
  595. stmt_bind_value(LoadFromTable, 0, DB::TYPE_STRING, ReturnPlayerName(playerid));
  596. stmt_bind_result_field(LoadFromTable, 0, DB::TYPE_INTEGER, CandyCount[playerid]);
  597. if(stmt_execute(LoadFromTable))
  598. {
  599. if(stmt_rows_left(LoadFromTable) > 0) {
  600. stmt_fetch_row(LoadFromTable);
  601. new string[10];
  602. format(string, sizeof(string), "%09d", CandyCount[playerid]);
  603. PlayerTextDrawSetString(playerid, CandyText[playerid], string);
  604. }else{
  605. stmt_bind_value(InsertToTable, 0, DB::TYPE_STRING, ReturnPlayerName(playerid));
  606. stmt_execute(InsertToTable);
  607. }
  608. }
  609. return 1;
  610. }
  611. Halloween_ChangeCandy(playerid, amount)
  612. {
  613. CandyCount[playerid] += amount;
  614. new string[10];
  615. format(string, sizeof(string), "%09d", CandyCount[playerid]);
  616. PlayerTextDrawSetString(playerid, CandyText[playerid], string);
  617. // save to database
  618. stmt_bind_value(SaveToTable, 0, DB::TYPE_INTEGER, CandyCount[playerid]);
  619. stmt_bind_value(SaveToTable, 1, DB::TYPE_STRING, ReturnPlayerName(playerid));
  620. stmt_execute(SaveToTable);
  621. return 1;
  622. }
  623. Halloween_ShowShopMenu(playerid)
  624. {
  625. new string[144];
  626. format(string, sizeof(string), "Item\tPrice\n");
  627. format(string, sizeof(string), "%sMedkit\t{9158B6}C%d\nBody Armor\t{9158B6}C%d\nGift Box\t{2ECC71}$%d {FFFFFF}/ {9158B6}C%d\nWeapons", string, MEDKIT_PRICE, ARMOR_PRICE, GIFT_PRICE, GIFT_PRICE_CANDY);
  628. ShowPlayerDialog(playerid, DIALOG_CANDY_SHOP, DIALOG_STYLE_TABLIST_HEADERS, "Candy Shop", string, "Select", "Cancel");
  629. return 1;
  630. }
  631. Halloween_ShowGiftMenu(playerid)
  632. {
  633. new string[70];
  634. format(string, sizeof(string), "Buy Using Money {2ECC71}($%d)\nBuy Using Candy {9158B6}(C%d)", GIFT_PRICE, GIFT_PRICE_CANDY);
  635. ShowPlayerDialog(playerid, DIALOG_BUY_GIFT, DIALOG_STYLE_LIST, "Candy Shop » {FFFFFF}Gift Box", string, "Buy", "Back");
  636. return 1;
  637. }
  638. Halloween_ShowWeaponsMenu(playerid)
  639. {
  640. new string[256], w_name[32];
  641. format(string, sizeof(string), "Weapon\tAmmo\tPrice\n");
  642. for(new i; i < sizeof(ShopWeapons); i++)
  643. {
  644. GetWeaponName(ShopWeapons[i][WeaponID], w_name, sizeof(w_name));
  645. format(string, sizeof(string), "%s%s\t%d\t{9158B6}C%d\n", string, w_name, ShopWeapons[i][WeaponAmmo], ShopWeapons[i][WeaponPrice]);
  646. }
  647. ShowPlayerDialog(playerid, DIALOG_BUY_WEAPON, DIALOG_STYLE_TABLIST_HEADERS, "Candy Shop » {FFFFFF}Weapons", string, "Buy", "Back");
  648. return 1;
  649. }
  650. #if defined PUMPKIN_DROPS
  651. /* Pumpkin Code */
  652. Halloween_CreatePumpkin(Float: x, Float: y, Float: z, virtualworld, interior)
  653. {
  654. new id = Pumpkin_FindFreeID();
  655. if(id == -1) return -1;
  656. z += 0.15;
  657. PumpkinData[id][PumpkinTimeLeft] = PUMPKIN_LIFETIME;
  658. PumpkinData[id][PumpkinPickup] = CreateDynamicPickup(19320, 1, x, y, z, virtualworld, interior);
  659. Streamer_SetIntData(STREAMER_TYPE_PICKUP, PumpkinData[id][PumpkinPickup], E_STREAMER_EXTRA_ID, id);
  660. new string[50];
  661. format(string, sizeof(string), "Pumpkin\n\n{FFFFFF}It's filled with candy!\n%s", formatTime(PumpkinData[id][PumpkinTimeLeft]));
  662. PumpkinData[id][PumpkinLabel] = CreateDynamic3DTextLabel(string, 0xFFA944FF, x, y, z, 10.0, _, _, 1, virtualworld, interior);
  663. PumpkinData[id][PumpkinTimer] = SetTimerEx("Pumpkin_Countdown", 1000, true, "i", id);
  664. PumpkinData[id][PumpkinExists] = true;
  665. return id;
  666. }
  667. Pumpkin_FindFreeID()
  668. {
  669. for(new i; i < MAX_PUMPKINS; i++) if(!PumpkinData[i][PumpkinExists]) return i;
  670. return -1;
  671. }
  672. Pumpkin_Destroy(id)
  673. {
  674. if(!(0 <= id <= MAX_PUMPKINS) || !PumpkinData[id][PumpkinExists]) return -1;
  675. KillTimer(PumpkinData[id][PumpkinTimer]);
  676. DestroyDynamicPickup(PumpkinData[id][PumpkinPickup]);
  677. DestroyDynamic3DTextLabel(PumpkinData[id][PumpkinLabel]);
  678. PumpkinData[id][PumpkinTimeLeft] = 0;
  679. PumpkinData[id][PumpkinPickup] = PumpkinData[id][PumpkinTimer] = -1;
  680. PumpkinData[id][PumpkinLabel] = Text3D: -1;
  681. PumpkinData[id][PumpkinExists] = false;
  682. return 1;
  683. }
  684. forward Pumpkin_Countdown(id);
  685. public Pumpkin_Countdown(id)
  686. {
  687. new string[50];
  688. if(PumpkinData[id][PumpkinTimeLeft] > 1) {
  689. PumpkinData[id][PumpkinTimeLeft]--;
  690. format(string, sizeof(string), "Pumpkin\n\n{FFFFFF}It's filled with candy!\n%s", formatTime(PumpkinData[id][PumpkinTimeLeft]));
  691. UpdateDynamic3DTextLabelText(PumpkinData[id][PumpkinLabel], 0xFFA944FF, string);
  692. }else if(PumpkinData[id][PumpkinTimeLeft] == 1) {
  693. Pumpkin_Destroy(id);
  694. }
  695. return 1;
  696. }
  697. #endif
  698. /* Gift Box Code */
  699. Halloween_CreateGiftBox(Float: x, Float: y, Float: z, virtualworld, interior)
  700. {
  701. new id = GiftBox_FindFreeID();
  702. if(id == -1) return -1;
  703. z += 0.15;
  704. GiftBoxData[id][GiftBoxX] = x;
  705. GiftBoxData[id][GiftBoxY] = y;
  706. GiftBoxData[id][GiftBoxZ] = z;
  707. GiftBoxData[id][GiftBoxTimeLeft] = GIFT_LIFETIME;
  708. GiftBoxData[id][GiftBoxPickup] = CreateDynamicPickup(19054 + random(5), 1, x, y, z, virtualworld, interior);
  709. Streamer_SetIntData(STREAMER_TYPE_PICKUP, GiftBoxData[id][GiftBoxPickup], E_STREAMER_EXTRA_ID, id);
  710. new string[128];
  711. format(string, sizeof(string), "Gift Box\n\n{FFFFFF}It has a surprise inside!\n%s", formatTime(GiftBoxData[id][GiftBoxTimeLeft]));
  712. GiftBoxData[id][GiftBoxLabel] = CreateDynamic3DTextLabel(string, 0xFFA944FF, x, y, z, 10.0, _, _, 1, virtualworld, interior);
  713. GiftBoxData[id][GiftBoxTimer] = SetTimerEx("GiftBox_Countdown", 1000, true, "i", id);
  714. GiftBoxData[id][GiftBoxExists] = true;
  715. format(string, sizeof(string), "HALLOWEEN: {FFFFFF}A gift box dropped at {FFA944}%s, %s!", GetZoneName(x, y, z), GetCityName(x, y, z));
  716. SendClientMessageToAll(0x9158B6FF, string);
  717. return id;
  718. }
  719. GiftBox_FindFreeID()
  720. {
  721. for(new i; i < MAX_GIFT_BOXES; i++) if(!GiftBoxData[i][GiftBoxExists]) return i;
  722. return -1;
  723. }
  724. GiftBox_Destroy(id)
  725. {
  726. if(!(0 <= id <= MAX_GIFT_BOXES) || !GiftBoxData[id][GiftBoxExists]) return -1;
  727. KillTimer(GiftBoxData[id][GiftBoxTimer]);
  728. DestroyDynamicPickup(GiftBoxData[id][GiftBoxPickup]);
  729. DestroyDynamic3DTextLabel(GiftBoxData[id][GiftBoxLabel]);
  730. GiftBoxData[id][GiftBoxTimeLeft] = 0;
  731. GiftBoxData[id][GiftBoxPickup] = GiftBoxData[id][GiftBoxTimer] = -1;
  732. GiftBoxData[id][GiftBoxLabel] = Text3D: -1;
  733. GiftBoxData[id][GiftBoxExists] = false;
  734. return 1;
  735. }
  736. forward GiftBox_Countdown(id);
  737. public GiftBox_Countdown(id)
  738. {
  739. new string[54];
  740. if(GiftBoxData[id][GiftBoxTimeLeft] > 1) {
  741. GiftBoxData[id][GiftBoxTimeLeft]--;
  742. format(string, sizeof(string), "Gift Box\n\n{FFFFFF}It has a surprise inside!\n%s", formatTime(GiftBoxData[id][GiftBoxTimeLeft]));
  743. UpdateDynamic3DTextLabelText(GiftBoxData[id][GiftBoxLabel], 0xFFA944FF, string);
  744. }else if(GiftBoxData[id][GiftBoxTimeLeft] == 1) {
  745. GiftBox_Destroy(id);
  746. }
  747. return 1;
  748. }
  749. /* Drop Timer */
  750. forward Halloween_GiftDrop();
  751. public Halloween_GiftDrop()
  752. {
  753. if(HalloweenData[DropTimeLeft] > 1) {
  754. HalloweenData[DropTimeLeft]--;
  755. TextDrawSetString(TimerText, formatTime(HalloweenData[DropTimeLeft]));
  756. }else if(HalloweenData[DropTimeLeft] == 1) {
  757. new id;
  758. for(new i; i < GIFT_AMOUNT; i++)
  759. {
  760. id = random(sizeof(GiftBoxCoords));
  761. Halloween_CreateGiftBox(GiftBoxCoords[id][GiftBoxSpawnX], GiftBoxCoords[id][GiftBoxSpawnY], GiftBoxCoords[id][GiftBoxSpawnZ], -1, -1);
  762. }
  763. HalloweenData[DropTimeLeft] = GIFT_INTERVAL;
  764. }
  765. return 1;
  766. }
  767. /* Callbacks */
  768. public OnFilterScriptInit()
  769. {
  770. // database
  771. HalloweenDB = db_open("halloween.db");
  772. db_query(HalloweenDB, "CREATE TABLE IF NOT EXISTS halloween_players (Name TEXT, Candy INTEGER)");
  773. // prepare queries
  774. LoadFromTable = db_prepare(HalloweenDB, "SELECT Candy FROM halloween_players WHERE Name=?");
  775. InsertToTable = db_prepare(HalloweenDB, "INSERT INTO halloween_players (Name) VALUES (?)");
  776. SaveToTable = db_prepare(HalloweenDB, "UPDATE halloween_players SET Candy=? WHERE Name=?");
  777. TopCandies = db_prepare(HalloweenDB, "SELECT * FROM halloween_players ORDER BY Candy DESC LIMIT 15");
  778. // init
  779. HalloweenData[DropTimeLeft] = GIFT_INTERVAL;
  780. HalloweenData[EventTimer] = SetTimer("Halloween_GiftDrop", 1000, true);
  781. for(new i; i < MAX_GIFT_BOXES; i++)
  782. {
  783. GiftBoxData[i][GiftBoxPickup] = GiftBoxData[i][GiftBoxTimer] = -1;
  784. GiftBoxData[i][GiftBoxLabel] = Text3D: -1;
  785. }
  786. for(new i; i < MAX_PUMPKINS; i++)
  787. {
  788. PumpkinData[i][PumpkinPickup] = PumpkinData[i][PumpkinTimer] = -1;
  789. PumpkinData[i][PumpkinLabel] = Text3D: -1;
  790. }
  791. // textdraws
  792. HalloweenText = TextDrawCreate(515.000000, 7.000000, "Happy Halloween!");
  793. TextDrawBackgroundColor(HalloweenText, 255);
  794. TextDrawFont(HalloweenText, 2);
  795. TextDrawLetterSize(HalloweenText, 0.210000, 1.100000);
  796. TextDrawColor(HalloweenText, 0xFF9922FF);
  797. TextDrawSetOutline(HalloweenText, 1);
  798. TextDrawSetProportional(HalloweenText, 1);
  799. TextDrawSetSelectable(HalloweenText, 0);
  800. PumpkinIcon = TextDrawCreate(486.000000, -20.000000, "_");
  801. TextDrawBackgroundColor(PumpkinIcon, 0);
  802. TextDrawFont(PumpkinIcon, 5);
  803. TextDrawLetterSize(PumpkinIcon, 0.210000, 1.100000);
  804. TextDrawColor(PumpkinIcon, -1);
  805. TextDrawSetOutline(PumpkinIcon, 1);
  806. TextDrawSetProportional(PumpkinIcon, 1);
  807. TextDrawUseBox(PumpkinIcon, 1);
  808. TextDrawBoxColor(PumpkinIcon, 255);
  809. TextDrawTextSize(PumpkinIcon, 40.000000, 40.000000);
  810. TextDrawSetPreviewModel(PumpkinIcon, 19320);
  811. TextDrawSetPreviewRot(PumpkinIcon, 0.000000, 0.000000, 0.000000, 0.550000);
  812. TextDrawSetSelectable(PumpkinIcon, 0);
  813. TimerText = TextDrawCreate(557.000000, 28.000000, formatTime(GIFT_INTERVAL));
  814. TextDrawBackgroundColor(TimerText, 255);
  815. TextDrawFont(TimerText, 1);
  816. TextDrawLetterSize(TimerText, 0.190000, 1.000000);
  817. TextDrawColor(TimerText, -1);
  818. TextDrawSetOutline(TimerText, 1);
  819. TextDrawSetProportional(TimerText, 1);
  820. TextDrawSetSelectable(TimerText, 0);
  821. TimerIcon = TextDrawCreate(545.000000, 25.000000, "ld_grav:timer");
  822. TextDrawBackgroundColor(TimerIcon, 255);
  823. TextDrawFont(TimerIcon, 4);
  824. TextDrawLetterSize(TimerIcon, 0.500000, 1.000000);
  825. TextDrawColor(TimerIcon, -1);
  826. TextDrawSetOutline(TimerIcon, 1);
  827. TextDrawSetProportional(TimerIcon, 1);
  828. TextDrawUseBox(TimerIcon, 1);
  829. TextDrawBoxColor(TimerIcon, 255);
  830. TextDrawTextSize(TimerIcon, 11.000000, 13.000000);
  831. TextDrawSetSelectable(TimerIcon, 0);
  832. // load player data
  833. for(new i, maxp = GetPlayerPoolSize(); i <= maxp; i++) if(IsPlayerConnected(i)) Halloween_InitPlayer(i);
  834. return 1;
  835. }
  836. public OnFilterScriptExit()
  837. {
  838. // remove textdraws
  839. TextDrawHideForAll(HalloweenText);
  840. TextDrawHideForAll(PumpkinIcon);
  841. TextDrawHideForAll(TimerText);
  842. TextDrawHideForAll(TimerIcon);
  843. TextDrawDestroy(HalloweenText);
  844. TextDrawDestroy(PumpkinIcon);
  845. TextDrawDestroy(TimerText);
  846. TextDrawDestroy(TimerIcon);
  847. // remove player stuff
  848. for(new i, maxp = GetPlayerPoolSize(); i <= maxp; i++)
  849. {
  850. if(!IsPlayerConnected(i)) continue;
  851. PlayerTextDrawDestroy(i, CandyText[i]);
  852. #if defined I_WANT_HATS_DAMMIT
  853. RemovePlayerAttachedObject(i, ATTACH_INDEX);
  854. #endif
  855. }
  856. // close database
  857. db_close(HalloweenDB);
  858. return 1;
  859. }
  860. public OnPlayerConnect(playerid)
  861. {
  862. // load player data
  863. Halloween_InitPlayer(playerid);
  864. return 1;
  865. }
  866. public OnPlayerDisconnect(playerid, reason)
  867. {
  868. CandyCount[playerid] = 0;
  869. return 1;
  870. }
  871. #if defined I_WANT_HATS_DAMMIT
  872. public OnPlayerSpawn(playerid)
  873. {
  874. SetPlayerAttachedObject(playerid, ATTACH_INDEX, 19528, 2, 0.091, 0.025, 0.0, 0.0, 0.0, -26.1, 1.227, 1.395, 1.4);
  875. return 1;
  876. }
  877. #endif
  878. #if defined PUMPKIN_DROPS
  879. public OnPlayerDeath(playerid, killerid, reason)
  880. {
  881. if(IsPlayerConnected(killerid))
  882. {
  883. new Float: x, Float: y, Float: z;
  884. GetPlayerPos(playerid, x, y, z);
  885. Halloween_CreatePumpkin(x, y, z, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid));
  886. }
  887. return 1;
  888. }
  889. #endif
  890. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  891. {
  892. switch(dialogid)
  893. {
  894. case DIALOG_CANDY_SHOP:
  895. {
  896. if(response)
  897. {
  898. new string[96];
  899. switch(listitem)
  900. {
  901. // medkit
  902. case 0:
  903. {
  904. if(MEDKIT_PRICE > CandyCount[playerid]) return SendClientMessage(playerid, 0xE74C3CFF, "ERROR: {FFFFFF}You don't have enough candies."), Halloween_ShowShopMenu(playerid);
  905. SetPlayerHealth(playerid, 100.0);
  906. Halloween_ChangeCandy(playerid, -MEDKIT_PRICE);
  907. format(string, sizeof(string), "CANDY SHOP: {FFFFFF}Bought {FFA944}medkit {FFFFFF}using {9158B6}C%d.", MEDKIT_PRICE);
  908. SendClientMessage(playerid, 0x9158B6FF, string);
  909. Halloween_ShowShopMenu(playerid);
  910. }
  911. // body armor
  912. case 1:
  913. {
  914. if(ARMOR_PRICE > CandyCount[playerid]) return SendClientMessage(playerid, 0xE74C3CFF, "ERROR: {FFFFFF}You don't have enough candies."), Halloween_ShowShopMenu(playerid);
  915. SetPlayerArmour(playerid, 100.0);
  916. Halloween_ChangeCandy(playerid, -ARMOR_PRICE);
  917. format(string, sizeof(string), "CANDY SHOP: {FFFFFF}Bought {FFA944}body armor {FFFFFF}using {9158B6}C%d.", ARMOR_PRICE);
  918. SendClientMessage(playerid, 0x9158B6FF, string);
  919. Halloween_ShowShopMenu(playerid);
  920. }
  921. // gift box
  922. case 2: Halloween_ShowGiftMenu(playerid);
  923. // weapons
  924. case 3: Halloween_ShowWeaponsMenu(playerid);
  925. }
  926. }
  927. return 1;
  928. }
  929. case DIALOG_BUY_GIFT:
  930. {
  931. if(!response) return Halloween_ShowShopMenu(playerid);
  932. switch(listitem)
  933. {
  934. // use money
  935. case 0:
  936. {
  937. if(GIFT_PRICE > GetPlayerMoney(playerid)) return SendClientMessage(playerid, 0xE74C3CFF, "ERROR: {FFFFFF}You don't have enough money."), Halloween_ShowGiftMenu(playerid);
  938. new Float: x, Float: y, Float: z, Float: a;
  939. GetPlayerPos(playerid, x, y, z);
  940. GetPlayerFacingAngle(playerid, a);
  941. x += (2.0 * floatsin(-a, degrees));
  942. y += (2.0 * floatcos(-a, degrees));
  943. if(Halloween_CreateGiftBox(x, y, z, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid)) != -1)
  944. {
  945. GivePlayerMoney(playerid, -GIFT_PRICE);
  946. Halloween_ShowGiftMenu(playerid);
  947. }
  948. }
  949. // use candy
  950. case 1:
  951. {
  952. if(GIFT_PRICE_CANDY > CandyCount[playerid]) return SendClientMessage(playerid, 0xE74C3CFF, "ERROR: {FFFFFF}You don't have enough candies."), Halloween_ShowGiftMenu(playerid);
  953. new Float: x, Float: y, Float: z, Float: a;
  954. GetPlayerPos(playerid, x, y, z);
  955. GetPlayerFacingAngle(playerid, a);
  956. x += (2.0 * floatsin(-a, degrees));
  957. y += (2.0 * floatcos(-a, degrees));
  958. if(Halloween_CreateGiftBox(x, y, z, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid)) != -1)
  959. {
  960. Halloween_ChangeCandy(playerid, -GIFT_PRICE_CANDY);
  961. Halloween_ShowGiftMenu(playerid);
  962. }
  963. }
  964. }
  965. return 1;
  966. }
  967. case DIALOG_BUY_WEAPON:
  968. {
  969. if(!response) return Halloween_ShowShopMenu(playerid);
  970. new price = ShopWeapons[listitem][WeaponPrice];
  971. if(price > CandyCount[playerid]) return SendClientMessage(playerid, 0xE74C3CFF, "ERROR: {FFFFFF}You don't have enough candies."), Halloween_ShowWeaponsMenu(playerid);
  972. GivePlayerWeapon(playerid, ShopWeapons[listitem][WeaponID], ShopWeapons[listitem][WeaponAmmo]);
  973. Halloween_ChangeCandy(playerid, -price);
  974. new string[128], w_name[32];
  975. GetWeaponName(ShopWeapons[listitem][WeaponID], w_name, sizeof(w_name));
  976. format(string, sizeof(string), "CANDY SHOP: {FFFFFF}Bought {FFA944}%s {FFFFFF}using {9158B6}C%d.", w_name, price);
  977. SendClientMessage(playerid, 0x9158B6FF, string);
  978. Halloween_ShowWeaponsMenu(playerid);
  979. return 1;
  980. }
  981. }
  982. return 0;
  983. }
  984. public OnPlayerPickUpDynamicPickup(playerid, STREAMER_TAG_PICKUP pickupid)
  985. {
  986. switch(Streamer_GetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_MODEL_ID))
  987. {
  988. // gift boxes
  989. case 19054..19058:
  990. {
  991. new id = Streamer_GetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID), string[144];
  992. format(string, sizeof(string), "HALLOWEEN: {FFFFFF}%s(%d) has found a gift box at {FFA944}%s, %s!", ReturnPlayerName(playerid), playerid, GetZoneName(GiftBoxData[id][GiftBoxX], GiftBoxData[id][GiftBoxY], GiftBoxData[id][GiftBoxZ]), GetCityName(GiftBoxData[id][GiftBoxX], GiftBoxData[id][GiftBoxY], GiftBoxData[id][GiftBoxZ]));
  993. SendClientMessageToAll(0x9158B6FF, string);
  994. switch(random(11))
  995. {
  996. case 0..2:
  997. {
  998. SetPlayerHealth(playerid, 100.0);
  999. SendClientMessage(playerid, 0x9158B6FF, "HALLOWEEN: {FFFFFF}Found a {FFA944}medkit.");
  1000. }
  1001. case 4, 5:
  1002. {
  1003. SetPlayerArmour(playerid, 100.0);
  1004. SendClientMessage(playerid, 0x9158B6FF, "HALLOWEEN: {FFFFFF}Found a {FFA944}body armor.");
  1005. }
  1006. case 6..8:
  1007. {
  1008. new money = RandomEx(GIFT_MIN_MONEY, GIFT_MAX_MONEY);
  1009. GivePlayerMoney(playerid, money);
  1010. format(string, sizeof(string), "HALLOWEEN: {FFFFFF}Found {2ECC71}$%d.", money);
  1011. SendClientMessage(playerid, 0x9158B6FF, string);
  1012. }
  1013. default:
  1014. {
  1015. new candy = RandomEx(GIFT_MIN_CANDY, GIFT_MAX_CANDY);
  1016. Halloween_ChangeCandy(playerid, candy);
  1017. format(string, sizeof(string), "HALLOWEEN: {FFFFFF}Found {FFA944}%d candy.", candy);
  1018. SendClientMessage(playerid, 0x9158B6FF, string);
  1019. }
  1020. }
  1021. GiftBox_Destroy(id);
  1022. }
  1023. #if defined PUMPKIN_DROPS
  1024. // pumpkin
  1025. case 19320:
  1026. {
  1027. new id = Streamer_GetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID);
  1028. Halloween_ChangeCandy(playerid, PUMPKIN_CANDY);
  1029. Pumpkin_Destroy(id);
  1030. }
  1031. #endif
  1032. }
  1033. return 1;
  1034. }
  1035. CMD:giftboxes(playerid, params[])
  1036. {
  1037. new string[2048], found; // overkill af but just in case
  1038. format(string, sizeof(string), "Area\tCity\tTime Left\n");
  1039. for(new i; i < MAX_GIFT_BOXES; i++)
  1040. {
  1041. if(!GiftBoxData[i][GiftBoxExists]) continue;
  1042. format(string, sizeof(string), "%s%s\t%s\t%s\n", string, GetZoneName(GiftBoxData[i][GiftBoxX], GiftBoxData[i][GiftBoxY], GiftBoxData[i][GiftBoxZ]), GetCityName(GiftBoxData[i][GiftBoxX], GiftBoxData[i][GiftBoxY], GiftBoxData[i][GiftBoxZ]), formatTime(GiftBoxData[i][GiftBoxTimeLeft]));
  1043. found++;
  1044. }
  1045. if(found > 0) {
  1046. new title[24];
  1047. format(title, sizeof(title), "Gift Boxes (%d Found)", found);
  1048. ShowPlayerDialog(playerid, DIALOG_UNUSED, DIALOG_STYLE_TABLIST_HEADERS, title, string, "Close", "");
  1049. }else{
  1050. ShowPlayerDialog(playerid, DIALOG_UNUSED, DIALOG_STYLE_MSGBOX, "Gift Boxes", "No gift boxes found.", "Close", "");
  1051. }
  1052. return 1;
  1053. }
  1054. CMD:topcollectors(playerid, params[])
  1055. {
  1056. new name[MAX_PLAYER_NAME], candies;
  1057. stmt_bind_result_field(TopCandies, 0, DB::TYPE_STRING, name, MAX_PLAYER_NAME);
  1058. stmt_bind_result_field(TopCandies, 1, DB::TYPE_INTEGER, candies);
  1059. if(stmt_execute(TopCandies))
  1060. {
  1061. new idx, string[700], colors[] = {0xF1C40FFF, 0xA8A8A8FF, 0x965A38FF};
  1062. format(string, sizeof(string), "#\tName\tCandies\n");
  1063. while(stmt_fetch_row(TopCandies))
  1064. {
  1065. if(idx < 3) {
  1066. format(string, sizeof(string), "%s{%06x}%d\t{%06x}%s\t{%06x}%d\n", string, colors[idx] >>> 8, idx + 1, colors[idx] >>> 8, name, colors[idx] >>> 8, candies);
  1067. }else{
  1068. format(string, sizeof(string), "%s%d\t%s\t%d\n", string, idx + 1, name, candies);
  1069. }
  1070. idx++;
  1071. }
  1072. ShowPlayerDialog(playerid, DIALOG_UNUSED, DIALOG_STYLE_TABLIST_HEADERS, "Top Candy Collectors", string, "Close", "");
  1073. }
  1074. return 1;
  1075. }
  1076. CMD:candyshop(playerid, params[])
  1077. {
  1078. // https://youtu.be/SRcnnId15BA, someone had to do it
  1079. Halloween_ShowShopMenu(playerid);
  1080. return 1;
  1081. }
  1082. /* Admin Commands */
  1083. CMD:givecandy(playerid, params[])
  1084. {
  1085. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xE74C3CFF, "ERROR: {FFFFFF}Only RCON admins can use this command.");
  1086. new id, amount;
  1087. if(sscanf(params, "ui", id, amount)) return SendClientMessage(playerid, 0xF39C12FF, "SYNTAX: {FFFFFF}/giveplayercandy [player] [amount]");
  1088. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xE74C3CFF, "ERROR: {FFFFFF}Player is offline.");
  1089. Halloween_ChangeCandy(id, amount);
  1090. new string[128];
  1091. format(string, sizeof(string), "HALLOWEEN: {FFFFFF}You gave %s(%d) {9158B6}C%d.", ReturnPlayerName(id), id, amount);
  1092. SendClientMessage(playerid, 0x9158B6FF, string);
  1093. format(string, sizeof(string), "HALLOWEEN: {FFFFFF}Admin %s(%d) gave you {9158B6}C%d.", ReturnPlayerName(playerid), playerid, amount);
  1094. SendClientMessage(id, 0x9158B6FF, string);
  1095. return 1;
  1096. }
  1097. CMD:giveallcandy(playerid, params[])
  1098. {
  1099. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xE74C3CFF, "ERROR: {FFFFFF}Only RCON admins can use this command.");
  1100. new amount;
  1101. if(sscanf(params, "i", amount)) return SendClientMessage(playerid, 0xF39C12FF, "SYNTAX: {FFFFFF}/giveallcandy [amount]");
  1102. for(new i, maxp = GetPlayerPoolSize(); i <= maxp; i++) if(IsPlayerConnected(i)) Halloween_ChangeCandy(i, amount);
  1103. new string[128];
  1104. format(string, sizeof(string), "HALLOWEEN: {FFFFFF}Admin %s(%d) gave everyone {9158B6}C%d.", ReturnPlayerName(playerid), playerid, amount);
  1105. SendClientMessageToAll(0x9158B6FF, string);
  1106. return 1;
  1107. }
  1108. CMD:dropgift(playerid, params[])
  1109. {
  1110. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xE74C3CFF, "ERROR: {FFFFFF}Only RCON admins can use this command.");
  1111. new Float: x, Float: y, Float: z, Float: a;
  1112. GetPlayerPos(playerid, x, y, z);
  1113. GetPlayerFacingAngle(playerid, a);
  1114. x += (2.0 * floatsin(-a, degrees));
  1115. y += (2.0 * floatcos(-a, degrees));
  1116. if(Halloween_CreateGiftBox(x, y, z, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid)) != -1)
  1117. {
  1118. new string[128];
  1119. format(string, sizeof(string), "HALLOWEEN: {FFFFFF}Admin %s(%d) spawned a gift box on their location.", ReturnPlayerName(playerid), playerid);
  1120. SendClientMessageToAll(0x9158B6FF, string);
  1121. }
  1122. return 1;
  1123. }
  1124. CMD:dropgiftaround(playerid, params[])
  1125. {
  1126. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xE74C3CFF, "ERROR: {FFFFFF}Only RCON admins can use this command.");
  1127. new amount;
  1128. if(sscanf(params, "i", amount)) return SendClientMessage(playerid, 0xF39C12FF, "SYNTAX: {FFFFFF}/dropgiftaround [amount]");
  1129. if(!(1 <= amount <= 10)) return SendClientMessage(playerid, 0xE74C3CFF, "ERROR: {FFFFFF}You can't drop less than 1 and more than 10 gift boxes at once.");
  1130. new id, total;
  1131. for(new i; i < amount; i++)
  1132. {
  1133. id = random(sizeof(GiftBoxCoords));
  1134. if(Halloween_CreateGiftBox(GiftBoxCoords[id][GiftBoxSpawnX], GiftBoxCoords[id][GiftBoxSpawnY], GiftBoxCoords[id][GiftBoxSpawnZ], -1, -1) != -1) total++;
  1135. }
  1136. if(total > 0)
  1137. {
  1138. new string[128];
  1139. format(string, sizeof(string), "HALLOWEEN: {FFFFFF}Admin %s(%d) spawned %d gift boxes.", ReturnPlayerName(playerid), playerid, total);
  1140. SendClientMessageToAll(0x9158B6FF, string);
  1141. }
  1142. return 1;
  1143. }