Advertisement
Guest User

Untitled

a guest
Jan 8th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 83.37 KB | None | 0 0
  1.  
  2. posfunc(x = 0, y = 0, z = 0) {
  3. if (x = 0) && (y = 0) && (z = 0) {
  4. GetPlayerPos(x, y, z)
  5. if (x >= -145 && x <= 524) && (y >= 1591 && y <= 2213)
  6. mpos = Army Base
  7. else if (x >= 1699 && x <= 1838) && (y >= 2020 && y <= 2181)
  8. mpos = Feuerwehrbase (LV)
  9. else if (x >= -2767 && x <= -2589) && (y >= 1158 && y <= 2244)
  10. mpos = Gant Bridge
  11. else if (x >= 824 && x <= 1199) && (y >= 1101 && y <= 1373)
  12. mpos = Fahrschule (LV)
  13. else if (x >= 196 && x <= 872) && (y >= 985 && y <= 1291)
  14. mpos = Farm (LV)
  15. else if (x >= 329 && x <= 824) && (y >= 1291 && y <= 1591)
  16. mpos = Oel-Pumpen bei Tank BIZ
  17. else if (x >= 250 && x <= 958) && (y >= 632 && y <= 1057) || (x >= 872 && x <= 958) && (y >= 1058 && y <= 1101)
  18. mpos = Steinbruch
  19. else if (x >= -476 && x <= 250) && (y >= 725 && y <= 1269)
  20. mpos = Fort Carson
  21. else if (x >= -500 && x <= -118) && (y >= 1269 && y <= 1683) || (x >= -500 && x <= -476) && (y >= 1228 && y <= 1269)
  22. mpos = Terror Base
  23. else if (x >= -533 && x <= -214) && (y >= 2084 && y <= 2357)
  24. mpos = altes Dorf (Paintball-Map)
  25. else if (x >= -891 && x <= -289) && (y >= -722 && y <= -241)
  26. mpos = Trucker Base
  27. else if (x >= -891 && x <= -387) && (y >= -848 && y <= -723) || (x >= -892 && x <= -327) && (y >= -1461 && y <= -848) || (x >= -412 && x <= -327) && (y >= -1544 && y <= -1461)
  28. mpos = Aecker bei Trucker Tanke
  29. else if (x >= -1673 && x <= -891) && (y >= -1461 && y <= -892)
  30. mpos = The Farm
  31. else if (x >= -2073 && x <= -1863) && (y >= 225 && y <= 387)
  32. mpos = Wang Cars
  33. else if (x >= -1673 && x <= -412) && (y >= -1952 && y <= -1461)
  34. mpos = Hanffarm
  35. else if (x >= -2779 && x <= -2472) && (y >= 434 && y <= 728)
  36. mpos = Krankenhaus (SF)
  37. else if (x >= -2701 && x <= -2277) && (y >= 551 && y <= 917)
  38. mpos = 24/7 (SF Stadt)
  39. else if (x >= -2995 && x <= -2701) && (y >= 551 && y <= 1217)
  40. mpos = Admininsel
  41. else if (x >= -1673 && x <= -1040) && (y >= -2500 && y <= -1952)
  42. mpos = Sumpf (SF) bei Mount Chiliad
  43. else if (x >= -2565 && x <= -1673) && (y >= -2713 && y <= -2191)
  44. mpos = Angel Pine
  45. else if (x >= -2975 && x <= -2565) && (y >= -2913 && y <= -2191) || (x >= -2565 && x <= -1673) && (y >= -2913 && y <= -2713)
  46. mpos = Strand (SF) bei Mount Chiliad
  47. else if (x >= -1673 && x <= -1040) && (y >= -2979 && y <= -2500)
  48. mpos = 24/7 (SF) bei Angel Pine, HW
  49. else if (x >= -2004 && x <= -1673) && (y >= -1835 && y <= -1385)
  50. mpos = Schrottplatz bei Mount Chiliad
  51. else if (x >= -2975 && x <= -1673) && (y >= -2191 && y <= -892)
  52. mpos = Mount Chiliad
  53. else if (x >= -2975 && x <= -2245) && (y >= -892 && y <= -438)
  54. mpos = Missionary Hill
  55. else if (x >= -2245 && x <= -1863) && (y >= -892 && y <= -366)
  56. mpos = Dirtring Arena bei Fahrschule (SF)
  57. else if (x >= -2975 && x <= -2245) && (y >= -438 && y <= -65)
  58. mpos = Golfclub (SF)
  59. else if (x >= -2245 && x <= -1863) && (y >= -366 && y <= -65)
  60. mpos = Fahrschule (SF)
  61. else if (x >= -1180 && x <= -891) && (y >= -892 && y <= -519)
  62. mpos = Raffinerie bei Airport (SF)
  63. else if (x >= -2992 && x <= -2335) && (y >= 2071 && y <= 2992) || (x >= -2335 && x <= -2087) && (y >= 2071 && y <= 2100)
  64. mpos = Bayside
  65. else if (x >= -2335 && x <= -1912) && (y >= 2435 && y <= 2992)
  66. mpos = Bayside Tunnels
  67. else if (x >= -2087 && x <= -1911) && (y >= 2071 && y <= 2435)
  68. mpos = gemappte Villa bei Bayside
  69. else if (x >= -1911 && x <= -1298) && (y >= 2229 && y <= 2992)
  70. mpos = El Quebrados
  71. else if (x >= -1911 && x <= -1231) && (y >= 1602 && y <= 2229) || (x >= -1231 && x <= -1008) && (y >= 1776 && y <= 2229)
  72. mpos = westlich des Sherman Staudamm
  73. else if (x >= -1298 && x <= -717) && (y >= 2554 && y <= 2992)
  74. mpos = Bruecke El Quebrados - Knast
  75. else if (x >= -1298 && x <= -717) && (y >= 2229 && y <= 2554) || (x >= -1008 && x <= -533) && (y >= 2157 && y <= 2229) || (x >= -717 && x <= -533) && (y >= 2229 && y <= 2357)
  76. mpos = Stausee
  77. else if (x >= -717 && x <= -409) && (y >= 2357 && y <= 2992)
  78. mpos = Knast
  79. else if (x >= -409 && x <= -129) && (y >= 2357 && y <= 2992)
  80. mpos = Dorf beim Knast
  81. else if (x >= -2965 && x <= -2825) && (y >= 1217 && y <= 1342) || (x >= -2825 && x <= -2767) && (y >= 1217 && y <= 1531) || (x >= -2589 && x <= -2303) && (y >= 1158 && y <= 1462) || (x >= -2303 && x <= -2222) && (y >= 1327 && y <= 1462)
  82. mpos = Jizzys Club bei Gant Bridge
  83. else if (x >= -2589 && x <= -2222) && (y >= 1462 && y <= 1670)
  84. mpos = Frachtschiff bei Gant Bridge
  85. else if (x >= -2222 && x <= -1863) && (y >= 1327 && y <= 1602) || (x >= -1863 && x <= -1614) && (y >= 1386 && y <= 1602)
  86. mpos = SF Docks (Nordkueste)
  87. else if (x >= -1614 && x <= -1231) && (y >= 1386 && y <= 1602) || (x >= -1481 && x <= -1231) && (y >= 1228 && y <= 1386)
  88. mpos = Frachtschiff bei Garver Bridge
  89. else if (x >= -1008 && x <= -448) && (y >= 1776 && y <= 2157)
  90. mpos = Sherman Staudamm
  91. else if (x >= -500 && x <= -448) && (y >= 1683 && y <= 1776) || (x >= -448 && x <= -145) && (y >= 1683 && y <= 2084) || (x >= -214 && x <= -145) && (y >= 2084 && y <= 2357) || (x >= -145 && x <= -129) && (y >= 2213 && y <= 2357)
  92. mpos = Kristallsole
  93. else if (x >= -1231 && x <= -500) && (y >= 1228 && y <= 1776)
  94. mpos = Las Barrancas
  95. else if (x >= -1005 && x <= -476) && (y >= 725 && y <= 1228)
  96. mpos = Hitman Base
  97. else if (x >= -2996 && x <= -2530) && (y >= -200 && y <= 65)
  98. mpos = Ocean Flats
  99. else if (x >= -2996 && x <= -2542) && (y >= 200 && y <= 551)
  100. mpos = Stadthalle (SF)
  101. else if (x >= -2541 && x <= -2150) && (y >= 200 && y <= 551)
  102. mpos = Praesidentenvilla bei Baseballfeld (SF)
  103. else if (x >= -1863 && x <= -1201) && (y >= 431 && y <= 551) || (x >= -1873 && x <= -1305) && (y >= 241 && y <= 431)
  104. mpos = Flugzeugtraeger
  105. else if (x >= -2701 && x <= -2303) && (y >= 917 && y <= 1158)
  106. mpos = Burger Shot bei Gant Bridge
  107. else if (x >= -2303 && x <= -1863) && (y >= 917 && y <= 1327)
  108. mpos = Kirche (SF)
  109. else if (x >= -1863 && x <= -1481) && (y >= 869 && y <= 1386)
  110. mpos = Ottos Autos
  111. else if (x >= -1863 && x <= -1481) && (y >= 551 && y <= 869)
  112. mpos = SFPD
  113. else if (x >= -2277 && x <= -1863) && (y >= 551 && y <= 917)
  114. mpos = Chinatown (SF)
  115. else if (x >= -1481 && x <= -1005) && (y >= 551 && y <= 1228)
  116. mpos = Garver Bridge
  117. else if (x >= 1074 && x <= 1621) && (y >= 2655 && y <= 2992)
  118. mpos = Golfclub (LV)
  119. else if (x >= 1074 && x <= 2097) && (y >= 2516 && y <= 2992)
  120. mpos = Villenviertel (LV)
  121. else if (x >= 2097 && x <= 2470) && (y >= 2579 && y <= 2992)
  122. mpos = Schmugglerbase (LV)
  123. else if (x >= 2470 && x <= 2992) && (y >= 2565 && y <= 2992)
  124. mpos = Militaerfabrik
  125. else if (x >= 524 && x <= 1199) && (y >= 1931 && y <= 2516)
  126. mpos = ehem. SAAP Base (LV)
  127. else if (x >= 1012 && x <= 1199) && (y >= 1591 && y <= 1724) || (x >= 824 && x <= 1199) && (y >= 1373 && y <= 1591)
  128. mpos = Dirtring Arena (LV) bei FBI Base
  129. else if (x >= 870 && x <= 1199) && (y >= 1591 && y <= 1931)
  130. mpos = FBI Base
  131. else if (x >= 1199 && x <= 1717) && (y >= 2030 && y <= 2516)
  132. mpos = Stadion (LV)
  133. else if (x >= 1717 && x <= 2097) && (y >= 2284 && y <= 2516)
  134. mpos = mittlerer Highway bei Stadion (LV)
  135. else if (x >= 2097 && x <= 2470) && (y >= 2239 && y <= 2579)
  136. mpos = LVPD
  137. else if (x >= 2470 && x <= 2992) && (y >= 2095 && y <= 2565)
  138. mpos = Rock Hotel
  139. else if (x >= 742 && x <= 870) && (y >= 1591 && y <= 1931)
  140. mpos = Schiessstand bei FBI Base
  141. else if (x >= 524 && x <= 742) && (y >= 1591 && y <= 1931)
  142. mpos = Tank BIZ
  143. else if (x >= 958 && x <= 1431) && (y >= 813 && y <= 1101)
  144. mpos = Blackfield Intersection
  145. else if (x >= 958 && x <= 1735) && (y >= 604 && y <= 960)
  146. mpos = Triaden Base
  147. else if (x >= 1557 && x <= 1736) && (y >= 1704 && y <= 1933)
  148. mpos = Krankenhaus (LV)
  149. else if (x >= 1199 && x <= 1778) && (y >= 1101 && y <= 2030) || (x >= 1431 && x <= 1778) && (y >= 960 && y <= 1101)
  150. mpos = Airport (LV)
  151. else if (x >= 1717 && x <= 2110) && (y >= 2030 && y <= 2284)
  152. mpos = Lowrider BIZ
  153. else if (x >= 1778 && x <= 1814) && (y >= 906 && y <= 2030) || (x >= 1735 && x <= 1778) && (y >= 906 && y <= 960)
  154. mpos = mittlerer Highway (LV)
  155. else if (x >= 1735 && x <= 1862) && (y >= 797 && y <= 906)
  156. mpos = Kreisverkehr/Kreisel (LV)
  157. else if (x >= 2203 && x <= 2419) && (y >= 1369 && y <= 1577)
  158. mpos = Parkhaus (LV)
  159. else if (x >= 2051 && x <= 2337) && (y >= 1577 && y <= 1784)
  160. mpos = Casino (LV)
  161. else if (x >= 1814 && x <= 2061) && (y >= 1458 && y <= 1708)
  162. mpos = Hovercraft BIZ bei Casino (LV)
  163. else if (x >= 1814 && x <= 2110) && (y >= 1708 && y <= 2030)
  164. mpos = Visage Hotel
  165. else if (x >= 2110 && x <= 2470) && (y >= 1708 && y <= 2239)
  166. mpos = Rentcar BIZ (LV)
  167. else if (x >= 2337 && x <= 2470) && (y >= 1577 && y <= 1708) || (x >= 2470 && x <= 2992) && (y >= 1577 && y <= 2095)
  168. mpos = ehem. Triaden Base bei Rentcar BIZ (LV)
  169. else if (x >= 1814 && x <= 2598) && (y >= 1184 && y <= 1577)
  170. mpos = Pyramide (LV)
  171. else if (x >= 2598 && x <= 2992) && (y >= 1103 && y <= 1577)
  172. mpos = Yakuza Base
  173. else if (x >= 2598 && x <= 2992) && (y >= 734 && y <= 1103)
  174. mpos = Russen Mafia Base
  175. else if (x >= 1814 && x <= 1862) && (y >= 906 && y <= 1184) || (x >= 1862 && x <= 2287) && (y >= 825 && y <= 1184)
  176. mpos = Four Dragons Casino
  177. else if (x >= 2287 && x <= 2598) && (y >= 825 && y <= 1184)
  178. mpos = Kirche (LV)
  179. else if (x >= 1735 && x <= 1807) && (y >= 604 && y <= 797) || (x >= 1807 && x <= 2139) && (y >= 572 && y <= 825)
  180. mpos = HP Base
  181. else if (x >= 1845 && x <= 2139) && (y >= 425 && y <= 572) || (x >= 2139 && x <= 2598) && (y >= 425 && y <= 825)
  182. mpos = Boot BIZ
  183. else if (x >= 2598 && x <= 2992) && (y >= 233 && y <= 734)
  184. mpos = Schmugglerschienen
  185. else if (x >= 295 && x <= 958) && (y >= 262 && y <= 632)
  186. mpos = WT Bruecke
  187. else if (x >= 1566 && x <= 1845) && (y >= 238 && y <= 604)
  188. mpos = Zoll
  189. else if (x >= 1566 && x <= 1842) && (y >= -681 && y <= -7)
  190. mpos = LS/LV-Highway
  191. else if (x >= 1842 && x <= 2180) && (y >= -876 && y <= -298) || (x >= 2180 && x <= 2934) && (y >= -822 && y <= -298)
  192. mpos = North Rock bei Ballas Base
  193. else if (x >= 2180 && x <= 2934) && (y >= -1125 && y <= -822)
  194. mpos = Ballas Base
  195. else if (x >= 2180 && x <= 2378) && (y >= -1310 && y <= -1125)
  196. mpos = Bikeshop
  197. else if (x >= 2180 && x <= 2966) && (y >= -1490 && y <= -1125)
  198. mpos = East Los Santos
  199. else if (x >= 2624 && x <= 2966) && (y >= -2106 && y <= -1490)
  200. mpos = Dirtring Arena (LS)
  201. else if (x >= 2209 && x <= 2934) && (y >= -2800 && y <= -2106)
  202. mpos = Docks (LS)
  203. else if (x >= 2180 && x <= 2624) && (y >= -1756 && y <= -1490)
  204. mpos = Grove Street/ Grove Base
  205. else if (x >= 2409 && x <= 2624) && (y >= -2106 && y <= -1756)
  206. mpos = Kanal (Grove Street)
  207. else if (x >= 1969 && x <= 2409) && (y >= -2106 && y <= -1756)
  208. mpos = Grove PnS
  209. else if (x >= 1668 && x <= 1969) && (y >= -2176 && y <= -2043)
  210. mpos = ehem. Ballas Base bei Airport (LS)
  211. else if (x >= 1668 && x <= 1969) && (y >= -2043 && y <= -1756)
  212. mpos = Noobautohaus
  213. else if (x >= 1702 && x <= 1842) && (y >= -1600 && y <= -1544) || (x >= 1702 && x <= 2180) && (y >= -1756 && y <= -1544)
  214. mpos = Alhambra
  215. else if (x >= 1842 && x <= 2180) && (y >= -1600 && y <= -1344)
  216. mpos = Skater Park
  217. else if (x >= 1842 && x <= 2180) && (y >= -1344 && y <= -876)
  218. mpos = Glen Park
  219. else if (x >= 1454 && x <= 1842) && (y >= -1153 && y <= -681)
  220. mpos = Highway-Auffahrt (LS)
  221. else if (x >= 1287 && x <= 1842) && (y >= -1544 && y <= -1153)
  222. mpos = Startower
  223. else if (x >= 1525 && x <= 1702) && (y >= -1726 && y <= -1581)
  224. mpos = LSPD
  225. else if (x >= 1287 && x <= 1702) && (y >= -1726 && y <= -1544)
  226. mpos = Pershing Square
  227. else if (x >= 1358 && x <= 1702) && (y >= -1848 && y <= -1726)
  228. mpos = Stadthalle (LS)
  229. else if (x >= 1200 && x <= 2209) && (y >= -2800 && y <= -2106) || (x >= 999 && x <= 1200) && (y >= -2488 && y <= -2338)
  230. mpos = Airport (LS)
  231. else if (x >= 1041 && x <= 1668) && (y >= -2388 && y <= -1848) || (x >= 939 && x <= 1041) && (y >= -2338 && y <= -2145)
  232. mpos = Krankenhaus (LS)
  233. else if (x >= 1008 && x <= 1454) && (y >= -1153 && y <= -681)
  234. mpos = BSN (Burger Shot North)
  235. else if (x >= 731 && x <= 1008) && (y >= -1271 && y <= -789)
  236. mpos = Friedhof (LS)
  237. else if (x >= 907 && x <= 1287) && (y >= -1693 && y <= -1153) || (x >= 1041 && x <= 1287) && (y >= -1703 && y <= -1693)
  238. mpos = Verona Mall
  239. else if (x >= 1041 && x <= 1358) && (y >= -1848 && y <= -1703)
  240. mpos = Bus Base
  241. else if (x >= 55 && x <= 1041) && (y >= -2145 && y <= -1693) || (x >= 1 && x <= 55) && (y >= -1952 && y <= -1693)
  242. mpos = Santa Maria Beach
  243. else if (x >= 731 && x <= 907) && (y >= -1413 && y <= -1271)
  244. mpos = Market Station
  245. else if (x >= 462 && x <= 731) && (y >= -1376 && y <= -1063)
  246. mpos = Rentcar BIZ (LS)
  247. else if (x >= 647 && x <= 907) && (y >= -1692 && y <= -1376)
  248. mpos = BSS (Burger Shot South)
  249. else if (x >= 65 && x <= 647) && (y >= -1693 && y <= -1185) || (x >= 1 && x <= 65) && (y >= -1693 && y <= -1544)
  250. mpos = Crashhotel
  251. else if (x >= 65 && x <= 428) && (y >= -789 && y <= -493) || (x >= 65 && x <= 731) && (y >= -1063 && y <= -789) || (x >= 65 && x <= 462) && (y >= -1185 && y <= -1063)
  252. mpos = West Villenviertel (LS)
  253. else if (x >= 428 && x <= 1008) && (y >= -789 && y <= -336)
  254. mpos = Dillimore/ Red County Dorf (GW Gebiet)
  255. else if (x >= 547 && x <= 1008) && (y >= -336 && y <= -113) || (x >= 1008 && x <= 1566) && (y >= -681 && y <= -113)
  256. mpos = Hilltop Farm (Dillimore)
  257. else if (x >= 1845 && x <= 2598) && (y >= -298 && y <= 425) || (x >= 1842 && x <= 1845) && (y >= -298 && y <= 7)
  258. mpos = Palomino Creek
  259. else if (x >= 2598 && x <= 2992) && (y >= -298 && y <= 233)
  260. mpos = East Beach Highway bei Palomino Creek
  261. else if (x >= 1440 && x <= 1845) && (y >= -7 && y <= 238)
  262. mpos = Raststaette
  263. else if (x >= 958 && x <= 1566) && (y >= -133 && y <= 604)
  264. mpos = Montgomery/ ehem. WT Dorf
  265. else if (x >= 547 && x <= 958) && (y >= -113 && y <= 263)
  266. mpos = Berg bei WT Bruecke
  267. else if (x >= -891 && x <= -387) && (y >= -241 && y <= 363)
  268. mpos = Panopticon
  269. else if (x >= -2530 && x <= -2141) && (y >= -65 && y <= 200)
  270. mpos = Baseballfeld (SF)
  271. else if (x >= -2007 && x <= -1863) && (y >= -65 && y <= 225)
  272. mpos = Bahnhof (SF)
  273. else if (x >= -2141 && x <= -1863) && (y >= -65 && y <= 551)
  274. mpos = Baustelle (SF)
  275. else if (x >= -1863 && x <= -891) && (y >= -892 && y <= 551)
  276. mpos = Airport (SF)
  277. else if (x >= -129 && x <= 524) && (y >= 2213 && y <= 2992) || (x >= 524 && x <= 1274) && (y >= 2516 && y <= 2992)
  278. mpos = verlassener Flughafen
  279. else if (x >= -118 && x <= 329) && (y >= 1269 && y <= 1591)
  280. mpos = West Las Venturas (GW Gebiet)
  281. else if (x >= -1005 && x <= -891) && (y >= 551 && y <= 725) || (x >= -891 && x <= 250) && (y >= 363 && y <= 725) || (x >= 250 && x <= 295) && (y >= 363 && y <= 632)
  282. mpos = Hitman Highway
  283. else if (x >= -387 && x <= 547) && (y >= -493 && y <= 363)
  284. mpos = Blueberry (SAAP Base)
  285. else if (x >= -369 && x <= 65) && (y >= -848 && y <= -493)
  286. mpos = See bei Trucker Base
  287. else if (x >= -327 && x <= 65) && (y >= -1544 && y <= -493)
  288. mpos = Trucker Tanke
  289. else if (x >= -412 && x <= 1) && (y >= -1952 && y <= -1544)
  290. mpos = Highway (SF) bei Trucker Tanke
  291. else if (x >= -1040 && x <= 55) && (y >= -2979 && y <= -1952) || (x >= 55 && x <= 133) && (y >= -2907 && y <= -2451)
  292. mpos = Suedost SF
  293. else if (x >= -2589 && x <= -1911) && (y >= 1602 && y <= 2071)
  294. mpos = Ozean bei Bayside
  295. else
  296. mpos = Ozean
  297. return mpos
  298. }
  299. }
  300.  
  301. global ERROR_OK := 0
  302. global ERROR_PROCESS_NOT_FOUND := 1
  303. global ERROR_OPEN_PROCESS := 2
  304. global ERROR_INVALID_HANDLE := 3
  305. global ERROR_MODULE_NOT_FOUND := 4
  306. global ERROR_ENUM_PROCESS_MODULES := 5
  307. global ERROR_ZONE_NOT_FOUND := 6
  308. global ERROR_CITY_NOT_FOUND := 7
  309. global ERROR_READ_MEMORY := 8
  310. global ERROR_WRITE_MEMORY := 9
  311. global ERROR_ALLOC_MEMORY := 10
  312. global ERROR_FREE_MEMORY := 11
  313. global ERROR_WAIT_FOR_OBJECT := 12
  314. global ERROR_CREATE_THREAD := 13
  315. global ADDR_ZONECODE := 0xA49AD4
  316. global ADDR_POSITION_X := 0xB6F2E4
  317. global ADDR_POSITION_Y := 0xB6F2E8
  318. global ADDR_POSITION_Z := 0xB6F2EC
  319. global ADDR_CPED_PTR := 0xB6F5F0
  320. global ADDR_CPED_HPOFF := 0x540
  321. global ADDR_CPED_ARMOROFF := 0x548
  322. global ADDR_VEHICLE_PTR := 0xBA18FC
  323. global ADDR_VEHICLE_HPOFF := 0x4C0
  324. global ADDR_CPED_MONEY := 0x0B7CE54
  325. global ADDR_CPED_INTID := 0xA4ACE8
  326. global ADDR_VEHICLE_DOORSTATE := 0x4F8
  327. global ADDR_VEHICLE_ENGINESTATE := 0x428
  328. global ADDR_VEHICLE_LIGHTSTATE := 0x584
  329. global ADDR_VEHICLE_MODEL := 0x22
  330. global ADDR_VEHICLE_TYPE := 0x590
  331. global ADDR_VEHICLE_DRIVER := 0x460
  332. global ADDR_VEHICLE_CVEH := 0xB6F980
  333. global ADDR_VEHICLE_SPEED_X := 0x44
  334. global ADDR_VEHICLE_SPEED_Y := 0x48
  335. global ADDR_VEHICLE_SPEED_Z := 0x4C
  336. global oAirplaneModels := [417, 425, 447, 460, 469, 476, 487, 488, 497, 511, 512, 513, 519, 520, 548, 553, 563, 577, 592, 593]
  337. global oBikeModels := [481,509,510]
  338. global ovehicleNames := ["Landstalker","Bravura","Buffalo","Linerunner","Perrenial","Sentinel","Dumper","Firetruck","Trashmaster","Stretch","Manana","Infernus","Voodoo","Pony","Mule","Cheetah","Ambulance","Leviathan","Moonbeam","Esperanto","Taxi","Washington","Bobcat","Whoopee","BFInjection","Hunter","Premier","Enforcer","Securicar","Banshee","Predator","Bus","Rhino","Barracks","Hotknife","Trailer","Previon","Coach","Cabbie","Stallion","Rumpo","RCBandit","Romero","Packer","Monster","Admiral","Squalo","Seasparrow","Pizzaboy","Tram","Trailer","Turismo","Speeder","Reefer","Tropic","Flatbed","Yankee","Caddy","Solair","Berkley'sRCVan","Skimmer","PCJ-600","Faggio","Freeway","RCBaron","RCRaider","Glendale","Oceanic","Sanchez","Sparrow","Patriot","Quad","Coastguard","Dinghy","Hermes","Sabre","Rustler","ZR-350","Walton","Regina","Comet","BMX","Burrito","Camper","Marquis","Baggage","Dozer","Maverick","NewsChopper","Rancher","FBIRancher","Virgo","Greenwood","Jetmax","Hotring","Sandking","BlistaCompact","PoliceMaverick","Boxvillde","Benson","Mesa","RCGoblin","HotringRacerA","HotringRacerB","BloodringBanger","Rancher","SuperGT","Elegant","Journey","Bike","MountainBike","Beagle","Cropduster","Stunt","Tanker","Roadtrain","Nebula","Majestic","Buccaneer","Shamal","hydra","FCR-900","NRG-500","HPV1000","CementTruck","TowTruck","Fortune","Cadrona","FBITruck","Willard","Forklift","Tractor","Combine","Feltzer","Remington","Slamvan","Blade","Freight","Streak","Vortex","Vincent","Bullet","Clover","Sadler","Firetruck","Hustler","Intruder","Primo","Cargobob","Tampa","Sunrise","Merit","Utility","Nevada","Yosemite","Windsor","Monster","Monster","Uranus","Jester","Sultan","Stratum","Elegy","Raindance","RCTiger","Flash","Tahoma","Savanna","Bandito","FreightFlat","StreakCarriage","Kart","Mower","Dune","Sweeper","Broadway","Tornado","AT-400","DFT-30","Huntley","Stafford","BF-400","NewsVan","Tug","Trailer","Emperor","Wayfarer","Euros","Hotdog","Club","FreightBox","Trailer","Andromada","Dodo","RCCam","Launch","PoliceCar","PoliceCar","PoliceCar","PoliceRanger","Picador","S.W.A.T","Alpha","Phoenix","GlendaleShit","SadlerShit","Luggage","Luggage","Stairs","Boxville","Tiller","UtilityTrailer"]
  339. global ADDR_SAMP_INCHAT_PTR := 0x21a10c
  340. global ADDR_SAMP_INCHAT_PTR_OFF := 0x55
  341. global ADDR_SAMP_USERNAME := 0x219A6F
  342. global ADDR_SAMP_CHATMSG_PTR := 0x21A0E4
  343. global ADDR_SAMP_SHOWDLG_PTR := 0x21A0B8
  344. global FUNC_SAMP_SENDCMD := 0x65c60
  345. global FUNC_SAMP_SENDSAY := 0x57f0
  346. global FUNC_SAMP_ADDTOCHATWND := 0x64520
  347. global FUNC_SAMP_SHOWGAMETEXT := 0x9C2C0
  348. global FUNC_SAMP_PLAYAUDIOSTR := 0x62dA0
  349. global FUNC_SAMP_STOPAUDIOSTR := 0x629A0
  350. global FUNC_SAMP_SHOWDIALOG := 0x6B9C0
  351. global FUNC_UPDATESCOREBOARD := 0x8A10
  352. global SAMP_INFO_OFFSET := 0x21A0F8
  353. global SAMP_PPOOLS_OFFSET := 0x3CD
  354. global SAMP_PPOOL_PLAYER_OFFSET := 0x18
  355. global SAMP_SLOCALPLAYERID_OFFSET := 0x4
  356. global SAMP_ISTRLEN_LOCALPLAYERNAME_OFFSET := 0x1A
  357. global SAMP_SZLOCALPLAYERNAME_OFFSET := 0xA
  358. global SAMP_PSZLOCALPLAYERNAME_OFFSET := 0xA
  359. global SAMP_PREMOTEPLAYER_OFFSET := 0x2E
  360. global SAMP_ISTRLENNAME___OFFSET := 0x1C
  361. global SAMP_SZPLAYERNAME_OFFSET := 0xC
  362. global SAMP_PSZPLAYERNAME_OFFSET := 0xC
  363. global SAMP_ILOCALPLAYERPING_OFFSET := 0x26
  364. global SAMP_ILOCALPLAYERSCORE_OFFSET := 0x2A
  365. global SAMP_IPING_OFFSET := 0x28
  366. global SAMP_ISCORE_OFFSET := 0x24
  367. global SAMP_ISNPC_OFFSET := 0x4
  368. global SAMP_SZIP_OFFSET := 0x20
  369. global SAMP_SZHOSTNAME_OFFSET := 0x121
  370. global SAMP_PLAYER_MAX := 1004
  371. global SIZE_SAMP_CHATMSG := 0xFC
  372. global hGTA := 0x0
  373. global dwGTAPID := 0x0
  374. global dwSAMP := 0x0
  375. global pMemory := 0x0
  376. global pParam1 := 0x0
  377. global pParam2 := 0x0
  378. global pParam3 := 0x0
  379. global pParam4 := 0x0
  380. global pParam5 := 0x0
  381. global pInjectFunc := 0x0
  382. global nZone := 1
  383. global nCity := 1
  384. global bInitZaC := 0
  385. global iRefreshScoreboard := 0
  386. global oScoreboardData := ""
  387. global iRefreshHandles := 0
  388. global iUpdateTick := 2500
  389. isInChat() {
  390. if(!checkHandles())
  391. return -1
  392. dwPtr := dwSAMP + ADDR_SAMP_INCHAT_PTR
  393. dwAddress := readDWORD(hGTA, dwPtr) + ADDR_SAMP_INCHAT_PTR_OFF
  394. if(ErrorLevel) {
  395. ErrorLevel := ERROR_READ_MEMORY
  396. return -1
  397. }
  398. dwInChat := readDWORD(hGTA, dwAddress)
  399. if(ErrorLevel) {
  400. ErrorLevel := ERROR_READ_MEMORY
  401. return -1
  402. }
  403. ErrorLevel := ERROR_OK
  404. if(dwInChat > 0) {
  405. return true
  406. } else {
  407. return false
  408. }
  409. }
  410. getUsername() {
  411. if(!checkHandles())
  412. return ""
  413. dwAddress := dwSAMP + ADDR_SAMP_USERNAME
  414. sUsername := readString(hGTA, dwAddress, 25)
  415. if(ErrorLevel) {
  416. ErrorLevel := ERROR_READ_MEMORY
  417. return ""
  418. }
  419. ErrorLevel := ERROR_OK
  420. return sUsername
  421. }
  422. getId() {
  423. s:=getUsername()
  424. return getPlayerIdByName(s)
  425. }
  426. SendChat(wText) {
  427. wText := "" wText
  428. if(!checkHandles())
  429. return false
  430. dwFunc:=0
  431. if(SubStr(wText, 1, 1) == "/") {
  432. dwFunc := dwSAMP + FUNC_SAMP_SENDCMD
  433. } else {
  434. dwFunc := dwSAMP + FUNC_SAMP_SENDSAY
  435. }
  436. callWithParams(hGTA, dwFunc, [["s", wText]], false)
  437. ErrorLevel := ERROR_OK
  438. return true
  439. }
  440. addChatMessage(wText) {
  441. wText := "" wText
  442. if(!checkHandles())
  443. return false
  444. dwFunc := dwSAMP + FUNC_SAMP_ADDTOCHATWND
  445. dwChatInfo := readDWORD(hGTA, dwSAMP + ADDR_SAMP_CHATMSG_PTR)
  446. if(ErrorLevel) {
  447. ErrorLevel := ERROR_READ_MEMORY
  448. return false
  449. }
  450. callWithParams(hGTA, dwFunc, [["p", dwChatInfo], ["s", wText]], true)
  451. ErrorLevel := ERROR_OK
  452. return true
  453. }
  454. showGameText(wText, dwTime, dwSize) {
  455. wText := "" wText
  456. dwTime += 0
  457. dwTime := Floor(dwTime)
  458. dwSize += 0
  459. dwSize := Floor(dwSize)
  460. if(!checkHandles())
  461. return false
  462. dwFunc := dwSAMP + FUNC_SAMP_SHOWGAMETEXT
  463. callWithParams(hGTA, dwFunc, [["s", wText], ["i", dwTime], ["i", dwSize]], false)
  464. ErrorLevel := ERROR_OK
  465. return true
  466. }
  467. showDialog(dwStyle, wCaption, wInfo, wButton1 ) {
  468. dwStyle += 0
  469. dwStyle := Floor(dwStyle)
  470. wCaption := "" wCaption
  471. wInfo := "" wInfo
  472. wButton1 := "" wButton1
  473. if(dwStyle<0 || dwStyle>5 || StrLen(wCaption)>=64 || StrLen(wInfo)>=4096 || StrLen(wButton1)>10)
  474. return false
  475. if(!checkHandles())
  476. return false
  477. dwFunc := dwSAMP + FUNC_SAMP_SHOWDIALOG
  478. dwAddress := readDWORD(hGTA, dwSAMP + ADDR_SAMP_SHOWDLG_PTR)
  479. if(ErrorLevel || dwAddress==0) {
  480. ErrorLevel := ERROR_READ_MEMORY
  481. return false
  482. }
  483. writeString(hGTA, pParam5, wCaption)
  484. if(ErrorLevel)
  485. return false
  486. writeString(hGTA, pParam1, wInfo)
  487. if(ErrorLevel)
  488. return false
  489. writeString(hGTA, pParam5+512, wButton1)
  490. if(ErrorLevel)
  491. return false
  492. dwLen := 5 + 7*5 + 5 + 1
  493. VarSetCapacity(injectData, dwLen, 0)
  494. NumPut(0xB9, injectData, 0, "UChar")
  495. NumPut(dwAddress, injectData, 1, "UInt")
  496. NumPut(0x68, injectData, 5, "UChar")
  497. NumPut(0, injectData, 6, "UInt")
  498. NumPut(0x68, injectData, 10, "UChar")
  499. NumPut(pParam5+StrLen(wCaption), injectData, 11, "UInt")
  500. NumPut(0x68, injectData, 15, "UChar")
  501. NumPut(pParam5+512, injectData, 16, "UInt")
  502. NumPut(0x68, injectData, 20, "UChar")
  503. NumPut(pParam1, injectData, 21, "UInt")
  504. NumPut(0x68, injectData, 25, "UChar")
  505. NumPut(pParam5, injectData, 26, "UInt")
  506. NumPut(0x68, injectData, 30, "UChar")
  507. NumPut(dwStyle, injectData, 31, "UInt")
  508. NumPut(0x68, injectData, 35, "UChar")
  509. NumPut(1, injectData, 36, "UInt")
  510. NumPut(0xE8, injectData, 40, "UChar")
  511. offset := dwFunc - (pInjectFunc + 45)
  512. NumPut(offset, injectData, 41, "Int")
  513. NumPut(0xC3, injectData, 45, "UChar")
  514. writeRaw(hGTA, pInjectFunc, &injectData, dwLen)
  515. if(ErrorLevel)
  516. return false
  517. hThread := createRemoteThread(hGTA, 0, 0, pInjectFunc, 0, 0, 0)
  518. if(ErrorLevel)
  519. return false
  520. waitForSingleObject(hThread, 0xFFFFFFFF)
  521. closeProcess(hThread)
  522. return true
  523. }
  524. playAudioStream(wUrl) {
  525. wUrl := "" wUrl
  526. if(!checkHandles())
  527. return false
  528. dwFunc := dwSAMP + FUNC_SAMP_PLAYAUDIOSTR
  529. patchRadio()
  530. callWithParams(hGTA, dwFunc, [["s", wUrl], ["i", 0], ["i", 0], ["i", 0], ["i", 0], ["i", 0]], false)
  531. unPatchRadio()
  532. ErrorLevel := ERROR_OK
  533. return true
  534. }
  535. stopAudioStream() {
  536. if(!checkHandles())
  537. return false
  538. dwFunc := dwSAMP + FUNC_SAMP_STOPAUDIOSTR
  539. patchRadio()
  540. callWithParams(hGTA, dwFunc, [["i", 1]], false)
  541. unPatchRadio()
  542. ErrorLevel := ERROR_OK
  543. return true
  544. }
  545. patchRadio()
  546. {
  547. if(!checkHandles())
  548. return false
  549. VarSetCapacity(nop, 4, 0)
  550. NumPut(0x90909090,nop,0,"UInt")
  551. dwFunc := dwSAMP + FUNC_SAMP_PLAYAUDIOSTR
  552. writeRaw(hGTA, dwFunc, &nop, 4)
  553. writeRaw(hGTA, dwFunc+4, &nop, 1)
  554. dwFunc := dwSAMP + FUNC_SAMP_STOPAUDIOSTR
  555. writeRaw(hGTA, dwFunc, &nop, 4)
  556. writeRaw(hGTA, dwFunc+4, &nop, 1)
  557. return true
  558. }
  559. unPatchRadio()
  560. {
  561. if(!checkHandles())
  562. return false
  563. VarSetCapacity(old, 4, 0)
  564. dwFunc := dwSAMP + FUNC_SAMP_PLAYAUDIOSTR
  565. NumPut(0x74003980,old,0,"UInt")
  566. writeRaw(hGTA, dwFunc, &old, 4)
  567. NumPut(0x39,old,0,"UChar")
  568. writeRaw(hGTA, dwFunc+4, &old, 1)
  569. dwFunc := dwSAMP + FUNC_SAMP_STOPAUDIOSTR
  570. NumPut(0x74003980,old,0,"UInt")
  571. writeRaw(hGTA, dwFunc, &old, 4)
  572. NumPut(0x09,old,0,"UChar")
  573. writeRaw(hGTA, dwFunc+4, &old, 1)
  574. return true
  575. }
  576. blockChatInput() {
  577. if(!checkHandles())
  578. return false
  579. VarSetCapacity(nop, 2, 0)
  580. dwFunc := dwSAMP + FUNC_SAMP_SENDSAY
  581. NumPut(0x04C2,nop,0,"Short")
  582. writeRaw(hGTA, dwFunc, &nop, 2)
  583. dwFunc := dwSAMP + FUNC_SAMP_SENDCMD
  584. writeRaw(hGTA, dwFunc, &nop, 2)
  585. return true
  586. }
  587. unBlockChatInput() {
  588. if(!checkHandles())
  589. return false
  590. VarSetCapacity(nop, 2, 0)
  591. dwFunc := dwSAMP + FUNC_SAMP_SENDSAY
  592. NumPut(0xA164,nop,0,"Short")
  593. writeRaw(hGTA, dwFunc, &nop, 2)
  594. dwFunc := dwSAMP + FUNC_SAMP_SENDCMD
  595. writeRaw(hGTA, dwFunc, &nop, 2)
  596. return true
  597. }
  598. getPlayerNameById(dwId) {
  599. dwId += 0
  600. dwId := Floor(dwId)
  601. if(dwId < 0 || dwId >= SAMP_PLAYER_MAX)
  602. return ""
  603. if(iRefreshScoreboard+iUpdateTick > A_TickCount)
  604. {
  605. if(oScoreboardData[dwId])
  606. return oScoreboardData[dwId].NAME
  607. return ""
  608. }
  609. if(!updateOScoreboardData())
  610. return ""
  611. if(oScoreboardData[dwId])
  612. return oScoreboardData[dwId].NAME
  613. return ""
  614. }
  615. getPlayerIdByName(wName) {
  616. wName := "" wName
  617. if(StrLen(wName) < 1 || StrLen(wName) > 20)
  618. return -1
  619. if(iRefreshScoreboard+iUpdateTick > A_TickCount)
  620. {
  621. For i, o in oScoreboardData
  622. {
  623. if(InStr(o.NAME,wName)==1)
  624. return i
  625. }
  626. return -1
  627. }
  628. if(!updateOScoreboardData())
  629. return -1
  630. For i, o in oScoreboardData
  631. {
  632. if(InStr(o.NAME,wName)==1)
  633. return i
  634. }
  635. return -1
  636. }
  637. getPlayerScoreById(dwId) {
  638. dwId += 0
  639. dwId := Floor(dwId)
  640. if(dwId < 0 || dwId >= SAMP_PLAYER_MAX)
  641. return ""
  642. if(iRefreshScoreboard+iUpdateTick > A_TickCount)
  643. {
  644. if(oScoreboardData[dwId])
  645. return oScoreboardData[dwId].SCORE
  646. return ""
  647. }
  648. if(!updateOScoreboardData())
  649. return ""
  650. if(oScoreboardData[dwId])
  651. return oScoreboardData[dwId].SCORE
  652. return ""
  653. }
  654. getPlayerPingById(dwId) {
  655. dwId += 0
  656. dwId := Floor(dwId)
  657. if(dwId < 0 || dwId >= SAMP_PLAYER_MAX)
  658. return -1
  659. if(iRefreshScoreboard+iUpdateTick > A_TickCount)
  660. {
  661. if(oScoreboardData[dwId])
  662. return oScoreboardData[dwId].PING
  663. return -1
  664. }
  665. if(!updateOScoreboardData())
  666. return -1
  667. if(oScoreboardData[dwId])
  668. return oScoreboardData[dwId].PING
  669. return -1
  670. }
  671. isNPCById(dwId) {
  672. dwId += 0
  673. dwId := Floor(dwId)
  674. if(dwId < 0 || dwId >= SAMP_PLAYER_MAX)
  675. return -1
  676. if(iRefreshScoreboard+iUpdateTick > A_TickCount)
  677. {
  678. if(oScoreboardData[dwId])
  679. return oScoreboardData[dwId].ISNPC
  680. return -1
  681. }
  682. if(!updateOScoreboardData())
  683. return -1
  684. if(oScoreboardData[dwId])
  685. return oScoreboardData[dwId].ISNPC
  686. return -1
  687. }
  688. getIP() {
  689. if(!checkHandles())
  690. return ""
  691. dwAddress := readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET)
  692. if(ErrorLevel || dwAddress==0) {
  693. ErrorLevel := ERROR_READ_MEMORY
  694. return ""
  695. }
  696. ipaddr := readString(hGTA, dwAddress+SAMP_SZIP_OFFSET, 257)
  697. if(ErrorLevel) {
  698. ErrorLevel := ERROR_READ_MEMORY
  699. return ""
  700. }
  701. return ipaddr
  702. }
  703. getHostname() {
  704. if(!checkHandles())
  705. return ""
  706. dwAddress := readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET)
  707. if(ErrorLevel || dwAddress==0) {
  708. ErrorLevel := ERROR_READ_MEMORY
  709. return ""
  710. }
  711. hostname := readString(hGTA, dwAddress+SAMP_SZHOSTNAME_OFFSET, 259)
  712. if(ErrorLevel) {
  713. ErrorLevel := ERROR_READ_MEMORY
  714. return ""
  715. }
  716. return hostname
  717. }
  718. CountOnlinePlayers() {
  719. if(!checkHandles())
  720. return -1
  721. dwOnline := readDWORD(hGTA, dwSAMP + 0x21A0B4)
  722. if(ErrorLevel) {
  723. ErrorLevel := ERROR_READ_MEMORY
  724. return -1
  725. }
  726. dwAddr := dwOnline + 0x4
  727. OnlinePlayers := readDWORD(hGTA, dwAddr)
  728. if(ErrorLevel) {
  729. ErrorLevel := ERROR_READ_MEMORY
  730. return -1
  731. }
  732. ErrorLevel := ERROR_OK
  733. return OnlinePlayers
  734. }
  735. updateScoreboardDataEx() {
  736. if(!checkHandles())
  737. return false
  738. dwAddress := readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET)
  739. if(ErrorLevel || dwAddress==0) {
  740. ErrorLevel := ERROR_READ_MEMORY
  741. return false
  742. }
  743. dwFunc := dwSAMP + FUNC_UPDATESCOREBOARD
  744. VarSetCapacity(injectData, 11, 0)
  745. NumPut(0xB9, injectData, 0, "UChar")
  746. NumPut(dwAddress, injectData, 1, "UInt")
  747. NumPut(0xE8, injectData, 5, "UChar")
  748. offset := dwFunc - (pInjectFunc + 10)
  749. NumPut(offset, injectData, 6, "Int")
  750. NumPut(0xC3, injectData, 10, "UChar")
  751. writeRaw(hGTA, pInjectFunc, &injectData, 11)
  752. if(ErrorLevel)
  753. return false
  754. hThread := createRemoteThread(hGTA, 0, 0, pInjectFunc, 0, 0, 0)
  755. if(ErrorLevel)
  756. return false
  757. waitForSingleObject(hThread, 0xFFFFFFFF)
  758. closeProcess(hThread)
  759. return true
  760. }
  761. updateOScoreboardData() {
  762. if(!checkHandles())
  763. return 0
  764. oScoreboardData := []
  765. if(!updateScoreboardDataEx())
  766. return 0
  767. iRefreshScoreboard := A_TickCount
  768. dwAddress := readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET)
  769. if(ErrorLevel || dwAddress==0) {
  770. ErrorLevel := ERROR_READ_MEMORY
  771. return 0
  772. }
  773. dwAddress := readDWORD(hGTA, dwAddress + SAMP_PPOOLS_OFFSET)
  774. if(ErrorLevel || dwAddress==0) {
  775. ErrorLevel := ERROR_READ_MEMORY
  776. return 0
  777. }
  778. dwPlayers := readDWORD(hGTA, dwAddress + SAMP_PPOOL_PLAYER_OFFSET)
  779. if(ErrorLevel || dwPlayers==0) {
  780. ErrorLevel := ERROR_READ_MEMORY
  781. return 0
  782. }
  783. wID := readMem(hGTA, dwPlayers + SAMP_SLOCALPLAYERID_OFFSET, 2, "Short")
  784. if(ErrorLevel) {
  785. ErrorLevel := ERROR_READ_MEMORY
  786. return 0
  787. }
  788. dwPing := readMem(hGTA, dwPlayers + SAMP_ILOCALPLAYERPING_OFFSET, 4, "Int")
  789. if(ErrorLevel) {
  790. ErrorLevel := ERROR_READ_MEMORY
  791. return 0
  792. }
  793. dwScore := readMem(hGTA, dwPlayers + SAMP_ILOCALPLAYERSCORE_OFFSET, 4, "Int")
  794. if(ErrorLevel) {
  795. ErrorLevel := ERROR_READ_MEMORY
  796. return 0
  797. }
  798. dwTemp := readMem(hGTA, dwPlayers + SAMP_ISTRLEN_LOCALPLAYERNAME_OFFSET, 4, "Int")
  799. if(ErrorLevel) {
  800. ErrorLevel := ERROR_READ_MEMORY
  801. return 0
  802. }
  803. sUsername := ""
  804. if(dwTemp <= 0xf) {
  805. sUsername := readString(hGTA, dwPlayers + SAMP_SZLOCALPLAYERNAME_OFFSET, 16)
  806. if(ErrorLevel) {
  807. ErrorLevel := ERROR_READ_MEMORY
  808. return 0
  809. }
  810. }
  811. else {
  812. dwAddress := readDWORD(hGTA, dwPlayers + SAMP_PSZLOCALPLAYERNAME_OFFSET)
  813. if(ErrorLevel) {
  814. ErrorLevel := ERROR_READ_MEMORY
  815. return 0
  816. }
  817. sUsername := readString(hGTA, dwAddress, 25)
  818. if(ErrorLevel) {
  819. ErrorLevel := ERROR_READ_MEMORY
  820. return 0
  821. }
  822. }
  823. oScoreboardData[wID] := Object("NAME", sUsername, "ID", wID, "PING", dwPing, "SCORE", dwScore, "ISNPC", 0)
  824. Loop, % SAMP_PLAYER_MAX
  825. {
  826. i := A_Index-1
  827. dwRemoteplayer := readDWORD(hGTA, dwPlayers+SAMP_PREMOTEPLAYER_OFFSET+i*4)
  828. if(ErrorLevel) {
  829. ErrorLevel := ERROR_READ_MEMORY
  830. return 0
  831. }
  832. if(dwRemoteplayer==0)
  833. continue
  834. dwPing := readMem(hGTA, dwRemoteplayer + SAMP_IPING_OFFSET, 4, "Int")
  835. if(ErrorLevel) {
  836. ErrorLevel := ERROR_READ_MEMORY
  837. return 0
  838. }
  839. dwScore := readMem(hGTA, dwRemoteplayer + SAMP_ISCORE_OFFSET, 4, "Int")
  840. if(ErrorLevel) {
  841. ErrorLevel := ERROR_READ_MEMORY
  842. return 0
  843. }
  844. dwIsNPC := readMem(hGTA, dwRemoteplayer + SAMP_ISNPC_OFFSET, 4, "Int")
  845. if(ErrorLevel) {
  846. ErrorLevel := ERROR_READ_MEMORY
  847. return 0
  848. }
  849. dwTemp := readMem(hGTA, dwRemoteplayer + SAMP_ISTRLENNAME___OFFSET, 4, "Int")
  850. if(ErrorLevel) {
  851. ErrorLevel := ERROR_READ_MEMORY
  852. return 0
  853. }
  854. sUsername := ""
  855. if(dwTemp <= 0xf)
  856. {
  857. sUsername := readString(hGTA, dwRemoteplayer+SAMP_SZPLAYERNAME_OFFSET, 16)
  858. if(ErrorLevel) {
  859. ErrorLevel := ERROR_READ_MEMORY
  860. return 0
  861. }
  862. }
  863. else {
  864. dwAddress := readDWORD(hGTA, dwRemoteplayer + SAMP_PSZPLAYERNAME_OFFSET)
  865. if(ErrorLevel || dwAddress==0) {
  866. ErrorLevel := ERROR_READ_MEMORY
  867. return 0
  868. }
  869. sUsername := readString(hGTA, dwAddress, 25)
  870. if(ErrorLevel) {
  871. ErrorLevel := ERROR_READ_MEMORY
  872. return 0
  873. }
  874. }
  875. o := Object("NAME", sUsername, "ID", i, "PING", dwPing, "SCORE", dwScore, "ISNPC", dwIsNPC)
  876. oScoreboardData[i] := o
  877. }
  878. ErrorLevel := ERROR_OK
  879. return 1
  880. }
  881. GetChatLine(Line, ByRef Output, timestamp=0, color=0){
  882. chatindex := 0
  883. FileRead, file, %A_MyDocuments%\GTA San Andreas User Files\SAMP\chatlog.txt
  884. loop, Parse, file, `n, `r
  885. {
  886. if(A_LoopField)
  887. chatindex := A_Index
  888. }
  889. loop, Parse, file, `n, `r
  890. {
  891. if(A_Index = chatindex - line){
  892. output := A_LoopField
  893. break
  894. }
  895. }
  896. file := ""
  897. if(!timestamp)
  898. output := RegExReplace(output, "U)^\[\d{2}:\d{2}:\d{2}\]")
  899. if(!color)
  900. output := RegExReplace(output, "Ui)\{[a-f0-9]{6}\}")
  901. return
  902. }
  903. getPlayerHealth() {
  904. if(!checkHandles())
  905. return -1
  906. dwCPedPtr := readDWORD(hGTA, ADDR_CPED_PTR)
  907. if(ErrorLevel) {
  908. ErrorLevel := ERROR_READ_MEMORY
  909. return -1
  910. }
  911. dwAddr := dwCPedPtr + ADDR_CPED_HPOFF
  912. fHealth := readFloat(hGTA, dwAddr)
  913. if(ErrorLevel) {
  914. ErrorLevel := ERROR_READ_MEMORY
  915. return -1
  916. }
  917. ErrorLevel := ERROR_OK
  918. return Round(fHealth)
  919. }
  920. getPlayerArmor() {
  921. if(!checkHandles())
  922. return -1
  923. dwCPedPtr := readDWORD(hGTA, ADDR_CPED_PTR)
  924. if(ErrorLevel) {
  925. ErrorLevel := ERROR_READ_MEMORY
  926. return -1
  927. }
  928. dwAddr := dwCPedPtr + ADDR_CPED_ARMOROFF
  929. fHealth := readFloat(hGTA, dwAddr)
  930. if(ErrorLevel) {
  931. ErrorLevel := ERROR_READ_MEMORY
  932. return -1
  933. }
  934. ErrorLevel := ERROR_OK
  935. return Round(fHealth)
  936. }
  937. getPlayerInteriorId() {
  938. if(!checkHandles())
  939. return -1
  940. iid := readMem(hGTA, ADDR_CPED_INTID, 4, "Int")
  941. if(ErrorLevel) {
  942. ErrorLevel := ERROR_READ_MEMORY
  943. return -1
  944. }
  945. ErrorLevel := ERROR_OK
  946. return iid
  947. }
  948. getPlayerMoney() {
  949. if(!checkHandles())
  950. return ""
  951. money := readMem(hGTA, ADDR_CPED_MONEY, 4, "Int")
  952. if(ErrorLevel) {
  953. ErrorLevel := ERROR_READ_MEMORY
  954. return ""
  955. }
  956. ErrorLevel := ERROR_OK
  957. return money
  958. }
  959. getPlayerWanteds() {
  960. if(!checkHandles())
  961. return -1
  962. dwPtr := 0xB7CD9C
  963. dwPtr := readDWORD(hGTA, dwPtr)
  964. if(ErrorLevel) {
  965. ErrorLevel := ERROR_READ_MEMORY
  966. return -1
  967. }
  968. Wantedsw := readDWORD(hGTA, dwPtr)
  969. if(ErrorLevel) {
  970. ErrorLevel := ERROR_READ_MEMORY
  971. return -1
  972. }
  973. ErrorLevel := ERROR_OK
  974. return Wantedsw
  975. }
  976. isPlayerInAnyVehicle()
  977. {
  978. if(!checkHandles())
  979. return -1
  980. dwVehPtr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
  981. if(ErrorLevel) {
  982. ErrorLevel := ERROR_READ_MEMORY
  983. return -1
  984. }
  985. return (dwVehPtr > 0)
  986. }
  987. isPlayerDriver() {
  988. if(!checkHandles())
  989. return -1
  990. dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
  991. if(ErrorLevel) {
  992. ErrorLevel := ERROR_READ_MEMORY
  993. return -1
  994. }
  995. if(!dwAddr)
  996. return -1
  997. dwCPedPtr := readDWORD(hGTA, ADDR_CPED_PTR)
  998. if(ErrorLevel) {
  999. ErrorLevel := ERROR_READ_MEMORY
  1000. return -1
  1001. }
  1002. dwVal := readDWORD(hGTA, dwAddr + ADDR_VEHICLE_DRIVER)
  1003. if(ErrorLevel) {
  1004. ErrorLevel := ERROR_READ_MEMORY
  1005. return -1
  1006. }
  1007. ErrorLevel := ERROR_OK
  1008. return (dwVal==dwCPedPtr)
  1009. }
  1010. getVehicleHealth() {
  1011. if(!checkHandles())
  1012. return -1
  1013. dwVehPtr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
  1014. if(ErrorLevel) {
  1015. ErrorLevel := ERROR_READ_MEMORY
  1016. return -1
  1017. }
  1018. dwAddr := dwVehPtr + ADDR_VEHICLE_HPOFF
  1019. fHealth := readFloat(hGTA, dwAddr)
  1020. if(ErrorLevel) {
  1021. ErrorLevel := ERROR_READ_MEMORY
  1022. return -1
  1023. }
  1024. ErrorLevel := ERROR_OK
  1025. return Round(fHealth)
  1026. }
  1027. getVehicleType() {
  1028. if(!checkHandles())
  1029. return 0
  1030. dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
  1031. if(ErrorLevel) {
  1032. ErrorLevel := ERROR_READ_MEMORY
  1033. return 0
  1034. }
  1035. if(!dwAddr)
  1036. return 0
  1037. cVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_TYPE, 1, "Char")
  1038. if(ErrorLevel) {
  1039. ErrorLevel := ERROR_READ_MEMORY
  1040. return 0
  1041. }
  1042. ErrorLevel := ERROR_OK
  1043. if(!cVal)
  1044. {
  1045. mid := getVehicleModelId()
  1046. Loop % oAirplaneModels.MaxIndex()
  1047. {
  1048. if(oAirplaneModels[A_Index]==mid)
  1049. return 5
  1050. }
  1051. return 1
  1052. }
  1053. else if(cVal==5)
  1054. return 2
  1055. else if(cVal==6)
  1056. return 3
  1057. else if(cVal==9)
  1058. {
  1059. mid := getVehicleModelId()
  1060. Loop % oBikeModels.MaxIndex()
  1061. {
  1062. if(oBikeModels[A_Index]==mid)
  1063. return 6
  1064. }
  1065. return 4
  1066. }
  1067. return 0
  1068. }
  1069. getVehicleModelId() {
  1070. if(!checkHandles())
  1071. return 0
  1072. dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
  1073. if(ErrorLevel) {
  1074. ErrorLevel := ERROR_READ_MEMORY
  1075. return 0
  1076. }
  1077. if(!dwAddr)
  1078. return 0
  1079. sVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_MODEL, 2, "Short")
  1080. if(ErrorLevel) {
  1081. ErrorLevel := ERROR_READ_MEMORY
  1082. return 0
  1083. }
  1084. ErrorLevel := ERROR_OK
  1085. return sVal
  1086. }
  1087. getVehicleModelName() {
  1088. id:=getVehicleModelId()
  1089. if(id>400 && id <611)
  1090. {
  1091. return ovehicleNames[id-399]
  1092. }
  1093. return ""
  1094. }
  1095. getVehicleLightState() {
  1096. if(!checkHandles())
  1097. return -1
  1098. dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
  1099. if(ErrorLevel) {
  1100. ErrorLevel := ERROR_READ_MEMORY
  1101. return -1
  1102. }
  1103. if(!dwAddr)
  1104. return -1
  1105. dwVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_LIGHTSTATE, 4, "Int")
  1106. if(ErrorLevel) {
  1107. ErrorLevel := ERROR_READ_MEMORY
  1108. return -1
  1109. }
  1110. ErrorLevel := ERROR_OK
  1111. return (dwVal>0)
  1112. }
  1113. getVehicleEngineState() {
  1114. if(!checkHandles())
  1115. return -1
  1116. dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
  1117. if(ErrorLevel) {
  1118. ErrorLevel := ERROR_READ_MEMORY
  1119. return -1
  1120. }
  1121. if(!dwAddr)
  1122. return -1
  1123. cVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_ENGINESTATE, 1, "Char")
  1124. if(ErrorLevel) {
  1125. ErrorLevel := ERROR_READ_MEMORY
  1126. return -1
  1127. }
  1128. ErrorLevel := ERROR_OK
  1129. return (cVal==24 || cVal==56 || cVal==88 || cVal==120)
  1130. }
  1131. getVehicleLockState() {
  1132. if(!checkHandles())
  1133. return -1
  1134. dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
  1135. if(ErrorLevel) {
  1136. ErrorLevel := ERROR_READ_MEMORY
  1137. return -1
  1138. }
  1139. if(!dwAddr)
  1140. return -1
  1141. dwVal := readDWORD(hGTA, dwAddr + ADDR_VEHICLE_DOORSTATE)
  1142. if(ErrorLevel) {
  1143. ErrorLevel := ERROR_READ_MEMORY
  1144. return -1
  1145. }
  1146. ErrorLevel := ERROR_OK
  1147. return (dwVal==2)
  1148. }
  1149. GetVehicleSpeed()
  1150. {
  1151. if(!checkHandles())
  1152. return -1
  1153. dwAddr := readDWORD(hGTA,ADDR_VEHICLE_CVEH)
  1154. if(ErrorLevel) {
  1155. ErrorLevel := ERROR_READ_MEMORY
  1156. return -1
  1157. }
  1158. SpeedX := readFloat(hGTA, dwAddr+ADDR_VEHICLE_SPEED_X)
  1159. if(ErrorLevel) {
  1160. ErrorLevel := ERROR_READ_MEMORY
  1161. return -1
  1162. }
  1163. SpeedY := readFloat(hGTA, dwAddr+ADDR_VEHICLE_SPEED_Y)
  1164. if(ErrorLevel) {
  1165. ErrorLevel := ERROR_READ_MEMORY
  1166. return -1
  1167. }
  1168. SpeedZ := readFloat(hGTA, dwAddr+ADDR_VEHICLE_SPEED_Z)
  1169. if(ErrorLevel) {
  1170. ErrorLevel := ERROR_READ_MEMORY
  1171. return -1
  1172. }
  1173. SpeedX := (SpeedX*145)**2
  1174. SpeedY := (SpeedY*145)**2
  1175. SpeedZ := (SpeedZ*145)**2
  1176. Speed := Sqrt(SpeedX+SpeedY+SpeedZ)
  1177. Speed := Round(Speed)
  1178. return Speed
  1179. }
  1180. getCoordinates() {
  1181. if(!checkHandles())
  1182. return ""
  1183. fX := readFloat(hGTA, ADDR_POSITION_X)
  1184. if(ErrorLevel) {
  1185. ErrorLevel := ERROR_READ_MEMORY
  1186. return ""
  1187. }
  1188. fY := readFloat(hGTA, ADDR_POSITION_Y)
  1189. if(ErrorLevel) {
  1190. ErrorLevel := ERROR_READ_MEMORY
  1191. return ""
  1192. }
  1193. fZ := readFloat(hGTA, ADDR_POSITION_Z)
  1194. if(ErrorLevel) {
  1195. ErrorLevel := ERROR_READ_MEMORY
  1196. return ""
  1197. }
  1198. ErrorLevel := ERROR_OK
  1199. return [fX, fY, fZ]
  1200. }
  1201. GetPlayerPos(ByRef fX,ByRef fY,ByRef fZ) {
  1202. if(!checkHandles())
  1203. return 0
  1204. fX := readFloat(hGTA, ADDR_POSITION_X)
  1205. if(ErrorLevel) {
  1206. ErrorLevel := ERROR_READ_MEMORY
  1207. return 0
  1208. }
  1209. fY := readFloat(hGTA, ADDR_POSITION_Y)
  1210. if(ErrorLevel) {
  1211. ErrorLevel := ERROR_READ_MEMORY
  1212. return 0
  1213. }
  1214. fZ := readFloat(hGTA, ADDR_POSITION_Z)
  1215. if(ErrorLevel) {
  1216. ErrorLevel := ERROR_READ_MEMORY
  1217. return 0
  1218. }
  1219. ErrorLevel := ERROR_OK
  1220. }
  1221. initZonesAndCities() {
  1222. AddCity("Las Venturas", 685.0, 476.093, -500.0, 3000.0, 3000.0, 500.0)
  1223. AddCity("San Fierro", -3000.0, -742.306, -500.0, -1270.53, 1530.24, 500.0)
  1224. AddCity("San Fierro", -1270.53, -402.481, -500.0, -1038.45, 832.495, 500.0)
  1225. AddCity("San Fierro", -1038.45, -145.539, -500.0, -897.546, 376.632, 500.0)
  1226. AddCity("Los Santos", 480.0, -3000.0, -500.0, 3000.0, -850.0, 500.0)
  1227. AddCity("Los Santos", 80.0, -2101.61, -500.0, 1075.0, -1239.61, 500.0)
  1228. AddCity("Tierra Robada", -1213.91, 596.349, -242.99, -480.539, 1659.68, 900.0)
  1229. AddCity("Red County", -1213.91, -768.027, -242.99, 2997.06, 596.349, 900.0)
  1230. AddCity("Flint County", -1213.91, -2892.97, -242.99, 44.6147, -768.027, 900.0)
  1231. AddCity("Whetstone", -2997.47, -2892.97, -242.99, -1213.91, -1115.58, 900.0)
  1232. AddZone("Avispa Country Club", -2667.810, -302.135, -28.831, -2646.400, -262.320, 71.169)
  1233. AddZone("Easter Bay Airport", -1315.420, -405.388, 15.406, -1264.400, -209.543, 25.406)
  1234. AddZone("Avispa Country Club", -2550.040, -355.493, 0.000, -2470.040, -318.493, 39.700)
  1235. AddZone("Easter Bay Airport", -1490.330, -209.543, 15.406, -1264.400, -148.388, 25.406)
  1236. AddZone("Garcia", -2395.140, -222.589, -5.3, -2354.090, -204.792, 200.000)
  1237. AddZone("Shady Cabin", -1632.830, -2263.440, -3.0, -1601.330, -2231.790, 200.000)
  1238. AddZone("East Los Santos", 2381.680, -1494.030, -89.084, 2421.030, -1454.350, 110.916)
  1239. AddZone("LVA Freight Depot", 1236.630, 1163.410, -89.084, 1277.050, 1203.280, 110.916)
  1240. AddZone("Blackfield Intersection", 1277.050, 1044.690, -89.084, 1315.350, 1087.630, 110.916)
  1241. AddZone("Avispa Country Club", -2470.040, -355.493, 0.000, -2270.040, -318.493, 46.100)
  1242. AddZone("Temple", 1252.330, -926.999, -89.084, 1357.000, -910.170, 110.916)
  1243. AddZone("Unity Station", 1692.620, -1971.800, -20.492, 1812.620, -1932.800, 79.508)
  1244. AddZone("LVA Freight Depot", 1315.350, 1044.690, -89.084, 1375.600, 1087.630, 110.916)
  1245. AddZone("Los Flores", 2581.730, -1454.350, -89.084, 2632.830, -1393.420, 110.916)
  1246. AddZone("Starfish Casino", 2437.390, 1858.100, -39.084, 2495.090, 1970.850, 60.916)
  1247. AddZone("Easter Bay Chemicals", -1132.820, -787.391, 0.000, -956.476, -768.027, 200.000)
  1248. AddZone("Downtown Los Santos", 1370.850, -1170.870, -89.084, 1463.900, -1130.850, 110.916)
  1249. AddZone("Esplanade East", -1620.300, 1176.520, -4.5, -1580.010, 1274.260, 200.000)
  1250. AddZone("Market Station", 787.461, -1410.930, -34.126, 866.009, -1310.210, 65.874)
  1251. AddZone("Linden Station", 2811.250, 1229.590, -39.594, 2861.250, 1407.590, 60.406)
  1252. AddZone("Montgomery Intersection", 1582.440, 347.457, 0.000, 1664.620, 401.750, 200.000)
  1253. AddZone("Frederick Bridge", 2759.250, 296.501, 0.000, 2774.250, 594.757, 200.000)
  1254. AddZone("Yellow Bell Station", 1377.480, 2600.430, -21.926, 1492.450, 2687.360, 78.074)
  1255. AddZone("Downtown Los Santos", 1507.510, -1385.210, 110.916, 1582.550, -1325.310, 335.916)
  1256. AddZone("Jefferson", 2185.330, -1210.740, -89.084, 2281.450, -1154.590, 110.916)
  1257. AddZone("Mulholland", 1318.130, -910.170, -89.084, 1357.000, -768.027, 110.916)
  1258. AddZone("Avispa Country Club", -2361.510, -417.199, 0.000, -2270.040, -355.493, 200.000)
  1259. AddZone("Jefferson", 1996.910, -1449.670, -89.084, 2056.860, -1350.720, 110.916)
  1260. AddZone("Julius Thruway West", 1236.630, 2142.860, -89.084, 1297.470, 2243.230, 110.916)
  1261. AddZone("Jefferson", 2124.660, -1494.030, -89.084, 2266.210, -1449.670, 110.916)
  1262. AddZone("Julius Thruway North", 1848.400, 2478.490, -89.084, 1938.800, 2553.490, 110.916)
  1263. AddZone("Rodeo", 422.680, -1570.200, -89.084, 466.223, -1406.050, 110.916)
  1264. AddZone("Cranberry Station", -2007.830, 56.306, 0.000, -1922.000, 224.782, 100.000)
  1265. AddZone("Downtown Los Santos", 1391.050, -1026.330, -89.084, 1463.900, -926.999, 110.916)
  1266. AddZone("Redsands West", 1704.590, 2243.230, -89.084, 1777.390, 2342.830, 110.916)
  1267. AddZone("Little Mexico", 1758.900, -1722.260, -89.084, 1812.620, -1577.590, 110.916)
  1268. AddZone("Blackfield Intersection", 1375.600, 823.228, -89.084, 1457.390, 919.447, 110.916)
  1269. AddZone("Los Santos International", 1974.630, -2394.330, -39.084, 2089.000, -2256.590, 60.916)
  1270. AddZone("Beacon Hill", -399.633, -1075.520, -1.489, -319.033, -977.516, 198.511)
  1271. AddZone("Rodeo", 334.503, -1501.950, -89.084, 422.680, -1406.050, 110.916)
  1272. AddZone("Richman", 225.165, -1369.620, -89.084, 334.503, -1292.070, 110.916)
  1273. AddZone("Downtown Los Santos", 1724.760, -1250.900, -89.084, 1812.620, -1150.870, 110.916)
  1274. AddZone("The Strip", 2027.400, 1703.230, -89.084, 2137.400, 1783.230, 110.916)
  1275. AddZone("Downtown Los Santos", 1378.330, -1130.850, -89.084, 1463.900, -1026.330, 110.916)
  1276. AddZone("Blackfield Intersection", 1197.390, 1044.690, -89.084, 1277.050, 1163.390, 110.916)
  1277. AddZone("Conference Center", 1073.220, -1842.270, -89.084, 1323.900, -1804.210, 110.916)
  1278. AddZone("Montgomery", 1451.400, 347.457, -6.1, 1582.440, 420.802, 200.000)
  1279. AddZone("Foster Valley", -2270.040, -430.276, -1.2, -2178.690, -324.114, 200.000)
  1280. AddZone("Blackfield Chapel", 1325.600, 596.349, -89.084, 1375.600, 795.010, 110.916)
  1281. AddZone("Los Santos International", 2051.630, -2597.260, -39.084, 2152.450, -2394.330, 60.916)
  1282. AddZone("Mulholland", 1096.470, -910.170, -89.084, 1169.130, -768.027, 110.916)
  1283. AddZone("Yellow Bell Gol Course", 1457.460, 2723.230, -89.084, 1534.560, 2863.230, 110.916)
  1284. AddZone("The Strip", 2027.400, 1783.230, -89.084, 2162.390, 1863.230, 110.916)
  1285. AddZone("Jefferson", 2056.860, -1210.740, -89.084, 2185.330, -1126.320, 110.916)
  1286. AddZone("Mulholland", 952.604, -937.184, -89.084, 1096.470, -860.619, 110.916)
  1287. AddZone("Aldea Malvada", -1372.140, 2498.520, 0.000, -1277.590, 2615.350, 200.000)
  1288. AddZone("Las Colinas", 2126.860, -1126.320, -89.084, 2185.330, -934.489, 110.916)
  1289. AddZone("Las Colinas", 1994.330, -1100.820, -89.084, 2056.860, -920.815, 110.916)
  1290. AddZone("Richman", 647.557, -954.662, -89.084, 768.694, -860.619, 110.916)
  1291. AddZone("LVA Freight Depot", 1277.050, 1087.630, -89.084, 1375.600, 1203.280, 110.916)
  1292. AddZone("Julius Thruway North", 1377.390, 2433.230, -89.084, 1534.560, 2507.230, 110.916)
  1293. AddZone("Willowfield", 2201.820, -2095.000, -89.084, 2324.000, -1989.900, 110.916)
  1294. AddZone("Julius Thruway North", 1704.590, 2342.830, -89.084, 1848.400, 2433.230, 110.916)
  1295. AddZone("Temple", 1252.330, -1130.850, -89.084, 1378.330, -1026.330, 110.916)
  1296. AddZone("Little Mexico", 1701.900, -1842.270, -89.084, 1812.620, -1722.260, 110.916)
  1297. AddZone("Queens", -2411.220, 373.539, 0.000, -2253.540, 458.411, 200.000)
  1298. AddZone("Las Venturas Airport", 1515.810, 1586.400, -12.500, 1729.950, 1714.560, 87.500)
  1299. AddZone("Richman", 225.165, -1292.070, -89.084, 466.223, -1235.070, 110.916)
  1300. AddZone("Temple", 1252.330, -1026.330, -89.084, 1391.050, -926.999, 110.916)
  1301. AddZone("East Los Santos", 2266.260, -1494.030, -89.084, 2381.680, -1372.040, 110.916)
  1302. AddZone("Julius Thruway East", 2623.180, 943.235, -89.084, 2749.900, 1055.960, 110.916)
  1303. AddZone("Willowfield", 2541.700, -1941.400, -89.084, 2703.580, -1852.870, 110.916)
  1304. AddZone("Las Colinas", 2056.860, -1126.320, -89.084, 2126.860, -920.815, 110.916)
  1305. AddZone("Julius Thruway East", 2625.160, 2202.760, -89.084, 2685.160, 2442.550, 110.916)
  1306. AddZone("Rodeo", 225.165, -1501.950, -89.084, 334.503, -1369.620, 110.916)
  1307. AddZone("Las Brujas", -365.167, 2123.010, -3.0, -208.570, 2217.680, 200.000)
  1308. AddZone("Julius Thruway East", 2536.430, 2442.550, -89.084, 2685.160, 2542.550, 110.916)
  1309. AddZone("Rodeo", 334.503, -1406.050, -89.084, 466.223, -1292.070, 110.916)
  1310. AddZone("Vinewood", 647.557, -1227.280, -89.084, 787.461, -1118.280, 110.916)
  1311. AddZone("Rodeo", 422.680, -1684.650, -89.084, 558.099, -1570.200, 110.916)
  1312. AddZone("Julius Thruway North", 2498.210, 2542.550, -89.084, 2685.160, 2626.550, 110.916)
  1313. AddZone("Downtown Los Santos", 1724.760, -1430.870, -89.084, 1812.620, -1250.900, 110.916)
  1314. AddZone("Rodeo", 225.165, -1684.650, -89.084, 312.803, -1501.950, 110.916)
  1315. AddZone("Jefferson", 2056.860, -1449.670, -89.084, 2266.210, -1372.040, 110.916)
  1316. AddZone("Hampton Barns", 603.035, 264.312, 0.000, 761.994, 366.572, 200.000)
  1317. AddZone("Temple", 1096.470, -1130.840, -89.084, 1252.330, -1026.330, 110.916)
  1318. AddZone("Kincaid Bridge", -1087.930, 855.370, -89.084, -961.950, 986.281, 110.916)
  1319. AddZone("Verona Beach", 1046.150, -1722.260, -89.084, 1161.520, -1577.590, 110.916)
  1320. AddZone("Commerce", 1323.900, -1722.260, -89.084, 1440.900, -1577.590, 110.916)
  1321. AddZone("Mulholland", 1357.000, -926.999, -89.084, 1463.900, -768.027, 110.916)
  1322. AddZone("Rodeo", 466.223, -1570.200, -89.084, 558.099, -1385.070, 110.916)
  1323. AddZone("Mulholland", 911.802, -860.619, -89.084, 1096.470, -768.027, 110.916)
  1324. AddZone("Mulholland", 768.694, -954.662, -89.084, 952.604, -860.619, 110.916)
  1325. AddZone("Julius Thruway South", 2377.390, 788.894, -89.084, 2537.390, 897.901, 110.916)
  1326. AddZone("Idlewood", 1812.620, -1852.870, -89.084, 1971.660, -1742.310, 110.916)
  1327. AddZone("Ocean Docks", 2089.000, -2394.330, -89.084, 2201.820, -2235.840, 110.916)
  1328. AddZone("Commerce", 1370.850, -1577.590, -89.084, 1463.900, -1384.950, 110.916)
  1329. AddZone("Julius Thruway North", 2121.400, 2508.230, -89.084, 2237.400, 2663.170, 110.916)
  1330. AddZone("Temple", 1096.470, -1026.330, -89.084, 1252.330, -910.170, 110.916)
  1331. AddZone("Glen Park", 1812.620, -1449.670, -89.084, 1996.910, -1350.720, 110.916)
  1332. AddZone("Easter Bay Airport", -1242.980, -50.096, 0.000, -1213.910, 578.396, 200.000)
  1333. AddZone("Martin Bridge", -222.179, 293.324, 0.000, -122.126, 476.465, 200.000)
  1334. AddZone("The Strip", 2106.700, 1863.230, -89.084, 2162.390, 2202.760, 110.916)
  1335. AddZone("Willowfield", 2541.700, -2059.230, -89.084, 2703.580, -1941.400, 110.916)
  1336. AddZone("Marina", 807.922, -1577.590, -89.084, 926.922, -1416.250, 110.916)
  1337. AddZone("Las Venturas Airport", 1457.370, 1143.210, -89.084, 1777.400, 1203.280, 110.916)
  1338. AddZone("Idlewood", 1812.620, -1742.310, -89.084, 1951.660, -1602.310, 110.916)
  1339. AddZone("Esplanade East", -1580.010, 1025.980, -6.1, -1499.890, 1274.260, 200.000)
  1340. AddZone("Downtown Los Santos", 1370.850, -1384.950, -89.084, 1463.900, -1170.870, 110.916)
  1341. AddZone("The Mako Span", 1664.620, 401.750, 0.000, 1785.140, 567.203, 200.000)
  1342. AddZone("Rodeo", 312.803, -1684.650, -89.084, 422.680, -1501.950, 110.916)
  1343. AddZone("Pershing Square", 1440.900, -1722.260, -89.084, 1583.500, -1577.590, 110.916)
  1344. AddZone("Mulholland", 687.802, -860.619, -89.084, 911.802, -768.027, 110.916)
  1345. AddZone("Gant Bridge", -2741.070, 1490.470, -6.1, -2616.400, 1659.680, 200.000)
  1346. AddZone("Las Colinas", 2185.330, -1154.590, -89.084, 2281.450, -934.489, 110.916)
  1347. AddZone("Mulholland", 1169.130, -910.170, -89.084, 1318.130, -768.027, 110.916)
  1348. AddZone("Julius Thruway North", 1938.800, 2508.230, -89.084, 2121.400, 2624.230, 110.916)
  1349. AddZone("Commerce", 1667.960, -1577.590, -89.084, 1812.620, -1430.870, 110.916)
  1350. AddZone("Rodeo", 72.648, -1544.170, -89.084, 225.165, -1404.970, 110.916)
  1351. AddZone("Roca Escalante", 2536.430, 2202.760, -89.084, 2625.160, 2442.550, 110.916)
  1352. AddZone("Rodeo", 72.648, -1684.650, -89.084, 225.165, -1544.170, 110.916)
  1353. AddZone("Market", 952.663, -1310.210, -89.084, 1072.660, -1130.850, 110.916)
  1354. AddZone("Las Colinas", 2632.740, -1135.040, -89.084, 2747.740, -945.035, 110.916)
  1355. AddZone("Mulholland", 861.085, -674.885, -89.084, 1156.550, -600.896, 110.916)
  1356. AddZone("King's", -2253.540, 373.539, -9.1, -1993.280, 458.411, 200.000)
  1357. AddZone("Redsands East", 1848.400, 2342.830, -89.084, 2011.940, 2478.490, 110.916)
  1358. AddZone("Downtown", -1580.010, 744.267, -6.1, -1499.890, 1025.980, 200.000)
  1359. AddZone("Conference Center", 1046.150, -1804.210, -89.084, 1323.900, -1722.260, 110.916)
  1360. AddZone("Richman", 647.557, -1118.280, -89.084, 787.461, -954.662, 110.916)
  1361. AddZone("Ocean Flats", -2994.490, 277.411, -9.1, -2867.850, 458.411, 200.000)
  1362. AddZone("Greenglass College", 964.391, 930.890, -89.084, 1166.530, 1044.690, 110.916)
  1363. AddZone("Glen Park", 1812.620, -1100.820, -89.084, 1994.330, -973.380, 110.916)
  1364. AddZone("LVA Freight Depot", 1375.600, 919.447, -89.084, 1457.370, 1203.280, 110.916)
  1365. AddZone("Regular Tom", -405.770, 1712.860, -3.0, -276.719, 1892.750, 200.000)
  1366. AddZone("Verona Beach", 1161.520, -1722.260, -89.084, 1323.900, -1577.590, 110.916)
  1367. AddZone("East Los Santos", 2281.450, -1372.040, -89.084, 2381.680, -1135.040, 110.916)
  1368. AddZone("Caligula's Palace", 2137.400, 1703.230, -89.084, 2437.390, 1783.230, 110.916)
  1369. AddZone("Idlewood", 1951.660, -1742.310, -89.084, 2124.660, -1602.310, 110.916)
  1370. AddZone("Pilgrim", 2624.400, 1383.230, -89.084, 2685.160, 1783.230, 110.916)
  1371. AddZone("Idlewood", 2124.660, -1742.310, -89.084, 2222.560, -1494.030, 110.916)
  1372. AddZone("Queens", -2533.040, 458.411, 0.000, -2329.310, 578.396, 200.000)
  1373. AddZone("Downtown", -1871.720, 1176.420, -4.5, -1620.300, 1274.260, 200.000)
  1374. AddZone("Commerce", 1583.500, -1722.260, -89.084, 1758.900, -1577.590, 110.916)
  1375. AddZone("East Los Santos", 2381.680, -1454.350, -89.084, 2462.130, -1135.040, 110.916)
  1376. AddZone("Marina", 647.712, -1577.590, -89.084, 807.922, -1416.250, 110.916)
  1377. AddZone("Richman", 72.648, -1404.970, -89.084, 225.165, -1235.070, 110.916)
  1378. AddZone("Vinewood", 647.712, -1416.250, -89.084, 787.461, -1227.280, 110.916)
  1379. AddZone("East Los Santos", 2222.560, -1628.530, -89.084, 2421.030, -1494.030, 110.916)
  1380. AddZone("Rodeo", 558.099, -1684.650, -89.084, 647.522, -1384.930, 110.916)
  1381. AddZone("Easter Tunnel", -1709.710, -833.034, -1.5, -1446.010, -730.118, 200.000)
  1382. AddZone("Rodeo", 466.223, -1385.070, -89.084, 647.522, -1235.070, 110.916)
  1383. AddZone("Redsands East", 1817.390, 2202.760, -89.084, 2011.940, 2342.830, 110.916)
  1384. AddZone("The Clown's Pocket", 2162.390, 1783.230, -89.084, 2437.390, 1883.230, 110.916)
  1385. AddZone("Idlewood", 1971.660, -1852.870, -89.084, 2222.560, -1742.310, 110.916)
  1386. AddZone("Montgomery Intersection", 1546.650, 208.164, 0.000, 1745.830, 347.457, 200.000)
  1387. AddZone("Willowfield", 2089.000, -2235.840, -89.084, 2201.820, -1989.900, 110.916)
  1388. AddZone("Temple", 952.663, -1130.840, -89.084, 1096.470, -937.184, 110.916)
  1389. AddZone("Prickle Pine", 1848.400, 2553.490, -89.084, 1938.800, 2863.230, 110.916)
  1390. AddZone("Los Santos International", 1400.970, -2669.260, -39.084, 2189.820, -2597.260, 60.916)
  1391. AddZone("Garver Bridge", -1213.910, 950.022, -89.084, -1087.930, 1178.930, 110.916)
  1392. AddZone("Garver Bridge", -1339.890, 828.129, -89.084, -1213.910, 1057.040, 110.916)
  1393. AddZone("Kincaid Bridge", -1339.890, 599.218, -89.084, -1213.910, 828.129, 110.916)
  1394. AddZone("Kincaid Bridge", -1213.910, 721.111, -89.084, -1087.930, 950.022, 110.916)
  1395. AddZone("Verona Beach", 930.221, -2006.780, -89.084, 1073.220, -1804.210, 110.916)
  1396. AddZone("Verdant Bluffs", 1073.220, -2006.780, -89.084, 1249.620, -1842.270, 110.916)
  1397. AddZone("Vinewood", 787.461, -1130.840, -89.084, 952.604, -954.662, 110.916)
  1398. AddZone("Vinewood", 787.461, -1310.210, -89.084, 952.663, -1130.840, 110.916)
  1399. AddZone("Commerce", 1463.900, -1577.590, -89.084, 1667.960, -1430.870, 110.916)
  1400. AddZone("Market", 787.461, -1416.250, -89.084, 1072.660, -1310.210, 110.916)
  1401. AddZone("Rockshore West", 2377.390, 596.349, -89.084, 2537.390, 788.894, 110.916)
  1402. AddZone("Julius Thruway North", 2237.400, 2542.550, -89.084, 2498.210, 2663.170, 110.916)
  1403. AddZone("East Beach", 2632.830, -1668.130, -89.084, 2747.740, -1393.420, 110.916)
  1404. AddZone("Fallow Bridge", 434.341, 366.572, 0.000, 603.035, 555.680, 200.000)
  1405. AddZone("Willowfield", 2089.000, -1989.900, -89.084, 2324.000, -1852.870, 110.916)
  1406. AddZone("Chinatown", -2274.170, 578.396, -7.6, -2078.670, 744.170, 200.000)
  1407. AddZone("El Castillo del Diablo", -208.570, 2337.180, 0.000, 8.430, 2487.180, 200.000)
  1408. AddZone("Ocean Docks", 2324.000, -2145.100, -89.084, 2703.580, -2059.230, 110.916)
  1409. AddZone("Easter Bay Chemicals", -1132.820, -768.027, 0.000, -956.476, -578.118, 200.000)
  1410. AddZone("The Visage", 1817.390, 1703.230, -89.084, 2027.400, 1863.230, 110.916)
  1411. AddZone("Ocean Flats", -2994.490, -430.276, -1.2, -2831.890, -222.589, 200.000)
  1412. AddZone("Richman", 321.356, -860.619, -89.084, 687.802, -768.027, 110.916)
  1413. AddZone("Green Palms", 176.581, 1305.450, -3.0, 338.658, 1520.720, 200.000)
  1414. AddZone("Richman", 321.356, -768.027, -89.084, 700.794, -674.885, 110.916)
  1415. AddZone("Starfish Casino", 2162.390, 1883.230, -89.084, 2437.390, 2012.180, 110.916)
  1416. AddZone("East Beach", 2747.740, -1668.130, -89.084, 2959.350, -1498.620, 110.916)
  1417. AddZone("Jefferson", 2056.860, -1372.040, -89.084, 2281.450, -1210.740, 110.916)
  1418. AddZone("Downtown Los Santos", 1463.900, -1290.870, -89.084, 1724.760, -1150.870, 110.916)
  1419. AddZone("Downtown Los Santos", 1463.900, -1430.870, -89.084, 1724.760, -1290.870, 110.916)
  1420. AddZone("Garver Bridge", -1499.890, 696.442, -179.615, -1339.890, 925.353, 20.385)
  1421. AddZone("Julius Thruway South", 1457.390, 823.228, -89.084, 2377.390, 863.229, 110.916)
  1422. AddZone("East Los Santos", 2421.030, -1628.530, -89.084, 2632.830, -1454.350, 110.916)
  1423. AddZone("Greenglass College", 964.391, 1044.690, -89.084, 1197.390, 1203.220, 110.916)
  1424. AddZone("Las Colinas", 2747.740, -1120.040, -89.084, 2959.350, -945.035, 110.916)
  1425. AddZone("Mulholland", 737.573, -768.027, -89.084, 1142.290, -674.885, 110.916)
  1426. AddZone("Ocean Docks", 2201.820, -2730.880, -89.084, 2324.000, -2418.330, 110.916)
  1427. AddZone("East Los Santos", 2462.130, -1454.350, -89.084, 2581.730, -1135.040, 110.916)
  1428. AddZone("Ganton", 2222.560, -1722.330, -89.084, 2632.830, -1628.530, 110.916)
  1429. AddZone("Avispa Country Club", -2831.890, -430.276, -6.1, -2646.400, -222.589, 200.000)
  1430. AddZone("Willowfield", 1970.620, -2179.250, -89.084, 2089.000, -1852.870, 110.916)
  1431. AddZone("Esplanade North", -1982.320, 1274.260, -4.5, -1524.240, 1358.900, 200.000)
  1432. AddZone("The High Roller", 1817.390, 1283.230, -89.084, 2027.390, 1469.230, 110.916)
  1433. AddZone("Ocean Docks", 2201.820, -2418.330, -89.084, 2324.000, -2095.000, 110.916)
  1434. AddZone("Last Dime Motel", 1823.080, 596.349, -89.084, 1997.220, 823.228, 110.916)
  1435. AddZone("Bayside Marina", -2353.170, 2275.790, 0.000, -2153.170, 2475.790, 200.000)
  1436. AddZone("King's", -2329.310, 458.411, -7.6, -1993.280, 578.396, 200.000)
  1437. AddZone("El Corona", 1692.620, -2179.250, -89.084, 1812.620, -1842.270, 110.916)
  1438. AddZone("Blackfield Chapel", 1375.600, 596.349, -89.084, 1558.090, 823.228, 110.916)
  1439. AddZone("The Pink Swan", 1817.390, 1083.230, -89.084, 2027.390, 1283.230, 110.916)
  1440. AddZone("Julius Thruway West", 1197.390, 1163.390, -89.084, 1236.630, 2243.230, 110.916)
  1441. AddZone("Los Flores", 2581.730, -1393.420, -89.084, 2747.740, -1135.040, 110.916)
  1442. AddZone("The Visage", 1817.390, 1863.230, -89.084, 2106.700, 2011.830, 110.916)
  1443. AddZone("Prickle Pine", 1938.800, 2624.230, -89.084, 2121.400, 2861.550, 110.916)
  1444. AddZone("Verona Beach", 851.449, -1804.210, -89.084, 1046.150, -1577.590, 110.916)
  1445. AddZone("Robada Intersection", -1119.010, 1178.930, -89.084, -862.025, 1351.450, 110.916)
  1446. AddZone("Linden Side", 2749.900, 943.235, -89.084, 2923.390, 1198.990, 110.916)
  1447. AddZone("Ocean Docks", 2703.580, -2302.330, -89.084, 2959.350, -2126.900, 110.916)
  1448. AddZone("Willowfield", 2324.000, -2059.230, -89.084, 2541.700, -1852.870, 110.916)
  1449. AddZone("King's", -2411.220, 265.243, -9.1, -1993.280, 373.539, 200.000)
  1450. AddZone("Commerce", 1323.900, -1842.270, -89.084, 1701.900, -1722.260, 110.916)
  1451. AddZone("Mulholland", 1269.130, -768.027, -89.084, 1414.070, -452.425, 110.916)
  1452. AddZone("Marina", 647.712, -1804.210, -89.084, 851.449, -1577.590, 110.916)
  1453. AddZone("Battery Point", -2741.070, 1268.410, -4.5, -2533.040, 1490.470, 200.000)
  1454. AddZone("The Four Dragons Casino", 1817.390, 863.232, -89.084, 2027.390, 1083.230, 110.916)
  1455. AddZone("Blackfield", 964.391, 1203.220, -89.084, 1197.390, 1403.220, 110.916)
  1456. AddZone("Julius Thruway North", 1534.560, 2433.230, -89.084, 1848.400, 2583.230, 110.916)
  1457. AddZone("Yellow Bell Gol Course", 1117.400, 2723.230, -89.084, 1457.460, 2863.230, 110.916)
  1458. AddZone("Idlewood", 1812.620, -1602.310, -89.084, 2124.660, -1449.670, 110.916)
  1459. AddZone("Redsands West", 1297.470, 2142.860, -89.084, 1777.390, 2243.230, 110.916)
  1460. AddZone("Doherty", -2270.040, -324.114, -1.2, -1794.920, -222.589, 200.000)
  1461. AddZone("Hilltop Farm", 967.383, -450.390, -3.0, 1176.780, -217.900, 200.000)
  1462. AddZone("Las Barrancas", -926.130, 1398.730, -3.0, -719.234, 1634.690, 200.000)
  1463. AddZone("Pirates in Men's Pants", 1817.390, 1469.230, -89.084, 2027.400, 1703.230, 110.916)
  1464. AddZone("City Hall", -2867.850, 277.411, -9.1, -2593.440, 458.411, 200.000)
  1465. AddZone("Avispa Country Club", -2646.400, -355.493, 0.000, -2270.040, -222.589, 200.000)
  1466. AddZone("The Strip", 2027.400, 863.229, -89.084, 2087.390, 1703.230, 110.916)
  1467. AddZone("Hashbury", -2593.440, -222.589, -1.0, -2411.220, 54.722, 200.000)
  1468. AddZone("Los Santos International", 1852.000, -2394.330, -89.084, 2089.000, -2179.250, 110.916)
  1469. AddZone("Whitewood Estates", 1098.310, 1726.220, -89.084, 1197.390, 2243.230, 110.916)
  1470. AddZone("Sherman Reservoir", -789.737, 1659.680, -89.084, -599.505, 1929.410, 110.916)
  1471. AddZone("El Corona", 1812.620, -2179.250, -89.084, 1970.620, -1852.870, 110.916)
  1472. AddZone("Downtown", -1700.010, 744.267, -6.1, -1580.010, 1176.520, 200.000)
  1473. AddZone("Foster Valley", -2178.690, -1250.970, 0.000, -1794.920, -1115.580, 200.000)
  1474. AddZone("Las Payasadas", -354.332, 2580.360, 2.0, -133.625, 2816.820, 200.000)
  1475. AddZone("Valle Ocultado", -936.668, 2611.440, 2.0, -715.961, 2847.900, 200.000)
  1476. AddZone("Blackfield Intersection", 1166.530, 795.010, -89.084, 1375.600, 1044.690, 110.916)
  1477. AddZone("Ganton", 2222.560, -1852.870, -89.084, 2632.830, -1722.330, 110.916)
  1478. AddZone("Easter Bay Airport", -1213.910, -730.118, 0.000, -1132.820, -50.096, 200.000)
  1479. AddZone("Redsands East", 1817.390, 2011.830, -89.084, 2106.700, 2202.760, 110.916)
  1480. AddZone("Esplanade East", -1499.890, 578.396, -79.615, -1339.890, 1274.260, 20.385)
  1481. AddZone("Caligula's Palace", 2087.390, 1543.230, -89.084, 2437.390, 1703.230, 110.916)
  1482. AddZone("Royal Casino", 2087.390, 1383.230, -89.084, 2437.390, 1543.230, 110.916)
  1483. AddZone("Richman", 72.648, -1235.070, -89.084, 321.356, -1008.150, 110.916)
  1484. AddZone("Starfish Casino", 2437.390, 1783.230, -89.084, 2685.160, 2012.180, 110.916)
  1485. AddZone("Mulholland", 1281.130, -452.425, -89.084, 1641.130, -290.913, 110.916)
  1486. AddZone("Downtown", -1982.320, 744.170, -6.1, -1871.720, 1274.260, 200.000)
  1487. AddZone("Hankypanky Point", 2576.920, 62.158, 0.000, 2759.250, 385.503, 200.000)
  1488. AddZone("K.A.C.C. Military Fuels", 2498.210, 2626.550, -89.084, 2749.900, 2861.550, 110.916)
  1489. AddZone("Harry Gold Parkway", 1777.390, 863.232, -89.084, 1817.390, 2342.830, 110.916)
  1490. AddZone("Bayside Tunnel", -2290.190, 2548.290, -89.084, -1950.190, 2723.290, 110.916)
  1491. AddZone("Ocean Docks", 2324.000, -2302.330, -89.084, 2703.580, -2145.100, 110.916)
  1492. AddZone("Richman", 321.356, -1044.070, -89.084, 647.557, -860.619, 110.916)
  1493. AddZone("Randolph Industrial Estate", 1558.090, 596.349, -89.084, 1823.080, 823.235, 110.916)
  1494. AddZone("East Beach", 2632.830, -1852.870, -89.084, 2959.350, -1668.130, 110.916)
  1495. AddZone("Flint Water", -314.426, -753.874, -89.084, -106.339, -463.073, 110.916)
  1496. AddZone("Blueberry", 19.607, -404.136, 3.8, 349.607, -220.137, 200.000)
  1497. AddZone("Linden Station", 2749.900, 1198.990, -89.084, 2923.390, 1548.990, 110.916)
  1498. AddZone("Glen Park", 1812.620, -1350.720, -89.084, 2056.860, -1100.820, 110.916)
  1499. AddZone("Downtown", -1993.280, 265.243, -9.1, -1794.920, 578.396, 200.000)
  1500. AddZone("Redsands West", 1377.390, 2243.230, -89.084, 1704.590, 2433.230, 110.916)
  1501. AddZone("Richman", 321.356, -1235.070, -89.084, 647.522, -1044.070, 110.916)
  1502. AddZone("Gant Bridge", -2741.450, 1659.680, -6.1, -2616.400, 2175.150, 200.000)
  1503. AddZone("Lil' Probe Inn", -90.218, 1286.850, -3.0, 153.859, 1554.120, 200.000)
  1504. AddZone("Flint Intersection", -187.700, -1596.760, -89.084, 17.063, -1276.600, 110.916)
  1505. AddZone("Las Colinas", 2281.450, -1135.040, -89.084, 2632.740, -945.035, 110.916)
  1506. AddZone("Sobell Rail Yards", 2749.900, 1548.990, -89.084, 2923.390, 1937.250, 110.916)
  1507. AddZone("The Emerald Isle", 2011.940, 2202.760, -89.084, 2237.400, 2508.230, 110.916)
  1508. AddZone("El Castillo del Diablo", -208.570, 2123.010, -7.6, 114.033, 2337.180, 200.000)
  1509. AddZone("Santa Flora", -2741.070, 458.411, -7.6, -2533.040, 793.411, 200.000)
  1510. AddZone("Playa del Seville", 2703.580, -2126.900, -89.084, 2959.350, -1852.870, 110.916)
  1511. AddZone("Market", 926.922, -1577.590, -89.084, 1370.850, -1416.250, 110.916)
  1512. AddZone("Queens", -2593.440, 54.722, 0.000, -2411.220, 458.411, 200.000)
  1513. AddZone("Pilson Intersection", 1098.390, 2243.230, -89.084, 1377.390, 2507.230, 110.916)
  1514. AddZone("Spinybed", 2121.400, 2663.170, -89.084, 2498.210, 2861.550, 110.916)
  1515. AddZone("Pilgrim", 2437.390, 1383.230, -89.084, 2624.400, 1783.230, 110.916)
  1516. AddZone("Blackfield", 964.391, 1403.220, -89.084, 1197.390, 1726.220, 110.916)
  1517. AddZone("'The Big Ear'", -410.020, 1403.340, -3.0, -137.969, 1681.230, 200.000)
  1518. AddZone("Dillimore", 580.794, -674.885, -9.5, 861.085, -404.790, 200.000)
  1519. AddZone("El Quebrados", -1645.230, 2498.520, 0.000, -1372.140, 2777.850, 200.000)
  1520. AddZone("Esplanade North", -2533.040, 1358.900, -4.5, -1996.660, 1501.210, 200.000)
  1521. AddZone("Easter Bay Airport", -1499.890, -50.096, -1.0, -1242.980, 249.904, 200.000)
  1522. AddZone("Fisher's Lagoon", 1916.990, -233.323, -100.000, 2131.720, 13.800, 200.000)
  1523. AddZone("Mulholland", 1414.070, -768.027, -89.084, 1667.610, -452.425, 110.916)
  1524. AddZone("East Beach", 2747.740, -1498.620, -89.084, 2959.350, -1120.040, 110.916)
  1525. AddZone("San Andreas Sound", 2450.390, 385.503, -100.000, 2759.250, 562.349, 200.000)
  1526. AddZone("Shady Creeks", -2030.120, -2174.890, -6.1, -1820.640, -1771.660, 200.000)
  1527. AddZone("Market", 1072.660, -1416.250, -89.084, 1370.850, -1130.850, 110.916)
  1528. AddZone("Rockshore West", 1997.220, 596.349, -89.084, 2377.390, 823.228, 110.916)
  1529. AddZone("Prickle Pine", 1534.560, 2583.230, -89.084, 1848.400, 2863.230, 110.916)
  1530. AddZone("Easter Basin", -1794.920, -50.096, -1.04, -1499.890, 249.904, 200.000)
  1531. AddZone("Leafy Hollow", -1166.970, -1856.030, 0.000, -815.624, -1602.070, 200.000)
  1532. AddZone("LVA Freight Depot", 1457.390, 863.229, -89.084, 1777.400, 1143.210, 110.916)
  1533. AddZone("Prickle Pine", 1117.400, 2507.230, -89.084, 1534.560, 2723.230, 110.916)
  1534. AddZone("Blueberry", 104.534, -220.137, 2.3, 349.607, 152.236, 200.000)
  1535. AddZone("El Castillo del Diablo", -464.515, 2217.680, 0.000, -208.570, 2580.360, 200.000)
  1536. AddZone("Downtown", -2078.670, 578.396, -7.6, -1499.890, 744.267, 200.000)
  1537. AddZone("Rockshore East", 2537.390, 676.549, -89.084, 2902.350, 943.235, 110.916)
  1538. AddZone("San Fierro Bay", -2616.400, 1501.210, -3.0, -1996.660, 1659.680, 200.000)
  1539. AddZone("Paradiso", -2741.070, 793.411, -6.1, -2533.040, 1268.410, 200.000)
  1540. AddZone("The Camel's Toe", 2087.390, 1203.230, -89.084, 2640.400, 1383.230, 110.916)
  1541. AddZone("Old Venturas Strip", 2162.390, 2012.180, -89.084, 2685.160, 2202.760, 110.916)
  1542. AddZone("Juniper Hill", -2533.040, 578.396, -7.6, -2274.170, 968.369, 200.000)
  1543. AddZone("Juniper Hollow", -2533.040, 968.369, -6.1, -2274.170, 1358.900, 200.000)
  1544. AddZone("Roca Escalante", 2237.400, 2202.760, -89.084, 2536.430, 2542.550, 110.916)
  1545. AddZone("Julius Thruway East", 2685.160, 1055.960, -89.084, 2749.900, 2626.550, 110.916)
  1546. AddZone("Verona Beach", 647.712, -2173.290, -89.084, 930.221, -1804.210, 110.916)
  1547. AddZone("Foster Valley", -2178.690, -599.884, -1.2, -1794.920, -324.114, 200.000)
  1548. AddZone("Arco del Oeste", -901.129, 2221.860, 0.000, -592.090, 2571.970, 200.000)
  1549. AddZone("Fallen Tree", -792.254, -698.555, -5.3, -452.404, -380.043, 200.000)
  1550. AddZone("The Farm", -1209.670, -1317.100, 114.981, -908.161, -787.391, 251.981)
  1551. AddZone("The Sherman Dam", -968.772, 1929.410, -3.0, -481.126, 2155.260, 200.000)
  1552. AddZone("Esplanade North", -1996.660, 1358.900, -4.5, -1524.240, 1592.510, 200.000)
  1553. AddZone("Financial", -1871.720, 744.170, -6.1, -1701.300, 1176.420, 300.000)
  1554. AddZone("Garcia", -2411.220, -222.589, -1.14, -2173.040, 265.243, 200.000)
  1555. AddZone("Montgomery", 1119.510, 119.526, -3.0, 1451.400, 493.323, 200.000)
  1556. AddZone("Creek", 2749.900, 1937.250, -89.084, 2921.620, 2669.790, 110.916)
  1557. AddZone("Los Santos International", 1249.620, -2394.330, -89.084, 1852.000, -2179.250, 110.916)
  1558. AddZone("Santa Maria Beach", 72.648, -2173.290, -89.084, 342.648, -1684.650, 110.916)
  1559. AddZone("Mulholland Intersection", 1463.900, -1150.870, -89.084, 1812.620, -768.027, 110.916)
  1560. AddZone("Angel Pine", -2324.940, -2584.290, -6.1, -1964.220, -2212.110, 200.000)
  1561. AddZone("Verdant Meadows", 37.032, 2337.180, -3.0, 435.988, 2677.900, 200.000)
  1562. AddZone("Octane Springs", 338.658, 1228.510, 0.000, 664.308, 1655.050, 200.000)
  1563. AddZone("Come-A-Lot", 2087.390, 943.235, -89.084, 2623.180, 1203.230, 110.916)
  1564. AddZone("Redsands West", 1236.630, 1883.110, -89.084, 1777.390, 2142.860, 110.916)
  1565. AddZone("Santa Maria Beach", 342.648, -2173.290, -89.084, 647.712, -1684.650, 110.916)
  1566. AddZone("Verdant Bluffs", 1249.620, -2179.250, -89.084, 1692.620, -1842.270, 110.916)
  1567. AddZone("Las Venturas Airport", 1236.630, 1203.280, -89.084, 1457.370, 1883.110, 110.916)
  1568. AddZone("Flint Range", -594.191, -1648.550, 0.000, -187.700, -1276.600, 200.000)
  1569. AddZone("Verdant Bluffs", 930.221, -2488.420, -89.084, 1249.620, -2006.780, 110.916)
  1570. AddZone("Palomino Creek", 2160.220, -149.004, 0.000, 2576.920, 228.322, 200.000)
  1571. AddZone("Ocean Docks", 2373.770, -2697.090, -89.084, 2809.220, -2330.460, 110.916)
  1572. AddZone("Easter Bay Airport", -1213.910, -50.096, -4.5, -947.980, 578.396, 200.000)
  1573. AddZone("Whitewood Estates", 883.308, 1726.220, -89.084, 1098.310, 2507.230, 110.916)
  1574. AddZone("Calton Heights", -2274.170, 744.170, -6.1, -1982.320, 1358.900, 200.000)
  1575. AddZone("Easter Basin", -1794.920, 249.904, -9.1, -1242.980, 578.396, 200.000)
  1576. AddZone("Los Santos Inlet", -321.744, -2224.430, -89.084, 44.615, -1724.430, 110.916)
  1577. AddZone("Doherty", -2173.040, -222.589, -1.0, -1794.920, 265.243, 200.000)
  1578. AddZone("Mount Chiliad", -2178.690, -2189.910, -47.917, -2030.120, -1771.660, 576.083)
  1579. AddZone("Fort Carson", -376.233, 826.326, -3.0, 123.717, 1220.440, 200.000)
  1580. AddZone("Foster Valley", -2178.690, -1115.580, 0.000, -1794.920, -599.884, 200.000)
  1581. AddZone("Ocean Flats", -2994.490, -222.589, -1.0, -2593.440, 277.411, 200.000)
  1582. AddZone("Fern Ridge", 508.189, -139.259, 0.000, 1306.660, 119.526, 200.000)
  1583. AddZone("Bayside", -2741.070, 2175.150, 0.000, -2353.170, 2722.790, 200.000)
  1584. AddZone("Las Venturas Airport", 1457.370, 1203.280, -89.084, 1777.390, 1883.110, 110.916)
  1585. AddZone("Blueberry Acres", -319.676, -220.137, 0.000, 104.534, 293.324, 200.000)
  1586. AddZone("Palisades", -2994.490, 458.411, -6.1, -2741.070, 1339.610, 200.000)
  1587. AddZone("North Rock", 2285.370, -768.027, 0.000, 2770.590, -269.740, 200.000)
  1588. AddZone("Hunter Quarry", 337.244, 710.840, -115.239, 860.554, 1031.710, 203.761)
  1589. AddZone("Los Santos International", 1382.730, -2730.880, -89.084, 2201.820, -2394.330, 110.916)
  1590. AddZone("Missionary Hill", -2994.490, -811.276, 0.000, -2178.690, -430.276, 200.000)
  1591. AddZone("San Fierro Bay", -2616.400, 1659.680, -3.0, -1996.660, 2175.150, 200.000)
  1592. AddZone("Restricted Area", -91.586, 1655.050, -50.000, 421.234, 2123.010, 250.000)
  1593. AddZone("Mount Chiliad", -2997.470, -1115.580, -47.917, -2178.690, -971.913, 576.083)
  1594. AddZone("Mount Chiliad", -2178.690, -1771.660, -47.917, -1936.120, -1250.970, 576.083)
  1595. AddZone("Easter Bay Airport", -1794.920, -730.118, -3.0, -1213.910, -50.096, 200.000)
  1596. AddZone("The Panopticon", -947.980, -304.320, -1.1, -319.676, 327.071, 200.000)
  1597. AddZone("Shady Creeks", -1820.640, -2643.680, -8.0, -1226.780, -1771.660, 200.000)
  1598. AddZone("Back o Beyond", -1166.970, -2641.190, 0.000, -321.744, -1856.030, 200.000)
  1599. AddZone("Mount Chiliad", -2994.490, -2189.910, -47.917, -2178.690, -1115.580, 576.083)
  1600. AddZone("Tierra Robada", -1213.910, 596.349, -242.990, -480.539, 1659.680, 900.000)
  1601. AddZone("Flint County", -1213.910, -2892.970, -242.990, 44.615, -768.027, 900.000)
  1602. AddZone("Whetstone", -2997.470, -2892.970, -242.990, -1213.910, -1115.580, 900.000)
  1603. AddZone("Bone County", -480.539, 596.349, -242.990, 869.461, 2993.870, 900.000)
  1604. AddZone("Tierra Robada", -2997.470, 1659.680, -242.990, -480.539, 2993.870, 900.000)
  1605. AddZone("San Fierro", -2997.470, -1115.580, -242.990, -1213.910, 1659.680, 900.000)
  1606. AddZone("Las Venturas", 869.461, 596.349, -242.990, 2997.060, 2993.870, 900.000)
  1607. AddZone("Red County", -1213.910, -768.027, -242.990, 2997.060, 596.349, 900.000)
  1608. AddZone("Los Santos", 44.615, -2892.970, -242.990, 2997.060, -768.027, 900.000)
  1609. }
  1610. calculateZone(posX, posY, posZ) {
  1611. if ( bInitZaC == 0 )
  1612. {
  1613. initZonesAndCities()
  1614. bInitZaC := 1
  1615. }
  1616. Loop % nZone-1
  1617. {
  1618. if (posX >= zone%A_Index%_x1) && (posY >= zone%A_Index%_y1) && (posZ >= zone%A_Index%_z1) && (posX <= zone%A_Index%_x2) && (posY <= zone%A_Index%_y2) && (posZ <= zone%A_Index%_z2)
  1619. {
  1620. ErrorLevel := ERROR_OK
  1621. return zone%A_Index%_name
  1622. }
  1623. }
  1624. ErrorLevel := ERROR_ZONE_NOT_FOUND
  1625. return "Unbekannt"
  1626. }
  1627. calculateCity(posX, posY, posZ) {
  1628. if ( bInitZaC == 0 )
  1629. {
  1630. initZonesAndCities()
  1631. bInitZaC := 1
  1632. }
  1633. smallestCity := "Unbekannt"
  1634. currentCitySize := 0
  1635. smallestCitySize := 0
  1636. Loop % nCity-1
  1637. {
  1638. if (posX >= city%A_Index%_x1) && (posY >= city%A_Index%_y1) && (posZ >= city%A_Index%_z1) && (posX <= city%A_Index%_x2) && (posY <= city%A_Index%_y2) && (posZ <= city%A_Index%_z2)
  1639. {
  1640. currentCitySize := ((city%A_Index%_x2 - city%A_Index%_x1) * (city%A_Index%_y2 - city%A_Index%_y1) * (city%A_Index%_z2 - city%A_Index%_z1))
  1641. if (smallestCity == "Unbekannt") || (currentCitySize < smallestCitySize)
  1642. {
  1643. smallestCity := city%A_Index%_name
  1644. smallestCitySize := currentCitySize
  1645. }
  1646. }
  1647. }
  1648. if(smallestCity == "Unbekannt") {
  1649. ErrorLevel := ERROR_CITY_NOT_FOUND
  1650. } else {
  1651. ErrorLevel := ERROR_OK
  1652. }
  1653. return smallestCity
  1654. }
  1655. AddZone(sName, x1, y1, z1, x2, y2, z2) {
  1656. global
  1657. zone%nZone%_name := sName
  1658. zone%nZone%_x1 := x1
  1659. zone%nZone%_y1 := y1
  1660. zone%nZone%_z1 := z1
  1661. zone%nZone%_x2 := x2
  1662. zone%nZone%_y2 := y2
  1663. zone%nZone%_z2 := z2
  1664. nZone := nZone + 1
  1665. }
  1666. AddCity(sName, x1, y1, z1, x2, y2, z2) {
  1667. global
  1668. city%nCity%_name := sName
  1669. city%nCity%_x1 := x1
  1670. city%nCity%_y1 := y1
  1671. city%nCity%_z1 := z1
  1672. city%nCity%_x2 := x2
  1673. city%nCity%_y2 := y2
  1674. city%nCity%_z2 := z2
  1675. nCity := nCity + 1
  1676. }
  1677. IsPlayerInRangeOfPoint(_posX, _posY, _posZ, _posRadius)
  1678. {
  1679. GetPlayerPos(posX, posY, posZ)
  1680. X := posX -_posX
  1681. Y := posY -_posY
  1682. Z := posZ -_posZ
  1683. if(((X < _posRadius) && (X > -_posRadius)) && ((Y < _posRadius) && (Y > -_posRadius)) && ((Z < _posRadius) && (Z > -_posRadius)))
  1684. return TRUE
  1685. return FALSE
  1686. }
  1687. IsPlayerInRangeOfPoint2D(_posX, _posY, _posRadius)
  1688. {
  1689. GetPlayerPos(posX, posY, posZ)
  1690. X := posX - _posX
  1691. Y := posY - _posY
  1692. if(((X < _posRadius) && (X > -_posRadius)) && ((Y < _posRadius) && (Y > -_posRadius)))
  1693. return TRUE
  1694. return FALSE
  1695. }
  1696. getPlayerZone()
  1697. {
  1698. aktPos := getCoordinates()
  1699. return calculateZone(aktPos[1], aktPos[2], aktPos[3])
  1700. }
  1701. getPlayerCity()
  1702. {
  1703. aktPos := getCoordinates()
  1704. return calculateCity(aktPos[1], aktPos[2], aktPos[3])
  1705. }
  1706. checkHandles() {
  1707. if(iRefreshHandles+500>A_TickCount)
  1708. return true
  1709. iRefreshHandles:=A_TickCount
  1710. if(!refreshGTA() || !refreshSAMP() || !refreshMemory()) {
  1711. return false
  1712. } else {
  1713. return true
  1714. }
  1715. return true
  1716. }
  1717. refreshGTA() {
  1718. newPID := getPID("GTA:SA:MP")
  1719. if(!newPID) {
  1720. if(hGTA) {
  1721. virtualFreeEx(hGTA, pMemory, 0, 0x8000)
  1722. closeProcess(hGTA)
  1723. hGTA := 0x0
  1724. }
  1725. dwGTAPID := 0
  1726. hGTA := 0x0
  1727. dwSAMP := 0x0
  1728. pMemory := 0x0
  1729. return false
  1730. }
  1731. if(!hGTA || (dwGTAPID != newPID)) {
  1732. hGTA := openProcess(newPID)
  1733. if(ErrorLevel) {
  1734. dwGTAPID := 0
  1735. hGTA := 0x0
  1736. dwSAMP := 0x0
  1737. pMemory := 0x0
  1738. return false
  1739. }
  1740. dwGTAPID := newPID
  1741. dwSAMP := 0x0
  1742. pMemory := 0x0
  1743. return true
  1744. }
  1745. return true
  1746. }
  1747. refreshSAMP() {
  1748. if(dwSAMP)
  1749. return true
  1750. dwSAMP := getModuleBaseAddress("samp.dll", hGTA)
  1751. if(!dwSAMP)
  1752. return false
  1753. return true
  1754. }
  1755. refreshMemory() {
  1756. if(!pMemory) {
  1757. pMemory := virtualAllocEx(hGTA, 6144, 0x1000 | 0x2000, 0x40)
  1758. if(ErrorLevel) {
  1759. pMemory := 0x0
  1760. return false
  1761. }
  1762. pParam1 := pMemory
  1763. pParam2 := pMemory + 1024
  1764. pParam3 := pMemory + 2048
  1765. pParam4 := pMemory + 3072
  1766. pParam5 := pMemory + 4096
  1767. pInjectFunc := pMemory + 5120
  1768. }
  1769. return true
  1770. }
  1771. getPID(szWindow) {
  1772. local dwPID := 0
  1773. WinGet, dwPID, PID, %szWindow%
  1774. return dwPID
  1775. }
  1776. openProcess(dwPID, dwRights = 0x1F0FFF) {
  1777. hProcess := DllCall("OpenProcess"
  1778. , "UInt", dwRights
  1779. , "int", 0
  1780. , "UInt", dwPID
  1781. , "Uint")
  1782. if(hProcess == 0) {
  1783. ErrorLevel := ERROR_OPEN_PROCESS
  1784. return 0
  1785. }
  1786. ErrorLevel := ERROR_OK
  1787. return hProcess
  1788. }
  1789. closeProcess(hProcess) {
  1790. if(hProcess == 0) {
  1791. ErrorLevel := ERROR_INVALID_HANDLE
  1792. return 0
  1793. }
  1794. dwRet := DllCall( "CloseHandle"
  1795. , "Uint", hProcess
  1796. , "UInt")
  1797. ErrorLevel := ERROR_OK
  1798. }
  1799. getModuleBaseAddress(sModule, hProcess) {
  1800. if(!sModule) {
  1801. ErrorLevel := ERROR_MODULE_NOT_FOUND
  1802. return 0
  1803. }
  1804. if(!hProcess) {
  1805. ErrorLevel := ERROR_INVALID_HANDLE
  1806. return 0
  1807. }
  1808. dwSize = 1024*4
  1809. VarSetCapacity(hMods, dwSize)
  1810. VarSetCapacity(cbNeeded, 4)
  1811. dwRet := DllCall( "Psapi.dll\EnumProcessModules"
  1812. , "UInt", hProcess
  1813. , "UInt", &hMods
  1814. , "UInt", dwSize
  1815. , "UInt*", cbNeeded
  1816. , "UInt")
  1817. if(dwRet == 0) {
  1818. ErrorLevel := ERROR_ENUM_PROCESS_MODULES
  1819. return 0
  1820. }
  1821. dwMods := cbNeeded / 4
  1822. i := 0
  1823. VarSetCapacity(hModulee, 4)
  1824. VarSetCapacity(sCurModule, 260)
  1825. while(i < dwMods) {
  1826. hModulee := NumGet(hMods, i*4)
  1827. DllCall("Psapi.dll\GetModuleFileNameEx"
  1828. , "UInt", hProcess
  1829. , "UInt", hModulee
  1830. , "Str", sCurModule
  1831. , "UInt", 260)
  1832. SplitPath, sCurModule, sFilename
  1833. if(sModule == sFilename) {
  1834. ErrorLevel := ERROR_OK
  1835. return hModulee
  1836. }
  1837. i := i + 1
  1838. }
  1839. ErrorLevel := ERROR_MODULE_NOT_FOUND
  1840. return 0
  1841. }
  1842. readString(hProcess, dwAddress, dwLen) {
  1843. if(!hProcess) {
  1844. ErrorLevel := ERROR_INVALID_HANDLE
  1845. return 0
  1846. }
  1847. VarSetCapacity(sRead, dwLen)
  1848. dwRet := DllCall( "ReadProcessMemory"
  1849. , "UInt", hProcess
  1850. , "UInt", dwAddress
  1851. , "Str", sRead
  1852. , "UInt", dwLen
  1853. , "UInt*", 0
  1854. , "UInt")
  1855. if(dwRet == 0) {
  1856. ErrorLevel := ERROR_READ_MEMORY
  1857. return 0
  1858. }
  1859. ErrorLevel := ERROR_OK
  1860. if A_IsUnicode
  1861. return __ansiToUnicode(sRead)
  1862. return sRead
  1863. }
  1864. readFloat(hProcess, dwAddress) {
  1865. if(!hProcess) {
  1866. ErrorLevel := ERROR_INVALID_HANDLE
  1867. return 0
  1868. }
  1869. VarSetCapacity(dwRead, 4)
  1870. dwRet := DllCall( "ReadProcessMemory"
  1871. , "UInt", hProcess
  1872. , "UInt", dwAddress
  1873. , "Str", dwRead
  1874. , "UInt", 4
  1875. , "UInt*", 0
  1876. , "UInt")
  1877. if(dwRet == 0) {
  1878. ErrorLevel := ERROR_READ_MEMORY
  1879. return 0
  1880. }
  1881. ErrorLevel := ERROR_OK
  1882. return NumGet(dwRead, 0, "Float")
  1883. }
  1884. readDWORD(hProcess, dwAddress) {
  1885. if(!hProcess) {
  1886. ErrorLevel := ERROR_INVALID_HANDLE
  1887. return 0
  1888. }
  1889. VarSetCapacity(dwRead, 4)
  1890. dwRet := DllCall( "ReadProcessMemory"
  1891. , "UInt", hProcess
  1892. , "UInt", dwAddress
  1893. , "Str", dwRead
  1894. , "UInt", 4
  1895. , "UInt*", 0)
  1896. if(dwRet == 0) {
  1897. ErrorLevel := ERROR_READ_MEMORY
  1898. return 0
  1899. }
  1900. ErrorLevel := ERROR_OK
  1901. return NumGet(dwRead, 0, "UInt")
  1902. }
  1903. readMem(hProcess, dwAddress, dwLen=4, type="UInt") {
  1904. if(!hProcess) {
  1905. ErrorLevel := ERROR_INVALID_HANDLE
  1906. return 0
  1907. }
  1908. VarSetCapacity(dwRead, dwLen)
  1909. dwRet := DllCall( "ReadProcessMemory"
  1910. , "UInt", hProcess
  1911. , "UInt", dwAddress
  1912. , "Str", dwRead
  1913. , "UInt", dwLen
  1914. , "UInt*", 0)
  1915. if(dwRet == 0) {
  1916. ErrorLevel := ERROR_READ_MEMORY
  1917. return 0
  1918. }
  1919. ErrorLevel := ERROR_OK
  1920. return NumGet(dwRead, 0, type)
  1921. }
  1922. writeString(hProcess, dwAddress, wString) {
  1923. if(!hProcess) {
  1924. ErrorLevel := ERROR_INVALID_HANDLE
  1925. return false
  1926. }
  1927. sString := wString
  1928. if A_IsUnicode
  1929. sString := __unicodeToAnsi(wString)
  1930. dwRet := DllCall( "WriteProcessMemory"
  1931. , "UInt", hProcess
  1932. , "UInt", dwAddress
  1933. , "Str", sString
  1934. , "UInt", StrLen(wString) + 1
  1935. , "UInt", 0
  1936. , "UInt")
  1937. if(dwRet == 0) {
  1938. ErrorLEvel := ERROR_WRITE_MEMORY
  1939. return false
  1940. }
  1941. ErrorLevel := ERROR_OK
  1942. return true
  1943. }
  1944. writeRaw(hProcess, dwAddress, pBuffer, dwLen) {
  1945. if(!hProcess) {
  1946. ErrorLevel := ERROR_INVALID_HANDLE
  1947. return false
  1948. }
  1949. dwRet := DllCall( "WriteProcessMemory"
  1950. , "UInt", hProcess
  1951. , "UInt", dwAddress
  1952. , "UInt", pBuffer
  1953. , "UInt", dwLen
  1954. , "UInt", 0
  1955. , "UInt")
  1956. if(dwRet == 0) {
  1957. ErrorLEvel := ERROR_WRITE_MEMORY
  1958. return false
  1959. }
  1960. ErrorLevel := ERROR_OK
  1961. return true
  1962. }
  1963. callWithParams(hProcess, dwFunc, aParams, bCleanupStack = true) {
  1964. if(!hProcess) {
  1965. ErrorLevel := ERROR_INVALID_HANDLE
  1966. return false
  1967. }
  1968. validParams := 0
  1969. i := aParams.MaxIndex()
  1970. dwLen := i * 5 + 5 + 1
  1971. if(bCleanupStack)
  1972. dwLen += 3
  1973. VarSetCapacity(injectData, i * 5 + 5 + 3 + 1, 0)
  1974. i_ := 1
  1975. while(i > 0) {
  1976. if(aParams[i][1] != "") {
  1977. dwMemAddress := 0x0
  1978. if(aParams[i][1] == "p") {
  1979. dwMemAddress := aParams[i][2]
  1980. } else if(aParams[i][1] == "s") {
  1981. if(i_>3)
  1982. return false
  1983. dwMemAddress := pParam%i_%
  1984. writeString(hProcess, dwMemAddress, aParams[i][2])
  1985. if(ErrorLevel)
  1986. return false
  1987. i_ += 1
  1988. } else if(aParams[i][1] == "i") {
  1989. dwMemAddress := aParams[i][2]
  1990. } else {
  1991. return false
  1992. }
  1993. NumPut(0x68, injectData, validParams * 5, "UChar")
  1994. NumPut(dwMemAddress, injectData, validParams * 5 + 1, "UInt")
  1995. validParams += 1
  1996. }
  1997. i -= 1
  1998. }
  1999. offset := dwFunc - ( pInjectFunc + validParams * 5 + 5 )
  2000. NumPut(0xE8, injectData, validParams * 5, "UChar")
  2001. NumPut(offset, injectData, validParams * 5 + 1, "Int")
  2002. if(bCleanupStack) {
  2003. NumPut(0xC483, injectData, validParams * 5 + 5, "UShort")
  2004. NumPut(validParams*4, injectData, validParams * 5 + 7, "UChar")
  2005. NumPut(0xC3, injectData, validParams * 5 + 8, "UChar")
  2006. } else {
  2007. NumPut(0xC3, injectData, validParams * 5 + 5, "UChar")
  2008. }
  2009. writeRaw(hGTA, pInjectFunc, &injectData, dwLen)
  2010. if(ErrorLevel)
  2011. return false
  2012. hThread := createRemoteThread(hGTA, 0, 0, pInjectFunc, 0, 0, 0)
  2013. if(ErrorLevel)
  2014. return false
  2015. waitForSingleObject(hThread, 0xFFFFFFFF)
  2016. closeProcess(hThread)
  2017. return true
  2018. }
  2019. virtualAllocEx(hProcess, dwSize, flAllocationType, flProtect) {
  2020. if(!hProcess) {
  2021. ErrorLevel := ERROR_INVALID_HANDLE
  2022. return 0
  2023. }
  2024. dwRet := DllCall( "VirtualAllocEx"
  2025. , "UInt", hProcess
  2026. , "UInt", 0
  2027. , "UInt", dwSize
  2028. , "UInt", flAllocationType
  2029. , "UInt", flProtect
  2030. , "UInt")
  2031. if(dwRet == 0) {
  2032. ErrorLEvel := ERROR_ALLOC_MEMORY
  2033. return 0
  2034. }
  2035. ErrorLevel := ERROR_OK
  2036. return dwRet
  2037. }
  2038. virtualFreeEx(hProcess, lpAddress, dwSize, dwFreeType) {
  2039. if(!hProcess) {
  2040. ErrorLevel := ERROR_INVALID_HANDLE
  2041. return 0
  2042. }
  2043. dwRet := DllCall( "VirtualFreeEx"
  2044. , "UInt", hProcess
  2045. , "UInt", lpAddress
  2046. , "UInt", dwSize
  2047. , "UInt", dwFreeType
  2048. , "UInt")
  2049. if(dwRet == 0) {
  2050. ErrorLEvel := ERROR_FREE_MEMORY
  2051. return 0
  2052. }
  2053. ErrorLevel := ERROR_OK
  2054. return dwRet
  2055. }
  2056. createRemoteThread(hProcess, lpThreadAttributes, dwStackSize, lpStartAddress, lpParameter, dwCreationFlags, lpThreadId) {
  2057. if(!hProcess) {
  2058. ErrorLevel := ERROR_INVALID_HANDLE
  2059. return 0
  2060. }
  2061. dwRet := DllCall( "CreateRemoteThread"
  2062. , "UInt", hProcess
  2063. , "UInt", lpThreadAttributes
  2064. , "UInt", dwStackSize
  2065. , "UInt", lpStartAddress
  2066. , "UInt", lpParameter
  2067. , "UInt", dwCreationFlags
  2068. , "UInt", lpThreadId
  2069. , "UInt")
  2070. if(dwRet == 0) {
  2071. ErrorLEvel := ERROR_ALLOC_MEMORY
  2072. return 0
  2073. }
  2074. ErrorLevel := ERROR_OK
  2075. return dwRet
  2076. }
  2077. waitForSingleObject(hThread, dwMilliseconds) {
  2078. if(!hThread) {
  2079. ErrorLevel := ERROR_INVALID_HANDLE
  2080. return 0
  2081. }
  2082. dwRet := DllCall( "WaitForSingleObject"
  2083. , "UInt", hThread
  2084. , "UInt", dwMilliseconds
  2085. , "UInt")
  2086. if(dwRet == 0xFFFFFFFF) {
  2087. ErrorLEvel := ERROR_WAIT_FOR_OBJECT
  2088. return 0
  2089. }
  2090. ErrorLevel := ERROR_OK
  2091. return dwRet
  2092. }
  2093. __ansiToUnicode(sString, nLen = 0) {
  2094. If !nLen
  2095. {
  2096. nLen := DllCall("MultiByteToWideChar"
  2097. , "Uint", 0
  2098. , "Uint", 0
  2099. , "Uint", &sString
  2100. , "int", -1
  2101. , "Uint", 0
  2102. , "int", 0)
  2103. }
  2104. VarSetCapacity(wString, nLen * 2)
  2105. DllCall("MultiByteToWideChar"
  2106. , "Uint", 0
  2107. , "Uint", 0
  2108. , "Uint", &sString
  2109. , "int", -1
  2110. , "Uint", &wString
  2111. , "int", nLen)
  2112. return wString
  2113. }
  2114. __unicodeToAnsi(wString, nLen = 0) {
  2115. pString := wString + 1 > 65536 ? wString : &wString
  2116. If !nLen
  2117. {
  2118. nLen := DllCall("WideCharToMultiByte"
  2119. , "Uint", 0
  2120. , "Uint", 0
  2121. , "Uint", pString
  2122. , "int", -1
  2123. , "Uint", 0
  2124. , "int", 0
  2125. , "Uint", 0
  2126. , "Uint", 0)
  2127. }
  2128. VarSetCapacity(sString, nLen)
  2129. DllCall("WideCharToMultiByte"
  2130. , "Uint", 0
  2131. , "Uint", 0
  2132. , "Uint", pString
  2133. , "int", -1
  2134. , "str", sString
  2135. , "int", nLen
  2136. , "Uint", 0
  2137. , "Uint", 0)
  2138. return sString
  2139. }
  2140. restartGameEx() {
  2141. if(!checkHandles())
  2142. return -1
  2143. dwAddress := readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET)
  2144. if(ErrorLevel || dwAddress==0) {
  2145. ErrorLevel := ERROR_READ_MEMORY
  2146. return -1
  2147. }
  2148. dwFunc := dwSAMP + 0xA060
  2149. VarSetCapacity(injectData, 11, 0)
  2150. NumPut(0xB9, injectData, 0, "UChar")
  2151. NumPut(dwAddress, injectData, 1, "UInt")
  2152. NumPut(0xE8, injectData, 5, "UChar")
  2153. offset := dwFunc - (pInjectFunc + 10)
  2154. NumPut(offset, injectData, 6, "Int")
  2155. NumPut(0xC3, injectData, 10, "UChar")
  2156. writeRaw(hGTA, pInjectFunc, &injectData, 11)
  2157. if(ErrorLevel)
  2158. return false
  2159. hThread := createRemoteThread(hGTA, 0, 0, pInjectFunc, 0, 0, 0)
  2160. if(ErrorLevel)
  2161. return false
  2162. waitForSingleObject(hThread, 0xFFFFFFFF)
  2163. return true
  2164. }
  2165. disconnectEx() {
  2166. if(!checkHandles())
  2167. return 0
  2168. dwAddress := readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET)
  2169. if(ErrorLevel || dwAddress==0) {
  2170. ErrorLevel := ERROR_READ_MEMORY
  2171. return 0
  2172. }
  2173. dwAddress := readDWORD(hGTA, dwAddress + 0x3c9)
  2174. if(ErrorLevel || dwAddress==0) {
  2175. ErrorLevel := ERROR_READ_MEMORY
  2176. return 0
  2177. }
  2178. ecx := dwAddress
  2179. dwAddress := readDWORD(hGTA, dwAddress)
  2180. if(ErrorLevel || dwAddress==0) {
  2181. ErrorLevel := ERROR_READ_MEMORY
  2182. return 0
  2183. }
  2184. VarSetCapacity(injectData, 24, 0)
  2185. NumPut(0xB9, injectData, 0, "UChar")
  2186. NumPut(ecx, injectData, 1, "UInt")
  2187. NumPut(0xB8, injectData, 5, "UChar")
  2188. NumPut(dwAddress, injectData, 6, "UInt")
  2189. NumPut(0x68, injectData, 10, "UChar")
  2190. NumPut(0, injectData, 11, "UInt")
  2191. NumPut(0x68, injectData, 15, "UChar")
  2192. NumPut(500, injectData, 16, "UInt")
  2193. NumPut(0x50FF, injectData, 20, "UShort")
  2194. NumPut(0x08, injectData, 22, "UChar")
  2195. NumPut(0xC3, injectData, 23, "UChar")
  2196. writeRaw(hGTA, pInjectFunc, &injectData, 24)
  2197. if(ErrorLevel)
  2198. return false
  2199. hThread := createRemoteThread(hGTA, 0, 0, pInjectFunc, 0, 0, 0)
  2200. if(ErrorLevel)
  2201. return false
  2202. waitForSingleObject(hThread, 0xFFFFFFFF)
  2203. return true
  2204. }
  2205. setrestart()
  2206. {
  2207. VarSetCapacity(old, 4, 0)
  2208. dwAddress := readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET)
  2209. if(ErrorLevel || dwAddress==0) {
  2210. ErrorLevel := ERROR_READ_MEMORY
  2211. return 0
  2212. }
  2213. NumPut(9,old,0,"Int")
  2214. writeRaw(hGTA, dwAddress + 957, &old, 4)
  2215. }
  2216. restart()
  2217. {
  2218. restartGameEx()
  2219. disconnectEx()
  2220. addChatMessage("{FFFFFF}Rejoining..")
  2221. Sleep 1000
  2222. setrestart()
  2223. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement