SHARE
TWEET

Martin Frühauf Binder RPG-City.de comniemeer

a guest Dec 29th, 2016 490 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #Persistent
  2. #NoEnv
  3. global ERROR_OK                     := 0
  4. global ERROR_PROCESS_NOT_FOUND      := 1
  5. global ERROR_OPEN_PROCESS           := 2
  6. global ERROR_INVALID_HANDLE         := 3
  7. global ERROR_MODULE_NOT_FOUND       := 4
  8. global ERROR_ENUM_PROCESS_MODULES   := 5
  9. global ERROR_ZONE_NOT_FOUND         := 6
  10. global ERROR_CITY_NOT_FOUND         := 7
  11. global ERROR_READ_MEMORY            := 8
  12. global ERROR_WRITE_MEMORY           := 9
  13. global ERROR_ALLOC_MEMORY           := 10
  14. global ERROR_FREE_MEMORY            := 11
  15. global ERROR_WAIT_FOR_OBJECT        := 12
  16. global ERROR_CREATE_THREAD          := 13
  17. global ADDR_ZONECODE                := 0xA49AD4
  18. global ADDR_POSITION_X              := 0xB6F2E4
  19. global ADDR_POSITION_Y              := 0xB6F2E8
  20. global ADDR_POSITION_Z              := 0xB6F2EC
  21. global ADDR_CPED_PTR                := 0xB6F5F0
  22. global ADDR_CPED_HPOFF              := 0x540
  23. global ADDR_CPED_ARMOROFF           := 0x548
  24. global ADDR_CPED_MONEY              := 0x0B7CE54
  25. global ADDR_CPED_INTID              := 0xA4ACE8
  26. global ADDR_CPED_SKINIDOFF          := 0x22
  27. global ADDR_VEHICLE_PTR             := 0xBA18FC
  28. global ADDR_VEHICLE_HPOFF           := 0x4C0
  29. global ADDR_VEHICLE_DOORSTATE       := 0x4F8
  30. global ADDR_VEHICLE_ENGINESTATE     := 0x428
  31. global ADDR_VEHICLE_LIGHTSTATE      := 0x584
  32. global ADDR_VEHICLE_MODEL           := 0x22
  33. global ADDR_VEHICLE_TYPE            := 0x590
  34. global ADDR_VEHICLE_DRIVER          := 0x460
  35. global ADDR_VEHICLE_X               := 0x44
  36. global ADDR_VEHICLE_Y               := 0x48
  37. global ADDR_VEHICLE_Z               := 0x4C
  38. global oAirplaneModels := [417, 425, 447, 460, 469, 476, 487, 488, 497, 511, 512, 513, 519, 520, 548, 553, 563, 577, 592, 593]
  39. global oBikeModels := [481,509,510]
  40. 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"]
  41. global oweaponNames := ["Fist","Brass Knuckles","Golf Club","Nightstick","Knife","Baseball Bat","Shovel","Pool Cue","Katana","Chainsaw","Purple Dildo","Dildo","Vibrator","Silver Vibrator","Flowers","Cane","Grenade","Tear Gas","Molotov Cocktail", "", "", "", "9mm","Silenced 9mm","21Desert Eagle","Shotgun","Sawnoff Shotgun","Combat Shotgun","Micro SMG/Uzi","MP5","AK-47","M4","Tec-9","Country Rifle","Sniper Rifle","RPG","HS Rocket","Flamethrower","Minigun","Satchel Charge","Detonator","Spraycan","Fire Extinguisher","Camera","Night Vis Goggles","Thermal Goggles","Parachute"]
  42. global oradiostationNames := ["Playback FM", "K Rose", "K-DST", "Bounce FM", "SF-UR", "Radio Los Santos", "Radio X", "CSR 103.9", "K-JAH West", "Master Sounds 98.3", "WCTR Talk Radio", "User Track Player", "Radio Off"]
  43. global oweatherNames := ["EXTRASUNNY_LA", "SUNNY_LA", "EXTRASUNNY_SMOG_LA", "SUNNY_SMOG_LA", "CLOUDY_LA", "SUNNY_SF", "EXTRASUNNY_SF", "CLOUDY_SF", "RAINY_SF", "FOGGY_SF", "SUNNY_VEGAS", "EXTRASUNNY_VEGAS", "CLOUDY_VEGAS", "EXTRASUNNY_COUNTRYSIDE", "SUNNY_COUNTRYSIDE", "CLOUDY_COUNTRYSIDE", "RAINY_COUNTRYSIDE", "EXTRASUNNY_DESERT", "SUNNY_DESERT", "SANDSTORM_DESERT", "UNDERWATER", "EXTRACOLOURS_1", "EXTRACOLOURS_2"]
  44. global ADDR_SAMP_INCHAT_PTR             := 0x21a10c
  45. global ADDR_SAMP_INCHAT_PTR_OFF         := 0x55
  46. global ADDR_SAMP_USERNAME               := 0x219A6F
  47. global FUNC_SAMP_SENDCMD                := 0x65c60
  48. global FUNC_SAMP_SENDSAY                := 0x57f0
  49. global FUNC_SAMP_ADDTOCHATWND           := 0x64520
  50. global ADDR_SAMP_CHATMSG_PTR            := 0x21a0e4
  51. global FUNC_SAMP_SHOWGAMETEXT           := 0x9c2c0
  52. global FUNC_SAMP_PLAYAUDIOSTR           := 0x62da0
  53. global FUNC_SAMP_STOPAUDIOSTR           := 0x629a0
  54. global DIALOG_STYLE_MSGBOX          := 0
  55. global DIALOG_STYLE_INPUT           := 1
  56. global DIALOG_STYLE_LIST            := 2
  57. global DIALOG_STYLE_PASSWORD        := 3
  58. global DIALOG_STYLE_TABLIST         := 4
  59. global DIALOG_STYLE_TABLIST_HEADERS := 5
  60. global SAMP_DIALOG_STRUCT_PTR                   := 0x21A0B8
  61. global SAMP_DIALOG_PTR1_OFFSET              := 0x1C
  62. global SAMP_DIALOG_LINES_OFFSET             := 0x44C
  63. global SAMP_DIALOG_INDEX_OFFSET             := 0x443
  64. global SAMP_DIALOG_BUTTON_HOVERING_OFFSET   := 0x465
  65. global SAMP_DIALOG_BUTTON_CLICKED_OFFSET    := 0x466
  66. global SAMP_DIALOG_PTR2_OFFSET              := 0x20
  67. global SAMP_DIALOG_LINECOUNT_OFFSET         := 0x150
  68. global SAMP_DIALOG_OPEN_OFFSET              := 0x28
  69. global SAMP_DIALOG_STYLE_OFFSET             := 0x2C
  70. global SAMP_DIALOG_ID_OFFSET                := 0x30
  71. global SAMP_DIALOG_TEXT_PTR_OFFSET          := 0x34
  72. global SAMP_DIALOG_CAPTION_OFFSET           := 0x40
  73. global FUNC_SAMP_SHOWDIALOG                 := 0x6B9C0
  74. global FUNC_SAMP_CLOSEDIALOG                := 0x6C040
  75. global FUNC_UPDATESCOREBOARD                := 0x8A10
  76. global SAMP_INFO_OFFSET                     := 0x21A0F8
  77. global ADDR_SAMP_CRASHREPORT                := 0x5CF2C
  78. global SAMP_PPOOLS_OFFSET                   := 0x3CD
  79. global SAMP_PPOOL_PLAYER_OFFSET             := 0x18
  80. global SAMP_SLOCALPLAYERID_OFFSET           := 0x4
  81. global SAMP_ISTRLEN_LOCALPLAYERNAME_OFFSET  := 0x1A
  82. global SAMP_SZLOCALPLAYERNAME_OFFSET        := 0xA
  83. global SAMP_PSZLOCALPLAYERNAME_OFFSET       := 0xA
  84. global SAMP_PREMOTEPLAYER_OFFSET            := 0x2E
  85. global SAMP_ISTRLENNAME___OFFSET            := 0x1C
  86. global SAMP_SZPLAYERNAME_OFFSET             := 0xC
  87. global SAMP_PSZPLAYERNAME_OFFSET            := 0xC
  88. global SAMP_ILOCALPLAYERPING_OFFSET         := 0x26
  89. global SAMP_ILOCALPLAYERSCORE_OFFSET        := 0x2A
  90. global SAMP_IPING_OFFSET                    := 0x28
  91. global SAMP_ISCORE_OFFSET                   := 0x24
  92. global SAMP_ISNPC_OFFSET                    := 0x4
  93. global SAMP_PLAYER_MAX                      := 1004
  94. global CheckpointCheck                      := 0xC7DEEA
  95. global rmaddrs                              := [0xC7DEC8, 0xC7DECC, 0xC7DED0]
  96. global SIZE_SAMP_CHATMSG := 0xFC
  97. global hGTA := 0x0
  98. global dwGTAPID := 0x0
  99. global dwSAMP := 0x0
  100. global pMemory := 0x0
  101. global pParam1 := 0x0
  102. global pParam2 := 0x0
  103. global pParam3 := 0x0
  104. global pParam4                         := 0x0
  105. global pParam5                         := 0x0
  106. global pInjectFunc := 0x0
  107. global nZone := 1
  108. global nCity := 1
  109. global bInitZaC := 0
  110. global iRefreshScoreboard := 0
  111. global oScoreboardData := ""
  112. global iRefreshHandles := 0
  113. global iUpdateTick := 2500
  114. IsSAMPAvailable() {
  115. if(!checkHandles())
  116. return false
  117. dwChatInfo := readDWORD(hGTA, dwSAMP + ADDR_SAMP_CHATMSG_PTR)
  118. if(dwChatInfo == 0 || dwChatInfo == "ERROR")
  119. {
  120. return false
  121. }
  122. else
  123. {
  124. return true
  125. }
  126. }
  127. isInChat() {
  128. if(!checkHandles())
  129. return -1
  130. dwPtr := dwSAMP + ADDR_SAMP_INCHAT_PTR
  131. dwAddress := readDWORD(hGTA, dwPtr) + ADDR_SAMP_INCHAT_PTR_OFF
  132. if(ErrorLevel) {
  133. ErrorLevel := ERROR_READ_MEMORY
  134. return -1
  135. }
  136. dwInChat := readDWORD(hGTA, dwAddress)
  137. if(ErrorLevel) {
  138. ErrorLevel := ERROR_READ_MEMORY
  139. return -1
  140. }
  141. ErrorLevel := ERROR_OK
  142. if(dwInChat > 0) {
  143. return true
  144. } else {
  145. return false
  146. }
  147. }
  148. getUsername() {
  149. if(!checkHandles())
  150. return ""
  151. dwAddress := dwSAMP + ADDR_SAMP_USERNAME
  152. sUsername := readString(hGTA, dwAddress, 25)
  153. if(ErrorLevel) {
  154. ErrorLevel := ERROR_READ_MEMORY
  155. return ""
  156. }
  157. ErrorLevel := ERROR_OK
  158. return sUsername
  159. }
  160. getId() {
  161. s:=getUsername()
  162. return getPlayerIdByName(s)
  163. }
  164. SendChat(wText) {
  165. wText := "" wText
  166. if(!checkHandles())
  167. return false
  168. dwFunc:=0
  169. if(SubStr(wText, 1, 1) == "/") {
  170. dwFunc := dwSAMP + FUNC_SAMP_SENDCMD
  171. } else {
  172. dwFunc := dwSAMP + FUNC_SAMP_SENDSAY
  173. }
  174. callWithParams(hGTA, dwFunc, [["s", wText]], false)
  175. ErrorLevel := ERROR_OK
  176. return true
  177. }
  178. addChatMessage(wText) {
  179. wText := "" wText
  180. if(!checkHandles())
  181. return false
  182. dwFunc := dwSAMP + FUNC_SAMP_ADDTOCHATWND
  183. dwChatInfo := readDWORD(hGTA, dwSAMP + ADDR_SAMP_CHATMSG_PTR)
  184. if(ErrorLevel) {
  185. ErrorLevel := ERROR_READ_MEMORY
  186. return false
  187. }
  188. callWithParams(hGTA, dwFunc, [["p", dwChatInfo], ["s", wText]], true)
  189. ErrorLevel := ERROR_OK
  190. return true
  191. }
  192. showGameText(wText, dwTime, dwSize) {
  193. wText := "" wText
  194. dwTime += 0
  195. dwTime := Floor(dwTime)
  196. dwSize += 0
  197. dwSize := Floor(dwSize)
  198. if(!checkHandles())
  199. return false
  200. dwFunc := dwSAMP + FUNC_SAMP_SHOWGAMETEXT
  201. callWithParams(hGTA, dwFunc, [["s", wText], ["i", dwTime], ["i", dwSize]], false)
  202. ErrorLevel := ERROR_OK
  203. return true
  204. }
  205. playAudioStream(wUrl) {
  206. wUrl := "" wUrl
  207. if(!checkHandles())
  208. return false
  209. dwFunc := dwSAMP + FUNC_SAMP_PLAYAUDIOSTR
  210. patchRadio()
  211. callWithParams(hGTA, dwFunc, [["s", wUrl], ["i", 0], ["i", 0], ["i", 0], ["i", 0], ["i", 0]], false)
  212. unPatchRadio()
  213. ErrorLevel := ERROR_OK
  214. return true
  215. }
  216. stopAudioStream() {
  217. if(!checkHandles())
  218. return false
  219. dwFunc := dwSAMP + FUNC_SAMP_STOPAUDIOSTR
  220. patchRadio()
  221. callWithParams(hGTA, dwFunc, [["i", 1]], false)
  222. unPatchRadio()
  223. ErrorLevel := ERROR_OK
  224. return true
  225. }
  226. patchRadio()
  227. {
  228. if(!checkHandles())
  229. return false
  230. VarSetCapacity(nop, 4, 0)
  231. NumPut(0x90909090,nop,0,"UInt")
  232. dwFunc := dwSAMP + FUNC_SAMP_PLAYAUDIOSTR
  233. writeRaw(hGTA, dwFunc, &nop, 4)
  234. writeRaw(hGTA, dwFunc+4, &nop, 1)
  235. dwFunc := dwSAMP + FUNC_SAMP_STOPAUDIOSTR
  236. writeRaw(hGTA, dwFunc, &nop, 4)
  237. writeRaw(hGTA, dwFunc+4, &nop, 1)
  238. return true
  239. }
  240. unPatchRadio()
  241. {
  242. if(!checkHandles())
  243. return false
  244. VarSetCapacity(old, 4, 0)
  245. dwFunc := dwSAMP + FUNC_SAMP_PLAYAUDIOSTR
  246. NumPut(0x74003980,old,0,"UInt")
  247. writeRaw(hGTA, dwFunc, &old, 4)
  248. NumPut(0x39,old,0,"UChar")
  249. writeRaw(hGTA, dwFunc+4, &old, 1)
  250. dwFunc := dwSAMP + FUNC_SAMP_STOPAUDIOSTR
  251. NumPut(0x74003980,old,0,"UInt")
  252. writeRaw(hGTA, dwFunc, &old, 4)
  253. NumPut(0x09,old,0,"UChar")
  254. writeRaw(hGTA, dwFunc+4, &old, 1)
  255. return true
  256. }
  257. blockChatInput() {
  258. if(!checkHandles())
  259. return false
  260. VarSetCapacity(nop, 2, 0)
  261. dwFunc := dwSAMP + FUNC_SAMP_SENDSAY
  262. NumPut(0x04C2,nop,0,"Short")
  263. writeRaw(hGTA, dwFunc, &nop, 2)
  264. dwFunc := dwSAMP + FUNC_SAMP_SENDCMD
  265. writeRaw(hGTA, dwFunc, &nop, 2)
  266. return true
  267. }
  268. unBlockChatInput() {
  269. if(!checkHandles())
  270. return false
  271. VarSetCapacity(nop, 2, 0)
  272. dwFunc := dwSAMP + FUNC_SAMP_SENDSAY
  273. NumPut(0xA164,nop,0,"Short")
  274. writeRaw(hGTA, dwFunc, &nop, 2)
  275. dwFunc := dwSAMP + FUNC_SAMP_SENDCMD
  276. writeRaw(hGTA, dwFunc, &nop, 2)
  277. return true
  278. }
  279. getServerName() {
  280. if(!checkHandles())
  281. return -1
  282. dwAdress := readMem(hGTA, dwSAMP + 0x21A0F8, 4, "int")
  283. if(ErrorLevel) {
  284. ErrorLevel := ERROR_READ_MEMORY
  285. return -1
  286. }
  287. if(!dwAdress)
  288. return -1
  289. ServerName := readString(hGTA, dwAdress + 0x121, 200)
  290. if(ErrorLevel) {
  291. ErrorLevel := ERROR_READ_MEMORY
  292. return -1
  293. }
  294. ErrorLevel := ERROR_OK
  295. return ServerName
  296. }
  297. getServerIP() {
  298. if(!checkHandles())
  299. return -1
  300. dwAdress := readMem(hGTA, dwSAMP + 0x21A0F8, 4, "int")
  301. if(ErrorLevel) {
  302. ErrorLevel := ERROR_READ_MEMORY
  303. return -1
  304. }
  305. if(!dwAdress)
  306. return -1
  307. ServerIP := readString(hGTA, dwAdress + 0x20, 100)
  308. if(ErrorLevel) {
  309. ErrorLevel := ERROR_READ_MEMORY
  310. return -1
  311. }
  312. ErrorLevel := ERROR_OK
  313. return ServerIP
  314. }
  315. getServerPort() {
  316. if(!checkHandles())
  317. return -1
  318. dwAdress := readMem(hGTA, dwSAMP + 0x21A0F8, 4, "int")
  319. if(ErrorLevel) {
  320. ErrorLevel := ERROR_READ_MEMORY
  321. return -1
  322. }
  323. if(!dwAdress)
  324. return -1
  325. ServerPort := readMem(hGTA, dwAdress + 0x225, 4, "int")
  326. if(ErrorLevel) {
  327. ErrorLevel := ERROR_READ_MEMORY
  328. return -1
  329. }
  330. ErrorLevel := ERROR_OK
  331. return ServerPort
  332. }
  333. getWeatherID() {
  334. if(!checkHandles())
  335. return -1
  336. dwGTA := getModuleBaseAddress("gta_sa.exe", hGTA)
  337. WeatherID := readMem(hGTA, dwGTA + 0xC81320, 2, "byte")
  338. if(ErrorLevel) {
  339. ErrorLevel := ERROR_READ_MEMORY
  340. return -1
  341. }
  342. ErrorLevel := ERROR_OK
  343. return WeatherID
  344. }
  345. getWeatherName() {
  346. if(isPlayerInAnyVehicle() == 0)
  347. return -1
  348. if(id >= 0 && id < 23)
  349. {
  350. return oweatherNames[id-1]
  351. }
  352. return ""
  353. }
  354. getTargetPed() {
  355. if(!checkHandles())
  356. return 0
  357. dwAddress := readDWORD(hGTA, 0xB6F3B8)
  358. if(ErrorLevel) {
  359. ErrorLevel := ERROR_READ_MEMORY
  360. return 0
  361. }
  362. if(!dwAddress)
  363. return 0
  364. dwAddress := readDWORD(hGTA, dwAddress+0x79C)
  365. if(ErrorLevel) {
  366. ErrorLevel := ERROR_READ_MEMORY
  367. return 0
  368. }
  369. ErrorLevel := ERROR_OK
  370. return dwAddress
  371. }
  372. calcScreenCoors(fX,fY,fZ)
  373. {
  374. if(!checkHandles())
  375. return false
  376. dwM := 0xB6FA2C
  377. m_11 := readFloat(hGTA, dwM + 0*4)
  378. if(ErrorLevel) {
  379. ErrorLevel := ERROR_READ_MEMORY
  380. return false
  381. }
  382. m_12 := readFloat(hGTA, dwM + 1*4)
  383. m_13 := readFloat(hGTA, dwM + 2*4)
  384. m_21 := readFloat(hGTA, dwM + 4*4)
  385. m_22 := readFloat(hGTA, dwM + 5*4)
  386. m_23 := readFloat(hGTA, dwM + 6*4)
  387. m_31 := readFloat(hGTA, dwM + 8*4)
  388. m_32 := readFloat(hGTA, dwM + 9*4)
  389. m_33 := readFloat(hGTA, dwM + 10*4)
  390. m_41 := readFloat(hGTA, dwM + 12*4)
  391. m_42 := readFloat(hGTA, dwM + 13*4)
  392. m_43 := readFloat(hGTA, dwM + 14*4)
  393. dwLenX := readDWORD(hGTA, 0xC17044)
  394. if(ErrorLevel) {
  395. ErrorLevel := ERROR_READ_MEMORY
  396. return false
  397. }
  398. dwLenY := readDWORD(hGTA, 0xC17048)
  399. frX := fZ * m_31 + fY * m_21 + fX * m_11 + m_41
  400. frY := fZ * m_32 + fY * m_22 + fX * m_12 + m_42
  401. frZ := fZ * m_33 + fY * m_23 + fX * m_13 + m_43
  402. fRecip := 1.0/frZ
  403. frX *= fRecip * dwLenX
  404. frY *= fRecip * dwLenY
  405. if(frX<=dwLenX && frY<=dwLenY && frZ>1)
  406. return [frX,frY,frZ]
  407. }
  408. getPedById(dwId) {
  409. dwId += 0
  410. dwId := Floor(dwId)
  411. if(dwId < 0 || dwId >= SAMP_PLAYER_MAX)
  412. return 0
  413. if(iRefreshScoreboard+iUpdateTick > A_TickCount)
  414. {
  415. if(oScoreboardData[dwId])
  416. {
  417. if(oScoreboardData[dwId].HasKey("PED"))
  418. return oScoreboardData[dwId].PED
  419. }
  420. return 0
  421. }
  422. if(!updateOScoreboardData())
  423. return 0
  424. if(oScoreboardData[dwId])
  425. {
  426. if(oScoreboardData[dwId].HasKey("PED"))
  427. return oScoreboardData[dwId].PED
  428. }
  429. return 0
  430. }
  431. getIdByPed(dwPed) {
  432. dwPed += 0
  433. dwPed := Floor(dwPed)
  434. if(!dwPed)
  435. return -1
  436. if(iRefreshScoreboard+iUpdateTick > A_TickCount)
  437. {
  438. For i, o in oScoreboardData
  439. {
  440. if(o.HasKey("PED"))
  441. {
  442. if(o.PED==dwPed)
  443. return i
  444. }
  445. }
  446. return -1
  447. }
  448. if(!updateOScoreboardData())
  449. return -1
  450. For i, o in oScoreboardData
  451. {
  452. if(o.HasKey("PED"))
  453. {
  454. if(o.PED==dwPed)
  455. return i
  456. }
  457. }
  458. return -1
  459. }
  460. getStreamedInPlayersInfo() {
  461. r:=[]
  462. if(iRefreshScoreboard+iUpdateTick > A_TickCount)
  463. {
  464. For i, o in oScoreboardData
  465. {
  466. if(o.HasKey("PED"))
  467. {
  468. p := getPedCoordinates(o.PED)
  469. if(p)
  470. {
  471. o.POS := p
  472. r[i] := o
  473. }
  474. }
  475. }
  476. return r
  477. }
  478. if(!updateOScoreboardData())
  479. return ""
  480. For i, o in oScoreboardData
  481. {
  482. if(o.HasKey("PED"))
  483. {
  484. p := getPedCoordinates(o.PED)
  485. if(p)
  486. {
  487. o.POS := p
  488. r[i] := o
  489. }
  490. }
  491. }
  492. return r
  493. }
  494. callFuncForAllStreamedInPlayers(cfunc,dist=0x7fffffff) {
  495. cfunc := "" cfunc
  496. dist += 0
  497. if(!IsFunc(cfunc))
  498. return false
  499. p := getStreamedInPlayersInfo()
  500. if(!p)
  501. return false
  502. if(dist<0x7fffffff)
  503. {
  504. lpos := getCoordinates()
  505. if(!lpos)
  506. return false
  507. For i, o in p
  508. {
  509. if(dist>getDist(lpos,o.POS))
  510. %cfunc%(o)
  511. }
  512. }
  513. else
  514. {
  515. For i, o in p
  516. %cfunc%(o)
  517. }
  518. return true
  519. }
  520. getDist(pos1,pos2) {
  521. if(!pos1 || !pos2)
  522. return 0
  523. return Sqrt((pos1[1]-pos2[1])*(pos1[1]-pos2[1])+(pos1[2]-pos2[2])*(pos1[2]-pos2[2])+(pos1[3]-pos2[3])*(pos1[3]-pos2[3]))
  524. }
  525. getClosestPlayerPed() {
  526. dist := 0x7fffffff
  527. p := getStreamedInPlayersInfo()
  528. if(!p)
  529. return -1
  530. lpos := getCoordinates()
  531. if(!lpos)
  532. return -1
  533. id := -1
  534. For i, o in p
  535. {
  536. t:=getDist(lpos,o.POS)
  537. if(t<dist)
  538. {
  539. dist := t
  540. id := i
  541. }
  542. }
  543. PED := getPedById(id)
  544. return PED
  545. }
  546. getClosestPlayerId() {
  547. dist := 0x7fffffff
  548. p := getStreamedInPlayersInfo()
  549. if(!p)
  550. return -1
  551. lpos := getCoordinates()
  552. if(!lpos)
  553. return -1
  554. id := -1
  555. For i, o in p
  556. {
  557. t:=getDist(lpos,o.POS)
  558. if(t<dist)
  559. {
  560. dist := t
  561. id := i
  562. }
  563. }
  564. return id
  565. }
  566. CountOnlinePlayers() {
  567. if(!checkHandles())
  568. return -1
  569. dwOnline := readDWORD(hGTA, dwSAMP + 0x21A0B4)
  570. if(ErrorLevel) {
  571. ErrorLevel := ERROR_READ_MEMORY
  572. return -1
  573. }
  574. dwAddr := dwOnline + 0x4
  575. OnlinePlayers := readDWORD(hGTA, dwAddr)
  576. if(ErrorLevel) {
  577. ErrorLevel := ERROR_READ_MEMORY
  578. return -1
  579. }
  580. ErrorLevel := ERROR_OK
  581. return OnlinePlayers
  582. }
  583. getPedCoordinates(dwPED) {
  584. dwPED += 0
  585. dwPED := Floor(dwPED)
  586. if(!dwPED)
  587. return ""
  588. if(!checkHandles())
  589. return ""
  590. dwAddress := readDWORD(hGTA, dwPED + 0x14)
  591. if(ErrorLevel || dwAddress==0) {
  592. ErrorLevel := ERROR_READ_MEMORY
  593. return ""
  594. }
  595. fX := readFloat(hGTA, dwAddress + 0x30)
  596. if(ErrorLevel) {
  597. ErrorLevel := ERROR_READ_MEMORY
  598. return ""
  599. }
  600. fY := readFloat(hGTA, dwAddress + 0x34)
  601. if(ErrorLevel) {
  602. ErrorLevel := ERROR_READ_MEMORY
  603. return ""
  604. }
  605. fZ := readFloat(hGTA, dwAddress + 0x38)
  606. if(ErrorLevel) {
  607. ErrorLevel := ERROR_READ_MEMORY
  608. return ""
  609. }
  610. ErrorLevel := ERROR_OK
  611. return [fX, fY, fZ]
  612. }
  613. getTargetPos(dwId) {
  614. dwId += 0
  615. dwId := Floor(dwId)
  616. if(dwId < 0 || dwId >= SAMP_PLAYER_MAX)
  617. return ""
  618. if(iRefreshScoreboard+iUpdateTick > A_TickCount)
  619. {
  620. if(oScoreboardData[dwId])
  621. {
  622. if(oScoreboardData[dwId].HasKey("PED"))
  623. return getPedCoordinates(oScoreboardData[dwId].PED)
  624. if(oScoreboardData[dwId].HasKey("MPOS"))
  625. return oScoreboardData[dwId].MPOS
  626. }
  627. return ""
  628. }
  629. if(!updateOScoreboardData())
  630. return ""
  631. if(oScoreboardData[dwId])
  632. {
  633. if(oScoreboardData[dwId].HasKey("PED"))
  634. return getPedCoordinates(oScoreboardData[dwId].PED)
  635. if(oScoreboardData[dwId].HasKey("MPOS"))
  636. return oScoreboardData[dwId].MPOS
  637. }
  638. return ""
  639. }
  640. getTargetPlayerSkinIdByPed(dwPED) {
  641. if(!checkHandles())
  642. return -1
  643. dwAddr := dwPED + ADDR_CPED_SKINIDOFF
  644. SkinID := readMem(hGTA, dwAddr, 2, "byte")
  645. if(ErrorLevel) {
  646. ErrorLevel := ERROR_READ_MEMORY
  647. return -1
  648. }
  649. ErrorLevel := ERROR_OK
  650. return SkinID
  651. }
  652. getTargetPlayerSkinIdById(dwId) {
  653. if(!checkHandles())
  654. return -1
  655. dwPED := getPedById(dwId)
  656. dwAddr := dwPED + ADDR_CPED_SKINIDOFF
  657. SkinID := readMem(hGTA, dwAddr, 2, "byte")
  658. if(ErrorLevel) {
  659. ErrorLevel := ERROR_READ_MEMORY
  660. return -1
  661. }
  662. ErrorLevel := ERROR_OK
  663. return SkinID
  664. }
  665. getVehiclePointerByPed(dwPED) {
  666. dwPED += 0
  667. dwPED := Floor(dwPED)
  668. if(!dwPED)
  669. return 0
  670. if(!checkHandles())
  671. return 0
  672. dwAddress := readDWORD(hGTA, dwPED + 0x58C)
  673. if(ErrorLevel) {
  674. ErrorLevel := ERROR_READ_MEMORY
  675. return 0
  676. }
  677. ErrorLevel := ERROR_OK
  678. return dwAddress
  679. }
  680. getVehiclePointerById(dwId) {
  681. if(!dwId)
  682. return 0
  683. if(!checkHandles())
  684. return 0
  685. dwPed_By_Id := getPedById(dwId)
  686. dwAddress := readDWORD(hGTA, dwPed_By_Id + 0x58C)
  687. if(ErrorLevel) {
  688. ErrorLevel := ERROR_READ_MEMORY
  689. return 0
  690. }
  691. ErrorLevel := ERROR_OK
  692. return dwAddress
  693. }
  694. isTargetInAnyVehicleByPed(dwPED)
  695. {
  696. if(!checkHandles())
  697. return -1
  698. dwVehiclePointer := getVehiclePointerByPed(dwPedPointer)
  699. if(dwVehiclePointer > 0)
  700. {
  701. return 1
  702. }
  703. else if(dwVehiclePointer <= 0)
  704. {
  705. return 0
  706. }
  707. else
  708. {
  709. return -1
  710. }
  711. }
  712. isTargetInAnyVehiclebyId(dwId)
  713. {
  714. if(!checkHandles())
  715. return -1
  716. dwPedPointer := getPedById(dwId)
  717. dwVehiclePointer := getVehiclePointerByPed(dwPedPointer)
  718. if(dwVehiclePointer > 0)
  719. {
  720. return 1
  721. }
  722. else if(dwVehiclePointer <= 0)
  723. {
  724. return 0
  725. }
  726. else
  727. {
  728. return -1
  729. }
  730. }
  731. getTargetVehicleHealthByPed(dwPed) {
  732. if(!checkHandles())
  733. return -1
  734. dwVehPtr := getVehiclePointerByPed(dwPed)
  735. dwAddr := dwVehPtr + ADDR_VEHICLE_HPOFF
  736. fHealth := readFloat(hGTA, dwAddr)
  737. if(ErrorLevel) {
  738. ErrorLevel := ERROR_READ_MEMORY
  739. return -1
  740. }
  741. ErrorLevel := ERROR_OK
  742. return Round(fHealth)
  743. }
  744. getTargetVehicleHealthById(dwId) {
  745. if(!checkHandles())
  746. return -1
  747. dwVehPtr := getVehiclePointerById(dwId)
  748. dwAddr := dwVehPtr + ADDR_VEHICLE_HPOFF
  749. fHealth := readFloat(hGTA, dwAddr)
  750. if(ErrorLevel) {
  751. ErrorLevel := ERROR_READ_MEMORY
  752. return -1
  753. }
  754. ErrorLevel := ERROR_OK
  755. return Round(fHealth)
  756. }
  757. getTargetVehicleTypeByPed(dwPED) {
  758. if(!checkHandles())
  759. return 0
  760. dwAddr := getVehiclePointerByPed(dwPED)
  761. if(!dwAddr)
  762. return 0
  763. cVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_TYPE, 1, "Char")
  764. if(ErrorLevel) {
  765. ErrorLevel := ERROR_READ_MEMORY
  766. return 0
  767. }
  768. ErrorLevel := ERROR_OK
  769. if(!cVal)
  770. {
  771. mid := getVehicleModelId()
  772. Loop % oAirplaneModels.MaxIndex()
  773. {
  774. if(oAirplaneModels[A_Index]==mid)
  775. return 5
  776. }
  777. return 1
  778. }
  779. else if(cVal==5)
  780. return 2
  781. else if(cVal==6)
  782. return 3
  783. else if(cVal==9)
  784. {
  785. mid := getVehicleModelId()
  786. Loop % oBikeModels.MaxIndex()
  787. {
  788. if(oBikeModels[A_Index]==mid)
  789. return 6
  790. }
  791. return 4
  792. }
  793. return 0
  794. }
  795. getTargetVehicleTypeById(dwId) {
  796. if(!checkHandles())
  797. return 0
  798. dwAddr := getVehiclePointerById(dwId)
  799. if(!dwAddr)
  800. return 0
  801. cVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_TYPE, 1, "Char")
  802. if(ErrorLevel) {
  803. ErrorLevel := ERROR_READ_MEMORY
  804. return 0
  805. }
  806. ErrorLevel := ERROR_OK
  807. if(!cVal)
  808. {
  809. mid := getVehicleModelId()
  810. Loop % oAirplaneModels.MaxIndex()
  811. {
  812. if(oAirplaneModels[A_Index]==mid)
  813. return 5
  814. }
  815. return 1
  816. }
  817. else if(cVal==5)
  818. return 2
  819. else if(cVal==6)
  820. return 3
  821. else if(cVal==9)
  822. {
  823. mid := getVehicleModelId()
  824. Loop % oBikeModels.MaxIndex()
  825. {
  826. if(oBikeModels[A_Index]==mid)
  827. return 6
  828. }
  829. return 4
  830. }
  831. return 0
  832. }
  833. getTargetVehicleModelIdByPed(dwPED) {
  834. if(!checkHandles())
  835. return 0
  836. dwAddr := getVehiclePointerByPed(dwPED)
  837. if(!dwAddr)
  838. return 0
  839. sVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_MODEL, 2, "Short")
  840. if(ErrorLevel) {
  841. ErrorLevel := ERROR_READ_MEMORY
  842. return 0
  843. }
  844. ErrorLevel := ERROR_OK
  845. return sVal
  846. }
  847. getTargetVehicleModelIdById(dwId) {
  848. if(!checkHandles())
  849. return 0
  850. dwAddr := getVehiclePointerById(dwId)
  851. if(!dwAddr)
  852. return 0
  853. sVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_MODEL, 2, "Short")
  854. if(ErrorLevel) {
  855. ErrorLevel := ERROR_READ_MEMORY
  856. return 0
  857. }
  858. ErrorLevel := ERROR_OK
  859. return sVal
  860. }
  861. getTargetVehicleModelNameByPed(dwPED) {
  862. id := getTargetVehicleModelIdByPed(dwPED)
  863. if(id > 400 && id < 611)
  864. {
  865. return ovehicleNames[id-399]
  866. }
  867. return ""
  868. }
  869. getTargetVehicleModelNameById(dwId) {
  870. id := getTargetVehicleModelIdById(dwId)
  871. if(id > 400 && id < 611)
  872. {
  873. return ovehicleNames[id-399]
  874. }
  875. return ""
  876. }
  877. getTargetVehicleLightStateByPed(dwPED) {
  878. if(!checkHandles())
  879. return -1
  880. dwAddr := getVehiclePointerByPed(dwPED)
  881. if(!dwAddr)
  882. return -1
  883. dwVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_LIGHTSTATE, 4, "Int")
  884. if(ErrorLevel) {
  885. ErrorLevel := ERROR_READ_MEMORY
  886. return -1
  887. }
  888. ErrorLevel := ERROR_OK
  889. return (dwVal>0)
  890. }
  891. getTargetVehicleLightStateById(dwId) {
  892. if(!checkHandles())
  893. return -1
  894. dwAddr := getVehiclePointerById(dwId)
  895. if(!dwAddr)
  896. return -1
  897. dwVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_LIGHTSTATE, 4, "Int")
  898. if(ErrorLevel) {
  899. ErrorLevel := ERROR_READ_MEMORY
  900. return -1
  901. }
  902. ErrorLevel := ERROR_OK
  903. return (dwVal>0)
  904. }
  905. getTargetVehicleLockStateByPed(dwPED) {
  906. if(!checkHandles())
  907. return -1
  908. dwAddr := getVehiclePointerByPed(dwPED)
  909. if(!dwAddr)
  910. return -1
  911. dwVal := readDWORD(hGTA, dwAddr + ADDR_VEHICLE_DOORSTATE)
  912. if(ErrorLevel) {
  913. ErrorLevel := ERROR_READ_MEMORY
  914. return -1
  915. }
  916. ErrorLevel := ERROR_OK
  917. return (dwVal==2)
  918. }
  919. getTargetVehicleLockStateById(dwId) {
  920. if(!checkHandles())
  921. return -1
  922. dwAddr := getVehiclePointerById(dwId)
  923. if(!dwAddr)
  924. return -1
  925. dwVal := readDWORD(hGTA, dwAddr + ADDR_VEHICLE_DOORSTATE)
  926. if(ErrorLevel) {
  927. ErrorLevel := ERROR_READ_MEMORY
  928. return -1
  929. }
  930. ErrorLevel := ERROR_OK
  931. return (dwVal==2)
  932. }
  933. getTargetVehicleColor1byPed(dwPED) {
  934. if(!checkHandles())
  935. return 0
  936. dwAddr := getVehiclePointerByPed(dwPED)
  937. if(!dwAddr)
  938. return 0
  939. sVal := readMem(hGTA, dwAddr + 1076, 1, "byte")
  940. if(ErrorLevel) {
  941. ErrorLevel := ERROR_READ_MEMORY
  942. return 0
  943. }
  944. ErrorLevel := ERROR_OK
  945. return sVal
  946. }
  947. getTargetVehicleColor1byId(dwId) {
  948. if(!checkHandles())
  949. return 0
  950. dwAddr := getVehiclePointerById(dwId)
  951. if(!dwAddr)
  952. return 0
  953. sVal := readMem(hGTA, dwAddr + 1076, 1, "byte")
  954. if(ErrorLevel) {
  955. ErrorLevel := ERROR_READ_MEMORY
  956. return 0
  957. }
  958. ErrorLevel := ERROR_OK
  959. return sVal
  960. }
  961. getTargetVehicleColor2byPed(dwPED) {
  962. if(!checkHandles())
  963. return 0
  964. dwAddr := getVehiclePointerByPed(dwPED)
  965. if(!dwAddr)
  966. return 0
  967. sVal := readMem(hGTA, dwAddr + 1077, 1, "byte")
  968. if(ErrorLevel) {
  969. ErrorLevel := ERROR_READ_MEMORY
  970. return 0
  971. }
  972. ErrorLevel := ERROR_OK
  973. return sVal
  974. }
  975. getTargetVehicleColor2byId(dwId) {
  976. if(!checkHandles())
  977. return 0
  978. dwAddr := getVehiclePointerById(dwId)
  979. if(!dwAddr)
  980. return 0
  981. sVal := readMem(hGTA, dwAddr + 1077, 1, "byte")
  982. if(ErrorLevel) {
  983. ErrorLevel := ERROR_READ_MEMORY
  984. return 0
  985. }
  986. ErrorLevel := ERROR_OK
  987. return sVal
  988. }
  989. getTargetVehicleSpeedByPed(dwPED) {
  990. if(!checkHandles())
  991. return -1
  992. dwAddr := getVehiclePointerByPed(dwPED)
  993. fSpeedX := readMem(hGTA, dwAddr + ADDR_VEHICLE_X, 4, "float")
  994. fSpeedY := readMem(hGTA, dwAddr + ADDR_VEHICLE_Y, 4, "float")
  995. fSpeedZ := readMem(hGTA, dwAddr + ADDR_VEHICLE_Z, 4, "float")
  996. fVehicleSpeed :=  sqrt((fSpeedX * fSpeedX) + (fSpeedY * fSpeedY) + (fSpeedZ * fSpeedZ))
  997. fVehicleSpeed := (fVehicleSpeed * 100) * 1.43
  998. return fVehicleSpeed
  999. }
  1000. getTargetVehicleSpeedById(dwId) {
  1001. if(!checkHandles())
  1002. return -1
  1003. dwAddr := getVehiclePointerById(dwId)
  1004. fSpeedX := readMem(hGTA, dwAddr + ADDR_VEHICLE_X, 4, "float")
  1005. fSpeedY := readMem(hGTA, dwAddr + ADDR_VEHICLE_Y, 4, "float")
  1006. fSpeedZ := readMem(hGTA, dwAddr + ADDR_VEHICLE_Z, 4, "float")
  1007. fVehicleSpeed :=  sqrt((fSpeedX * fSpeedX) + (fSpeedY * fSpeedY) + (fSpeedZ * fSpeedZ))
  1008. fVehicleSpeed := (fVehicleSpeed * 100) * 1.43
  1009. return fVehicleSpeed
  1010. }
  1011. getPlayerNameById(dwId) {
  1012. dwId += 0
  1013. dwId := Floor(dwId)
  1014. if(dwId < 0 || dwId >= SAMP_PLAYER_MAX)
  1015. return ""
  1016. if(iRefreshScoreboard+iUpdateTick > A_TickCount)
  1017. {
  1018. if(oScoreboardData[dwId])
  1019. return oScoreboardData[dwId].NAME
  1020. return ""
  1021. }
  1022. if(!updateOScoreboardData())
  1023. return ""
  1024. if(oScoreboardData[dwId])
  1025. return oScoreboardData[dwId].NAME
  1026. return ""
  1027. }
  1028. getPlayerIdByName(wName) {
  1029. wName := "" wName
  1030. if(StrLen(wName) < 1 || StrLen(wName) > 24)
  1031. return -1
  1032. if(iRefreshScoreboard+iUpdateTick > A_TickCount)
  1033. {
  1034. For i, o in oScoreboardData
  1035. {
  1036. if(InStr(o.NAME,wName)==1)
  1037. return i
  1038. }
  1039. return -1
  1040. }
  1041. if(!updateOScoreboardData())
  1042. return -1
  1043. For i, o in oScoreboardData
  1044. {
  1045. if(InStr(o.NAME,wName)==1)
  1046. return i
  1047. }
  1048. return -1
  1049. }
  1050. getPlayerScoreById(dwId) {
  1051. dwId += 0
  1052. dwId := Floor(dwId)
  1053. if(dwId < 0 || dwId >= SAMP_PLAYER_MAX)
  1054. return ""
  1055. if(iRefreshScoreboard+iUpdateTick > A_TickCount)
  1056. {
  1057. if(oScoreboardData[dwId])
  1058. return oScoreboardData[dwId].SCORE
  1059. return ""
  1060. }
  1061. if(!updateOScoreboardData())
  1062. return ""
  1063. if(oScoreboardData[dwId])
  1064. return oScoreboardData[dwId].SCORE
  1065. return ""
  1066. }
  1067. getPlayerPingById(dwId) {
  1068. dwId += 0
  1069. dwId := Floor(dwId)
  1070. if(dwId < 0 || dwId >= SAMP_PLAYER_MAX)
  1071. return -1
  1072. if(iRefreshScoreboard+iUpdateTick > A_TickCount)
  1073. {
  1074. if(oScoreboardData[dwId])
  1075. return oScoreboardData[dwId].PING
  1076. return -1
  1077. }
  1078. if(!updateOScoreboardData())
  1079. return -1
  1080. if(oScoreboardData[dwId])
  1081. return oScoreboardData[dwId].PING
  1082. return -1
  1083. }
  1084. isNPCById(dwId) {
  1085. dwId += 0
  1086. dwId := Floor(dwId)
  1087. if(dwId < 0 || dwId >= SAMP_PLAYER_MAX)
  1088. return -1
  1089. if(iRefreshScoreboard+iUpdateTick > A_TickCount)
  1090. {
  1091. if(oScoreboardData[dwId])
  1092. return oScoreboardData[dwId].ISNPC
  1093. return -1
  1094. }
  1095. if(!updateOScoreboardData())
  1096. return -1
  1097. if(oScoreboardData[dwId])
  1098. return oScoreboardData[dwId].ISNPC
  1099. return -1
  1100. }
  1101. updateScoreboardDataEx() {
  1102. if(!checkHandles())
  1103. return false
  1104. dwAddress := readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET)
  1105. if(ErrorLevel || dwAddress==0) {
  1106. ErrorLevel := ERROR_READ_MEMORY
  1107. return false
  1108. }
  1109. dwFunc := dwSAMP + FUNC_UPDATESCOREBOARD
  1110. VarSetCapacity(injectData, 11, 0)
  1111. NumPut(0xB9, injectData, 0, "UChar")
  1112. NumPut(dwAddress, injectData, 1, "UInt")
  1113. NumPut(0xE8, injectData, 5, "UChar")
  1114. offset := dwFunc - (pInjectFunc + 10)
  1115. NumPut(offset, injectData, 6, "Int")
  1116. NumPut(0xC3, injectData, 10, "UChar")
  1117. writeRaw(hGTA, pInjectFunc, &injectData, 11)
  1118. if(ErrorLevel)
  1119. return false
  1120. hThread := createRemoteThread(hGTA, 0, 0, pInjectFunc, 0, 0, 0)
  1121. if(ErrorLevel)
  1122. return false
  1123. waitForSingleObject(hThread, 0xFFFFFFFF)
  1124. closeProcess(hThread)
  1125. return true
  1126. }
  1127. updateOScoreboardData() {
  1128. if(!checkHandles())
  1129. return 0
  1130. oScoreboardData := []
  1131. if(!updateScoreboardDataEx())
  1132. return 0
  1133. iRefreshScoreboard := A_TickCount
  1134. dwAddress := readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET)
  1135. if(ErrorLevel || dwAddress==0) {
  1136. ErrorLevel := ERROR_READ_MEMORY
  1137. return 0
  1138. }
  1139. dwAddress := readDWORD(hGTA, dwAddress + SAMP_PPOOLS_OFFSET)
  1140. if(ErrorLevel || dwAddress==0) {
  1141. ErrorLevel := ERROR_READ_MEMORY
  1142. return 0
  1143. }
  1144. dwPlayers := readDWORD(hGTA, dwAddress + SAMP_PPOOL_PLAYER_OFFSET)
  1145. if(ErrorLevel || dwPlayers==0) {
  1146. ErrorLevel := ERROR_READ_MEMORY
  1147. return 0
  1148. }
  1149. wID := readMem(hGTA, dwPlayers + SAMP_SLOCALPLAYERID_OFFSET, 2, "Short")
  1150. if(ErrorLevel) {
  1151. ErrorLevel := ERROR_READ_MEMORY
  1152. return 0
  1153. }
  1154. dwPing := readMem(hGTA, dwPlayers + SAMP_ILOCALPLAYERPING_OFFSET, 4, "Int")
  1155. if(ErrorLevel) {
  1156. ErrorLevel := ERROR_READ_MEMORY
  1157. return 0
  1158. }
  1159. dwScore := readMem(hGTA, dwPlayers + SAMP_ILOCALPLAYERSCORE_OFFSET, 4, "Int")
  1160. if(ErrorLevel) {
  1161. ErrorLevel := ERROR_READ_MEMORY
  1162. return 0
  1163. }
  1164. dwTemp := readMem(hGTA, dwPlayers + SAMP_ISTRLEN_LOCALPLAYERNAME_OFFSET, 4, "Int")
  1165. if(ErrorLevel) {
  1166. ErrorLevel := ERROR_READ_MEMORY
  1167. return 0
  1168. }
  1169. sUsername := ""
  1170. if(dwTemp <= 0xf) {
  1171. sUsername := readString(hGTA, dwPlayers + SAMP_SZLOCALPLAYERNAME_OFFSET, 16)
  1172. if(ErrorLevel) {
  1173. ErrorLevel := ERROR_READ_MEMORY
  1174. return 0
  1175. }
  1176. }
  1177. else {
  1178. dwAddress := readDWORD(hGTA, dwPlayers + SAMP_PSZLOCALPLAYERNAME_OFFSET)
  1179. if(ErrorLevel) {
  1180. ErrorLevel := ERROR_READ_MEMORY
  1181. return 0
  1182. }
  1183. sUsername := readString(hGTA, dwAddress, 25)
  1184. if(ErrorLevel) {
  1185. ErrorLevel := ERROR_READ_MEMORY
  1186. return 0
  1187. }
  1188. }
  1189. oScoreboardData[wID] := Object("NAME", sUsername, "ID", wID, "PING", dwPing, "SCORE", dwScore, "ISNPC", 0)
  1190. Loop, % SAMP_PLAYER_MAX
  1191. {
  1192. i := A_Index-1
  1193. dwRemoteplayer := readDWORD(hGTA, dwPlayers+SAMP_PREMOTEPLAYER_OFFSET+i*4)
  1194. if(ErrorLevel) {
  1195. ErrorLevel := ERROR_READ_MEMORY
  1196. return 0
  1197. }
  1198. if(dwRemoteplayer==0)
  1199. continue
  1200. dwPing := readMem(hGTA, dwRemoteplayer + SAMP_IPING_OFFSET, 4, "Int")
  1201. if(ErrorLevel) {
  1202. ErrorLevel := ERROR_READ_MEMORY
  1203. return 0
  1204. }
  1205. dwScore := readMem(hGTA, dwRemoteplayer + SAMP_ISCORE_OFFSET, 4, "Int")
  1206. if(ErrorLevel) {
  1207. ErrorLevel := ERROR_READ_MEMORY
  1208. return 0
  1209. }
  1210. dwIsNPC := readMem(hGTA, dwRemoteplayer + SAMP_ISNPC_OFFSET, 4, "Int")
  1211. if(ErrorLevel) {
  1212. ErrorLevel := ERROR_READ_MEMORY
  1213. return 0
  1214. }
  1215. dwTemp := readMem(hGTA, dwRemoteplayer + SAMP_ISTRLENNAME___OFFSET, 4, "Int")
  1216. if(ErrorLevel) {
  1217. ErrorLevel := ERROR_READ_MEMORY
  1218. return 0
  1219. }
  1220. sUsername := ""
  1221. if(dwTemp <= 0xf)
  1222. {
  1223. sUsername := readString(hGTA, dwRemoteplayer+SAMP_SZPLAYERNAME_OFFSET, 16)
  1224. if(ErrorLevel) {
  1225. ErrorLevel := ERROR_READ_MEMORY
  1226. return 0
  1227. }
  1228. }
  1229. else {
  1230. dwAddress := readDWORD(hGTA, dwRemoteplayer + SAMP_PSZPLAYERNAME_OFFSET)
  1231. if(ErrorLevel || dwAddress==0) {
  1232. ErrorLevel := ERROR_READ_MEMORY
  1233. return 0
  1234. }
  1235. sUsername := readString(hGTA, dwAddress, 25)
  1236. if(ErrorLevel) {
  1237. ErrorLevel := ERROR_READ_MEMORY
  1238. return 0
  1239. }
  1240. }
  1241. o := Object("NAME", sUsername, "ID", i, "PING", dwPing, "SCORE", dwScore, "ISNPC", dwIsNPC)
  1242. oScoreboardData[i] := o
  1243. dwRemoteplayerData := readDWORD(hGTA, dwRemoteplayer + 0x0)
  1244. if(ErrorLevel) {
  1245. ErrorLevel := ERROR_READ_MEMORY
  1246. return 0
  1247. }
  1248. if(dwRemoteplayerData==0)
  1249. continue
  1250. dwAddress := readDWORD(hGTA, dwRemoteplayerData + 489)
  1251. if(ErrorLevel) {
  1252. ErrorLevel := ERROR_READ_MEMORY
  1253. return 0
  1254. }
  1255. if(dwAddress)
  1256. {
  1257. ix := readMem(hGTA, dwRemoteplayerData + 493, 4, "Int")
  1258. if(ErrorLevel) {
  1259. ErrorLevel := ERROR_READ_MEMORY
  1260. return 0
  1261. }
  1262. iy := readMem(hGTA, dwRemoteplayerData + 497, 4, "Int")
  1263. if(ErrorLevel) {
  1264. ErrorLevel := ERROR_READ_MEMORY
  1265. return 0
  1266. }
  1267. iz := readMem(hGTA, dwRemoteplayerData + 501, 4, "Int")
  1268. if(ErrorLevel) {
  1269. ErrorLevel := ERROR_READ_MEMORY
  1270. return 0
  1271. }
  1272. o.MPOS := [ix, iy, iz]
  1273. }
  1274. dwpSAMP_Actor := readDWORD(hGTA, dwRemoteplayerData + 0x0)
  1275. if(ErrorLevel) {
  1276. ErrorLevel := ERROR_READ_MEMORY
  1277. return 0
  1278. }
  1279. if(dwpSAMP_Actor==0)
  1280. continue
  1281. dwPed := readDWORD(hGTA, dwpSAMP_Actor + 676)
  1282. if(ErrorLevel) {
  1283. ErrorLevel := ERROR_READ_MEMORY
  1284. return 0
  1285. }
  1286. if(dwPed==0)
  1287. continue
  1288. o.PED := dwPed
  1289. fHP := readFloat(hGTA, dwRemoteplayerData + 444)
  1290. if(ErrorLevel) {
  1291. ErrorLevel := ERROR_READ_MEMORY
  1292. return 0
  1293. }
  1294. fARMOR := readFloat(hGTA, dwRemoteplayerData + 440)
  1295. if(ErrorLevel) {
  1296. ErrorLevel := ERROR_READ_MEMORY
  1297. return 0
  1298. }
  1299. o.HP := fHP
  1300. o.ARMOR := fARMOR
  1301. }
  1302. ErrorLevel := ERROR_OK
  1303. return 1
  1304. }
  1305. GetChatLine(Line, ByRef Output, timestamp=0, color=0){
  1306. chatindex := 0
  1307. FileRead, file, %A_MyDocuments%\GTA San Andreas User Files\SAMP\chatlog.txt
  1308. loop, Parse, file, `n, `r
  1309. {
  1310. if(A_LoopField)
  1311. chatindex := A_Index
  1312. }
  1313. loop, Parse, file, `n, `r
  1314. {
  1315. if(A_Index = chatindex - line){
  1316. output := A_LoopField
  1317. break
  1318. }
  1319. }
  1320. file := ""
  1321. if(!timestamp)
  1322. output := RegExReplace(output, "U)^\[\d{2}:\d{2}:\d{2}\]")
  1323. if(!color)
  1324. output := RegExReplace(output, "Ui)\{[a-f0-9]{6}\}")
  1325. return
  1326. }
  1327. getPlayerHealth() {
  1328. if(!checkHandles())
  1329. return -1
  1330. dwCPedPtr := readDWORD(hGTA, ADDR_CPED_PTR)
  1331. if(ErrorLevel) {
  1332. ErrorLevel := ERROR_READ_MEMORY
  1333. return -1
  1334. }
  1335. dwAddr := dwCPedPtr + ADDR_CPED_HPOFF
  1336. fHealth := readFloat(hGTA, dwAddr)
  1337. if(ErrorLevel) {
  1338. ErrorLevel := ERROR_READ_MEMORY
  1339. return -1
  1340. }
  1341. ErrorLevel := ERROR_OK
  1342. return Round(fHealth)
  1343. }
  1344. getPlayerArmor() {
  1345. if(!checkHandles())
  1346. return -1
  1347. dwCPedPtr := readDWORD(hGTA, ADDR_CPED_PTR)
  1348. if(ErrorLevel) {
  1349. ErrorLevel := ERROR_READ_MEMORY
  1350. return -1
  1351. }
  1352. dwAddr := dwCPedPtr + ADDR_CPED_ARMOROFF
  1353. fHealth := readFloat(hGTA, dwAddr)
  1354. if(ErrorLevel) {
  1355. ErrorLevel := ERROR_READ_MEMORY
  1356. return -1
  1357. }
  1358. ErrorLevel := ERROR_OK
  1359. return Round(fHealth)
  1360. }
  1361. getPlayerInteriorId() {
  1362. if(!checkHandles())
  1363. return -1
  1364. iid := readMem(hGTA, ADDR_CPED_INTID, 4, "Int")
  1365. if(ErrorLevel) {
  1366. ErrorLevel := ERROR_READ_MEMORY
  1367. return -1
  1368. }
  1369. ErrorLevel := ERROR_OK
  1370. return iid
  1371. }
  1372. getPlayerSkinID() {
  1373. if(!checkHandles())
  1374. return -1
  1375. dwCPedPtr := readDWORD(hGTA, ADDR_CPED_PTR)
  1376. if(ErrorLevel) {
  1377. ErrorLevel := ERROR_READ_MEMORY
  1378. return -1
  1379. }
  1380. dwAddr := dwCPedPtr + ADDR_CPED_SKINIDOFF
  1381. SkinID := readMem(hGTA, dwAddr, 2, "byte")
  1382. if(ErrorLevel) {
  1383. ErrorLevel := ERROR_READ_MEMORY
  1384. return -1
  1385. }
  1386. ErrorLevel := ERROR_OK
  1387. return SkinID
  1388. }
  1389. getPlayerMoney() {
  1390. if(!checkHandles())
  1391. return ""
  1392. money := readMem(hGTA, ADDR_CPED_MONEY, 4, "Int")
  1393. if(ErrorLevel) {
  1394. ErrorLevel := ERROR_READ_MEMORY
  1395. return ""
  1396. }
  1397. ErrorLevel := ERROR_OK
  1398. return money
  1399. }
  1400. getPlayerWanteds() {
  1401. if(!checkHandles())
  1402. return -1
  1403. dwPtr := 0xB7CD9C
  1404. dwPtr := readDWORD(hGTA, dwPtr)
  1405. if(ErrorLevel) {
  1406. ErrorLevel := ERROR_READ_MEMORY
  1407. return -1
  1408. }
  1409. Wanteds := readDWORD(hGTA, dwPtr)
  1410. if(ErrorLevel) {
  1411. ErrorLevel := ERROR_READ_MEMORY
  1412. return -1
  1413. }
  1414. ErrorLevel := ERROR_OK
  1415. return Wanteds
  1416. }
  1417. getPlayerWeaponId() {
  1418. if(!checkHandles())
  1419. return 0
  1420. WaffenId := readMem(hGTA, 0xBAA410, 4, "byte")
  1421. if(ErrorLevel) {
  1422. ErrorLevel := ERROR_READ_MEMORY
  1423. return -1
  1424. }
  1425. return WaffenId
  1426. }
  1427. getPlayerWeaponName() {
  1428. id := getPlayerWeaponId()
  1429. if(id >= 0 && id < 44)
  1430. {
  1431. return oweaponNames[id+1]
  1432. }
  1433. return ""
  1434. }
  1435. getPlayerState() {
  1436. if(!checkHandles())
  1437. return -1
  1438. dwCPedPtr := readDWORD(hGTA, ADDR_CPED_PTR)
  1439. if(ErrorLevel) {
  1440. ErrorLevel := ERROR_READ_MEMORY
  1441. return -1
  1442. }
  1443. State := readDWORD(hGTA, dwCPedPtr + 0x530)
  1444. if(ErrorLevel) {
  1445. ErrorLevel := ERROR_READ_MEMORY
  1446. return -1
  1447. }
  1448. ErrorLevel := ERROR_OK
  1449. return State
  1450. }
  1451. IsPlayerInMenu() {
  1452. if(!checkHandles())
  1453. return -1
  1454. IsInMenu := readMem(hGTA, 0xBA67A4, 4, "byte")
  1455. if(ErrorLevel) {
  1456. ErrorLevel := ERROR_READ_MEMORY
  1457. return -1
  1458. }
  1459. ErrorLevel := ERROR_OK
  1460. return IsInMenu
  1461. }
  1462. getPlayerMapPosX() {
  1463. if(!checkHandles())
  1464. return -1
  1465. MapPosX := readFloat(hGTA, 0xBA67B8)
  1466. if(ErrorLevel) {
  1467. ErrorLevel := ERROR_READ_MEMORY
  1468. return -1
  1469. }
  1470. ErrorLevel := ERROR_OK
  1471. return MapPosX
  1472. }
  1473. getPlayerMapPosY() {
  1474. if(!checkHandles())
  1475. return -1
  1476. MapPosY := readFloat(hGTA, 0xBA67BC)
  1477. if(ErrorLevel) {
  1478. ErrorLevel := ERROR_READ_MEMORY
  1479. return -1
  1480. }
  1481. ErrorLevel := ERROR_OK
  1482. return MapPosY
  1483. }
  1484. getPlayerMapZoom() {
  1485. if(!checkHandles())
  1486. return -1
  1487. MapZoom := readFloat(hGTA, 0xBA67AC)
  1488. if(ErrorLevel) {
  1489. ErrorLevel := ERROR_READ_MEMORY
  1490. return -1
  1491. }
  1492. ErrorLevel := ERROR_OK
  1493. return MapZoom
  1494. }
  1495. IsPlayerFreezed() {
  1496. if(!checkHandles())
  1497. return -1
  1498. dwGTA := getModuleBaseAddress("gta_sa.exe", hGTA)
  1499. IPF := readMem(hGTA, dwGTA + 0x690495, 2, "byte")
  1500. if(ErrorLevel) {
  1501. ErrorLevel := ERROR_READ_MEMORY
  1502. return -1
  1503. }
  1504. ErrorLevel := ERROR_OK
  1505. return IPF
  1506. }
  1507. isPlayerInAnyVehicle()
  1508. {
  1509. if(!checkHandles())
  1510. return -1
  1511. dwVehPtr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
  1512. if(ErrorLevel) {
  1513. ErrorLevel := ERROR_READ_MEMORY
  1514. return -1
  1515. }
  1516. return (dwVehPtr > 0)
  1517. }
  1518. isPlayerDriver() {
  1519. if(!checkHandles())
  1520. return -1
  1521. dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
  1522. if(ErrorLevel) {
  1523. ErrorLevel := ERROR_READ_MEMORY
  1524. return -1
  1525. }
  1526. if(!dwAddr)
  1527. return -1
  1528. dwCPedPtr := readDWORD(hGTA, ADDR_CPED_PTR)
  1529. if(ErrorLevel) {
  1530. ErrorLevel := ERROR_READ_MEMORY
  1531. return -1
  1532. }
  1533. dwVal := readDWORD(hGTA, dwAddr + ADDR_VEHICLE_DRIVER)
  1534. if(ErrorLevel) {
  1535. ErrorLevel := ERROR_READ_MEMORY
  1536. return -1
  1537. }
  1538. ErrorLevel := ERROR_OK
  1539. return (dwVal==dwCPedPtr)
  1540. }
  1541. getVehicleHealth() {
  1542. if(!checkHandles())
  1543. return -1
  1544. dwVehPtr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
  1545. if(ErrorLevel) {
  1546. ErrorLevel := ERROR_READ_MEMORY
  1547. return -1
  1548. }
  1549. dwAddr := dwVehPtr + ADDR_VEHICLE_HPOFF
  1550. fHealth := readFloat(hGTA, dwAddr)
  1551. if(ErrorLevel) {
  1552. ErrorLevel := ERROR_READ_MEMORY
  1553. return -1
  1554. }
  1555. ErrorLevel := ERROR_OK
  1556. return Round(fHealth)
  1557. }
  1558. getVehicleType() {
  1559. if(!checkHandles())
  1560. return 0
  1561. dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
  1562. if(ErrorLevel) {
  1563. ErrorLevel := ERROR_READ_MEMORY
  1564. return 0
  1565. }
  1566. if(!dwAddr)
  1567. return 0
  1568. cVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_TYPE, 1, "Char")
  1569. if(ErrorLevel) {
  1570. ErrorLevel := ERROR_READ_MEMORY
  1571. return 0
  1572. }
  1573. ErrorLevel := ERROR_OK
  1574. if(!cVal)
  1575. {
  1576. mid := getVehicleModelId()
  1577. Loop % oAirplaneModels.MaxIndex()
  1578. {
  1579. if(oAirplaneModels[A_Index]==mid)
  1580. return 5
  1581. }
  1582. return 1
  1583. }
  1584. else if(cVal==5)
  1585. return 2
  1586. else if(cVal==6)
  1587. return 3
  1588. else if(cVal==9)
  1589. {
  1590. mid := getVehicleModelId()
  1591. Loop % oBikeModels.MaxIndex()
  1592. {
  1593. if(oBikeModels[A_Index]==mid)
  1594. return 6
  1595. }
  1596. return 4
  1597. }
  1598. return 0
  1599. }
  1600. getVehicleModelId() {
  1601. if(!checkHandles())
  1602. return 0
  1603. dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
  1604. if(ErrorLevel) {
  1605. ErrorLevel := ERROR_READ_MEMORY
  1606. return 0
  1607. }
  1608. if(!dwAddr)
  1609. return 0
  1610. sVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_MODEL, 2, "Short")
  1611. if(ErrorLevel) {
  1612. ErrorLevel := ERROR_READ_MEMORY
  1613. return 0
  1614. }
  1615. ErrorLevel := ERROR_OK
  1616. return sVal
  1617. }
  1618. getVehicleModelName() {
  1619. id:=getVehicleModelId()
  1620. if(id > 400 && id < 611)
  1621. {
  1622. return ovehicleNames[id-399]
  1623. }
  1624. return ""
  1625. }
  1626. getVehicleLightState() {
  1627. if(!checkHandles())
  1628. return -1
  1629. dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
  1630. if(ErrorLevel) {
  1631. ErrorLevel := ERROR_READ_MEMORY
  1632. return -1
  1633. }
  1634. if(!dwAddr)
  1635. return -1
  1636. dwVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_LIGHTSTATE, 4, "Int")
  1637. if(ErrorLevel) {
  1638. ErrorLevel := ERROR_READ_MEMORY
  1639. return -1
  1640. }
  1641. ErrorLevel := ERROR_OK
  1642. return (dwVal>0)
  1643. }
  1644. getVehicleEngineState() {
  1645. if(!checkHandles())
  1646. return -1
  1647. dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
  1648. if(ErrorLevel) {
  1649. ErrorLevel := ERROR_READ_MEMORY
  1650. return -1
  1651. }
  1652. if(!dwAddr)
  1653. return -1
  1654. cVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_ENGINESTATE, 1, "Char")
  1655. if(ErrorLevel) {
  1656. ErrorLevel := ERROR_READ_MEMORY
  1657. return -1
  1658. }
  1659. ErrorLevel := ERROR_OK
  1660. return (cVal==24 || cVal==56 || cVal==88 || cVal==120)
  1661. }
  1662. getVehicleLockState() {
  1663. if(!checkHandles())
  1664. return -1
  1665. dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
  1666. if(ErrorLevel) {
  1667. ErrorLevel := ERROR_READ_MEMORY
  1668. return -1
  1669. }
  1670. if(!dwAddr)
  1671. return -1
  1672. dwVal := readDWORD(hGTA, dwAddr + ADDR_VEHICLE_DOORSTATE)
  1673. if(ErrorLevel) {
  1674. ErrorLevel := ERROR_READ_MEMORY
  1675. return -1
  1676. }
  1677. ErrorLevel := ERROR_OK
  1678. return (dwVal==2)
  1679. }
  1680. getVehicleColor1() {
  1681. if(!checkHandles())
  1682. return 0
  1683. dwAddr := readDWORD(hGTA, 0xBA18FC)
  1684. if(ErrorLevel) {
  1685. ErrorLevel := ERROR_READ_MEMORY
  1686. return 0
  1687. }
  1688. if(!dwAddr)
  1689. return 0
  1690. sVal := readMem(hGTA, dwAddr + 1076, 1, "byte")
  1691. if(ErrorLevel) {
  1692. ErrorLevel := ERROR_READ_MEMORY
  1693. return 0
  1694. }
  1695. ErrorLevel := ERROR_OK
  1696. return sVal
  1697. }
  1698. getVehicleColor2() {
  1699. if(!checkHandles())
  1700. return 0
  1701. dwAddr := readDWORD(hGTA, 0xBA18FC)
  1702. if(ErrorLevel) {
  1703. ErrorLevel := ERROR_READ_MEMORY
  1704. return 0
  1705. }
  1706. if(!dwAddr)
  1707. return 0
  1708. sVal := readMem(hGTA, dwAddr + 1077, 1, "byte")
  1709. if(ErrorLevel) {
  1710. ErrorLevel := ERROR_READ_MEMORY
  1711. return 0
  1712. }
  1713. ErrorLevel := ERROR_OK
  1714. return sVal
  1715. }
  1716. getVehicleSpeed() {
  1717. if(!checkHandles())
  1718. return -1
  1719. dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
  1720. if(ErrorLevel) {
  1721. ErrorLevel := ERROR_READ_MEMORY
  1722. return ""
  1723. }
  1724. fSpeedX := readMem(hGTA, dwAddr + ADDR_VEHICLE_X, 4, "float")
  1725. fSpeedY := readMem(hGTA, dwAddr + ADDR_VEHICLE_Y, 4, "float")
  1726. fSpeedZ := readMem(hGTA, dwAddr + ADDR_VEHICLE_Z, 4, "float")
  1727. fVehicleSpeed :=  sqrt((fSpeedX * fSpeedX) + (fSpeedY * fSpeedY) + (fSpeedZ * fSpeedZ))
  1728. fVehicleSpeed := (fVehicleSpeed * 100) * 1.43
  1729. return fVehicleSpeed
  1730. }
  1731. getPlayerRadiostationID() {
  1732. if(!checkHandles())
  1733. return -1
  1734. if(isPlayerInAnyVehicle() == 0)
  1735. return -1
  1736. dwGTA := getModuleBaseAddress("gta_sa.exe", hGTA)
  1737. RadioStationID := readMem(hGTA, dwGTA + 0x4CB7E1, 1, "byte")
  1738. if(ErrorLevel) {
  1739. ErrorLevel := ERROR_READ_MEMORY
  1740. return -1
  1741. }
  1742. return RadioStationID
  1743. }
  1744. getPlayerRadiostationName() {
  1745. if(isPlayerInAnyVehicle() == 0)
  1746. return -1
  1747. id := getPlayerRadiostationID()
  1748. if(id == 0)
  1749. return -1
  1750. if(id >= 0 && id < 14)
  1751. {
  1752. return oradiostationNames[id]
  1753. }
  1754. return ""
  1755. }
  1756. setCheckpoint(fX, fY, fZ, fSize ) {
  1757. if(!checkHandles())
  1758. return false
  1759. dwFunc := dwSAMP + 0x9D340
  1760. dwAddress := readDWORD(hGTA, dwSAMP + ADDR_SAMP_INCHAT_PTR)
  1761. if(ErrorLevel || dwAddress==0) {
  1762. ErrorLevel := ERROR_READ_MEMORY
  1763. return false
  1764. }
  1765. VarSetCapacity(buf, 16, 0)
  1766. NumPut(fX, buf, 0, "Float")
  1767. NumPut(fY, buf, 4, "Float")
  1768. NumPut(fZ, buf, 8, "Float")
  1769. NumPut(fSize, buf, 12, "Float")
  1770. writeRaw(hGTA, pParam1, &buf, 16)
  1771. dwLen := 31
  1772. VarSetCapacity(injectData, dwLen, 0)
  1773. NumPut(0xB9, injectData, 0, "UChar")
  1774. NumPut(dwAddress, injectData, 1, "UInt")
  1775. NumPut(0x68, injectData, 5, "UChar")
  1776. NumPut(pParam1+12, injectData, 6, "UInt")
  1777. NumPut(0x68, injectData, 10, "UChar")
  1778. NumPut(pParam1, injectData, 11, "UInt")
  1779. NumPut(0xE8, injectData, 15, "UChar")
  1780. offset := dwFunc - (pInjectFunc + 20)
  1781. NumPut(offset, injectData, 16, "Int")
  1782. NumPut(0x05C7, injectData, 20, "UShort")
  1783. NumPut(dwAddress+0x24, injectData, 22, "UInt")
  1784. NumPut(1, injectData, 26, "UInt")
  1785. NumPut(0xC3, injectData, 30, "UChar")
  1786. writeRaw(hGTA, pInjectFunc, &injectData, dwLen)
  1787. if(ErrorLevel)
  1788. return false
  1789. hThread := createRemoteThread(hGTA, 0, 0, pInjectFunc, 0, 0, 0)
  1790. if(ErrorLevel)
  1791. return false
  1792. waitForSingleObject(hThread, 0xFFFFFFFF)
  1793. closeProcess(hThread)
  1794. ErrorLevel := ERROR_OK
  1795. return true
  1796. }
  1797. disableCheckpoint()
  1798. {
  1799. if(!checkHandles())
  1800. return false
  1801. dwAddress := readDWORD(hGTA, dwSAMP + ADDR_SAMP_INCHAT_PTR)
  1802. if(ErrorLevel || dwAddress==0) {
  1803. ErrorLevel := ERROR_READ_MEMORY
  1804. return false
  1805. }
  1806. VarSetCapacity(enablecp, 4, 0)
  1807. NumPut(0,enablecp,0,"Int")
  1808. writeRaw(hGTA, dwAddress+0x24, &enablecp, 4)
  1809. ErrorLevel := ERROR_OK
  1810. return true
  1811. }
  1812. IsMarkerCreated(){
  1813. If(!checkHandles())
  1814. return false
  1815. active := readMem(hGTA, CheckpointCheck, 1, "byte")
  1816. If(!active)
  1817. return 0
  1818. else return 1
  1819. }
  1820. CoordsFromRedmarker(){
  1821. if(!checkhandles())
  1822. return false
  1823. for i, v in rmaddrs
  1824. f%i% := readFloat(hGTA, v)
  1825. return [f1, f2, f3]
  1826. }
  1827. getCoordinates() {
  1828. if(!checkHandles())
  1829. return ""
  1830. fX := readFloat(hGTA, ADDR_POSITION_X)
  1831. if(ErrorLevel) {
  1832. ErrorLevel := ERROR_READ_MEMORY
  1833. return ""
  1834. }
  1835. fY := readFloat(hGTA, ADDR_POSITION_Y)
  1836. if(ErrorLevel) {
  1837. ErrorLevel := ERROR_READ_MEMORY
  1838. return ""
  1839. }
  1840. fZ := readFloat(hGTA, ADDR_POSITION_Z)
  1841. if(ErrorLevel) {
  1842. ErrorLevel := ERROR_READ_MEMORY
  1843. return ""
  1844. }
  1845. ErrorLevel := ERROR_OK
  1846. return [fX, fY, fZ]
  1847. }
  1848. GetPlayerPos(ByRef fX,ByRef fY,ByRef fZ) {
  1849. if(!checkHandles())
  1850. return 0
  1851. fX := readFloat(hGTA, ADDR_POSITION_X)
  1852. if(ErrorLevel) {
  1853. ErrorLevel := ERROR_READ_MEMORY
  1854. return 0
  1855. }
  1856. fY := readFloat(hGTA, ADDR_POSITION_Y)
  1857. if(ErrorLevel) {
  1858. ErrorLevel := ERROR_READ_MEMORY
  1859. return 0
  1860. }
  1861. fZ := readFloat(hGTA, ADDR_POSITION_Z)
  1862. if(ErrorLevel) {
  1863. ErrorLevel := ERROR_READ_MEMORY
  1864. return 0
  1865. }
  1866. ErrorLevel := ERROR_OK
  1867. }
  1868. getDialogStructPtr() {
  1869. if (!checkHandles()) {
  1870. ErrorLevel := ERROR_INVALID_HANDLE
  1871. return false
  1872. }
  1873. dwPointer := readDWORD(hGTA, dwSAMP + SAMP_DIALOG_STRUCT_PTR)
  1874. if (ErrorLevel) {
  1875. ErrorLevel := ERROR_READ_MEMORY
  1876. return false
  1877. }
  1878. ErrorLevel := ERROR_OK
  1879. return dwPointer
  1880. }
  1881. isDialogOpen() {
  1882. dwPointer := getDialogStructPtr()
  1883. if (ErrorLevel || !dwPointer)
  1884. return false
  1885. dwIsOpen := readMem(hGTA, dwPointer + SAMP_DIALOG_OPEN_OFFSET, 4, "UInt")
  1886. if (ErrorLevel) {
  1887. ErrorLevel := ERROR_READ_MEMORY
  1888. return false
  1889. }
  1890. ErrorLevel := ERROR_OK
  1891. return dwIsOpen ? true : false
  1892. }
  1893. getDialogStyle() {
  1894. dwPointer := getDialogStructPtr()
  1895. if (ErrorLevel || !dwPointer)
  1896. return -1
  1897. style := readMem(hGTA, dwPointer + SAMP_DIALOG_STYLE_OFFSET, 4, "UInt")
  1898. if (ErrorLevel) {
  1899. ErrorLevel := ERROR_READ_MEMORY
  1900. return -1
  1901. }
  1902. ErrorLevel := ERROR_OK
  1903. return style
  1904. }
  1905. getDialogID() {
  1906. dwPointer := getDialogStructPtr()
  1907. if (ErrorLevel || !dwPointer)
  1908. return -1
  1909. id := readMem(hGTA, dwPointer + SAMP_DIALOG_ID_OFFSET, 4, "UInt")
  1910. if (ErrorLevel) {
  1911. ErrorLevel := ERROR_READ_MEMORY
  1912. return -1
  1913. }
  1914. ErrorLevel := ERROR_OK
  1915. return id
  1916. }
  1917. setDialogID(id) {
  1918. dwPointer := getDialogStructPtr()
  1919. if (ErrorLevel || !dwPointer)
  1920. return false
  1921. writeMemory(hGTA, dwPointer + SAMP_DIALOG_ID_OFFSET, id, "UInt", 4)
  1922. if (ErrorLevel) {
  1923. ErrorLevel := ERROR_WRITE_MEMORY
  1924. return false
  1925. }
  1926. ErrorLevel := ERROR_OK
  1927. return true
  1928. }
  1929. getDialogIndex() {
  1930. dwPointer := getDialogStructPtr()
  1931. if (ErrorLevel || !dwPointer)
  1932. return 0
  1933. dwPointer := readDWORD(hGTA, dwPointer + SAMP_DIALOG_PTR1_OFFSET)
  1934. if (ErrorLevel) {
  1935. ErrorLevel := ERROR_READ_MEMORY
  1936. return 0
  1937. }
  1938. index := readMem(hGTA, dwPointer + SAMP_DIALOG_INDEX_OFFSET, 1, "Byte")
  1939. if (ErrorLevel) {
  1940. ErrorLevel := ERROR_READ_MEMORY
  1941. return 0
  1942. }
  1943. ErrorLevel := ERROR_OK
  1944. return index + 1
  1945. }
  1946. getDialogCaption() {
  1947. dwPointer := getDialogStructPtr()
  1948. if (ErrorLevel || !dwPointer)
  1949. return ""
  1950. text := readString(hGTA, dwPointer + SAMP_DIALOG_CAPTION_OFFSET, 64)
  1951. if (ErrorLevel) {
  1952. ErrorLevel := ERROR_READ_MEMORY
  1953. return ""
  1954. }
  1955. ErrorLevel := ERROR_OK
  1956. return text
  1957. }
  1958. getDialogTextSize(dwAddress) {
  1959. i := 0
  1960. Loop, 4096 {
  1961. i := A_Index - 1
  1962. byte := Memory_ReadByte(hGTA, dwAddress + i)
  1963. if (!byte)
  1964. break
  1965. }
  1966. return i
  1967. }
  1968. getDialogText() {
  1969. dwPointer := getDialogStructPtr()
  1970. if (ErrorLevel || !dwPointer)
  1971. return ""
  1972. dwPointer := readDWORD(hGTA, dwPointer + SAMP_DIALOG_TEXT_PTR_OFFSET)
  1973. if (ErrorLevel) {
  1974. ErrorLevel := ERROR_READ_MEMORY
  1975. return ""
  1976. }
  1977. text := readString(hGTA, dwPointer, 4096)
  1978. if (ErrorLevel) {
  1979. text := readString(hGTA, dwPointer, getDialogTextSize(dwPointer))
  1980. if (ErrorLevel) {
  1981. ErrorLevel := ERROR_READ_MEMORY
  1982. return ""
  1983. }
  1984. }
  1985. ErrorLevel := ERROR_OK
  1986. return text
  1987. }
  1988. getDialogLineCount() {
  1989. dwPointer := getDialogStructPtr()
  1990. if (ErrorLevel || !dwPointer)
  1991. return 0
  1992. dwPointer := readDWORD(hGTA, dwPointer + SAMP_DIALOG_PTR2_OFFSET)
  1993. if (ErrorLevel) {
  1994. ErrorLevel := ERROR_READ_MEMORY
  1995. return 0
  1996. }
  1997. count := readMem(hGTA, dwPointer + SAMP_DIALOG_LINECOUNT_OFFSET, 4, "UInt")
  1998. if (ErrorLevel) {
  1999. ErrorLevel := ERROR_READ_MEMORY
  2000. return 0
  2001. }
  2002. ErrorLevel := ERROR_OK
  2003. return count
  2004. }
  2005. getDialogLine__(index) {
  2006. if (getDialogLineCount > index)
  2007. return ""
  2008. dwPointer := getDialogStructPtr()
  2009. if (ErrorLevel || !dwPointer)
  2010. return ""
  2011. dwPointer := readDWORD(hGTA, dwPointer + SAMP_DIALOG_PTR1_OFFSET)
  2012. if (ErrorLevel) {
  2013. ErrorLevel := ERROR_READ_MEMORY
  2014. return ""
  2015. }
  2016. dwPointer := readDWORD(hGTA, dwPointer + SAMP_DIALOG_LINES_OFFSET)
  2017. if (ErrorLevel) {
  2018. ErrorLevel := ERROR_READ_MEMORY
  2019. return ""
  2020. }
  2021. dwLineAddress := readDWORD(hGTA, dwPointer + (index - 1) * 0x4)
  2022. line := readString(hGTA, dwLineAddress, 128)
  2023. ErrorLevel := ERROR_OK
  2024. return line
  2025. }
  2026. getDialogLine(index) {
  2027. lines := getDialogLines()
  2028. if (index > lines.Length())
  2029. return ""
  2030. if (getDialogStyle() == DIALOG_STYLE_TABLIST_HEADERS)
  2031. index++
  2032. return lines[index]
  2033. }
  2034. getDialogLines() {
  2035. text := getDialogText()
  2036. if (text == "")
  2037. return -1
  2038. lines := StrSplit(text, "`n")
  2039. return lines
  2040. }
  2041. isDialogButton1Selected() {
  2042. dwPointer := getDialogStructPtr()
  2043. if (ErrorLevel || !dwPointer)
  2044. return false
  2045. dwPointer := readDWORD(hGTA, dwPointer + SAMP_DIALOG_PTR1_OFFSET)
  2046. if (ErrorLevel) {
  2047. ErrorLevel := ERROR_READ_MEMORY
  2048. return false
  2049. }
  2050. selected := readMem(hGTA, dwPointer + SAMP_DIALOG_BUTTON_HOVERING_OFFSET, 1, "Byte")
  2051. if (ErrorLevel) {
  2052. ErrorLevel := ERROR_READ_MEMORY
  2053. return false
  2054. }
  2055. ErrorLevel := ERROR_OK
  2056. return selected
  2057. }
  2058. getDialogLines__() {
  2059. count := getDialogLineCount()
  2060. dwPointer := getDialogStructPtr()
  2061. if (ErrorLevel || !dwPointer)
  2062. return -1
  2063. dwPointer := readDWORD(hGTA, dwPointer + SAMP_DIALOG_PTR1_OFFSET)
  2064. if (ErrorLevel) {
  2065. ErrorLevel := ERROR_READ_MEMORY
  2066. return -1
  2067. }
  2068. dwPointer := readDWORD(hGTA, dwPointer + SAMP_DIALOG_LINES_OFFSET)
  2069. if (ErrorLevel) {
  2070. ErrorLevel := ERROR_READ_MEMORY
  2071. return -1
  2072. }
  2073. lines := []
  2074. Loop %count% {
  2075. dwLineAddress := readDWORD(hGTA, dwPointer + (A_Index - 1) * 0x4)
  2076. lines[A_Index] := readString(hGTA, dwLineAddress, 128)
  2077. }
  2078. ErrorLevel := ERROR_OK
  2079. return lines
  2080. }
  2081. showDialog(style, caption, text, button1, button2 := "", id := 1) {
  2082. style += 0
  2083. style := Floor(style)
  2084. id += 0
  2085. id := Floor(id)
  2086. caption := "" caption
  2087. text := "" text
  2088. button1 := "" button1
  2089. button2 := "" button2
  2090. if (id < 0 || id > 32767 || style < 0 || style > 5 || StrLen(caption) > 64 || StrLen(text) > 4096 || StrLen(button1) > 10 || StrLen(button2) > 10)
  2091. return false
  2092. if (!checkHandles())
  2093. return false
  2094. dwFunc := dwSAMP + FUNC_SAMP_SHOWDIALOG
  2095. dwAddress := readDWORD(hGTA, dwSAMP + SAMP_DIALOG_STRUCT_PTR)
  2096. if (ErrorLevel || !dwAddress) {
  2097. ErrorLevel := ERROR_READ_MEMORY
  2098. return false
  2099. }
  2100. writeString(hGTA, pParam5, caption)
  2101. if (ErrorLevel)
  2102. return false
  2103. writeString(hGTA, pParam1, text)
  2104. if (ErrorLevel)
  2105. return false
  2106. writeString(hGTA, pParam5 + 512, button1)
  2107. if (ErrorLevel)
  2108. return false
  2109. writeString(hGTA, pParam5+StrLen(caption) + 1, button2)
  2110. if (ErrorLevel)
  2111. return false
  2112. dwLen := 5 + 7 * 5 + 5 + 1
  2113. VarSetCapacity(injectData, dwLen, 0)
  2114. NumPut(0xB9, injectData, 0, "UChar")
  2115. NumPut(dwAddress, injectData, 1, "UInt")
  2116. NumPut(0x68, injectData, 5, "UChar")
  2117. NumPut(1, injectData, 6, "UInt")
  2118. NumPut(0x68, injectData, 10, "UChar")
  2119. NumPut(pParam5 + StrLen(caption) + 1, injectData, 11, "UInt")
  2120. NumPut(0x68, injectData, 15, "UChar")
  2121. NumPut(pParam5 + 512, injectData, 16, "UInt")
  2122. NumPut(0x68, injectData, 20, "UChar")
  2123. NumPut(pParam1, injectData, 21, "UInt")
  2124. NumPut(0x68, injectData, 25, "UChar")
  2125. NumPut(pParam5, injectData, 26, "UInt")
  2126. NumPut(0x68, injectData, 30, "UChar")
  2127. NumPut(style, injectData, 31, "UInt")
  2128. NumPut(0x68, injectData, 35, "UChar")
  2129. NumPut(id, injectData, 36, "UInt")
  2130. NumPut(0xE8, injectData, 40, "UChar")
  2131. offset := dwFunc - (pInjectFunc + 45)
  2132. NumPut(offset, injectData, 41, "Int")
  2133. NumPut(0xC3, injectData, 45, "UChar")
  2134. writeRaw(hGTA, pInjectFunc, &injectData, dwLen)
  2135. if (ErrorLevel)
  2136. return false
  2137. hThread := createRemoteThread(hGTA, 0, 0, pInjectFunc, 0, 0, 0)
  2138. if (ErrorLevel)
  2139. return false
  2140. waitForSingleObject(hThread, 0xFFFFFFFF)
  2141. closeProcess(hThread)
  2142. return true
  2143. }
  2144. initZonesAndCities() {
  2145. AddCity("Las Venturas", 685.0, 476.093, -500.0, 3000.0, 3000.0, 500.0)
  2146. AddCity("San Fierro", -3000.0, -742.306, -500.0, -1270.53, 1530.24, 500.0)
  2147. AddCity("San Fierro", -1270.53, -402.481, -500.0, -1038.45, 832.495, 500.0)
  2148. AddCity("San Fierro", -1038.45, -145.539, -500.0, -897.546, 376.632, 500.0)
  2149. AddCity("Los Santos", 480.0, -3000.0, -500.0, 3000.0, -850.0, 500.0)
  2150. AddCity("Los Santos", 80.0, -2101.61, -500.0, 1075.0, -1239.61, 500.0)
  2151. AddCity("Tierra Robada", -1213.91, 596.349, -242.99, -480.539, 1659.68, 900.0)
  2152. AddCity("Red County", -1213.91, -768.027, -242.99, 2997.06, 596.349, 900.0)
  2153. AddCity("Flint County", -1213.91, -2892.97, -242.99, 44.6147, -768.027, 900.0)
  2154. AddCity("Whetstone", -2997.47, -2892.97, -242.99, -1213.91, -1115.58, 900.0)
  2155. AddZone("Avispa Country Club", -2667.810, -302.135, -28.831, -2646.400, -262.320, 71.169)
  2156. AddZone("Easter Bay Airport", -1315.420, -405.388, 15.406, -1264.400, -209.543, 25.406)
  2157. AddZone("Avispa Country Club", -2550.040, -355.493, 0.000, -2470.040, -318.493, 39.700)
  2158. AddZone("Easter Bay Airport", -1490.330, -209.543, 15.406, -1264.400, -148.388, 25.406)
  2159. AddZone("Garcia", -2395.140, -222.589, -5.3, -2354.090, -204.792, 200.000)
  2160. AddZone("Shady Cabin", -1632.830, -2263.440, -3.0, -1601.330, -2231.790, 200.000)
  2161. AddZone("East Los Santos", 2381.680, -1494.030, -89.084, 2421.030, -1454.350, 110.916)
  2162. AddZone("LVA Freight Depot", 1236.630, 1163.410, -89.084, 1277.050, 1203.280, 110.916)
  2163. AddZone("Blackfield Intersection", 1277.050, 1044.690, -89.084, 1315.350, 1087.630, 110.916)
  2164. AddZone("Avispa Country Club", -2470.040, -355.493, 0.000, -2270.040, -318.493, 46.100)
  2165. AddZone("Temple", 1252.330, -926.999, -89.084, 1357.000, -910.170, 110.916)
  2166. AddZone("Unity Station", 1692.620, -1971.800, -20.492, 1812.620, -1932.800, 79.508)
  2167. AddZone("LVA Freight Depot", 1315.350, 1044.690, -89.084, 1375.600, 1087.630, 110.916)
  2168. AddZone("Los Flores", 2581.730, -1454.350, -89.084, 2632.830, -1393.420, 110.916)
  2169. AddZone("Starfish Casino", 2437.390, 1858.100, -39.084, 2495.090, 1970.850, 60.916)
  2170. AddZone("Easter Bay Chemicals", -1132.820, -787.391, 0.000, -956.476, -768.027, 200.000)
  2171. AddZone("Downtown Los Santos", 1370.850, -1170.870, -89.084, 1463.900, -1130.850, 110.916)
  2172. AddZone("Esplanade East", -1620.300, 1176.520, -4.5, -1580.010, 1274.260, 200.000)
  2173. AddZone("Market Station", 787.461, -1410.930, -34.126, 866.009, -1310.210, 65.874)
  2174. AddZone("Linden Station", 2811.250, 1229.590, -39.594, 2861.250, 1407.590, 60.406)
  2175. AddZone("Montgomery Intersection", 1582.440, 347.457, 0.000, 1664.620, 401.750, 200.000)
  2176. AddZone("Frederick Bridge", 2759.250, 296.501, 0.000, 2774.250, 594.757, 200.000)
  2177. AddZone("Yellow Bell Station", 1377.480, 2600.430, -21.926, 1492.450, 2687.360, 78.074)
  2178. AddZone("Downtown Los Santos", 1507.510, -1385.210, 110.916, 1582.550, -1325.310, 335.916)
  2179. AddZone("Jefferson", 2185.330, -1210.740, -89.084, 2281.450, -1154.590, 110.916)
  2180. AddZone("Mulholland", 1318.130, -910.170, -89.084, 1357.000, -768.027, 110.916)
  2181. AddZone("Avispa Country Club", -2361.510, -417.199, 0.000, -2270.040, -355.493, 200.000)
  2182. AddZone("Jefferson", 1996.910, -1449.670, -89.084, 2056.860, -1350.720, 110.916)
  2183. AddZone("Julius Thruway West", 1236.630, 2142.860, -89.084, 1297.470, 2243.230, 110.916)
  2184. AddZone("Jefferson", 2124.660, -1494.030, -89.084, 2266.210, -1449.670, 110.916)
  2185. AddZone("Julius Thruway North", 1848.400, 2478.490, -89.084, 1938.800, 2553.490, 110.916)
  2186. AddZone("Rodeo", 422.680, -1570.200, -89.084, 466.223, -1406.050, 110.916)
  2187. AddZone("Cranberry Station", -2007.830, 56.306, 0.000, -1922.000, 224.782, 100.000)
  2188. AddZone("Downtown Los Santos", 1391.050, -1026.330, -89.084, 1463.900, -926.999, 110.916)
  2189. AddZone("Redsands West", 1704.590, 2243.230, -89.084, 1777.390, 2342.830, 110.916)
  2190. AddZone("Little Mexico", 1758.900, -1722.260, -89.084, 1812.620, -1577.590, 110.916)
  2191. AddZone("Blackfield Intersection", 1375.600, 823.228, -89.084, 1457.390, 919.447, 110.916)
  2192. AddZone("Los Santos International", 1974.630, -2394.330, -39.084, 2089.000, -2256.590, 60.916)
  2193. AddZone("Beacon Hill", -399.633, -1075.520, -1.489, -319.033, -977.516, 198.511)
  2194. AddZone("Rodeo", 334.503, -1501.950, -89.084, 422.680, -1406.050, 110.916)
  2195. AddZone("Richman", 225.165, -1369.620, -89.084, 334.503, -1292.070, 110.916)
  2196. AddZone("Downtown Los Santos", 1724.760, -1250.900, -89.084, 1812.620, -1150.870, 110.916)
  2197. AddZone("The Strip", 2027.400, 1703.230, -89.084, 2137.400, 1783.230, 110.916)
  2198. AddZone("Downtown Los Santos", 1378.330, -1130.850, -89.084, 1463.900, -1026.330, 110.916)
  2199. AddZone("Blackfield Intersection", 1197.390, 1044.690, -89.084, 1277.050, 1163.390, 110.916)
  2200. AddZone("Conference Center", 1073.220, -1842.270, -89.084, 1323.900, -1804.210, 110.916)
  2201. AddZone("Montgomery", 1451.400, 347.457, -6.1, 1582.440, 420.802, 200.000)
  2202. AddZone("Foster Valley", -2270.040, -430.276, -1.2, -2178.690, -324.114, 200.000)
  2203. AddZone("Blackfield Chapel", 1325.600, 596.349, -89.084, 1375.600, 795.010, 110.916)
  2204. AddZone("Los Santos International", 2051.630, -2597.260, -39.084, 2152.450, -2394.330, 60.916)
  2205. AddZone("Mulholland", 1096.470, -910.170, -89.084, 1169.130, -768.027, 110.916)
  2206. AddZone("Yellow Bell Gol Course", 1457.460, 2723.230, -89.084, 1534.560, 2863.230, 110.916)
  2207. AddZone("The Strip", 2027.400, 1783.230, -89.084, 2162.390, 1863.230, 110.916)
  2208. AddZone("Jefferson", 2056.860, -1210.740, -89.084, 2185.330, -1126.320, 110.916)
  2209. AddZone("Mulholland", 952.604, -937.184, -89.084, 1096.470, -860.619, 110.916)
  2210. AddZone("Aldea Malvada", -1372.140, 2498.520, 0.000, -1277.590, 2615.350, 200.000)
  2211. AddZone("Las Colinas", 2126.860, -1126.320, -89.084, 2185.330, -934.489, 110.916)
  2212. AddZone("Las Colinas", 1994.330, -1100.820, -89.084, 2056.860, -920.815, 110.916)
  2213. AddZone("Richman", 647.557, -954.662, -89.084, 768.694, -860.619, 110.916)
  2214. AddZone("LVA Freight Depot", 1277.050, 1087.630, -89.084, 1375.600, 1203.280, 110.916)
  2215. AddZone("Julius Thruway North", 1377.390, 2433.230, -89.084, 1534.560, 2507.230, 110.916)
  2216. AddZone("Willowfield", 2201.820, -2095.000, -89.084, 2324.000, -1989.900, 110.916)
  2217. AddZone("Julius Thruway North", 1704.590, 2342.830, -89.084, 1848.400, 2433.230, 110.916)
  2218. AddZone("Temple", 1252.330, -1130.850, -89.084, 1378.330, -1026.330, 110.916)
  2219. AddZone("Little Mexico", 1701.900, -1842.270, -89.084, 1812.620, -1722.260, 110.916)
  2220. AddZone("Queens", -2411.220, 373.539, 0.000, -2253.540, 458.411, 200.000)
  2221. AddZone("Las Venturas Airport", 1515.810, 1586.400, -12.500, 1729.950, 1714.560, 87.500)
  2222. AddZone("Richman", 225.165, -1292.070, -89.084, 466.223, -1235.070, 110.916)
  2223. AddZone("Temple", 1252.330, -1026.330, -89.084, 1391.050, -926.999, 110.916)
  2224. AddZone("East Los Santos", 2266.260, -1494.030, -89.084, 2381.680, -1372.040, 110.916)
  2225. AddZone("Julius Thruway East", 2623.180, 943.235, -89.084, 2749.900, 1055.960, 110.916)
  2226. AddZone("Willowfield", 2541.700, -1941.400, -89.084, 2703.580, -1852.870, 110.916)
  2227. AddZone("Las Colinas", 2056.860, -1126.320, -89.084, 2126.860, -920.815, 110.916)
  2228. AddZone("Julius Thruway East", 2625.160, 2202.760, -89.084, 2685.160, 2442.550, 110.916)
  2229. AddZone("Rodeo", 225.165, -1501.950, -89.084, 334.503, -1369.620, 110.916)
  2230. AddZone("Las Brujas", -365.167, 2123.010, -3.0, -208.570, 2217.680, 200.000)
  2231. AddZone("Julius Thruway East", 2536.430, 2442.550, -89.084, 2685.160, 2542.550, 110.916)
  2232. AddZone("Rodeo", 334.503, -1406.050, -89.084, 466.223, -1292.070, 110.916)
  2233. AddZone("Vinewood", 647.557, -1227.280, -89.084, 787.461, -1118.280, 110.916)
  2234. AddZone("Rodeo", 422.680, -1684.650, -89.084, 558.099, -1570.200, 110.916)
  2235. AddZone("Julius Thruway North", 2498.210, 2542.550, -89.084, 2685.160, 2626.550, 110.916)
  2236. AddZone("Downtown Los Santos", 1724.760, -1430.870, -89.084, 1812.620, -1250.900, 110.916)
  2237. AddZone("Rodeo", 225.165, -1684.650, -89.084, 312.803, -1501.950, 110.916)
  2238. AddZone("Jefferson", 2056.860, -1449.670, -89.084, 2266.210, -1372.040, 110.916)
  2239. AddZone("Hampton Barns", 603.035, 264.312, 0.000, 761.994, 366.572, 200.000)
  2240. AddZone("Temple", 1096.470, -1130.840, -89.084, 1252.330, -1026.330, 110.916)
  2241. AddZone("Kincaid Bridge", -1087.930, 855.370, -89.084, -961.950, 986.281, 110.916)
  2242. AddZone("Verona Beach", 1046.150, -1722.260, -89.084, 1161.520, -1577.590, 110.916)
  2243. AddZone("Commerce", 1323.900, -1722.260, -89.084, 1440.900, -1577.590, 110.916)
  2244. AddZone("Mulholland", 1357.000, -926.999, -89.084, 1463.900, -768.027, 110.916)
  2245. AddZone("Rodeo", 466.223, -1570.200, -89.084, 558.099, -1385.070, 110.916)
  2246. AddZone("Mulholland", 911.802, -860.619, -89.084, 1096.470, -768.027, 110.916)
  2247. AddZone("Mulholland", 768.694, -954.662, -89.084, 952.604, -860.619, 110.916)
  2248. AddZone("Julius Thruway South", 2377.390, 788.894, -89.084, 2537.390, 897.901, 110.916)
  2249. AddZone("Idlewood", 1812.620, -1852.870, -89.084, 1971.660, -1742.310, 110.916)
  2250. AddZone("Ocean Docks", 2089.000, -2394.330, -89.084, 2201.820, -2235.840, 110.916)
  2251. AddZone("Commerce", 1370.850, -1577.590, -89.084, 1463.900, -1384.950, 110.916)
  2252. AddZone("Julius Thruway North", 2121.400, 2508.230, -89.084, 2237.400, 2663.170, 110.916)
  2253. AddZone("Temple", 1096.470, -1026.330, -89.084, 1252.330, -910.170, 110.916)
  2254. AddZone("Glen Park", 1812.620, -1449.670, -89.084, 1996.910, -1350.720, 110.916)
  2255. AddZone("Easter Bay Airport", -1242.980, -50.096, 0.000, -1213.910, 578.396, 200.000)
  2256. AddZone("Martin Bridge", -222.179, 293.324, 0.000, -122.126, 476.465, 200.000)
  2257. AddZone("The Strip", 2106.700, 1863.230, -89.084, 2162.390, 2202.760, 110.916)
  2258. AddZone("Willowfield", 2541.700, -2059.230, -89.084, 2703.580, -1941.400, 110.916)
  2259. AddZone("Marina", 807.922, -1577.590, -89.084, 926.922, -1416.250, 110.916)
  2260. AddZone("Las Venturas Airport", 1457.370, 1143.210, -89.084, 1777.400, 1203.280, 110.916)
  2261. AddZone("Idlewood", 1812.620, -1742.310, -89.084, 1951.660, -1602.310, 110.916)
  2262. AddZone("Esplanade East", -1580.010, 1025.980, -6.1, -1499.890, 1274.260, 200.000)
  2263. AddZone("Downtown Los Santos", 1370.850, -1384.950, -89.084, 1463.900, -1170.870, 110.916)
  2264. AddZone("The Mako Span", 1664.620, 401.750, 0.000, 1785.140, 567.203, 200.000)
  2265. AddZone("Rodeo", 312.803, -1684.650, -89.084, 422.680, -1501.950, 110.916)
  2266. AddZone("Pershing Square", 1440.900, -1722.260, -89.084, 1583.500, -1577.590, 110.916)
  2267. AddZone("Mulholland", 687.802, -860.619, -89.084, 911.802, -768.027, 110.916)
  2268. AddZone("Gant Bridge", -2741.070, 1490.470, -6.1, -2616.400, 1659.680, 200.000)
  2269. AddZone("Las Colinas", 2185.330, -1154.590, -89.084, 2281.450, -934.489, 110.916)
  2270. AddZone("Mulholland", 1169.130, -910.170, -89.084, 1318.130, -768.027, 110.916)
  2271. AddZone("Julius Thruway North", 1938.800, 2508.230, -89.084, 2121.400, 2624.230, 110.916)
  2272. AddZone("Commerce", 1667.960, -1577.590, -89.084, 1812.620, -1430.870, 110.916)
  2273. AddZone("Rodeo", 72.648, -1544.170, -89.084, 225.165, -1404.970, 110.916)
  2274. AddZone("Roca Escalante", 2536.430, 2202.760, -89.084, 2625.160, 2442.550, 110.916)
  2275. AddZone("Rodeo", 72.648, -1684.650, -89.084, 225.165, -1544.170, 110.916)
  2276. AddZone("Market", 952.663, -1310.210, -89.084, 1072.660, -1130.850, 110.916)
  2277. AddZone("Las Colinas", 2632.740, -1135.040, -89.084, 2747.740, -945.035, 110.916)
  2278. AddZone("Mulholland", 861.085, -674.885, -89.084, 1156.550, -600.896, 110.916)
  2279. AddZone("King's", -2253.540, 373.539, -9.1, -1993.280, 458.411, 200.000)
  2280. AddZone("Redsands East", 1848.400, 2342.830, -89.084, 2011.940, 2478.490, 110.916)
  2281. AddZone("Downtown", -1580.010, 744.267, -6.1, -1499.890, 1025.980, 200.000)
  2282. AddZone("Conference Center", 1046.150, -1804.210, -89.084, 1323.900, -1722.260, 110.916)
  2283. AddZone("Richman", 647.557, -1118.280, -89.084, 787.461, -954.662, 110.916)
  2284. AddZone("Ocean Flats", -2994.490, 277.411, -9.1, -2867.850, 458.411, 200.000)
  2285. AddZone("Greenglass College", 964.391, 930.890, -89.084, 1166.530, 1044.690, 110.916)
  2286. AddZone("Glen Park", 1812.620, -1100.820, -89.084, 1994.330, -973.380, 110.916)
  2287. AddZone("LVA Freight Depot", 1375.600, 919.447, -89.084, 1457.370, 1203.280, 110.916)
  2288. AddZone("Regular Tom", -405.770, 1712.860, -3.0, -276.719, 1892.750, 200.000)
  2289. AddZone("Verona Beach", 1161.520, -1722.260, -89.084, 1323.900, -1577.590, 110.916)
  2290. AddZone("East Los Santos", 2281.450, -1372.040, -89.084, 2381.680, -1135.040, 110.916)
  2291. AddZone("Caligula's Palace", 2137.400, 1703.230, -89.084, 2437.390, 1783.230, 110.916)
  2292. AddZone("Idlewood", 1951.660, -1742.310, -89.084, 2124.660, -1602.310, 110.916)
  2293. AddZone("Pilgrim", 2624.400, 1383.230, -89.084, 2685.160, 1783.230, 110.916)
  2294. AddZone("Idlewood", 2124.660, -1742.310, -89.084, 2222.560, -1494.030, 110.916)
  2295. AddZone("Queens", -2533.040, 458.411, 0.000, -2329.310, 578.396, 200.000)
  2296. AddZone("Downtown", -1871.720, 1176.420, -4.5, -1620.300, 1274.260, 200.000)
  2297. AddZone("Commerce", 1583.500, -1722.260, -89.084, 1758.900, -1577.590, 110.916)
  2298. AddZone("East Los Santos", 2381.680, -1454.350, -89.084, 2462.130, -1135.040, 110.916)
  2299. AddZone("Marina", 647.712, -1577.590, -89.084, 807.922, -1416.250, 110.916)
  2300. AddZone("Richman", 72.648, -1404.970, -89.084, 225.165, -1235.070, 110.916)
  2301. AddZone("Vinewood", 647.712, -1416.250, -89.084, 787.461, -1227.280, 110.916)
  2302. AddZone("East Los Santos", 2222.560, -1628.530, -89.084, 2421.030, -1494.030, 110.916)
  2303. AddZone("Rodeo", 558.099, -1684.650, -89.084, 647.522, -1384.930, 110.916)
  2304. AddZone("Easter Tunnel", -1709.710, -833.034, -1.5, -1446.010, -730.118, 200.000)
  2305. AddZone("Rodeo", 466.223, -1385.070, -89.084, 647.522, -1235.070, 110.916)
  2306. AddZone("Redsands East", 1817.390, 2202.760, -89.084, 2011.940, 2342.830, 110.916)
  2307. AddZone("The Clown's Pocket", 2162.390, 1783.230, -89.084, 2437.390, 1883.230, 110.916)
  2308. AddZone("Idlewood", 1971.660, -1852.870, -89.084, 2222.560, -1742.310, 110.916)
  2309. AddZone("Montgomery Intersection", 1546.650, 208.164, 0.000, 1745.830, 347.457, 200.000)
  2310. AddZone("Willowfield", 2089.000, -2235.840, -89.084, 2201.820, -1989.900, 110.916)
  2311. AddZone("Temple", 952.663, -1130.840, -89.084, 1096.470, -937.184, 110.916)
  2312. AddZone("Prickle Pine", 1848.400, 2553.490, -89.084, 1938.800, 2863.230, 110.916)
  2313. AddZone("Los Santos International", 1400.970, -2669.260, -39.084, 2189.820, -2597.260, 60.916)
  2314. AddZone("Garver Bridge", -1213.910, 950.022, -89.084, -1087.930, 1178.930, 110.916)
  2315. AddZone("Garver Bridge", -1339.890, 828.129, -89.084, -1213.910, 1057.040, 110.916)
  2316. AddZone("Kincaid Bridge", -1339.890, 599.218, -89.084, -1213.910, 828.129, 110.916)
  2317. AddZone("Kincaid Bridge", -1213.910, 721.111, -89.084, -1087.930, 950.022, 110.916)
  2318. AddZone("Verona Beach", 930.221, -2006.780, -89.084, 1073.220, -1804.210, 110.916)
  2319. AddZone("Verdant Bluffs", 1073.220, -2006.780, -89.084, 1249.620, -1842.270, 110.916)
  2320. AddZone("Vinewood", 787.461, -1130.840, -89.084, 952.604, -954.662, 110.916)
  2321. AddZone("Vinewood", 787.461, -1310.210, -89.084, 952.663, -1130.840, 110.916)
  2322. AddZone("Commerce", 1463.900, -1577.590, -89.084, 1667.960, -1430.870, 110.916)
  2323. AddZone("Market", 787.461, -1416.250, -89.084, 1072.660, -1310.210, 110.916)
  2324. AddZone("Rockshore West", 2377.390, 596.349, -89.084, 2537.390, 788.894, 110.916)
  2325. AddZone("Julius Thruway North", 2237.400, 2542.550, -89.084, 2498.210, 2663.170, 110.916)
  2326. AddZone("East Beach", 2632.830, -1668.130, -89.084, 2747.740, -1393.420, 110.916)
  2327. AddZone("Fallow Bridge", 434.341, 366.572, 0.000, 603.035, 555.680, 200.000)
  2328. AddZone("Willowfield", 2089.000, -1989.900, -89.084, 2324.000, -1852.870, 110.916)
  2329. AddZone("Chinatown", -2274.170, 578.396, -7.6, -2078.670, 744.170, 200.000)
  2330. AddZone("El Castillo del Diablo", -208.570, 2337.180, 0.000, 8.430, 2487.180, 200.000)
  2331. AddZone("Ocean Docks", 2324.000, -2145.100, -89.084, 2703.580, -2059.230, 110.916)
  2332. AddZone("Easter Bay Chemicals", -1132.820, -768.027, 0.000, -956.476, -578.118, 200.000)
  2333. AddZone("The Visage", 1817.390, 1703.230, -89.084, 2027.400, 1863.230, 110.916)
  2334. AddZone("Ocean Flats", -2994.490, -430.276, -1.2, -2831.890, -222.589, 200.000)
  2335. AddZone("Richman", 321.356, -860.619, -89.084, 687.802, -768.027, 110.916)
  2336. AddZone("Green Palms", 176.581, 1305.450, -3.0, 338.658, 1520.720, 200.000)
  2337. AddZone("Richman", 321.356, -768.027, -89.084, 700.794, -674.885, 110.916)
  2338. AddZone("Starfish Casino", 2162.390, 1883.230, -89.084, 2437.390, 2012.180, 110.916)
  2339. AddZone("East Beach", 2747.740, -1668.130, -89.084, 2959.350, -1498.620, 110.916)
  2340. AddZone("Jefferson", 2056.860, -1372.040, -89.084, 2281.450, -1210.740, 110.916)
  2341. AddZone("Downtown Los Santos", 1463.900, -1290.870, -89.084, 1724.760, -1150.870, 110.916)
  2342. AddZone("Downtown Los Santos", 1463.900, -1430.870, -89.084, 1724.760, -1290.870, 110.916)
  2343. AddZone("Garver Bridge", -1499.890, 696.442, -179.615, -1339.890, 925.353, 20.385)
  2344. AddZone("Julius Thruway South", 1457.390, 823.228, -89.084, 2377.390, 863.229, 110.916)
  2345. AddZone("East Los Santos", 2421.030, -1628.530, -89.084, 2632.830, -1454.350, 110.916)
  2346. AddZone("Greenglass College", 964.391, 1044.690, -89.084, 1197.390, 1203.220, 110.916)
  2347. AddZone("Las Colinas", 2747.740, -1120.040, -89.084, 2959.350, -945.035, 110.916)
  2348. AddZone("Mulholland", 737.573, -768.027, -89.084, 1142.290, -674.885, 110.916)
  2349. AddZone("Ocean Docks", 2201.820, -2730.880, -89.084, 2324.000, -2418.330, 110.916)
  2350. AddZone("East Los Santos", 2462.130, -1454.350, -89.084, 2581.730, -1135.040, 110.916)
  2351. AddZone("Ganton", 2222.560, -1722.330, -89.084, 2632.830, -1628.530, 110.916)
  2352. AddZone("Avispa Country Club", -2831.890, -430.276, -6.1, -2646.400, -222.589, 200.000)
  2353. AddZone("Willowfield", 1970.620, -2179.250, -89.084, 2089.000, -1852.870, 110.916)
  2354. AddZone("Esplanade North", -1982.320, 1274.260, -4.5, -1524.240, 1358.900, 200.000)
  2355. AddZone("The High Roller", 1817.390, 1283.230, -89.084, 2027.390, 1469.230, 110.916)
  2356. AddZone("Ocean Docks", 2201.820, -2418.330, -89.084, 2324.000, -2095.000, 110.916)
  2357. AddZone("Last Dime Motel", 1823.080, 596.349, -89.084, 1997.220, 823.228, 110.916)
  2358. AddZone("Bayside Marina", -2353.170, 2275.790, 0.000, -2153.170, 2475.790, 200.000)
  2359. AddZone("King's", -2329.310, 458.411, -7.6, -1993.280, 578.396, 200.000)
  2360. AddZone("El Corona", 1692.620, -2179.250, -89.084, 1812.620, -1842.270, 110.916)
  2361. AddZone("Blackfield Chapel", 1375.600, 596.349, -89.084, 1558.090, 823.228, 110.916)
  2362. AddZone("The Pink Swan", 1817.390, 1083.230, -89.084, 2027.390, 1283.230, 110.916)
  2363. AddZone("Julius Thruway West", 1197.390, 1163.390, -89.084, 1236.630, 2243.230, 110.916)
  2364. AddZone("Los Flores", 2581.730, -1393.420, -89.084, 2747.740, -1135.040, 110.916)
  2365. AddZone("The Visage", 1817.390, 1863.230, -89.084, 2106.700, 2011.830, 110.916)
  2366. AddZone("Prickle Pine", 1938.800, 2624.230, -89.084, 2121.400, 2861.550, 110.916)
  2367. AddZone("Verona Beach", 851.449, -1804.210, -89.084, 1046.150, -1577.590, 110.916)
  2368. AddZone("Robada Intersection", -1119.010, 1178.930, -89.084, -862.025, 1351.450, 110.916)
  2369. AddZone("Linden Side", 2749.900, 943.235, -89.084, 2923.390, 1198.990, 110.916)
  2370. AddZone("Ocean Docks", 2703.580, -2302.330, -89.084, 2959.350, -2126.900, 110.916)
  2371. AddZone("Willowfield", 2324.000, -2059.230, -89.084, 2541.700, -1852.870, 110.916)
  2372. AddZone("King's", -2411.220, 265.243, -9.1, -1993.280, 373.539, 200.000)
  2373. AddZone("Commerce", 1323.900, -1842.270, -89.084, 1701.900, -1722.260, 110.916)
  2374. AddZone("Mulholland", 1269.130, -768.027, -89.084, 1414.070, -452.425, 110.916)
  2375. AddZone("Marina", 647.712, -1804.210, -89.084, 851.449, -1577.590, 110.916)
  2376. AddZone("Battery Point", -2741.070, 1268.410, -4.5, -2533.040, 1490.470, 200.000)
  2377. AddZone("The Four Dragons Casino", 1817.390, 863.232, -89.084, 2027.390, 1083.230, 110.916)
  2378. AddZone("Blackfield", 964.391, 1203.220, -89.084, 1197.390, 1403.220, 110.916)
  2379. AddZone("Julius Thruway North", 1534.560, 2433.230, -89.084, 1848.400, 2583.230, 110.916)
  2380. AddZone("Yellow Bell Gol Course", 1117.400, 2723.230, -89.084, 1457.460, 2863.230, 110.916)
  2381. AddZone("Idlewood", 1812.620, -1602.310, -89.084, 2124.660, -1449.670, 110.916)
  2382. AddZone("Redsands West", 1297.470, 2142.860, -89.084, 1777.390, 2243.230, 110.916)
  2383. AddZone("Doherty", -2270.040, -324.114, -1.2, -1794.920, -222.589, 200.000)
  2384. AddZone("Hilltop Farm", 967.383, -450.390, -3.0, 1176.780, -217.900, 200.000)
  2385. AddZone("Las Barrancas", -926.130, 1398.730, -3.0, -719.234, 1634.690, 200.000)
  2386. AddZone("Pirates in Men's Pants", 1817.390, 1469.230, -89.084, 2027.400, 1703.230, 110.916)
  2387. AddZone("City Hall", -2867.850, 277.411, -9.1, -2593.440, 458.411, 200.000)
  2388. AddZone("Avispa Country Club", -2646.400, -355.493, 0.000, -2270.040, -222.589, 200.000)
  2389. AddZone("The Strip", 2027.400, 863.229, -89.084, 2087.390, 1703.230, 110.916)
  2390. AddZone("Hashbury", -2593.440, -222.589, -1.0, -2411.220, 54.722, 200.000)
  2391. AddZone("Los Santos International", 1852.000, -2394.330, -89.084, 2089.000, -2179.250, 110.916)
  2392. AddZone("Whitewood Estates", 1098.310, 1726.220, -89.084, 1197.390, 2243.230, 110.916)
  2393. AddZone("Sherman Reservoir", -789.737, 1659.680, -89.084, -599.505, 1929.410, 110.916)
  2394. AddZone("El Corona", 1812.620, -2179.250, -89.084, 1970.620, -1852.870, 110.916)
  2395. AddZone("Downtown", -1700.010, 744.267, -6.1, -1580.010, 1176.520, 200.000)
  2396. AddZone("Foster Valley", -2178.690, -1250.970, 0.000, -1794.920, -1115.580, 200.000)
  2397. AddZone("Las Payasadas", -354.332, 2580.360, 2.0, -133.625, 2816.820, 200.000)
  2398. AddZone("Valle Ocultado", -936.668, 2611.440, 2.0, -715.961, 2847.900, 200.000)
  2399. AddZone("Blackfield Intersection", 1166.530, 795.010, -89.084, 1375.600, 1044.690, 110.916)
  2400. AddZone("Ganton", 2222.560, -1852.870, -89.084, 2632.830, -1722.330, 110.916)
  2401. AddZone("Easter Bay Airport", -1213.910, -730.118, 0.000, -1132.820, -50.096, 200.000)
  2402. AddZone("Redsands East", 1817.390, 2011.830, -89.084, 2106.700, 2202.760, 110.916)
  2403. AddZone("Esplanade East", -1499.890, 578.396, -79.615, -1339.890, 1274.260, 20.385)
  2404. AddZone("Caligula's Palace", 2087.390, 1543.230, -89.084, 2437.390, 1703.230, 110.916)
  2405. AddZone("Royal Casino", 2087.390, 1383.230, -89.084, 2437.390, 1543.230, 110.916)
  2406. AddZone("Richman", 72.648, -1235.070, -89.084, 321.356, -1008.150, 110.916)
  2407. AddZone("Starfish Casino", 2437.390, 1783.230, -89.084, 2685.160, 2012.180, 110.916)
  2408. AddZone("Mulholland", 1281.130, -452.425, -89.084, 1641.130, -290.913, 110.916)
  2409. AddZone("Downtown", -1982.320, 744.170, -6.1, -1871.720, 1274.260, 200.000)
  2410. AddZone("Hankypanky Point", 2576.920, 62.158, 0.000, 2759.250, 385.503, 200.000)
  2411. AddZone("K.A.C.C. Military Fuels", 2498.210, 2626.550, -89.084, 2749.900, 2861.550, 110.916)
  2412. AddZone("Harry Gold Parkway", 1777.390, 863.232, -89.084, 1817.390, 2342.830, 110.916)
  2413. AddZone("Bayside Tunnel", -2290.190, 2548.290, -89.084, -1950.190, 2723.290, 110.916)
  2414. AddZone("Ocean Docks", 2324.000, -2302.330, -89.084, 2703.580, -2145.100, 110.916)
  2415. AddZone("Richman", 321.356, -1044.070, -89.084, 647.557, -860.619, 110.916)
  2416. AddZone("Randolph Industrial Estate", 1558.090, 596.349, -89.084, 1823.080, 823.235, 110.916)
  2417. AddZone("East Beach", 2632.830, -1852.870, -89.084, 2959.350, -1668.130, 110.916)
  2418. AddZone("Flint Water", -314.426, -753.874, -89.084, -106.339, -463.073, 110.916)
  2419. AddZone("Blueberry", 19.607, -404.136, 3.8, 349.607, -220.137, 200.000)
  2420. AddZone("Linden Station", 2749.900, 1198.990, -89.084, 2923.390, 1548.990, 110.916)
  2421. AddZone("Glen Park", 1812.620, -1350.720, -89.084, 2056.860, -1100.820, 110.916)
  2422. AddZone("Downtown", -1993.280, 265.243, -9.1, -1794.920, 578.396, 200.000)
  2423. AddZone("Redsands West", 1377.390, 2243.230, -89.084, 1704.590, 2433.230, 110.916)
  2424. AddZone("Richman", 321.356, -1235.070, -89.084, 647.522, -1044.070, 110.916)
  2425. AddZone("Gant Bridge", -2741.450, 1659.680, -6.1, -2616.400, 2175.150, 200.000)
  2426. AddZone("Lil' Probe Inn", -90.218, 1286.850, -3.0, 153.859, 1554.120, 200.000)
  2427. AddZone("Flint Intersection", -187.700, -1596.760, -89.084, 17.063, -1276.600, 110.916)
  2428. AddZone("Las Colinas", 2281.450, -1135.040, -89.084, 2632.740, -945.035, 110.916)
  2429. AddZone("Sobell Rail Yards", 2749.900, 1548.990, -89.084, 2923.390, 1937.250, 110.916)
  2430. AddZone("The Emerald Isle", 2011.940, 2202.760, -89.084, 2237.400, 2508.230, 110.916)
  2431. AddZone("El Castillo del Diablo", -208.570, 2123.010, -7.6, 114.033, 2337.180, 200.000)
  2432. AddZone("Santa Flora", -2741.070, 458.411, -7.6, -2533.040, 793.411, 200.000)
  2433. AddZone("Playa del Seville", 2703.580, -2126.900, -89.084, 2959.350, -1852.870, 110.916)
  2434. AddZone("Market", 926.922, -1577.590, -89.084, 1370.850, -1416.250, 110.916)
  2435. AddZone("Queens", -2593.440, 54.722, 0.000, -2411.220, 458.411, 200.000)
  2436. AddZone("Pilson Intersection", 1098.390, 2243.230, -89.084, 1377.390, 2507.230, 110.916)
  2437. AddZone("Spinybed", 2121.400, 2663.170, -89.084, 2498.210, 2861.550, 110.916)
  2438. AddZone("Pilgrim", 2437.390, 1383.230, -89.084, 2624.400, 1783.230, 110.916)
  2439. AddZone("Blackfield", 964.391, 1403.220, -89.084, 1197.390, 1726.220, 110.916)
  2440. AddZone("'The Big Ear'", -410.020, 1403.340, -3.0, -137.969, 1681.230, 200.000)
  2441. AddZone("Dillimore", 580.794, -674.885, -9.5, 861.085, -404.790, 200.000)
  2442. AddZone("El Quebrados", -1645.230, 2498.520, 0.000, -1372.140, 2777.850, 200.000)
  2443. AddZone("Esplanade North", -2533.040, 1358.900, -4.5, -1996.660, 1501.210, 200.000)
  2444. AddZone("Easter Bay Airport", -1499.890, -50.096, -1.0, -1242.980, 249.904, 200.000)
  2445. AddZone("Fisher's Lagoon", 1916.990, -233.323, -100.000, 2131.720, 13.800, 200.000)
  2446. AddZone("Mulholland", 1414.070, -768.027, -89.084, 1667.610, -452.425, 110.916)
  2447. AddZone("East Beach", 2747.740, -1498.620, -89.084, 2959.350, -1120.040, 110.916)
  2448. AddZone("San Andreas Sound", 2450.390, 385.503, -100.000, 2759.250, 562.349, 200.000)
  2449. AddZone("Shady Creeks", -2030.120, -2174.890, -6.1, -1820.640, -1771.660, 200.000)
  2450. AddZone("Market", 1072.660, -1416.250, -89.084, 1370.850, -1130.850, 110.916)
  2451. AddZone("Rockshore West", 1997.220, 596.349, -89.084, 2377.390, 823.228, 110.916)
  2452. AddZone("Prickle Pine", 1534.560, 2583.230, -89.084, 1848.400, 2863.230, 110.916)
  2453. AddZone("Easter Basin", -1794.920, -50.096, -1.04, -1499.890, 249.904, 200.000)
  2454. AddZone("Leafy Hollow", -1166.970, -1856.030, 0.000, -815.624, -1602.070, 200.000)
  2455. AddZone("LVA Freight Depot", 1457.390, 863.229, -89.084, 1777.400, 1143.210, 110.916)
  2456. AddZone("Prickle Pine", 1117.400, 2507.230, -89.084, 1534.560, 2723.230, 110.916)
  2457. AddZone("Blueberry", 104.534, -220.137, 2.3, 349.607, 152.236, 200.000)
  2458. AddZone("El Castillo del Diablo", -464.515, 2217.680, 0.000, -208.570, 2580.360, 200.000)
  2459. AddZone("Downtown", -2078.670, 578.396, -7.6, -1499.890, 744.267, 200.000)
  2460. AddZone("Rockshore East", 2537.390, 676.549, -89.084, 2902.350, 943.235, 110.916)
  2461. AddZone("San Fierro Bay", -2616.400, 1501.210, -3.0, -1996.660, 1659.680, 200.000)
  2462. AddZone("Paradiso", -2741.070, 793.411, -6.1, -2533.040, 1268.410, 200.000)
  2463. AddZone("The Camel's Toe", 2087.390, 1203.230, -89.084, 2640.400, 1383.230, 110.916)
  2464. AddZone("Old Venturas Strip", 2162.390, 2012.180, -89.084, 2685.160, 2202.760, 110.916)
  2465. AddZone("Juniper Hill", -2533.040, 578.396, -7.6, -2274.170, 968.369, 200.000)
  2466. AddZone("Juniper Hollow", -2533.040, 968.369, -6.1, -2274.170, 1358.900, 200.000)
  2467. AddZone("Roca Escalante", 2237.400, 2202.760, -89.084, 2536.430, 2542.550, 110.916)
  2468. AddZone("Julius Thruway East", 2685.160, 1055.960, -89.084, 2749.900, 2626.550, 110.916)
  2469. AddZone("Verona Beach", 647.712, -2173.290, -89.084, 930.221, -1804.210, 110.916)
  2470. AddZone("Foster Valley", -2178.690, -599.884, -1.2, -1794.920, -324.114, 200.000)
  2471. AddZone("Arco del Oeste", -901.129, 2221.860, 0.000, -592.090, 2571.970, 200.000)
  2472. AddZone("Fallen Tree", -792.254, -698.555, -5.3, -452.404, -380.043, 200.000)
  2473. AddZone("The Farm", -1209.670, -1317.100, 114.981, -908.161, -787.391, 251.981)
  2474. AddZone("The Sherman Dam", -968.772, 1929.410, -3.0, -481.126, 2155.260, 200.000)
  2475. AddZone("Esplanade North", -1996.660, 1358.900, -4.5, -1524.240, 1592.510, 200.000)
  2476. AddZone("Financial", -1871.720, 744.170, -6.1, -1701.300, 1176.420, 300.000)
  2477. AddZone("Garcia", -2411.220, -222.589, -1.14, -2173.040, 265.243, 200.000)
  2478. AddZone("Montgomery", 1119.510, 119.526, -3.0, 1451.400, 493.323, 200.000)
  2479. AddZone("Creek", 2749.900, 1937.250, -89.084, 2921.620, 2669.790, 110.916)
  2480. AddZone("Los Santos International", 1249.620, -2394.330, -89.084, 1852.000, -2179.250, 110.916)
  2481. AddZone("Santa Maria Beach", 72.648, -2173.290, -89.084, 342.648, -1684.650, 110.916)
  2482. AddZone("Mulholland Intersection", 1463.900, -1150.870, -89.084, 1812.620, -768.027, 110.916)
  2483. AddZone("Angel Pine", -2324.940, -2584.290, -6.1, -1964.220, -2212.110, 200.000)
  2484. AddZone("Verdant Meadows", 37.032, 2337.180, -3.0, 435.988, 2677.900, 200.000)
  2485. AddZone("Octane Springs", 338.658, 1228.510, 0.000, 664.308, 1655.050, 200.000)
  2486. AddZone("Come-A-Lot", 2087.390, 943.235, -89.084, 2623.180, 1203.230, 110.916)
  2487. AddZone("Redsands West", 1236.630, 1883.110, -89.084, 1777.390, 2142.860, 110.916)
  2488. AddZone("Santa Maria Beach", 342.648, -2173.290, -89.084, 647.712, -1684.650, 110.916)
  2489. AddZone("Verdant Bluffs", 1249.620, -2179.250, -89.084, 1692.620, -1842.270, 110.916)
  2490. AddZone("Las Venturas Airport", 1236.630, 1203.280, -89.084, 1457.370, 1883.110, 110.916)
  2491. AddZone("Flint Range", -594.191, -1648.550, 0.000, -187.700, -1276.600, 200.000)
  2492. AddZone("Verdant Bluffs", 930.221, -2488.420, -89.084, 1249.620, -2006.780, 110.916)
  2493. AddZone("Palomino Creek", 2160.220, -149.004, 0.000, 2576.920, 228.322, 200.000)
  2494. AddZone("Ocean Docks", 2373.770, -2697.090, -89.084, 2809.220, -2330.460, 110.916)
  2495. AddZone("Easter Bay Airport", -1213.910, -50.096, -4.5, -947.980, 578.396, 200.000)
  2496. AddZone("Whitewood Estates", 883.308, 1726.220, -89.084, 1098.310, 2507.230, 110.916)
  2497. AddZone("Calton Heights", -2274.170, 744.170, -6.1, -1982.320, 1358.900, 200.000)
  2498. AddZone("Easter Basin", -1794.920, 249.904, -9.1, -1242.980, 578.396, 200.000)
  2499. AddZone("Los Santos Inlet", -321.744, -2224.430, -89.084, 44.615, -1724.430, 110.916)
  2500. AddZone("Doherty", -2173.040, -222.589, -1.0, -1794.920, 265.243, 200.000)
  2501. AddZone("Mount Chiliad", -2178.690, -2189.910, -47.917, -2030.120, -1771.660, 576.083)
  2502. AddZone("Fort Carson", -376.233, 826.326, -3.0, 123.717, 1220.440, 200.000)
  2503. AddZone("Foster Valley", -2178.690, -1115.580, 0.000, -1794.920, -599.884, 200.000)
  2504. AddZone("Ocean Flats", -2994.490, -222.589, -1.0, -2593.440, 277.411, 200.000)
  2505. AddZone("Fern Ridge", 508.189, -139.259, 0.000, 1306.660, 119.526, 200.000)
  2506. AddZone("Bayside", -2741.070, 2175.150, 0.000, -2353.170, 2722.790, 200.000)
  2507. AddZone("Las Venturas Airport", 1457.370, 1203.280, -89.084, 1777.390, 1883.110, 110.916)
  2508. AddZone("Blueberry Acres", -319.676, -220.137, 0.000, 104.534, 293.324, 200.000)
  2509. AddZone("Palisades", -2994.490, 458.411, -6.1, -2741.070, 1339.610, 200.000)
  2510. AddZone("North Rock", 2285.370, -768.027, 0.000, 2770.590, -269.740, 200.000)
  2511. AddZone("Hunter Quarry", 337.244, 710.840, -115.239, 860.554, 1031.710, 203.761)
  2512. AddZone("Los Santos International", 1382.730, -2730.880, -89.084, 2201.820, -2394.330, 110.916)
  2513. AddZone("Missionary Hill", -2994.490, -811.276, 0.000, -2178.690, -430.276, 200.000)
  2514. AddZone("San Fierro Bay", -2616.400, 1659.680, -3.0, -1996.660, 2175.150, 200.000)
  2515. AddZone("Restricted Area", -91.586, 1655.050, -50.000, 421.234, 2123.010, 250.000)
  2516. AddZone("Mount Chiliad", -2997.470, -1115.580, -47.917, -2178.690, -971.913, 576.083)
  2517. AddZone("Mount Chiliad", -2178.690, -1771.660, -47.917, -1936.120, -1250.970, 576.083)
  2518. AddZone("Easter Bay Airport", -1794.920, -730.118, -3.0, -1213.910, -50.096, 200.000)
  2519. AddZone("The Panopticon", -947.980, -304.320, -1.1, -319.676, 327.071, 200.000)
  2520. AddZone("Shady Creeks", -1820.640, -2643.680, -8.0, -1226.780, -1771.660, 200.000)
  2521. AddZone("Back o Beyond", -1166.970, -2641.190, 0.000, -321.744, -1856.030, 200.000)
  2522. AddZone("Mount Chiliad", -2994.490, -2189.910, -47.917, -2178.690, -1115.580, 576.083)
  2523. AddZone("Tierra Robada", -1213.910, 596.349, -242.990, -480.539, 1659.680, 900.000)
  2524. AddZone("Flint County", -1213.910, -2892.970, -242.990, 44.615, -768.027, 900.000)
  2525. AddZone("Whetstone", -2997.470, -2892.970, -242.990, -1213.910, -1115.580, 900.000)
  2526. AddZone("Bone County", -480.539, 596.349, -242.990, 869.461, 2993.870, 900.000)
  2527. AddZone("Tierra Robada", -2997.470, 1659.680, -242.990, -480.539, 2993.870, 900.000)
  2528. AddZone("San Fierro", -2997.470, -1115.580, -242.990, -1213.910, 1659.680, 900.000)
  2529. AddZone("Las Venturas", 869.461, 596.349, -242.990, 2997.060, 2993.870, 900.000)
  2530. AddZone("Red County", -1213.910, -768.027, -242.990, 2997.060, 596.349, 900.000)
  2531. AddZone("Los Santos", 44.615, -2892.970, -242.990, 2997.060, -768.027, 900.000)
  2532. }
  2533. calculateZone(posX, posY, posZ) {
  2534. if ( bInitZaC == 0 )
  2535. {
  2536. initZonesAndCities()
  2537. bInitZaC := 1
  2538. }
  2539. Loop % nZone-1
  2540. {
  2541. 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)
  2542. {
  2543. ErrorLevel := ERROR_OK
  2544. return zone%A_Index%_name
  2545. }
  2546. }
  2547. ErrorLevel := ERROR_ZONE_NOT_FOUND
  2548. return "Unbekannt"
  2549. }
  2550. calculateCity(posX, posY, posZ) {
  2551. if ( bInitZaC == 0 )
  2552. {
  2553. initZonesAndCities()
  2554. bInitZaC := 1
  2555. }
  2556. smallestCity := "Unbekannt"
  2557. currentCitySize := 0
  2558. smallestCitySize := 0
  2559. Loop % nCity-1
  2560. {
  2561. 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)
  2562. {
  2563. 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))
  2564. if (smallestCity == "Unbekannt") || (currentCitySize < smallestCitySize)
  2565. {
  2566. smallestCity := city%A_Index%_name
  2567. smallestCitySize := currentCitySize
  2568. }
  2569. }
  2570. }
  2571. if(smallestCity == "Unbekannt") {
  2572. ErrorLevel := ERROR_CITY_NOT_FOUND
  2573. } else {
  2574. ErrorLevel := ERROR_OK
  2575. }
  2576. return smallestCity
  2577. }
  2578. AddZone(sName, x1, y1, z1, x2, y2, z2) {
  2579. global
  2580. zone%nZone%_name := sName
  2581. zone%nZone%_x1 := x1
  2582. zone%nZone%_y1 := y1
  2583. zone%nZone%_z1 := z1
  2584. zone%nZone%_x2 := x2
  2585. zone%nZone%_y2 := y2
  2586. zone%nZone%_z2 := z2
  2587. nZone := nZone + 1
  2588. }
  2589. AddCity(sName, x1, y1, z1, x2, y2, z2) {
  2590. global
  2591. city%nCity%_name := sName
  2592. city%nCity%_x1 := x1
  2593. city%nCity%_y1 := y1
  2594. city%nCity%_z1 := z1
  2595. city%nCity%_x2 := x2
  2596. city%nCity%_y2 := y2
  2597. city%nCity%_z2 := z2
  2598. nCity := nCity + 1
  2599. }
  2600. IsPlayerInRangeOfPoint(_posX, _posY, _posZ, _posRadius)
  2601. {
  2602. GetPlayerPos(posX, posY, posZ)
  2603. X := posX -_posX
  2604. Y := posY -_posY
  2605. Z := posZ -_posZ
  2606. if(((X < _posRadius) && (X > -_posRadius)) && ((Y < _posRadius) && (Y > -_posRadius)) && ((Z < _posRadius) && (Z > -_posRadius)))
  2607. return TRUE
  2608. return FALSE
  2609. }
  2610. IsPlayerInRangeOfPoint2D(_posX, _posY, _posRadius)
  2611. {
  2612. GetPlayerPos(posX, posY, posZ)
  2613. X := posX - _posX
  2614. Y := posY - _posY
  2615. if(((X < _posRadius) && (X > -_posRadius)) && ((Y < _posRadius) && (Y > -_posRadius)))
  2616. return TRUE
  2617. return FALSE
  2618. }
  2619. getPlayerZone()
  2620. {
  2621. aktPos := getCoordinates()
  2622. return calculateZone(aktPos[1], aktPos[2], aktPos[3])
  2623. }
  2624. getPlayerCity()
  2625. {
  2626. aktPos := getCoordinates()
  2627. return calculateCity(aktPos[1], aktPos[2], aktPos[3])
  2628. }
  2629. AntiCrash(){
  2630. If(!checkHandles())
  2631. return false
  2632. cReport := ADDR_SAMP_CRASHREPORT
  2633. writeMemory(hGTA, dwSAMP + cReport, 0x90909090, 4)
  2634. cReport += 0x4
  2635. writeMemory(hGTA, dwSAMP + cReport, 0x90, 1)
  2636. cReport += 0x9
  2637. writeMemory(hGTA, dwSAMP + cReport, 0x90909090, 4)
  2638. cReport += 0x4
  2639. writeMemory(hGTA, dwSAMP + cReport, 0x90, 1)
  2640. }
  2641. writeMemory(hProcess,address,writevalue,length=4, datatype="int") {
  2642. if(!hProcess) {
  2643. ErrorLevel := ERROR_INVALID_HANDLE
  2644. return false
  2645. }
  2646. VarSetCapacity(finalvalue,length, 0)
  2647. NumPut(writevalue,finalvalue,0,datatype)
  2648. dwRet :=  DllCall(  "WriteProcessMemory"
  2649. ,"Uint",hProcess
  2650. ,"Uint",address
  2651. ,"Uint",&finalvalue
  2652. ,"Uint",length
  2653. ,"Uint",0)
  2654. if(dwRet == 0) {
  2655. ErrorLevel := ERROR_WRITE_MEMORY
  2656. return false
  2657. }
  2658. ErrorLevel := ERROR_OK
  2659. return true
  2660. }
  2661. checkHandles() {
  2662. if(iRefreshHandles+500>A_TickCount)
  2663. return true
  2664. iRefreshHandles:=A_TickCount
  2665. if(!refreshGTA() || !refreshSAMP() || !refreshMemory()) {
  2666. return false
  2667. } else {
  2668. return true
  2669. }
  2670. return true
  2671. }
  2672. refreshGTA() {
  2673. newPID := getPID("GTA:SA:MP")
  2674. if(!newPID) {
  2675. if(hGTA) {
  2676. virtualFreeEx(hGTA, pMemory, 0, 0x8000)
  2677. closeProcess(hGTA)
  2678. hGTA := 0x0
  2679. }
  2680. dwGTAPID := 0
  2681. hGTA := 0x0
  2682. dwSAMP := 0x0
  2683. pMemory := 0x0
  2684. return false
  2685. }
  2686. if(!hGTA || (dwGTAPID != newPID)) {
  2687. hGTA := openProcess(newPID)
  2688. if(ErrorLevel) {
  2689. dwGTAPID := 0
  2690. hGTA := 0x0
  2691. dwSAMP := 0x0
  2692. pMemory := 0x0
  2693. return false
  2694. }
  2695. dwGTAPID := newPID
  2696. dwSAMP := 0x0
  2697. pMemory := 0x0
  2698. return true
  2699. }
  2700. return true
  2701. }
  2702. refreshSAMP() {
  2703. if(dwSAMP)
  2704. return true
  2705. dwSAMP := getModuleBaseAddress("samp.dll", hGTA)
  2706. if(!dwSAMP)
  2707. return false
  2708. return true
  2709. }
  2710. refreshMemory() {
  2711. if(!pMemory) {
  2712. pMemory     := virtualAllocEx(hGTA, 6144, 0x1000 | 0x2000, 0x40)
  2713. if(ErrorLevel) {
  2714. pMemory := 0x0
  2715. return false
  2716. }
  2717. pParam1     := pMemory
  2718. pParam2     := pMemory + 1024
  2719. pParam3     := pMemory + 2048
  2720. pParam4     := pMemory + 3072
  2721. pParam5     := pMemory + 4096
  2722. pInjectFunc := pMemory + 5120
  2723. }
  2724. return true
  2725. }
  2726. getPID(szWindow) {
  2727. local dwPID := 0
  2728. WinGet, dwPID, PID, %szWindow%
  2729. return dwPID
  2730. }
  2731. openProcess(dwPID, dwRights = 0x1F0FFF) {
  2732. hProcess := DllCall("OpenProcess"
  2733. , "UInt", dwRights
  2734. , "int",  0
  2735. , "UInt", dwPID
  2736. , "Uint")
  2737. if(hProcess == 0) {
  2738. ErrorLevel := ERROR_OPEN_PROCESS
  2739. return 0
  2740. }
  2741. ErrorLevel := ERROR_OK
  2742. return hProcess
  2743. }
  2744. closeProcess(hProcess) {
  2745. if(hProcess == 0) {
  2746. ErrorLevel := ERROR_INVALID_HANDLE
  2747. return 0
  2748. }
  2749. dwRet := DllCall(    "CloseHandle"
  2750. , "Uint", hProcess
  2751. , "UInt")
  2752. ErrorLevel := ERROR_OK
  2753. }
  2754. getModuleBaseAddress(sModule, hProcess) {
  2755. if(!sModule) {
  2756. ErrorLevel := ERROR_MODULE_NOT_FOUND
  2757. return 0
  2758. }
  2759. if(!hProcess) {
  2760. ErrorLevel := ERROR_INVALID_HANDLE
  2761. return 0
  2762. }
  2763. dwSize = 1024*4
  2764. VarSetCapacity(hMods, dwSize)
  2765. VarSetCapacity(cbNeeded, 4)
  2766. dwRet := DllCall(    "Psapi.dll\EnumProcessModules"
  2767. , "UInt", hProcess
  2768. , "UInt", &hMods
  2769. , "UInt", dwSize
  2770. , "UInt*", cbNeeded
  2771. , "UInt")
  2772. if(dwRet == 0) {
  2773. ErrorLevel := ERROR_ENUM_PROCESS_MODULES
  2774. return 0
  2775. }
  2776. dwMods := cbNeeded / 4
  2777. i := 0
  2778. VarSetCapacity(hModule, 4)
  2779. VarSetCapacity(sCurModule, 260)
  2780. while(i < dwMods) {
  2781. hModule := NumGet(hMods, i*4)
  2782. DllCall("Psapi.dll\GetModuleFileNameEx"
  2783. , "UInt", hProcess
  2784. , "UInt", hModule
  2785. , "Str", sCurModule
  2786. , "UInt", 260)
  2787. SplitPath, sCurModule, sFilename
  2788. if(sModule == sFilename) {
  2789. ErrorLevel := ERROR_OK
  2790. return hModule
  2791. }
  2792. i := i + 1
  2793. }
  2794. ErrorLevel := ERROR_MODULE_NOT_FOUND
  2795. return 0
  2796. }
  2797. readString(hProcess, dwAddress, dwLen) {
  2798. if(!hProcess) {
  2799. ErrorLevel := ERROR_INVALID_HANDLE
  2800. return 0
  2801. }
  2802. VarSetCapacity(sRead, dwLen)
  2803. dwRet := DllCall(    "ReadProcessMemory"
  2804. , "UInt", hProcess
  2805. , "UInt", dwAddress
  2806. , "Str", sRead
  2807. , "UInt", dwLen
  2808. , "UInt*", 0
  2809. , "UInt")
  2810. if(dwRet == 0) {
  2811. ErrorLevel := ERROR_READ_MEMORY
  2812. return 0
  2813. }
  2814. ErrorLevel := ERROR_OK
  2815. if A_IsUnicode
  2816. return __ansiToUnicode(sRead)
  2817. return sRead
  2818. }
  2819. readFloat(hProcess, dwAddress) {
  2820. if(!hProcess) {
  2821. ErrorLevel := ERROR_INVALID_HANDLE
  2822. return 0
  2823. }
  2824. VarSetCapacity(dwRead, 4)
  2825. dwRet := DllCall(    "ReadProcessMemory"
  2826. , "UInt",  hProcess
  2827. , "UInt",  dwAddress
  2828. , "Str",   dwRead
  2829. , "UInt",  4
  2830. , "UInt*", 0
  2831. , "UInt")
  2832. if(dwRet == 0) {
  2833. ErrorLevel := ERROR_READ_MEMORY
  2834. return 0
  2835. }
  2836. ErrorLevel := ERROR_OK
  2837. return NumGet(dwRead, 0, "Float")
  2838. }
  2839. readDWORD(hProcess, dwAddress) {
  2840. if(!hProcess) {
  2841. ErrorLevel := ERROR_INVALID_HANDLE
  2842. return 0
  2843. }
  2844. VarSetCapacity(dwRead, 4)
  2845. dwRet := DllCall(    "ReadProcessMemory"
  2846. , "UInt",  hProcess
  2847. , "UInt",  dwAddress
  2848. , "Str",   dwRead
  2849. , "UInt",  4
  2850. , "UInt*", 0)
  2851. if(dwRet == 0) {
  2852. ErrorLevel := ERROR_READ_MEMORY
  2853. return 0
  2854. }
  2855. ErrorLevel := ERROR_OK
  2856. return NumGet(dwRead, 0, "UInt")
  2857. }
  2858. readMem(hProcess, dwAddress, dwLen=4, type="UInt") {
  2859. if(!hProcess) {
  2860. ErrorLevel := ERROR_INVALID_HANDLE
  2861. return 0
  2862. }
  2863. VarSetCapacity(dwRead, dwLen)
  2864. dwRet := DllCall(    "ReadProcessMemory"
  2865. , "UInt",  hProcess
  2866. , "UInt",  dwAddress
  2867. , "Str",   dwRead
  2868. , "UInt",  dwLen
  2869. , "UInt*", 0)
  2870. if(dwRet == 0) {
  2871. ErrorLevel := ERROR_READ_MEMORY
  2872. return 0
  2873. }
  2874. ErrorLevel := ERROR_OK
  2875. return NumGet(dwRead, 0, type)
  2876. }
  2877. writeString(hProcess, dwAddress, wString) {
  2878. if(!hProcess) {
  2879. ErrorLevel := ERROR_INVALID_HANDLE
  2880. return false
  2881. }
  2882. sString := wString
  2883. if A_IsUnicode
  2884. sString := __unicodeToAnsi(wString)
  2885. dwRet := DllCall(    "WriteProcessMemory"
  2886. , "UInt", hProcess
  2887. , "UInt", dwAddress
  2888. , "Str", sString
  2889. , "UInt", StrLen(wString) + 1
  2890. , "UInt", 0
  2891. , "UInt")
  2892. if(dwRet == 0) {
  2893. ErrorLEvel := ERROR_WRITE_MEMORY
  2894. return false
  2895. }
  2896. ErrorLevel := ERROR_OK
  2897. return true
  2898. }
  2899. writeRaw(hProcess, dwAddress, pBuffer, dwLen) {
  2900. if(!hProcess) {
  2901. ErrorLevel := ERROR_INVALID_HANDLE
  2902. return false
  2903. }
  2904. dwRet := DllCall(    "WriteProcessMemory"
  2905. , "UInt", hProcess
  2906. , "UInt", dwAddress
  2907. , "UInt", pBuffer
  2908. , "UInt", dwLen
  2909. , "UInt", 0
  2910. , "UInt")
  2911. if(dwRet == 0) {
  2912. ErrorLEvel := ERROR_WRITE_MEMORY
  2913. return false
  2914. }
  2915. ErrorLevel := ERROR_OK
  2916. return true
  2917. }
  2918. Memory_ReadByte(process_handle, address) {
  2919. VarSetCapacity(value, 1, 0)
  2920. DllCall("ReadProcessMemory", "UInt", process_handle, "UInt", address, "Str", value, "UInt", 1, "UInt *", 0)
  2921. return, NumGet(value, 0, "Byte")
  2922. }
  2923. callWithParams(hProcess, dwFunc, aParams, bCleanupStack = true) {
  2924. if(!hProcess) {
  2925. ErrorLevel := ERROR_INVALID_HANDLE
  2926. return false
  2927. }
  2928. validParams := 0
  2929. i := aParams.MaxIndex()
  2930. dwLen := i * 5    + 5    + 1
  2931. if(bCleanupStack)
  2932. dwLen += 3
  2933. VarSetCapacity(injectData, i * 5    + 5       + 3       + 1, 0)
  2934. i_ := 1
  2935. while(i > 0) {
  2936. if(aParams[i][1] != "") {
  2937. dwMemAddress := 0x0
  2938. if(aParams[i][1] == "p") {
  2939. dwMemAddress := aParams[i][2]
  2940. } else if(aParams[i][1] == "s") {
  2941. if(i_>3)
  2942. return false
  2943. dwMemAddress := pParam%i_%
  2944. writeString(hProcess, dwMemAddress, aParams[i][2])
  2945. if(ErrorLevel)
  2946. return false
  2947. i_ += 1
  2948. } else if(aParams[i][1] == "i") {
  2949. dwMemAddress := aParams[i][2]
  2950. } else {
  2951. return false
  2952. }
  2953. NumPut(0x68, injectData, validParams * 5, "UChar")
  2954. NumPut(dwMemAddress, injectData, validParams * 5 + 1, "UInt")
  2955. validParams += 1
  2956. }
  2957. i -= 1
  2958. }
  2959. offset := dwFunc - ( pInjectFunc + validParams * 5 + 5 )
  2960. NumPut(0xE8, injectData, validParams * 5, "UChar")
  2961. NumPut(offset, injectData, validParams * 5 + 1, "Int")
  2962. if(bCleanupStack) {
  2963. NumPut(0xC483, injectData, validParams * 5 + 5, "UShort")
  2964. NumPut(validParams*4, injectData, validParams * 5 + 7, "UChar")
  2965. NumPut(0xC3, injectData, validParams * 5 + 8, "UChar")
  2966. } else {
  2967. NumPut(0xC3, injectData, validParams * 5 + 5, "UChar")
  2968. }
  2969. writeRaw(hGTA, pInjectFunc, &injectData, dwLen)
  2970. if(ErrorLevel)
  2971. return false
  2972. hThread := createRemoteThread(hGTA, 0, 0, pInjectFunc, 0, 0, 0)
  2973. if(ErrorLevel)
  2974. return false
  2975. waitForSingleObject(hThread, 0xFFFFFFFF)
  2976. closeProcess(hThread)
  2977. return true
  2978. }
  2979. virtualAllocEx(hProcess, dwSize, flAllocationType, flProtect) {
  2980. if(!hProcess) {
  2981. ErrorLevel := ERROR_INVALID_HANDLE
  2982. return 0
  2983. }
  2984. dwRet := DllCall(    "VirtualAllocEx"
  2985. , "UInt", hProcess
  2986. , "UInt", 0
  2987. , "UInt", dwSize
  2988. , "UInt", flAllocationType
  2989. , "UInt", flProtect
  2990. , "UInt")
  2991. if(dwRet == 0) {
  2992. ErrorLEvel := ERROR_ALLOC_MEMORY
  2993. return 0
  2994. }
  2995. ErrorLevel := ERROR_OK
  2996. return dwRet
  2997. }
  2998. virtualFreeEx(hProcess, lpAddress, dwSize, dwFreeType) {
  2999. if(!hProcess) {
  3000. ErrorLevel := ERROR_INVALID_HANDLE
  3001. return 0
  3002. }
  3003. dwRet := DllCall(    "VirtualFreeEx"
  3004. , "UInt", hProcess
  3005. , "UInt", lpAddress
  3006. , "UInt", dwSize
  3007. , "UInt", dwFreeType
  3008. , "UInt")
  3009. if(dwRet == 0) {
  3010. ErrorLEvel := ERROR_FREE_MEMORY
  3011. return 0
  3012. }
  3013. ErrorLevel := ERROR_OK
  3014. return dwRet
  3015. }
  3016. createRemoteThread(hProcess, lpThreadAttributes, dwStackSize, lpStartAddress, lpParameter, dwCreationFlags, lpThreadId) {
  3017. if(!hProcess) {
  3018. ErrorLevel := ERROR_INVALID_HANDLE
  3019. return 0
  3020. }
  3021. dwRet := DllCall(    "CreateRemoteThread"
  3022. , "UInt", hProcess
  3023. , "UInt", lpThreadAttributes
  3024. , "UInt", dwStackSize
  3025. , "UInt", lpStartAddress
  3026. , "UInt", lpParameter
  3027. , "UInt", dwCreationFlags
  3028. , "UInt", lpThreadId
  3029. , "UInt")
  3030. if(dwRet == 0) {
  3031. ErrorLEvel := ERROR_ALLOC_MEMORY
  3032. return 0
  3033. }
  3034. ErrorLevel := ERROR_OK
  3035. return dwRet
  3036. }
  3037. waitForSingleObject(hThread, dwMilliseconds) {
  3038. if(!hThread) {
  3039. ErrorLevel := ERROR_INVALID_HANDLE
  3040. return 0
  3041. }
  3042. dwRet := DllCall(    "WaitForSingleObject"
  3043. , "UInt", hThread
  3044. , "UInt", dwMilliseconds
  3045. , "UInt")
  3046. if(dwRet == 0xFFFFFFFF) {
  3047. ErrorLEvel := ERROR_WAIT_FOR_OBJECT
  3048. return 0
  3049. }
  3050. ErrorLevel := ERROR_OK
  3051. return dwRet
  3052. }
  3053. __ansiToUnicode(sString, nLen = 0) {
  3054. If !nLen
  3055. {
  3056. nLen := DllCall("MultiByteToWideChar"
  3057. , "Uint", 0
  3058. , "Uint", 0
  3059. , "Uint", &sString
  3060. , "int",  -1
  3061. , "Uint", 0
  3062. , "int",  0)
  3063. }
  3064. VarSetCapacity(wString, nLen * 2)
  3065. DllCall("MultiByteToWideChar"
  3066. , "Uint", 0
  3067. , "Uint", 0
  3068. , "Uint", &sString
  3069. , "int",  -1
  3070. , "Uint", &wString
  3071. , "int",  nLen)
  3072. return wString
  3073. }
  3074. __unicodeToAnsi(wString, nLen = 0) {
  3075. pString := wString + 1 > 65536 ? wString : &wString
  3076. If !nLen
  3077. {
  3078. nLen := DllCall("WideCharToMultiByte"
  3079. , "Uint", 0
  3080. , "Uint", 0
  3081. , "Uint", pString
  3082. , "int",  -1
  3083. , "Uint", 0
  3084. , "int",  0
  3085. , "Uint", 0
  3086. , "Uint", 0)
  3087. }
  3088. VarSetCapacity(sString, nLen)
  3089. DllCall("WideCharToMultiByte"
  3090. , "Uint", 0
  3091. , "Uint", 0
  3092. , "Uint", pString
  3093. , "int",  -1
  3094. , "str",  sString
  3095. , "int",  nLen
  3096. , "Uint", 0
  3097. , "Uint", 0)
  3098. return sString
  3099. }
  3100. IniRead(fileName, section, key, default := 0) {
  3101. IniRead, var, %fileName%, %section%, %key%, %default%
  3102. return var
  3103. }
  3104. restartGameEx() {
  3105. if (!checkHandles())
  3106. return -1
  3107. dwAddress := readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET)
  3108. if (ErrorLevel || dwAddress==0) {
  3109. ErrorLevel := ERROR_READ_MEMORY
  3110. return -1
  3111. }
  3112. dwFunc := dwSAMP + 0xA060
  3113. VarSetCapacity(injectData, 11, 0)
  3114. NumPut(0xB9, injectData, 0, "UChar")
  3115. NumPut(dwAddress, injectData, 1, "UInt")
  3116. NumPut(0xE8, injectData, 5, "UChar")
  3117. offset := dwFunc - (pInjectFunc + 10)
  3118. NumPut(offset, injectData, 6, "Int")
  3119. NumPut(0xC3, injectData, 10, "UChar")
  3120. writeRaw(hGTA, pInjectFunc, &injectData, 11)
  3121. if (ErrorLevel)
  3122. return false
  3123. hThread := createRemoteThread(hGTA, 0, 0, pInjectFunc, 0, 0, 0)
  3124. if (ErrorLevel)
  3125. return false
  3126. waitForSingleObject(hThread, 0xFFFFFFFF)
  3127. return true
  3128. }
  3129. disconnectEx() {
  3130. if (!checkHandles())
  3131. return 0
  3132. dwAddress := readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET)
  3133. if (ErrorLevel || dwAddress==0) {
  3134. ErrorLevel := ERROR_READ_MEMORY
  3135. return 0
  3136. }
  3137. dwAddress := readDWORD(hGTA, dwAddress + 0x3c9)
  3138. if (ErrorLevel || dwAddress==0) {
  3139. ErrorLevel := ERROR_READ_MEMORY
  3140. return 0
  3141. }
  3142. ecx := dwAddress
  3143. dwAddress := readDWORD(hGTA, dwAddress)
  3144. if (ErrorLevel || dwAddress==0) {
  3145. ErrorLevel := ERROR_READ_MEMORY
  3146. return 0
  3147. }
  3148. VarSetCapacity(injectData, 24, 0)
  3149. NumPut(0xB9, injectData, 0, "UChar")
  3150. NumPut(ecx, injectData, 1, "UInt")
  3151. NumPut(0xB8, injectData, 5, "UChar")
  3152. NumPut(dwAddress, injectData, 6, "UInt")
  3153. NumPut(0x68, injectData, 10, "UChar")
  3154. NumPut(0, injectData, 11, "UInt")
  3155. NumPut(0x68, injectData, 15, "UChar")
  3156. NumPut(500, injectData, 16, "UInt")
  3157. NumPut(0x50FF, injectData, 20, "UShort")
  3158. NumPut(0x08, injectData, 22, "UChar")
  3159. NumPut(0xC3, injectData, 23, "UChar")
  3160. writeRaw(hGTA, pInjectFunc, &injectData, 24)
  3161. if (ErrorLevel)
  3162. return false
  3163. hThread := createRemoteThread(hGTA, 0, 0, pInjectFunc, 0, 0, 0)
  3164. if (ErrorLevel)
  3165. return false
  3166. waitForSingleObject(hThread, 0xFFFFFFFF)
  3167. return true
  3168. }
  3169. setRestart() {
  3170. VarSetCapacity(old, 4, 0)
  3171. dwAddress := readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET)
  3172. if (ErrorLevel || dwAddress==0) {
  3173. ErrorLevel := ERROR_READ_MEMORY
  3174. return 0
  3175. }
  3176. NumPut(9,old,0,"Int")
  3177. writeRaw(hGTA, dwAddress + 957, &old, 4)
  3178. }
  3179. restart() {
  3180. restartGameEx()
  3181. disconnectEx()
  3182. Sleep, 1000
  3183. setRestart()
  3184. }
  3185. global SAMP_3DTEXT                  := 0x12C7BC
  3186. getLabelText() {
  3187. if (!checkHandles())
  3188. return -1
  3189. ADDR_3DText := readDWORD(hGTA, dwSAMP + SAMP_3DTEXT)
  3190. TEXT_3DTEXT := readString(hGTA, ADDR_3DText, 512)
  3191. return TEXT_3DTEXT
  3192. }
  3193. GetSeatIDs() {
  3194. if (!checkHandles())
  3195. return -1
  3196. dw := readDWORD(hGTA, 0xBA18FC)
  3197. if (dw) {
  3198. driver := readDWORD(hGTA, dw + 0x460)
  3199. psg1 := readDWORD(hGTA, dw + 0x464)
  3200. psg2 := readDWORD(hGTA, dw + 0x468)
  3201. psg3 := readDWORD(hGTA, dw + 0x46C)
  3202. return [getIdByPed(driver), getIdByPed(psg1), getIdByPed(psg2), getIdByPed(psg3)]
  3203. } else {
  3204. AddChatMessage(PREFIX . "Du befindest dich nicht in einem Fahrzeug!")
  3205. }
  3206. }
  3207. PlayerInput(text) {
  3208. global alternativePlayerInput
  3209. if (alternativePlayerInput) {
  3210. Sleep, 100
  3211. Suspend, On
  3212. SendInput, t^a{backspace}/%text%
  3213. Input, var, V, {Enter}{Esc}{LButton}
  3214. SendInput, {End}+{Home}{Del}{Esc}
  3215. Suspend, Off
  3216. } else {
  3217. KeyWait, Enter
  3218. SendInput, t^a{backspace}/%text%
  3219. Input, var, V, {Enter}{Esc}{LButton}
  3220. SendInput, {End}+{Home}{Del}{Esc}
  3221. KeyWait, Enter
  3222. }
  3223. return var
  3224. }
  3225. DownloadBin(url, byref buf) {
  3226. if (!DllCall("LoadLibrary", "str", "wininet") || !(h := DllCall("wininet\InternetOpen", "str", a, "uint", 1, "ptr", 0, "ptr", 0, "uint", 0, "ptr")))
  3227. return 0
  3228. c := s := 0
  3229. if (f := DllCall("wininet\InternetOpenUrl", "ptr", h, "str", url, "ptr", 0, "uint", 0, "uint", 0x80003000, "ptr", 0, "ptr")) {
  3230. while (DllCall("wininet\InternetQueryDataAvailable", "ptr", f, "uint*", s, "uint", 0, "ptr", 0) && s>0) {
  3231. VarSetCapacity(b, c+s, 0)
  3232. if (c>0)
  3233. DllCall("RtlMoveMemory", "ptr", &b, "ptr", &buf, "ptr", c)
  3234. DllCall("wininet\InternetReadFile", "ptr", f, "ptr", &b+c, "uint", s, "uint*", r)
  3235. c += r
  3236. VarSetCapacity(buf, c, 0)
  3237. if (c>0)
  3238. DllCall("RtlMoveMemory", "ptr", &buf, "ptr", &b, "ptr", c)
  3239. }
  3240. DllCall("wininet\InternetCloseHandle", "ptr", f)
  3241. }
  3242. DllCall("wininet\InternetCloseHandle", "ptr", h)
  3243. return c
  3244. }
  3245. DownloadToString(url, head, encoding = "utf-8") {
  3246. static a := "AutoHotkey/" A_AhkVersion
  3247. if (!DllCall("LoadLibrary", "str", "wininet") || !(h := DllCall("wininet\InternetOpen", "str", a, "uint", 1, "ptr", 0, "ptr", 0, "uint", 0, "ptr")))
  3248. return 0
  3249. c := s := 0, o := ""
  3250. if (f := DllCall("wininet\InternetOpenUrl", "ptr", h, "str", url, "str", head, "int", -1, "uint", 0x80083000, "ptr", 0, "ptr")) {
  3251. while (DllCall("wininet\InternetQueryDataAvailable", "ptr", f, "uint*", s, "uint", 0, "ptr", 0) && s > 0) {
  3252. VarSetCapacity(b, s, 0)
  3253. DllCall("wininet\InternetReadFile", "ptr", f, "ptr", &b, "uint", s, "uint*", r)
  3254. o .= StrGet(&b, r >> (encoding = "utf-16" || encoding = "cp1200"), encoding)
  3255. }
  3256. DllCall("wininet\InternetCloseHandle", "ptr", f)
  3257. }
  3258. DllCall("wininet\InternetCloseHandle", "ptr", h)
  3259. return o
  3260. }
  3261. URLDownloadToVar(url, showerror := false) {
  3262. hObject := ComObjCreate("WinHttp.WinHttpRequest.5.1")
  3263. try {
  3264. hObject.Open("GET", url)
  3265. hObject.SetTimeouts(0, 2000, 2000, 2000)
  3266. hObject.Send()
  3267. data := hObject.ResponseText
  3268. } catch e {
  3269. if (showerror == true) {
  3270. AddChatMessage(PREFIX . "Aktuell liegt ein Fehler in der Verbindung zum Server vor!")
  3271. }
  3272. return "ERROR_CONNECTION"
  3273. }
  3274. return data
  3275. }
  3276. GetVehicleColor_func := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetVehicleColor")
  3277. GetVehicleColor(ByRef int_ColorFirst, ByRef int_ColorSecond) {
  3278. global GetVehicleColor_func
  3279. res := DllCall(GetVehicleColor_func, IntP, int_ColorFirst, IntP, int_ColorSecond)
  3280. return res
  3281. }
  3282. FormatNumber(_number) {
  3283. StringReplace, _number, _number, -
  3284. IfEqual, ErrorLevel, 0, SetEnv Sign, -
  3285. Loop, Parse, _number, .
  3286. if (A_Index = 1) {
  3287. len := StrLen(A_LoopField)
  3288. Loop, Parse, A_LoopField
  3289. if (Mod(len-A_Index,3) = 0 and A_Index != len) {
  3290. x .= A_LoopField "."
  3291. } else {
  3292. x .= A_LoopField
  3293. }
  3294. } else {
  3295. Return Sign x "." A_LoopField
  3296. }
  3297. Return Sign x
  3298. }
  3299. Unzip(sZip, sUnz) {
  3300. fso := ComObjCreate("Scripting.FileSystemObject")
  3301. psh := ComObjCreate("Shell.Application")
  3302. zippedItems := psh.Namespace( sZip ).items().count
  3303. psh.Namespace( sUnz ).CopyHere( psh.Namespace( sZip ).items, 4|16 )
  3304. Loop {
  3305. Sleep, 50
  3306. unzippedItems := psh.Namespace( sUnz ).items().count
  3307. IfEqual, zippedItems, %unzippedItems%
  3308. break
  3309. }
  3310. }
  3311. getFullName(name) {
  3312. if name is number
  3313. {
  3314. name := getPlayerNameById(name)
  3315. if (name == "") {
  3316. return ""
  3317. } else {
  3318. return name
  3319. }
  3320. } else {
  3321. name := getPlayerIdByName(name)
  3322. if (name == -1) {
  3323. return ""
  3324. } else {
  3325. return getPlayerNameById(name)
  3326. }
  3327. }
  3328. }
  3329. getDistanceBetween(posX, posY, posZ, _posX, _posY, _posZ, _posRadius) {
  3330. X := posX -_posX
  3331. Y := posY -_posY
  3332. Z := posZ -_posZ
  3333. if (((X < _posRadius) && (X > -_posRadius)) && ((Y < _posRadius) && (Y > -_posRadius)) && ((Z < _posRadius) && (Z > -_posRadius)))
  3334. return TRUE
  3335. return FALSE
  3336. }
  3337. getDistanceToPoint(posX, posY, posZ, _posX, _posY, _posZ) {
  3338. return Sqrt((posX - _posX) ** 2 + (posY - _posY) ** 2 + (posZ - _posZ) ** 2)
  3339. }
  3340. global SAMP_CHAT_OFF            := 0x0152
  3341. global SAMP_CHAT_SIZE           := 144
  3342. readChatLine(line, color = 0) {
  3343. if (!checkHandles())
  3344. return 0
  3345. dwPTR := readDWORD(hGTA, dwSAMP + ADDR_SAMP_CHATMSG_PTR)
  3346. chat := readString(hGTA, dwPTR + SAMP_CHAT_OFF + SIZE_SAMP_CHATMSG * (99 - line), SAMP_CHAT_SIZE)
  3347. if (!color)
  3348. chat := RegExReplace(chat, "\{[a-fA-F0-9]{6}\}")
  3349. return chat
  3350. }
  3351. setChatLine(line, text) {
  3352. if (!checkHandles())
  3353. return 0
  3354. dwPTR := readDWORD(hGTA, dwSAMP + ADDR_SAMP_CHATMSG_PTR)
  3355. result := writeString(hGTA, dwPTR + SAMP_CHAT_OFF + SIZE_SAMP_CHATMSG * (99 - line), text)
  3356. return result
  3357. }
  3358. instruction := 0
  3359. fpsUnlock() {
  3360. if (!checkHandles())
  3361. return 0
  3362. global instruction
  3363. instruction := readMem(hGTA, dwSAMP + 0x9D9D0, 4, "UInt")
  3364. return writeMemory(hGTA, dwSAMP + 0x9D9D0, 0x5051FF15, 4, "UChar")
  3365. }
  3366. fpsLock() {
  3367. if (!checkHandles())
  3368. return 0
  3369. global instruction
  3370. if (instruction) {
  3371. return writeMemory(hGTA, dwSAMP + 0x9D9D0, instruction, 4, "UInt")
  3372. } else {
  3373. return false
  3374. }
  3375. }
  3376. global SAMP_MAX_VEHICLES := 2000
  3377. global SAMP_PPOOL_VEHICLE_OFFSET := 0x1C
  3378. getVehiclePointer(wID) {
  3379. if (wID < 1 || wID > SAMP_MAX_VEHICLES || !checkHandles())
  3380. return false
  3381. var1 := readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET)
  3382. var2 := readDWORD(hGTA, var1 + SAMP_PPOOLS_OFFSET)
  3383. stVehiclePool := readDWORD(hGTA, var2 + SAMP_PPOOL_VEHICLE_OFFSET)
  3384. if (stVehiclePool) {
  3385. var3 := readDWORD(hGTA, stVehiclePool + 0x4FB4 + wID * 0x4)
  3386. return var3
  3387. } else {
  3388. return false
  3389. }
  3390. }
  3391. getVehiclePos(dwVehPtr = 0xBA18FC) {
  3392. if (!checkHandles())
  3393. return false
  3394. if (dwVehPtr = ADDR_VEHICLE_PTR)
  3395. dwVehPtr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
  3396. dwAddress := readDWORD(hGTA, dwVehPtr + 0x14)
  3397. if (!dwAddress)
  3398. return false
  3399. fX := readFloat(hGTA, dwAddress + 0x30)
  3400. fY := readFloat(hGTA, dwAddress + 0x34)
  3401. fZ := readFloat(hGTA, dwAddress + 0x38)
  3402. vehicleID := readDWORD(hGTA, dwVehPtr + 0x22)
  3403. return [fX, fY, fZ, vehicleID]
  3404. }
  3405. global TEXT_DRAW_POOL_OFFSET                := 0x10
  3406. global SAMP_MAX_PLAYERTEXTDRAWS             := 256
  3407. global SAMP_MAX_TEXTDRAWS                   := 2048
  3408. global iRefreshTD := 0
  3409. global iUpdateTickTD := 1000
  3410. global oTextDraws := []
  3411. updateTextDraws() {
  3412. if (!checkHandles())
  3413. return 0
  3414. if (iRefreshTD + iUpdateTickTD > A_TickCount)
  3415. return 1
  3416. oTextDraws := []
  3417. iRefreshTD := A_TickCount
  3418. dwAddress := readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET)
  3419. if (ErrorLevel || !dwAddress) {
  3420. ErrorLevel := ERROR_READ_MEMORY
  3421. return 0
  3422. }
  3423. dwAddress := readDWORD(hGTA, dwAddress + SAMP_PPOOLS_OFFSET)
  3424. if (ErrorLevel || !dwAddress) {
  3425. ErrorLevel := ERROR_READ_MEMORY
  3426. return 0
  3427. }
  3428. dwTextDraw := readDWORD(hGTA, dwAddress + TEXT_DRAW_POOL_OFFSET)
  3429. if (ErrorLevel || !dwTextDraw) {
  3430. ErrorLevel := ERROR_READ_MEMORY
  3431. return 0
  3432. }
  3433. Loop, % SAMP_MAX_TEXTDRAWS
  3434. {
  3435. i := A_Index - 1
  3436. dwIsActive := readDWORD(hGTA, dwTextDraw + i * 4)
  3437. if (ErrorLevel) {
  3438. ErrorLevel := ERROR_READ_MEMORY
  3439. return 0
  3440. }
  3441. if (!dwIsActive)
  3442. continue
  3443. dwAddr := readDWORD(hGTA, dwTextDraw + i * 4 + (4 * (SAMP_MAX_PLAYERTEXTDRAWS + SAMP_MAX_TEXTDRAWS)))
  3444. if (ErrorLevel) {
  3445. ErrorLevel := ERROR_READ_MEMORY
  3446. return 0
  3447. }
  3448. if (!dwAddr)
  3449. continue
  3450. sText := readString(hGTA, dwAddr, 800)
  3451. if (ErrorLevel) {
  3452. ErrorLevel := ERROR_READ_MEMORY
  3453. return 0
  3454. }
  3455. oTextDraws[i] := sText
  3456. }
  3457. ErrorLevel := ERROR_OK
  3458. return 1
  3459. }
  3460. printTextDraws() {
  3461. if (!updateTextDraws())
  3462. return
  3463. oReplace := ["~s~", "~r~", "~w~", "~h~", "~g~", "~y~", "~n~", "~b~", "  ", "   "]
  3464. For i, o in oTextDraws
  3465. {
  3466. Loop % oReplace.MaxIndex() {
  3467. o := StrReplace(o, oReplace[A_Index], " ")
  3468. }
  3469. AddChatMessage(o)
  3470. }
  3471. return
  3472. }
  3473. getTextDrawBySubstring(substring) {
  3474. if (!updateTextDraws())
  3475. return
  3476. oReplace := ["~s~", "~r~", "~w~", "~h~", "~g~", "~y~", "~n~", "~b~", "  ", "   "]
  3477. For i, o in oTextDraws
  3478. {
  3479. if (!InStr(o, substring))
  3480. continue
  3481. Loop % oReplace.MaxIndex()
  3482. o := StrReplace(o, oReplace[A_Index], " ")
  3483. return o
  3484. }
  3485. }
  3486. global iRefreshTL := 0
  3487. global oTextLabelData := ""
  3488. global iUpdateTickTL := 1000
  3489. updateTextLabelData() {
  3490. if (!checkHandles())
  3491. return 0
  3492. if (iRefreshTL+iUpdateTickTL > A_TickCount)
  3493. return 1
  3494. oTextLabelData := []
  3495. iRefreshTL := A_TickCount
  3496. dwAddress := readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET)
  3497. if (ErrorLevel || dwAddress==0) {
  3498. ErrorLevel := ERROR_READ_MEMORY
  3499. return 0
  3500. }
  3501. dwAddress := readDWORD(hGTA, dwAddress + SAMP_PPOOLS_OFFSET)
  3502. if (ErrorLevel || dwAddress==0) {
  3503. ErrorLevel := ERROR_READ_MEMORY
  3504. return 0
  3505. }
  3506. dwTextLabels := readDWORD(hGTA, dwAddress + 12)
  3507. if (ErrorLevel || dwTextDraws==0) {
  3508. ErrorLevel := ERROR_READ_MEMORY
  3509. return 0
  3510. }
  3511. Loop, % 2048
  3512. {
  3513. i := A_Index-1
  3514. dwIsActive := readDWORD(hGTA, dwTextLabels + 59392 + i*4)
  3515. if (ErrorLevel) {
  3516. ErrorLevel := ERROR_READ_MEMORY
  3517. return 0
  3518. }
  3519. if (dwIsActive==0)
  3520. continue
  3521. dwAddr := readDWORD(hGTA, dwTextLabels + i*29)
  3522. if (ErrorLevel) {
  3523. ErrorLevel := ERROR_READ_MEMORY
  3524. return 0
  3525. }
  3526. if (dwAddr==0)
  3527. continue
  3528. sText := readString(hGTA, dwAddr, 256)
  3529. if (ErrorLevel) {
  3530. ErrorLevel := ERROR_READ_MEMORY
  3531. return 0
  3532. }
  3533. fX := readFloat(hGTA, dwTextLabels + i*29 +8)
  3534. if (ErrorLevel) {
  3535. ErrorLevel := ERROR_READ_MEMORY
  3536. return 0
  3537. }
  3538. fY := readFloat(hGTA, dwTextLabels + i*29 +12)
  3539. if (ErrorLevel) {
  3540. ErrorLevel := ERROR_READ_MEMORY
  3541. return 0
  3542. }
  3543. fZ := readFloat(hGTA, dwTextLabels + i*29 +16)
  3544. if (ErrorLevel) {
  3545. ErrorLevel := ERROR_READ_MEMORY
  3546. return 0
  3547. }
  3548. wPlayerID := readMem(hGTA, dwTextLabels + i * 0x1D + 0x19, 2, "UShort")
  3549. wVehicleID := readMem(hGTA, dwTextLabels + i * 0x1D + 0x1B, 2, "UShort")
  3550. oTextLabelData[i] := Object("TEXT", sText, "XPOS", fX , "YPOS", fY , "ZPOS", fZ, "PLAYERID", wPlayerID, "VEHICLEID", wVehicleID)
  3551. }
  3552. ErrorLevel := ERROR_OK
  3553. return 1
  3554. }
  3555. countLabels() {
  3556. if (!updateTextLabelData())
  3557. return -1
  3558. j := 0
  3559. For i, o in oTextLabelData
  3560. {
  3561. j += 1
  3562. }
  3563. return j
  3564. }
  3565. printLabels() {
  3566. if (!updateTextLabelData())
  3567. return
  3568. For i, o in oTextLabelData
  3569. {
  3570. addchatmessage("ID: " . i . ", x:" . o.XPOS . ", y:" . o.YPOS . ", z:" . o.ZPOS . ", player: " . o.PLAYERID . ", vehicle: " . o.VEHICLEID)
  3571. addchatmessage("{FFFFFF}" . o.TEXT)
  3572. }
  3573. }
  3574. getTextWidth(text) {
  3575. array := StrSplit(text)
  3576. width := 0
  3577. Loop % array.MaxIndex()
  3578. {
  3579. if (array[A_Index] == "a") {
  3580. width += 6
  3581. } else if (array[A_Index] == "b") {
  3582. width += 7
  3583. } else if (array[A_Index] == "c") {
  3584. width += 6
  3585. } else if (array[A_Index] == "d") {
  3586. width += 7
  3587. } else if (array[A_Index] == "e") {
  3588. width += 7
  3589. } else if (array[A_Index] == "f") {
  3590. width += 3
  3591. } else if (array[A_Index] == "g") {
  3592. width += 7
  3593. } else if (array[A_Index] == "h") {
  3594. width += 7
  3595. } else if (array[A_Index] == "i") {
  3596. width += 2
  3597. } else if (array[A_Index] == "j") {
  3598. width += 2
  3599. } else if (array[A_Index] == "k") {
  3600. width += 6
  3601. } else if (array[A_Index] == "l") {
  3602. width += 2
  3603. } else if (array[A_Index] == "m") {
  3604. width += 10
  3605. } else if (array[A_Index] == "n") {
  3606. width += 7
  3607. } else if (array[A_Index] == "o") {
  3608. width += 7
  3609. } else if (array[A_Index] == "p") {
  3610. width += 7
  3611. } else if (array[A_Index] == "q") {
  3612. width += 7
  3613. } else if (array[A_Index] == "r") {
  3614. width += 5
  3615. } else if (array[A_Index] == "s") {
  3616. width += 6
  3617. } else if (array[A_Index] == "t") {
  3618. width += 3
  3619. } else if (array[A_Index] == "u") {
  3620. width += 7
  3621. } else if (array[A_Index] == "v") {
  3622. width += 7
  3623. } else if (array[A_Index] == "w") {
  3624. width += 9
  3625. } else if (array[A_Index] == "x") {
  3626. width += 6
  3627. } else if (array[A_Index] == "y") {
  3628. width += 5
  3629. } else if (array[A_Index] == "z") {
  3630. width += 6
  3631. } else if (array[A_Index] == "A") {
  3632. width += 7
  3633. } else if (array[A_Index] == "B") {
  3634. width += 9
  3635. } else if (array[A_Index] == "C") {
  3636. width += 9
  3637. } else if (array[A_Index] == "D") {
  3638. width += 9
  3639. } else if (array[A_Index] == "E") {
  3640. width += 8
  3641. } else if (array[A_Index] == "F") {
  3642. width += 7
  3643. } else if (array[A_Index] == "G") {
  3644. width += 10
  3645. } else if (array[A_Index] == "H") {
  3646. width += 9
  3647. } else if (array[A_Index] == "I") {
  3648. width += 2
  3649. } else if (array[A_Index] == "J") {
  3650. width += 7
  3651. } else if (array[A_Index] == "K") {
  3652. width += 9
  3653. } else if (array[A_Index] == "L") {
  3654. width += 7
  3655. } else if (array[A_Index] == "M") {
  3656. width += 11
  3657. } else if (array[A_Index] == "N") {
  3658. width += 9
  3659. } else if (array[A_Index] == "O") {
  3660. width += 10
  3661. } else if (array[A_Index] == "P") {
  3662. width += 8
  3663. } else if (array[A_Index] == "Q") {
  3664. width += 10
  3665. } else if (array[A_Index] == "R") {
  3666. width += 9
  3667. } else if (array[A_Index] == "S") {
  3668. width += 8
  3669. } else if (array[A_Index] == "T") {
  3670. width += 8
  3671. } else if (array[A_Index] == "U") {
  3672. width += 9
  3673. } else if (array[A_Index] == "V") {
  3674. width += 7
  3675. } else if (array[A_Index] == "W") {
  3676. width += 11
  3677. } else if (array[A_Index] == "X") {
  3678. width += 8
  3679. } else if (array[A_Index] == "Y") {
  3680. width += 8
  3681. } else if (array[A_Index] == "Z") {
  3682. width += 8
  3683. } else if (array[A_Index] == ".") {
  3684. width += 2
  3685. } else if (array[A_Index] == "_") {
  3686. width += 6
  3687. } else if (array[A_Index] == "$") {
  3688. width += 7
  3689. } else if (array[A_Index] == "[") {
  3690. width += 3
  3691. } else if (array[A_Index] == "]") {
  3692. width += 3
  3693. }
  3694. }
  3695. return width
  3696. }
  3697. class JSON
  3698. {
  3699. class Load extends JSON.Functor
  3700. {
  3701. Call(self, ByRef text, reviver:="")
  3702. {
  3703. this.rev := IsObject(reviver) ? reviver : false
  3704. this.keys := this.rev ? {} : false
  3705. static quot := Chr(34), bashq := "\" . quot
  3706. , json_value := quot . "{[01234567890-tfn"
  3707. , json_value_or_array_closing := quot . "{[]01234567890-tfn"
  3708. , object_key_or_object_closing := quot . "}"
  3709. key := ""
  3710. is_key := false
  3711. root := {}
  3712. stack := [root]
  3713. next := json_value
  3714. pos := 0
  3715. while ((ch := SubStr(text, ++pos, 1)) != "") {
  3716. if InStr(" `t`r`n", ch)
  3717. continue
  3718. if !InStr(next, ch, 1)
  3719. this.ParseError(next, text, pos)
  3720. holder := stack[1]
  3721. is_array := holder.IsArray
  3722. if InStr(",:", ch) {
  3723. next := (is_key := !is_array && ch == ",") ? quot : json_value
  3724. } else if InStr("}]", ch) {
  3725. ObjRemoveAt(stack, 1)
  3726. next := stack[1]==root ? "" : stack[1].IsArray ? ",]" : ",}"
  3727. } else {
  3728. if InStr("{[", ch) {
  3729. static json_array := Func("Array").IsBuiltIn || ![].IsArray ? {IsArray: true} : 0
  3730. (ch == "{")
  3731. ? ( is_key := true
  3732. , value := {}
  3733. , next := object_key_or_object_closing )
  3734. : ( value := json_array ? new json_array : []
  3735. , next := json_value_or_array_closing )
  3736. ObjInsertAt(stack, 1, value)
  3737. if (this.keys)
  3738. this.keys[value] := []
  3739. } else {
  3740. if (ch == quot) {
  3741. i := pos
  3742. while (i := InStr(text, quot,, i+1)) {
  3743. value := StrReplace(SubStr(text, pos+1, i-pos-1), "\\", "\u005c")
  3744. static tail := A_AhkVersion<"2" ? 0 : -1
  3745. if (SubStr(value, tail) != "\")
  3746. break
  3747. }
  3748. if (!i)
  3749. this.ParseError("'", text, pos)
  3750. value := StrReplace(value,  "\/",  "/")
  3751. , value := StrReplace(value, bashq, quot)
  3752. , value := StrReplace(value,  "\b", "`b")
  3753. , value := StrReplace(value,  "\f", "`f")
  3754. , value := StrReplace(value,  "\n", "`n")
  3755. , value := StrReplace(value,  "\r", "`r")
  3756. , value := StrReplace(value,  "\t", "`t")
  3757. pos := i
  3758. i := 0
  3759. while (i := InStr(value, "\",, i+1)) {
  3760. if !(SubStr(value, i+1, 1) == "u")
  3761. this.ParseError("\", text, pos - StrLen(SubStr(value, i+1)))
  3762. uffff := Abs("0x" . SubStr(value, i+2, 4))
  3763. if (A_IsUnicode || uffff < 0x100)
  3764. value := SubStr(value, 1, i-1) . Chr(uffff) . SubStr(value, i+6)
  3765. }
  3766. if (is_key) {
  3767. key := value, next := ":"
  3768. continue
  3769. }
  3770. } else {
  3771. value := SubStr(text, pos, i := RegExMatch(text, "[\]\},\s]|$",, pos)-pos)
  3772. static number := "number", integer :="integer"
  3773. if value is %number%
  3774. {
  3775. if value is %integer%
  3776. value += 0
  3777. }
  3778. else if (value == "true" || value == "false")
  3779. value := %value% + 0
  3780. else if (value == "null")
  3781. value := ""
  3782. else
  3783. this.ParseError(next, text, pos, i)
  3784. pos += i-1
  3785. }
  3786. next := holder==root ? "" : is_array ? ",]" : ",}"
  3787. }
  3788. is_array? key := ObjPush(holder, value) : holder[key] := value
  3789. if (this.keys && this.keys.HasKey(holder))
  3790. this.keys[holder].Push(key)
  3791. }
  3792. }
  3793. return this.rev ? this.Walk(root, "") : root[""]
  3794. }
  3795. ParseError(expect, ByRef text, pos, len:=1)
  3796. {
  3797. static quot := Chr(34), qurly := quot . "}"
  3798. line := StrSplit(SubStr(text, 1, pos), "`n", "`r").Length()
  3799. col := pos - InStr(text, "`n",, -(StrLen(text)-pos+1))
  3800. msg := Format("{1}`n`nLine:`t{2}`nCol:`t{3}`nChar:`t{4}"
  3801. ,     (expect == "")     ? "Extra data"
  3802. : (expect == "'")    ? "Unterminated string starting at"
  3803. : (expect == "\")    ? "Invalid \escape"
  3804. : (expect == ":")    ? "Expecting ':' delimiter"
  3805. : (expect == quot)   ? "Expecting object key enclosed in double quotes"
  3806. : (expect == qurly)  ? "Expecting object key enclosed in double quotes or object closing '}'"
  3807. : (expect == ",}")   ? "Expecting ',' delimiter or object closing '}'"
  3808. : (expect == ",]")   ? "Expecting ',' delimiter or array closing ']'"
  3809. : InStr(expect, "]") ? "Expecting JSON value or array closing ']'"
  3810. :                      "Expecting JSON value(string, number, true, false, null, object or array)"
  3811. , line, col, pos)
  3812. static offset := A_AhkVersion<"2" ? -3 : -4
  3813. throw Exception(msg, offset, SubStr(text, pos, len))
  3814. }
  3815. Walk(holder, key)
  3816. {
  3817. value := holder[key]
  3818. if IsObject(value) {
  3819. for i, k in this.keys[value] {
  3820. v := this.Walk(value, k)
  3821. if (v != JSON.Undefined)
  3822. value[k] := v
  3823. else
  3824. ObjDelete(value, k)
  3825. }
  3826. }
  3827. return this.rev.Call(holder, key, value)
  3828. }
  3829. }
  3830. class Dump extends JSON.Functor
  3831. {
  3832. Call(self, value, replacer:="", space:="")
  3833. {
  3834. this.rep := IsObject(replacer) ? replacer : ""
  3835. this.gap := ""
  3836. if (space) {
  3837. static integer := "integer"
  3838. if space is %integer%
  3839. Loop, % ((n := Abs(space))>10 ? 10 : n)
  3840. this.gap .= " "
  3841. else
  3842. this.gap := SubStr(space, 1, 10)
  3843. this.indent := "`n"
  3844. }
  3845. return this.Str({"": value}, "")
  3846. }
  3847. Str(holder, key)
  3848. {
  3849. value := holder[key]
  3850. if (this.rep)
  3851. value := this.rep.Call(holder, key, ObjHasKey(holder, key) ? value : JSON.Undefined)
  3852. if IsObject(value) {
  3853. static type := A_AhkVersion<"2" ? "" : Func("Type")
  3854. if (type ? type.Call(value) == "Object" : ObjGetCapacity(value) != "") {
  3855. if (this.gap) {
  3856. stepback := this.indent
  3857. this.indent .= this.gap
  3858. }
  3859. is_array := value.IsArray
  3860. if (!is_array) {
  3861. for i in value
  3862. is_array := i == A_Index
  3863. until !is_array
  3864. }
  3865. str := ""
  3866. if (is_array) {
  3867. Loop, % value.Length() {
  3868. if (this.gap)
  3869. str .= this.indent
  3870. v := this.Str(value, A_Index)
  3871. str .= (v != "") ? v . "," : "null,"
  3872. }
  3873. } else {
  3874. colon := this.gap ? ": " : ":"
  3875. for k in value {
  3876. v := this.Str(value, k)
  3877. if (v != "") {
  3878. if (this.gap)
  3879. str .= this.indent
  3880. str .= this.Quote(k) . colon . v . ","
  3881. }
  3882. }
  3883. }
  3884. if (str != "") {
  3885. str := RTrim(str, ",")
  3886. if (this.gap)
  3887. str .= stepback
  3888. }
  3889. if (this.gap)
  3890. this.indent := stepback
  3891. return is_array ? "[" . str . "]" : "{" . str . "}"
  3892. }
  3893. } else
  3894. return ObjGetCapacity([value], 1)=="" ? value : this.Quote(value)
  3895. }
  3896. Quote(string)
  3897. {
  3898. static quot := Chr(34), bashq := "\" . quot
  3899. if (string != "") {
  3900. string := StrReplace(string,  "\",  "\\")
  3901. , string := StrReplace(string, quot, bashq)
  3902. , string := StrReplace(string, "`b",  "\b")
  3903. , string := StrReplace(string, "`f",  "\f")
  3904. , string := StrReplace(string, "`n",  "\n")
  3905. , string := StrReplace(string, "`r",  "\r")
  3906. , string := StrReplace(string, "`t",  "\t")
  3907. static rx_escapable := A_AhkVersion<"2" ? "O)[^\x20-\x7e]" : "[^\x20-\x7e]"
  3908. while RegExMatch(string, rx_escapable, m)
  3909. string := StrReplace(string, m.Value, Format("\u{1:04x}", Ord(m.Value)))
  3910. }
  3911. return quot . string . quot
  3912. }
  3913. }
  3914. Undefined[]
  3915. {
  3916. get {
  3917. static empty := {}, vt_empty := ComObject(0, &empty, 1)
  3918. return vt_empty
  3919. }
  3920. }
  3921. class Functor
  3922. {
  3923. __Call(method, ByRef arg, args*)
  3924. {
  3925. if IsObject(method)
  3926. return (new this).Call(method, arg, args*)
  3927. else if (method == "")
  3928. return (new this).Call(arg, args*)
  3929. }
  3930. }
  3931. }
  3932. SetWorkingDir, %A_ScriptDir%
  3933. SetTimer, AntiDecompile, 250
  3934. global baseURL := "https://fbi.comniemeer.de/"
  3935. global projectName := "FBI"
  3936. global fullProjectName := "Federal Bureau of Investigation"
  3937. version := "1.0.3"
  3938. IniRead, username, login.ini, login, username, %A_Space%
  3939. IniRead, password, login.ini, login, password, %A_Space%
  3940. if (username != "" && password != "") {
  3941. Sleep, 100
  3942. loginResult := URLDownloadToVar(baseURL . "api/keybinder.php?type=login&username=" . username . "&password=" . password . "&version=" . version)
  3943. FormatTime, time, , dd.MM.yyyy HH:mm:ss
  3944. FileAppend, [%time%] Loginergebnis: %loginResult%`n, log.txt
  3945. if (loginResult == "true") {
  3946. Goto, Start
  3947. } else if (loginResult == "false") {
  3948. ExitApp
  3949. } else {
  3950. ExitApp
  3951. }
  3952. } else {
  3953. IniWrite, % "", login.ini, login, username
  3954. IniWrite, % "", login.ini, login, password
  3955. ExitApp
  3956. }
  3957. return
  3958. Start:
  3959. {
  3960. newver := URLDownloadToVar(baseURL . "api/getsetting?key=version")
  3961. StringSplit, version_, version, .
  3962. StringSplit, newver_, newver, .
  3963. if (version_1 < newver_1 || (version_1 <= newver_1 && version_2 < newver_2) || (version_1 <= newver_1 && version_2 <= newver_2 && version_3 < newver_3)) {
  3964. changelog := URLDownloadToVar(baseURL . "api/getupdatelog?version=" . newver . "&single")
  3965. MsgBox, 4, %projectName% Keybinder - Version %version%, Es wurde eine neue Keybinderversion (Version %newver%) veröffentlicht!`nMöchtest du diese nun herunterladen?`n`n%changelog%
  3966. IfMsgBox, Yes
  3967. {
  3968. MsgBox, 64, Update, Das Update wird nun heruntergeladen.`nDieser Vorgang kann bis zu 20 Sekunden dauern., 3
  3969. URLDownloadToVar(baseURL . "api/keybinder.php?type=update&username=" . username . "&password=" . password . "&version=" . newver)
  3970. extraVersion := ""
  3971. FileMove, %projectName%%extraVersion%.exe, %projectName%%extraVersion%_%version%.exe
  3972. Sleep, 1000
  3973. URLDownloadToFile, %baseURL%downloads/%projectName%%extraVersion%.exe, %projectName%%extraVersion%.exe
  3974. FileDelete, %projectName%%extraVersion%_%version%.exe
  3975. if (ErrorLevel) {
  3976. MsgBox, 64, Information, Die %projectName%%extraVersion%_%version%.exe konnte nicht gelöscht werden. Bitte lösche diese manuell!
  3977. }
  3978. ExitApp
  3979. }
  3980. }
  3981. defaultHotkeysArray := Object()
  3982. defaultHotkeysArray["atkWanteds"] := "!Numpad1"
  3983. defaultHotkeysArray["escapeWanteds"] := "!Numpad2"
  3984. defaultHotkeysArray["refusalWanteds"] := "!Numpad3"
  3985. defaultHotkeysArray["obstructionWanteds"] := "!Numpad4"
  3986. defaultHotkeysArray["possessionWanteds"] := "!Numpad5"
  3987. defaultHotkeysArray["tradeWanteds"] := "!Numpad6"
  3988. defaultHotkeysArray["escapeAidWanteds"] := "!Numpad7"
  3989. defaultHotkeysArray["unauthorizedEnterWanteds"] := "!Numpad9"
  3990. defaultHotkeysArray["hackingWanteds"] := "!N"
  3991. defaultHotkeysArray["customsEscapeWanteds"] := "!Z"
  3992. defaultHotkeysArray["vehicleTheftWanteds"] := "!K"
  3993. defaultHotkeysArray["insultingWanteds"] := "!H"
  3994. defaultHotkeysArray["useOfWeaponsWanteds"] := "!I"
  3995. defaultHotkeysArray["possessionOfWeaponsWanteds"] := "!U"
  3996. defaultHotkeysArray["briberyWanteds"] := "!B"
  3997. defaultHotkeysArray["emergencyAbuseWanteds"] := "!^"
  3998. defaultHotkeysArray["escWanteds"] := "!E"
  3999. defaultHotkeysArray["clearWanteds"] := "~-"
  4000. defaultHotkeysArray["secondRowPoints"] := "~^Numpad0"
  4001. defaultHotkeysArray["roadHazardPoints"] := "~^Numpad1"
  4002. defaultHotkeysArray["wrongSitePoints"] := "~^Numpad2"
  4003. defaultHotkeysArray["speedPoints"] := "~^Numpad3"
  4004. defaultHotkeysArray["rightOfWayPoints"] := "~^Numpad4"
  4005. defaultHotkeysArray["offsitePoints"] := "~^Numpad5"
  4006. defaultHotkeysArray["lightPoints"] := "~^Numpad6"
  4007. defaultHotkeysArray["noParkingPoints"] := "~^Numpad7"
  4008. defaultHotkeysArray["influenceOfDrugsPoints"] := "~^Numpad8"
  4009. defaultHotkeysArray["clearPoints"] := "!-"
  4010. defaultHotkeysArray["motorSystem"] := "~1"
  4011. defaultHotkeysArray["lock"] := "~Y"
  4012. defaultHotkeysArray["light"] := "~+1"
  4013. defaultHotkeysArray["uclight"] := "~B"
  4014. defaultHotkeysArray["uca"] := "~J"
  4015. defaultHotkeysArray["repeat"] := "~ä"
  4016. defaultHotkeysArray["megaFollow"] := "~Numpad0"
  4017. defaultHotkeysArray["megaControl"] := "~Numpad1"
  4018. defaultHotkeysArray["megaStop"] := "~Numpad2"
  4019. defaultHotkeysArray["megaShootWarning"] := "~Numpad3"
  4020. defaultHotkeysArray["megaGetOutOfCar"] := "~Numpad4"
  4021. defaultHotkeysArray["megaClear"] := "~Numpad5"
  4022. defaultHotkeysArray["megaWeapons"] := "~Numpad6"
  4023. defaultHotkeysArray["megaLeave"] := "~Numpad9"
  4024. defaultHotkeysArray["megaStopFollow"] := "!NumpadEnter"
  4025. defaultHotkeysArray["megaRoadTrafficAct"] := "~NumpadDot"
  4026. defaultHotkeysArray["equip"] := "!F4"
  4027. defaultHotkeysArray["heal"] := "^F4"
  4028. defaultHotkeysArray["equipProfile1"] := "F4"
  4029. defaultHotkeysArray["equipProfile2"] := "F5"
  4030. defaultHotkeysArray["equipProfile3"] := "F6"
  4031. defaultHotkeysArray["members"] := "~M"
  4032. defaultHotkeysArray["orgmembers"] := "!M"
  4033. defaultHotkeysArray["backup"] := "~NumpadAdd"
  4034. defaultHotkeysArray["backupWh"] := "~^NumpadAdd"
  4035. defaultHotkeysArray["noBackup"] := "!NumpadAdd"
  4036. defaultHotkeysArray["hqPosition"] := "!^P"
  4037. defaultHotkeysArray["dPosition"] := "~^P"
  4038. defaultHotkeysArray["fPosition"] := "!P"
  4039. defaultHotkeysArray["rPosition"] := "~P"
  4040. defaultHotkeysArray["acceptJob"] := "~´"
  4041. defaultHotkeysArray["doneJob"] := "!´"
  4042. defaultHotkeysArray["acceptJobD"] := "~^´"
  4043. defaultHotkeysArray["doneJobD"] := "^!´"
  4044. defaultHotkeysArray["wantedAll"] := "LWin"
  4045. defaultHotkeysArray["wantedLS"] := "LWin & 1"
  4046. defaultHotkeysArray["wantedSF"] := "LWin & 2"
  4047. defaultHotkeysArray["wantedLV"] := "LWin & 3"
  4048. defaultHotkeysArray["wantedInt"] := "LWin & 4"
  4049. defaultHotkeysArray["autoAcceptEmergency"] := "~^"
  4050. defaultHotkeysArray["acceptEmergency"] := "~+^"
  4051. defaultHotkeysArray["autoImprison"] := "~#"
  4052. defaultHotkeysArray["imprison"] := "~Numpad8"
  4053. defaultHotkeysArray["arrestSlots"] := "!#"
  4054. defaultHotkeysArray["resetArrestSlots"] := "F9"
  4055. defaultHotkeysArray["arrest"] := "~Numpad7"
  4056. defaultHotkeysArray["uncuff"] := "~U"
  4057. defaultHotkeysArray["check"] := "~K"
  4058. defaultHotkeysArray["askCheck"] := "~2"
  4059. defaultHotkeysArray["askTrunkCheck"] := "^2"
  4060. defaultHotkeysArray["openTrunk"] := "^K"
  4061. defaultHotkeysArray["checkTrunk"] := "~+K"
  4062. defaultHotkeysArray["askTrunkOpen"] := "~ß"
  4063. defaultHotkeysArray["askPapers"] := "~3"
  4064. defaultHotkeysArray["cooperation"] := "~4"
  4065. defaultHotkeysArray["getOutOfCar"] := "~5"
  4066. defaultHotkeysArray["stayInCar"] := "~^5"
  4067. defaultHotkeysArray["arrestedCar"] := "~6"
  4068. defaultHotkeysArray["arrestedFoot"] := "~7"
  4069. defaultHotkeysArray["putWeaponsAway"] := "~I"
  4070. defaultHotkeysArray["grab"] := "~9"
  4071. defaultHotkeysArray["ungrab"] := "~^9"
  4072. defaultHotkeysArray["useDrugs"] := "F1"
  4073. defaultHotkeysArray["togCellphone"] := "!F1"
  4074. defaultHotkeysArray["eatFish"] := "F2"
  4075. defaultHotkeysArray["firstAid"] := "F3"
  4076. defaultHotkeysArray["countdown"] := "~End"
  4077. defaultHotkeysArray["stopwatch"] := "~`,"
  4078. defaultHotkeysArray["stopAutomaticSystems"] := "~<"
  4079. defaultHotkeysArray["openDoor"] := "~NumpadSub"
  4080. defaultHotkeysArray["openCustoms"] := "!NumpadSub"
  4081. defaultHotkeysArray["closeCustomsControl"] := "~sc135"
  4082. defaultHotkeysArray["openCustomsControl"] := "!sc135"
  4083. defaultHotkeysArray["govClosedCustoms"] := "~NumpadMult"
  4084. defaultHotkeysArray["govOpenedCustoms"] := "!NumpadMult"
  4085. defaultHotkeysArray["closeCustomsRequest"] := "!C"
  4086. defaultHotkeysArray["openCustomsRequest"] := "~^C"
  4087. defaultHotkeysArray["ram"] := "~8"
  4088. defaultHotkeysArray["pause"] := "~Pause"
  4089. IfNotExist, Hotkeys.ini
  4090. {
  4091. For key, value in defaultHotkeysArray {
  4092. IniWrite, %value%, Hotkeys.ini, Hotkeys, %key%
  4093. }
  4094. }
  4095. For key in defaultHotkeysArray {
  4096. IniRead, hk, Hotkeys.ini, Hotkeys, %key%, %A_Space%
  4097. if (hk) {
  4098. Hotkey, %hk%, %key%Label
  4099. savedHK%key% := hk
  4100. }
  4101. StringReplace, %key%NoMods, hk, ~
  4102. }
  4103. IfNotExist, images
  4104. {
  4105. FileCreateDir, images
  4106. }
  4107. IfNotExist, images\Banner-%projectName%.png
  4108. {
  4109. URLDownloadToFile, %baseURL%downloads/Banner-%projectName%.png, Banner-%projectName%.png
  4110. FileMove, Banner-%projectName%.png, images\Banner-%projectName%.png
  4111. }
  4112. IfNotExist, bin
  4113. {
  4114. FileCreateDir, bin
  4115. }
  4116. IfNotExist, bin\overlay.dll
  4117. {
  4118. URLDownloadToFile, %baseURL%downloads/overlay.dll, overlay.dll
  4119. FileMove, overlay.dll, bin\overlay.dll
  4120. }
  4121. #NoEnv
  4122. API_ERROR_NONE                              := 0
  4123. API_ERROR_SNAPSHOT_FAILED                   := 1
  4124. API_ERROR_SAMP_NOT_FOUND                    := 2
  4125. API_ERROR_REMOTE_MEMORY_ALLOCATION_FAILED   := 3
  4126. API_ERROR_WRITEPROCESSMEMORY_FAILED         := 4
  4127. API_ERROR_GETPROCADDRESS_FAILED             := 5
  4128. API_ERROR_REMOTETHREAD_FAILED               := 6
  4129. API_ERROR_INVALID_GTA_HANDLE                := 7
  4130. API_ERROR_PIPE_DOESNT_RESPOND               := 8
  4131. API_ERROR_STRING_TOO_LONG                   := 9
  4132. PATH_API := RelToAbs(A_ScriptDir, "bin\overlay.dll")
  4133. dllModule := DllCall("LoadLibrary", Str, PATH_API)
  4134. if(dllModule == -1 || dllModule == 0)
  4135. {
  4136. MsgBox, 48, API - Fehler, Die overlay.dll konnte nicht gefunden werden.`nDer Keybinder wird nun beendet.
  4137. ExitApp
  4138. }
  4139. Init_func               := DllCall("GetProcAddress", UInt, dllModule, Str, "API_Init")
  4140. SetParam_func           := DllCall("GetProcAddress", UInt, dllModule, Str, "API_SetParam")
  4141. ReadMemory_func         := DllCall("GetProcAddress", UInt, dllModule, Str, "API_ReadMemory")
  4142. WriteMemory_func        := DllCall("GetProcAddress", UInt, dllModule, Str, "API_WriteMemory")
  4143. GetBasePointer_func     := DllCall("GetProcAddress", UInt, dllModule, Str, "API_GetBasePointer")
  4144. GetCommandLine_func     := DllCall("GetProcAddress", UInt, dllModule, Str, "API_GetCommandLine")
  4145. GetLastError_func       := DllCall("GetProcAddress", UInt, dllModule, Str, "API_GetLastError")
  4146. SetLastError_func       := DllCall("GetProcAddress", UInt, dllModule, Str, "API_SetLastError")
  4147. TextCreate_func         := DllCall("GetProcAddress", UInt, dllModule, Str, "API_TextCreate")
  4148. TextDestroy_func        := DllCall("GetProcAddress", UInt, dllModule, Str, "API_TextDestroy")
  4149. TextSetShadow_func      := DllCall("GetProcAddress", UInt, dllModule, Str, "API_TextSetShadow")
  4150. TextSetShown_func       := DllCall("GetProcAddress", UInt, dllModule, Str, "API_TextSetShown")
  4151. TextSetColor_func       := DllCall("GetProcAddress", UInt, dllModule, Str, "API_TextSetColor")
  4152. TextSetPos_func         := DllCall("GetProcAddress", UInt, dllModule, Str, "API_TextSetPos")
  4153. TextSetString_func      := DllCall("GetProcAddress", UInt, dllModule, Str, "API_TextSetString")
  4154. TextUpdate_func         := DllCall("GetProcAddress", UInt, dllModule, Str, "API_TextUpdate")
  4155. BoxCreate_func          := DllCall("GetProcAddress", UInt, dllModule, Str, "API_BoxCreate")
  4156. BoxDestroy_func         := DllCall("GetProcAddress", UInt, dllModule, Str, "API_BoxDestroy")
  4157. BoxSetShown_func        := DllCall("GetProcAddress", UInt, dllModule, Str, "API_BoxSetShown")
  4158. BoxSetBorder_func       := DllCall("GetProcAddress", UInt, dllModule, Str, "API_BoxSetBorder")
  4159. BoxSetBorderColor_func  := DllCall("GetProcAddress", UInt, dllModule, Str, "API_BoxSetBorderColor")
  4160. BoxSetColor_func        := DllCall("GetProcAddress", UInt, dllModule, Str, "API_BoxSetColor")
  4161. BoxSetHeight_func       := DllCall("GetProcAddress", UInt, dllModule, Str, "API_BoxSetHeight")
  4162. BoxSetPos_func          := DllCall("GetProcAddress", UInt, dllModule, Str, "API_BoxSetPos")
  4163. BoxSetWidth_func        := DllCall("GetProcAddress", UInt, dllModule, Str, "API_BoxSetWidth")
  4164. LineCreate_func         := DllCall("GetProcAddress", UInt, dllModule, Str, "API_LineCreate")
  4165. LineDestroy_func        := DllCall("GetProcAddress", UInt, dllModule, Str, "API_LineDestroy")
  4166. LineSetShown_func       := DllCall("GetProcAddress", UInt, dllModule, Str, "API_LineSetShown")
  4167. LineSetColor_func       := DllCall("GetProcAddress", UInt, dllModule, Str, "API_LineSetColor")
  4168. LineSetWidth_func       := DllCall("GetProcAddress", UInt, dllModule, Str, "API_LineSetWidth")
  4169. LineSetPos_func         := DllCall("GetProcAddress", UInt, dllModule, Str, "API_LineSetPos")
  4170. ImageCreate_func        := DllCall("GetProcAddress", UInt, dllModule, Str, "API_ImageCreate")
  4171. ImageDestroy_func       := DllCall("GetProcAddress", UInt, dllModule, Str, "API_ImageDestroy")
  4172. ImageSetShown_func      := DllCall("GetProcAddress", UInt, dllModule, Str, "API_ImageSetShown")
  4173. ImageSetAlign_func      := DllCall("GetProcAddress", UInt, dllModule, Str, "API_ImageSetAlign")
  4174. ImageSetPos_func        := DllCall("GetProcAddress", UInt, dllModule, Str, "API_ImageSetPos")
  4175. ImageSetRotation_func   := DllCall("GetProcAddress", UInt, dllModule, Str, "API_ImageSetRotation")
  4176. DestroyAllVisual_func   := DllCall("GetProcAddress", UInt, dllModule, Str, "API_DestroyAllVisual")
  4177. ShowAllVisual_func      := DllCall("GetProcAddress", UInt, dllModule, Str, "API_ShowAllVisual")
  4178. HideAllVisual_func      := DllCall("GetProcAddress", UInt, dllModule, Str, "API_HideAllVisual")
  4179. Init()
  4180. {
  4181. global Init_func
  4182. res := DllCall(Init_func)
  4183. return res
  4184. }
  4185. SetParam(str_Name, str_Value)
  4186. {
  4187. global SetParam_func
  4188. res := DllCall(SetParam_func, Str, str_Name, Str, str_Value)
  4189. return res
  4190. }
  4191. ReadMemory(addr, size, ByRef data)
  4192. {
  4193. global ReadMemory_func
  4194. VarSetCapacity(data,size)
  4195. res := DllCall(ReadMemory_func, UInt, addr, UInt, size, StrP, data)
  4196. return res
  4197. }
  4198. GetBasePointer(dll)
  4199. {
  4200. global GetBasePointer_func
  4201. res :=DllCall(GetBasePointer_func, Str, dll)
  4202. return res
  4203. }
  4204. GetCommandLine(ByRef line)
  4205. {
  4206. global GetCommandLine_func
  4207. VarSetCapacity(line,512,0)
  4208. res := DllCall(GetCommandLine_func, StrP, line)
  4209. return res
  4210. }
  4211. GetLastError()
  4212. {
  4213. global GetLastError_func
  4214. res:=DllCall(GetLastError_func)
  4215. return res
  4216. }
  4217. SetLastError(error)
  4218. {
  4219. global SetLastError_func
  4220. res := DllCall(SetLastError_func, Int, error)
  4221. return res
  4222. }
  4223. TextCreate(Font, fontsize, bold, italic, x, y, color, text, shadow, show)
  4224. {
  4225. global TextCreate_func
  4226. res := DllCall(TextCreate_func,Str,Font,Int,fontsize,UChar,bold,UChar,italic,Int,x,Int,y,UInt,color,Str,text,UChar,shadow,UChar,show)
  4227. return res
  4228. }
  4229. TextDestroy(id)
  4230. {
  4231. global TextDestroy_func
  4232. res := DllCall(TextDestroy_func,Int,id)
  4233. return res
  4234. }
  4235. TextSetShadow(id, shadow)
  4236. {
  4237. global TextSetShadow_func
  4238. res := DllCall(TextSetShadow_func,Int,id,UChar,shadow)
  4239. return res
  4240. }
  4241. TextSetShown(id, show)
  4242. {
  4243. global TextSetShown_func
  4244. res := DllCall(TextSetShown_func,Int,id,UChar,show)
  4245. return res
  4246. }
  4247. TextSetColor(id,color)
  4248. {
  4249. global TextSetColor_func
  4250. res := DllCall(TextSetColor_func,Int,id,UInt,color)
  4251. return res
  4252. }
  4253. TextSetPos(id,x,y)
  4254. {
  4255. global TextSetPos_func
  4256. res := DllCall(TextSetPos_func,Int,id,Int,x,Int,y)
  4257. return res
  4258. }
  4259. TextSetString(id,Text)
  4260. {
  4261. global TextSetString_func
  4262. res := DllCall(TextSetString_func,Int,id,Str,Text)
  4263. return res
  4264. }
  4265. TextUpdate(id,Font,Fontsize,bold,italic)
  4266. {
  4267. global TextUpdate_func
  4268. res := DllCall(TextUpdate_func,Int,id,Str,Font,int,Fontsize,UChar,bold,UChar,italic)
  4269. return res
  4270. }
  4271. BoxCreate(x,y,width,height,Color,show)
  4272. {
  4273. global BoxCreate_func
  4274. res := DllCall(BoxCreate_func,Int,x,Int,y,Int,width,Int,height,UInt,Color,UChar,show)
  4275. return res
  4276. }
  4277. BoxDestroy(id)
  4278. {
  4279. global BoxDestroy_func
  4280. res := DllCall(BoxDestroy_func,Int,id)
  4281. return res
  4282. }
  4283. BoxSetShown(id,Show)
  4284. {
  4285. global BoxSetShown_func
  4286. res := DllCall(BoxSetShown_func,Int,id,UChar,Show)
  4287. return res
  4288. }
  4289. BoxSetBorder(id,height,Show)
  4290. {
  4291. global BoxSetBorder_func
  4292. res := DllCall(BoxSetBorder_func,Int,id,Int,height,Int,Show)
  4293. return res
  4294. }
  4295. BoxSetBorderColor(id,Color)
  4296. {
  4297. global BoxSetBorderColor_func
  4298. res := DllCall(BoxSetBorderColor_func,Int,id,UInt,Color)
  4299. return res
  4300. }
  4301. BoxSetColor(id,Color)
  4302. {
  4303. global BoxSetColor_func
  4304. res := DllCall(BoxSetColor_func,Int,id,UInt,Color)
  4305. return res
  4306. }
  4307. BoxSetHeight(id,height)
  4308. {
  4309. global BoxSetHeight_func
  4310. res := DllCall(BoxSetHeight_func,Int,id,Int,height)
  4311. return res
  4312. }
  4313. BoxSetPos(id,x,y)
  4314. {
  4315. global BoxSetPos_func
  4316. res := DllCall(BoxSetPos_func,Int,id,Int,x,Int,y)
  4317. return res
  4318. }
  4319. BoxSetWidth(id,width)
  4320. {
  4321. global BoxSetWidth_func
  4322. res := DllCall(BoxSetWidth_func,Int,id,Int,width)
  4323. return res
  4324. }
  4325. LineCreate(x1,y1,x2,y2,width,color,show)
  4326. {
  4327. global LineCreate_func
  4328. res := DllCall(LineCreate_func,Int,x1,Int,y1,Int,x2,Int,y2,Int,Width,UInt,color,UChar,show)
  4329. return res
  4330. }
  4331. LineDestroy(id)
  4332. {
  4333. global LineDestroy_func
  4334. res := DllCall(LineDestroy_func,Int,id)
  4335. return res
  4336. }
  4337. LineSetShown(id,show)
  4338. {
  4339. global LineSetShown_func
  4340. res := DllCall(LineSetShown_func,Int,id,UChar,show)
  4341. return res
  4342. }
  4343. LineSetColor(id,color)
  4344. {
  4345. global LineSetColor_func
  4346. res := DllCall(LineSetColor_func,Int,id,UInt,color)
  4347. return res
  4348. }
  4349. LineSetWidth(id, width)
  4350. {
  4351. global LineSetWidth_func
  4352. res := DllCall(LineSetWidth_func,Int,id,Int,width)
  4353. return res
  4354. }
  4355. LineSetPos(id,x1,y1,x2,y2)
  4356. {
  4357. global LineSetPos_func
  4358. res := DllCall(LineSetPos_func,Int,id,Int,x1,Int,y1,Int,x2,Int,y2)
  4359. return res
  4360. }
  4361. ImageCreate(path, x, y, rotation, align, show)
  4362. {
  4363. global ImageCreate_func
  4364. res := DllCall(ImageCreate_func, Str, path, Int, x, Int, y, Int, rotation, Int, align, UChar, show)
  4365. return res
  4366. }
  4367. ImageDestroy(id)
  4368. {
  4369. global ImageDestroy_func
  4370. res := DllCall(ImageDestroy_func,Int,id)
  4371. return res
  4372. }
  4373. ImageSetShown(id,show)
  4374. {
  4375. global ImageSetShown_func
  4376. res := DllCall(ImageSetShown_func,Int,id,UChar,show)
  4377. return res
  4378. }
  4379. ImageSetAlign(id,align)
  4380. {
  4381. global ImageSetAlign_func
  4382. res := DllCall(ImageSetAlign_func,Int,id,Int,align)
  4383. return res
  4384. }
  4385. ImageSetPos(id, x, y)
  4386. {
  4387. global ImageSetPos_func
  4388. res := DllCall(ImageSetPos_func,Int,id,Int,x, Int, y)
  4389. return res
  4390. }
  4391. ImageSetRotation(id, rotation)
  4392. {
  4393. global ImageSetRotation_func
  4394. res := DllCall(ImageSetRotation_func,Int,id,Int, rotation)
  4395. return res
  4396. }
  4397. DestroyAllVisual()
  4398. {
  4399. global DestroyAllVisual_func
  4400. res := DllCall(DestroyAllVisual_func)
  4401. return res
  4402. }
  4403. ShowAllVisual()
  4404. {
  4405. global ShowAllVisual_func
  4406. res := DllCall(ShowAllVisual_func)
  4407. return res
  4408. }
  4409. HideAllVisual()
  4410. {
  4411. global HideAllVisual_func
  4412. res := DllCall(HideAllVisual_func )
  4413. return res
  4414. }
  4415. DecimalToHex(Var){
  4416. SetFormat, IntegerFast, hex
  4417. Dec2Hex += Var
  4418. Dec2Hex .= ""
  4419. SetFormat, IntegerFast, d
  4420. StringTrimLeft, Dec2Hex, Dec2Hex, 2
  4421. StringUpper, Dec2Hex, Dec2Hex
  4422. sDec2Hex .= Dec2Hex
  4423. return sDec2Hex
  4424. }
  4425. RelToAbs(root, dir, s = "\") {
  4426. pr := SubStr(root, 1, len := InStr(root, s, "", InStr(root, s . s) + 2) - 1)
  4427. , root := SubStr(root, len + 1), sk := 0
  4428. If InStr(root, s, "", 0) = StrLen(root)
  4429. StringTrimRight, root, root, 1
  4430. If InStr(dir, s, "", 0) = StrLen(dir)
  4431. StringTrimRight, dir, dir, 1
  4432. Loop, Parse, dir, %s%
  4433. {
  4434. If A_LoopField = ..
  4435. StringLeft, root, root, InStr(root, s, "", 0) - 1
  4436. Else If A_LoopField =
  4437. root =
  4438. Else If A_LoopField != .
  4439. Continue
  4440. StringReplace, dir, dir, %A_LoopField%%s%
  4441. }
  4442. Return, pr . root . s . dir
  4443. }
  4444. SetParam("use_window", "1")
  4445. SetParam("window", "GTA:SA:MP")
  4446. mdc := []
  4447. IniRead, lockSystem, settings.ini, Einstellungen, Locksystem, 1
  4448. IniRead, motorSystem, settings.ini, Einstellungen, Motorsystem, 1
  4449. IniRead, takeSystem, settings.ini, Einstellungen, Takesystem, 1
  4450. IniRead, autoWanteds, settings.ini, Einstellungen, AutoWanteds, 1
  4451. IniRead, fillSystem, settings.ini, Einstellungen, Tanksystem, 1
  4452. IniRead, customsSystem, settings.ini, Einstellungen, Zollsystem, 1
  4453. IniRead, lottoSystem, settings.ini, Einstellungen, Lottosystem, 1
  4454. IniRead, lottoNumber, settings.ini, Einstellungen, Lottozahl, 0
  4455. IniRead, chatlogSaver, settings.ini, Einstellungen, Chatlog, 1
  4456. IniRead, admin, settings.ini, Einstellungen, Admin, 0
  4457. IniRead, primaryColor, settings.ini, Einstellungen, Primärfarbe, %A_Space%
  4458. IniRead, secondaryColor, settings.ini, Einstellungen, Sekundärfarbe, %A_Space%
  4459. IniRead, antispamSystem, settings.ini, Einstellungen, Antispamsystem, 1
  4460. IniRead, autoFindLastEscapee, settings.ini, Einstellungen, LetztenFluechtigenFinden, 0
  4461. IniRead, department, settings.ini, Einstellungen, Abteilung, %A_Space%
  4462. IniRead, ownPrefix, settings.ini, Einstellungen, OwnPrefix, %A_Space%
  4463. IniRead, overlayX, settings.ini, Overlay, PositionX, 565
  4464. IniRead, overlayY, settings.ini, Overlay, PositionY, 440
  4465. IniRead, taxes, settings.ini, Steuern, Steuersatz, 1
  4466. IniRead, alternativePlayerInput, settings.ini, Einstellungen, AltPlayerInput, %A_Space%
  4467. if (alternativePlayerInput == "") {
  4468. alternativePlayerInput := false
  4469. IniWrite, %alternativePlayerInput%, settings.ini, Einstellungen, AltPlayerInput
  4470. }
  4471. Loop, 3 {
  4472. profileID := A_Index
  4473. Loop, 6 {
  4474. IniRead, profile%profileID%_%A_Index%, settings.ini, Ausrüstungsprofile, Profil%profileID%_%A_Index%, %A_Space%
  4475. }
  4476. }
  4477. IniRead, ucSkin, settings.ini, Ausrüstungsprofile, UCSkin, 0
  4478. IniRead, armour, settings.ini, Ausrüstungsprofile, Schutzweste, 0
  4479. primaryColor := StrReplace(primaryColor, "{", "")
  4480. primaryColor := StrReplace(primaryColor, "}", "")
  4481. secondaryColor := StrReplace(secondaryColor, "{", "")
  4482. secondaryColor := StrReplace(secondaryColor, "}", "")
  4483. if (primaryColor == "") {
  4484. primaryColor := "0033FF"
  4485. }
  4486. if (secondaryColor == "") {
  4487. secondaryColor := "FF9900"
  4488. }
  4489. global PRIMCOL := "{" . primaryColor . "}"
  4490. global SECCOL := "{" . secondaryColor . "}"
  4491. global PREFIX := "{FFFFFF}|" . PRIMCOL . projectName . "{FFFFFF}| "
  4492. if (ownPrefix != "") {
  4493. PREFIX := ownPrefix . " "
  4494. }
  4495. IniRead, overlayNameID, settings.ini, StatsOverlay, NameID, 1
  4496. IniRead, overlayNameHP, settings.ini, StatsOverlay, NameHP, 1
  4497. IniRead, overlayPosition, settings.ini, StatsOverlay, Position, 1
  4498. IniRead, overlayDate, settings.ini, StatsOverlay, Date, 1
  4499. IniRead, overlayWanteds, settings.ini, StatsOverlay, Wanteds, 1
  4500. IniRead, overlayPoints, settings.ini, StatsOverlay, Points, 1
  4501. IniRead, overlayChecks, settings.ini, StatsOverlay, Checks, 1
  4502. IniRead, overlayTazer, settings.ini, StatsOverlay, Tazer, 1
  4503. IniRead, overlayArrests, settings.ini, StatsOverlay, Arrests, 1
  4504. IniRead, overlaySuspectKills, settings.ini, StatsOverlay, SuspectKills, 1
  4505. IniRead, overlayDeathArrests, settings.ini, StatsOverlay, DeathArrests, 1
  4506. IniRead, overlayOfflineArrests, settings.ini, StatsOverlay, OfflineArrests, 1
  4507. IniRead, overlayArrestMoney, settings.ini, StatsOverlay, ArrestMoney, 1
  4508. IniRead, overlayTicketMoney, settings.ini, StatsOverlay, TicketMoney, 1
  4509. IniRead, overlayFishMoney, settings.ini, StatsOverlay, FishMoney, 1
  4510. IniRead, overlayTotalMoney, settings.ini, StatsOverlay, TotalMoney, 1
  4511. IniRead, overlayMarijuana, settings.ini, StatsOverlay, Marijuana, 1
  4512. IniRead, overlayDrugs, settings.ini, StatsOverlay, Drugs, 1
  4513. IniRead, overlayMats, settings.ini, StatsOverlay, Mats, 1
  4514. IniRead, overlayMotorStatus, settings.ini, StatsOverlay, MotorStatus, 1
  4515. IniRead, overlayLightStatus, settings.ini, StatsOverlay, LightStatus, 1
  4516. IniRead, overlayLockStatus, settings.ini, StatsOverlay, LockStatus, 1
  4517. IniRead, overlayFishStatus, settings.ini, StatsOverlay, FishStatus, 1
  4518. IniRead, overlayDistanceToCheckpoint, settings.ini, StatsOverlay, DistanceToCheckpoint, 1
  4519. IniRead, overlayPosX, settings.ini, StatsOverlay, PosX, 20
  4520. IniRead, overlayPosY, settings.ini, StatsOverlay, PosY, 215
  4521. IniRead, overlayColors, settings.ini, StatsOverlay, Colors, 1
  4522. IniRead, overlayItalic, settings.ini, StatsOverlay, Italic, 0
  4523. IniRead, overlayFont, settings.ini, StatsOverlay, Font, Arial
  4524. IniRead, overlayFontSize, settings.ini, StatsOverlay, FontSize, 7
  4525. IniRead, overlayBold, settings.ini, StatsOverlay, Bold, 1
  4526. IniRead, overlayColor, settings.ini, StatsOverlay, Color, FFFFFF
  4527. IniRead, mdcPosX, settings.ini, MDCOverlay, PosX, 495
  4528. IniRead, mdcPosY, settings.ini, MDCOverlay, PosY, 405
  4529. IniRead, mdcColors, settings.ini, MDCOverlay, Colors, 1
  4530. IniRead, mdcItalic, settings.ini, MDCOverlay, Italic, 0
  4531. IniRead, mdcLines, settings.ini, MDCOverlay, Lines, 15
  4532. IniRead, mdcFont, settings.ini, MDCOverlay, Font, Courier New
  4533. IniRead, mdcFontSize, settings.ini, MDCOverlay, FontSize, 7
  4534. IniRead, mdcBold, settings.ini, MDCOverlay, Bold, 1
  4535. IniRead, mdcColor, settings.ini, MDCOverlay, Color, 0174DF
  4536. IniRead, mdcBoxEnabled, settings.ini, MDCOverlay, Box, 1
  4537. if (overlayColors) {
  4538. overlayPrimColor := SECCOL
  4539. overlaySecColor := "{" . overlayColor . "}"
  4540. overlayPositiveColor := "{00FF00}"
  4541. overlayNegativeColor := "{FF0000}"
  4542. } else {
  4543. overlayPrimColor := ""
  4544. overlaySecColor := ""
  4545. overlayPositiveColor := ""
  4546. overlayNegativeColor := ""
  4547. }
  4548. if (mdcColors) {
  4549. mdcPrimColor := "{" . mdcColor . "}"
  4550. mdcSecColor := "{FFFFFF}"
  4551. mdcBackupColor := "{FF8000}"
  4552. } else {
  4553. mdcPrimColor := ""
  4554. mdcSecColor := ""
  4555. mdcBackupColor := ""
  4556. }
  4557. statsOverlayEnabled := false
  4558. mdcOverlayEnabled := false
  4559. IniRead, hotstring1Active, hotstrings.ini, 1, Active, 0
  4560. IniRead, hotstring2Active, hotstrings.ini, 2, Active, 0
  4561. IniRead, hotstring3Active, hotstrings.ini, 3, Active, 0
  4562. IniRead, hotstring4Active, hotstrings.ini, 4, Active, 0
  4563. IniRead, hotstring5Active, hotstrings.ini, 5, Active, 0
  4564. global hotstring1Active
  4565. global hotstring2Active
  4566. global hotstring3Active
  4567. global hotstring4Active
  4568. global hotstring5Active
  4569. IniRead, hotstring1, hotstrings.ini, 1, Hotstring, %A_Space%
  4570. IniRead, hotstring2, hotstrings.ini, 2, Hotstring, %A_Space%
  4571. IniRead, hotstring3, hotstrings.ini, 3, Hotstring, %A_Space%
  4572. IniRead, hotstring4, hotstrings.ini, 4, Hotstring, %A_Space%
  4573. IniRead, hotstring5, hotstrings.ini, 5, Hotstring, %A_Space%
  4574. global hotstring1
  4575. global hotstring2
  4576. global hotstring3
  4577. global hotstring4
  4578. global hotstring5
  4579. IniRead, hotstring1Text, hotstrings.ini, 1, Text, %A_Space%
  4580. IniRead, hotstring2Text, hotstrings.ini, 2, Text, %A_Space%
  4581. IniRead, hotstring3Text, hotstrings.ini, 3, Text, %A_Space%
  4582. IniRead, hotstring4Text, hotstrings.ini, 4, Text, %A_Space%
  4583. IniRead, hotstring5Text, hotstrings.ini, 5, Text, %A_Space%
  4584. hotstring1Text := StrReplace(hotstring1Text, "~", "`n")
  4585. hotstring2Text := StrReplace(hotstring2Text, "~", "`n")
  4586. hotstring3Text := StrReplace(hotstring3Text, "~", "`n")
  4587. hotstring4Text := StrReplace(hotstring4Text, "~", "`n")
  4588. hotstring5Text := StrReplace(hotstring5Text, "~", "`n")
  4589. global hotstring1Text
  4590. global hotstring2Text
  4591. global hotstring3Text
  4592. global hotstring4Text
  4593. global hotstring5Text
  4594. global registeredHotstrings := []
  4595. registerHotstrings()
  4596. wantedTickets := []
  4597. checkingPlayers := []
  4598. tasks := []
  4599. Loop, 5 {
  4600. arrest%A_Index% := -1
  4601. }
  4602. if (department == "") {
  4603. department := projectName
  4604. }
  4605. tv := false
  4606. watermode := false
  4607. airmode := false
  4608. afk := false
  4609. fishingPossible := true
  4610. oldHour := -1
  4611. timeout := true
  4612. lastLine0 := ""
  4613. lastLine1 := ""
  4614. Loop, 3 {
  4615. partner%A_Index% := -1
  4616. }
  4617. currentFish := 1
  4618. global statsFormat := "Personalien:\tGeschlecht: (\S+)\n\t\tPartner: (\S+)\n\n\t\tLevel: (\d+)\n\t\tRespekt: (\d+)\/(\d+)\n\t\tPayday: (\d+)\/(\d+) Minuten\n\nBerufe:\t\tFraktion: (.+)\tRang: (\d+)\n\t\tNebenjob: (\S+)\n\t\tCrew: (.+)\n\nFinanzen:\tBargeld: (\d+)\$\n\t\tKonto: (\d+)\$\n\t\tFestgeld: (\d+)\$\tZinssatz: (\d+)\.(\d+)\n\nStatistik:\tMorde: (\d+)\n\t\tGestorben: (\d+)\n\t\tVerbrechen: (\d+)\n\t\tSpielzeit: (\d+)h\n\t\tKnast: (\d+)\n\t\tWanteds: (\d+)\n\t\tVerwarnungen: (\d+)\/(\d+)\n\nInventar:\tMaterialien: (\d+) \(Safe: (\d+)\)\n\t\tDrogen: (\d+)g \(Safe: (\d+)g\)\n\t\tHandy \(Nr\. (\d+)\)(\n\t\tErste-Hilfe-Paket)?(\n\t\tBenzin Kanister)?\n\nSkills:\t\tWaffendealer: (\d+) \((\d+)\)\n\t\tDrogendealer: (\d+) \((\d+)\)\n\t\tAngler: (\d+)\n\t\tBusfahrer: (\d+)\t\tExp: (\d+)\/(\d+)\n\t\tAnwalt: (\d+)\t\tExp: (\d+)\n\t\tDetektiv: (\d+)\t\tExp: (\d+)\n\t\tPilot: (\d+)\n\t\tHochseefischer: (\d+)(\n\n{(\S+)}(\S+)( \(noch (.+)\))?)?"
  4619. SetTimer, Systeme, 100
  4620. SetTimer, UncuffTimer, 100
  4621. SetTimer, FillCustoms, 500
  4622. SetTimer, DrugTimer, 100
  4623. SetTimer, ChatlogSaver, 500
  4624. SetTimer, LottoTimer, 1000
  4625. SetTimer, MDCTimer, 100
  4626. SetTimer, TaskCheckTimer, 5000
  4627. Gui, Color, white
  4628. Gui, Font, S10 CDefault, Verdana
  4629. Gui, Add, Picture, x10 y10 w600 h200, images\Banner-%projectName%.png
  4630. Gui, Add, Button, x320 y230 w140 h40 gSettingsGUI, Einstellungen
  4631. Gui, Add, Button, x470 y230 w140 h40 gHotkeysGUI, Hotkeys
  4632. Gui, Add, Button, x320 y280 w140 h40 gSupport, Fehler melden
  4633. Gui, Add, Button, x470 y280 w140 h40 gHelpGUI, Hilfe
  4634. Gui, Add, Button, x320 y330 w140 h40 gControlPanel, Control Panel
  4635. Gui, Add, Button, x470 y330 w140 h40 gTeamSpeak, %projectName% - TS
  4636. Gui, Add, Button, x470 y450 w140 h40 gGuiClose, Schließen
  4637. Gui, Add, Groupbox, x10 y220 w300 h270, Neuigkeiten (Version %version%)
  4638. msg := URLDownloadToVar(baseURL . "api/getupdatelog?version=" . version . "&username=" . username . "&password=" . password)
  4639. StringReplace, update, msg, ', `r`n, All
  4640. Gui, Add, Edit, x20 y240 w280 h240 ReadOnly, %update%
  4641. Gui, Add, Groupbox, x320 y425 w140 h65, Versionsinfos
  4642. Gui, Add, Text, x330 y445 w120 h20, Overlay aktiv
  4643. Gui, Add, Text, x330 y465 w120 h20, User-Version
  4644. Gui, Show, w620 h500, %projectName% - Version: %version%
  4645. }
  4646. return
  4647. TeamSpeak:
  4648. {
  4649. teamspeak := URLDownloadToVar(baseURL . "api/getsetting?key=teamspeak")
  4650. run, ts3server://%teamspeak%
  4651. }
  4652. return
  4653. Support:
  4654. {
  4655. Run, %baseURL%feedback
  4656. }
  4657. return
  4658. ControlPanel:
  4659. {
  4660. Run, %baseURL%
  4661. }
  4662. return
  4663. GuiClose:
  4664. {
  4665. if (statsOverlayEnabled) {
  4666. TextDestroy(statsOverlay)
  4667. }
  4668. if (mdcOverlayEnabled) {
  4669. if (mdcBoxEnabled) {
  4670. BoxDestroy(mdcBox)
  4671. }
  4672. TextDestroy(mdcHeader)
  4673. TextDestroy(mdcText)
  4674. }
  4675. logoutResult := URLDownloadToVar(baseURL . "api/keybinder.php?type=logout&username=" . username . "&password=" . password . "&version=" . version)
  4676. FormatTime, time, , dd.MM.yyyy HH:mm:ss
  4677. FileAppend, [%time%] Logoutergebnis: %logoutResult%`n, log.txt
  4678. ExitApp
  4679. }
  4680. return
  4681. HotkeysGUI:
  4682. {
  4683. Gui, Hotkeys: Destroy
  4684. Gui, Hotkeys: Color, white
  4685. Gui, Hotkeys: Font, S10 CDefault, Verdana
  4686. Gui, Hotkeys: Add, Button, x340 y550 w130 h40 gResetHotkeys, Zurücksetzen
  4687. Gui, Hotkeys: Add, Button, x480 y550 w130 h40 gHotkeysGuiClose, Schließen
  4688. Gui, Hotkeys: Add, Tab, x0 y0 w620 h540, Seite 1|Seite 2|Seite 3
  4689. Gui, Hotkeys: Tab, Seite 1
  4690. Gui, Hotkeys: Add, Text, x10 y30 w170 h20 , Wtds: Angriff/Beschuss
  4691. Gui, Hotkeys: Add, Text, x10 y60 w170 h20 , Wtds: Flucht/-versuch
  4692. Gui, Hotkeys: Add, Text, x10 y90 w170 h20 , Wtds: Beihilfe Flucht
  4693. Gui, Hotkeys: Add, Text, x10 y120 w170 h20 , Wtds: Verweigerung
  4694. Gui, Hotkeys: Add, Text, x10 y150 w170 h20 , Wtds: Behinderung d.J.
  4695. Gui, Hotkeys: Add, Text, x10 y180 w170 h20 , Wtds: Besitz von ill. Geg.
  4696. Gui, Hotkeys: Add, Text, x10 y210 w170 h20 , Wtds: Handel mit ill. Geg.
  4697. Gui, Hotkeys: Add, Text, x10 y240 w170 h20 , Wtds: Unbefugter Betritt
  4698. Gui, Hotkeys: Add, Text, x10 y270 w170 h20 , Wtds: Wanted-Hacking
  4699. Gui, Hotkeys: Add, Text, x10 y300 w170 h20 , Wtds: Zollflucht
  4700. Gui, Hotkeys: Add, Text, x10 y330 w170 h20 , Wtds: Fahrzeugdiebstahl
  4701. Gui, Hotkeys: Add, Text, x10 y360 w170 h20 , Wtds: Beleidigung
  4702. Gui, Hotkeys: Add, Text, x10 y390 w170 h20 , Wtds: Waffengebrauch
  4703. Gui, Hotkeys: Add, Text, x10 y420 w170 h20 , Wtds: Waffenbesitz
  4704. Gui, Hotkeys: Add, Text, x10 y450 w170 h20 , Wtds: Bestechung
  4705. Gui, Hotkeys: Add, Text, x10 y480 w170 h20 , Wtds: Notrufmissbrauch
  4706. Gui, Hotkeys: Add, Text, x10 y510 w170 h20 , Wtds: ESC-Flucht
  4707. Gui, Hotkeys: Add, Hotkey, x190 y30 w120 h20 vatkWantedsHotkey gSaveHotkey, %atkWantedsNoMods%
  4708. Gui, Hotkeys: Add, Hotkey, x190 y60 w120 h20 vescapeWantedsHotkey gSaveHotkey, %escapeWantedsNoMods%
  4709. Gui, Hotkeys: Add, Hotkey, x190 y90 w120 h20 vescapeAidWantedsHotkey gSaveHotkey, %escapeAidWantedsNoMods%
  4710. Gui, Hotkeys: Add, Hotkey, x190 y120 w120 h20 vrefusalWantedsHotkey gSaveHotkey, %refusalWantedsNoMods%
  4711. Gui, Hotkeys: Add, Hotkey, x190 y150 w120 h20 vobstructionWantedsHotkey gSaveHotkey, %obstructionWantedsNoMods%
  4712. Gui, Hotkeys: Add, Hotkey, x190 y180 w120 h20 vpossessionMatsWantedsHotkey gSaveHotkey, %possessionWantedsNoMods%
  4713. Gui, Hotkeys: Add, Hotkey, x190 y210 w120 h20 vtradeWantedsHotkey gSaveHotkey, %tradeWantedsNoMods%
  4714. Gui, Hotkeys: Add, Hotkey, x190 y240 w120 h20 vunauthorizedEnterWantedsHotkey gSaveHotkey, %unauthorizedEnterWantedsNoMods%
  4715. Gui, Hotkeys: Add, Hotkey, x190 y270 w120 h20 vhackingWantedsHotkey gSaveHotkey, %hackingWantedsNoMods%
  4716. Gui, Hotkeys: Add, Hotkey, x190 y300 w120 h20 vcustomsEscapeWantedsHotkey gSaveHotkey, %customsEscapeWantedsNoMods%
  4717. Gui, Hotkeys: Add, Hotkey, x190 y330 w120 h20 vvehicleTheftWantedsHotkey gSaveHotkey, %vehicleTheftWantedsNoMods%
  4718. Gui, Hotkeys: Add, Hotkey, x190 y360 w120 h20 vinsultingWantedsHotkey gSaveHotkey, %insultingWantedsNoMods%
  4719. Gui, Hotkeys: Add, Hotkey, x190 y390 w120 h20 vuseOfWeaponsWantedsHotkey gSaveHotkey, %useOfWeaponsWantedsNoMods%
  4720. Gui, Hotkeys: Add, Hotkey, x190 y420 w120 h20 vpossessionOfWeaponsWantedsHotkey gSaveHotkey, %possessionOfWeaponsWantedsNoMods%
  4721. Gui, Hotkeys: Add, Hotkey, x190 y450 w120 h20 vbriberyWantedsHotkey gSaveHotkey, %briberyWantedsNoMods%
  4722. Gui, Hotkeys: Add, Hotkey, x190 y480 w120 h20 vemergencyAbuseWantedsHotkey gSaveHotkey, %emergencyAbuseWantedsNoMods%
  4723. Gui, Hotkeys: Add, Hotkey, x190 y510 w120 h20 vescWantedsHotkey gSaveHotkey, %escWantedsNoMods%
  4724. Gui, Hotkeys: Add, Text, x320 y30 w170 h20 , Punkte: Zweite Reihe
  4725. Gui, Hotkeys: Add, Text, x320 y60 w170 h20 , Punkte: SVG
  4726. Gui, Hotkeys: Add, Text, x320 y90 w170 h20 , Punkte: Falsche Seite
  4727. Gui, Hotkeys: Add, Text, x320 y120 w170 h20 , Punkte: Geschwindigkeit
  4728. Gui, Hotkeys: Add, Text, x320 y150 w170 h20 , Punkte: Vorfahrt
  4729. Gui, Hotkeys: Add, Text, x320 y180 w170 h20 , Punkte: Abseits
  4730. Gui, Hotkeys: Add, Text, x320 y210 w170 h20 , Punkte: Licht
  4731. Gui, Hotkeys: Add, Text, x320 y240 w170 h20 , Punkte: Parkverbot
  4732. Gui, Hotkeys: Add, Text, x320 y270 w170 h20 , Punkte: Drogeneinfluss
  4733. Gui, Hotkeys: Add, Text, x320 y300 w170 h20 , Punkte clearen
  4734. Gui, Hotkeys: Add, Text, x320 y330 w170 h20 , Motorsystem
  4735. Gui, Hotkeys: Add, Text, x320 y360 w170 h20 , Fahrzeug abschließen
  4736. Gui, Hotkeys: Add, Text, x320 y390 w170 h20 , Licht einschalten
  4737. Gui, Hotkeys: Add, Text, x320 y420 w170 h20 , /uclight
  4738. Gui, Hotkeys: Add, Text, x320 y450 w170 h20 , /uca
  4739. Gui, Hotkeys: Add, Text, x320 y480 w170 h20 , Eingabe wiederholen
  4740. Gui, Hotkeys: Add, Text, x320 y510 w170 h20 , Wanteds clearen
  4741. Gui, Hotkeys: Add, Hotkey, x490 y30 w120 h20 vsecondRowPointsHotkey gSaveHotkey, %secondRowPointsNoMods%
  4742. Gui, Hotkeys: Add, Hotkey, x490 y60 w120 h20 vroadHazardPointsHotkey gSaveHotkey, %roadHazardPointsNoMods%
  4743. Gui, Hotkeys: Add, Hotkey, x490 y90 w120 h20 vwrongSitePointsHotkey gSaveHotkey, %wrongSitePointsNoMods%
  4744. Gui, Hotkeys: Add, Hotkey, x490 y120 w120 h20 vspeedPointsHotkey gSaveHotkey, %speedPointsNoMods%
  4745. Gui, Hotkeys: Add, Hotkey, x490 y150 w120 h20 vrightOfWayPointsHotkey gSaveHotkey, %rightOfWayPointsNoMods%
  4746. Gui, Hotkeys: Add, Hotkey, x490 y180 w120 h20 voffsitePointsHotkey gSaveHotkey, %offsitePointsNoMods%
  4747. Gui, Hotkeys: Add, Hotkey, x490 y210 w120 h20 vlightPointsHotkey gSaveHotkey, %lightPointsNoMods%
  4748. Gui, Hotkeys: Add, Hotkey, x490 y240 w120 h20 vnoParkingPointsHotkey gSaveHotkey, %noParkingPointsNoMods%
  4749. Gui, Hotkeys: Add, Hotkey, x490 y270 w120 h20 vinfluenceOfDrugsPointsHotkey gSaveHotkey, %influenceOfDrugsPointsNoMods%
  4750. Gui, Hotkeys: Add, Hotkey, x490 y300 w120 h20 vclearPointsHotkey gSaveHotkey, %clearPointsNoMods%
  4751. Gui, Hotkeys: Add, Hotkey, x490 y330 w120 h20 vmotorSystemHotkey gSaveHotkey, %motorSystemNoMods%
  4752. Gui, Hotkeys: Add, Hotkey, x490 y360 w120 h20 vlockHotkey gSaveHotkey, %lockNoMods%
  4753. Gui, Hotkeys: Add, Hotkey, x490 y390 w120 h20 vlightHotkey gSaveHotkey, %lightNoMods%
  4754. Gui, Hotkeys: Add, Hotkey, x490 y420 w120 h20 vuclightHotkey gSaveHotkey, %uclightNoMods%
  4755. Gui, Hotkeys: Add, Hotkey, x490 y450 w120 h20 vucaHotkey gSaveHotkey, %ucaNoMods%
  4756. Gui, Hotkeys: Add, Hotkey, x490 y480 w120 h20 vrepeatHotkey gSaveHotkey, %repeatNoMods%
  4757. Gui, Hotkeys: Add, Hotkey, x490 y510 w120 h20 vclearWantedsHotkey gSaveHotkey, %clearWantedsNoMods%
  4758. Gui, Hotkeys: Tab, Seite 2
  4759. Gui, Hotkeys: Add, Text, x10 y30 w170 h20 , Megafon: Folgen
  4760. Gui, Hotkeys: Add, Text, x10 y60 w170 h20 , Megafon: Kontrolle
  4761. Gui, Hotkeys: Add, Text, x10 y90 w170 h20 , Megafon: Anhalten
  4762. Gui, Hotkeys: Add, Text, x10 y120 w170 h20 , Megafon: Schießen
  4763. Gui, Hotkeys: Add, Text, x10 y150 w170 h20 , Megafon: Aussteigen
  4764. Gui, Hotkeys: Add, Text, x10 y180 w170 h20 , Megafon: Straße räumen
  4765. Gui, Hotkeys: Add, Text, x10 y210 w170 h20 , Megafon: Waffen weg
  4766. Gui, Hotkeys: Add, Text, x10 y240 w170 h20 , Megafon: Verlassen
  4767. Gui, Hotkeys: Add, Text, x10 y270 w170 h20 , Megafon: Verfolung
  4768. Gui, Hotkeys: Add, Text, x10 y300 w170 h20 , Megafon: StVO
  4769. Gui, Hotkeys: Add, Text, x10 y330 w170 h20 , Heilen
  4770. Gui, Hotkeys: Add, Text, x10 y360 w170 h20 , Ausrüsten
  4771. Gui, Hotkeys: Add, Text, x10 y390 w170 h20 , Ausrüsten (Profil 1)
  4772. Gui, Hotkeys: Add, Text, x10 y420 w170 h20 , Ausrüsten (Profil 2)
  4773. Gui, Hotkeys: Add, Text, x10 y450 w170 h20 , Ausrüsten (Profil 3)
  4774. Gui, Hotkeys: Add, Text, x10 y480 w170 h20 , Frakmember anzeigen
  4775. Gui, Hotkeys: Add, Text, x10 y510 w170 h20 , Orgmember anzeigen
  4776. Gui, Hotkeys: Add, Hotkey, x190 y30 w120 h20 vmegaFollowHotkey gSaveHotkey, %megaFollowNoMods%
  4777. Gui, Hotkeys: Add, Hotkey, x190 y60 w120 h20 vmegaControlHotkey gSaveHotkey, %megaControlNoMods%
  4778. Gui, Hotkeys: Add, Hotkey, x190 y90 w120 h20 vmegaStopHotkey gSaveHotkey, %megaStopNoMods%
  4779. Gui, Hotkeys: Add, Hotkey, x190 y120 w120 h20 vmegaShootWarningHotkey gSaveHotkey, %megaShootWarningNoMods%
  4780. Gui, Hotkeys: Add, Hotkey, x190 y150 w120 h20 vmegaGetOutOfCarHotkey gSaveHotkey, %megaGetOutOfCarNoMods%
  4781. Gui, Hotkeys: Add, Hotkey, x190 y180 w120 h20 vmegaClearHotkey gSaveHotkey, %megaClearNoMods%
  4782. Gui, Hotkeys: Add, Hotkey, x190 y210 w120 h20 vmegaWeaponsHotkey gSaveHotkey, %megaWeaponsNoMods%
  4783. Gui, Hotkeys: Add, Hotkey, x190 y240 w120 h20 vmegaLeaveHotkey gSaveHotkey, %megaLeaveNoMods%
  4784. Gui, Hotkeys: Add, Hotkey, x190 y270 w120 h20 vmegaStopFollowHotkey gSaveHotkey, %megaStopFollowNoMods%
  4785. Gui, Hotkeys: Add, Hotkey, x190 y300 w120 h20 vmegaRoadTrafficActHotkey gSaveHotkey, %megaRoadTrafficActNoMods%
  4786. Gui, Hotkeys: Add, Hotkey, x190 y330 w120 h20 vhealHotkey gSaveHotkey, %healNoMods%
  4787. Gui, Hotkeys: Add, Hotkey, x190 y360 w120 h20 vequipHotkey gSaveHotkey, %equipNoMods%
  4788. Gui, Hotkeys: Add, Hotkey, x190 y390 w120 h20 vequipProfile1Hotkey gSaveHotkey, %equipProfile1NoMods%
  4789. Gui, Hotkeys: Add, Hotkey, x190 y420 w120 h20 vequipProfile2Hotkey gSaveHotkey, %equipProfile2NoMods%
  4790. Gui, Hotkeys: Add, Hotkey, x190 y450 w120 h20 vequipProfile3Hotkey gSaveHotkey, %equipProfile3NoMods%
  4791. Gui, Hotkeys: Add, Hotkey, x190 y480 w120 h20 vmembersHotkey gSaveHotkey, %membersNoMods%
  4792. Gui, Hotkeys: Add, Hotkey, x190 y510 w120 h20 vorgmembersHotkey gSaveHotkey, %orgmembersNoMods%
  4793. Gui, Hotkeys: Add, Text, x320 y30 w170 h20 , Backup anfordern
  4794. Gui, Hotkeys: Add, Text, x320 y60 w170 h20 , Backup (WH) anfordern
  4795. Gui, Hotkeys: Add, Text, x320 y90 w170 h20 , BK nicht mehr benötigt
  4796. Gui, Hotkeys: Add, Text, x320 y120 w170 h20 , Position (/hq)
  4797. Gui, Hotkeys: Add, Text, x320 y150 w170 h20 , Position (/d)
  4798. Gui, Hotkeys: Add, Text, x320 y180 w170 h20 , Position (/f)
  4799. Gui, Hotkeys: Add, Text, x320 y210 w170 h20 , Position (/r)
  4800. Gui, Hotkeys: Add, Text, x320 y240 w170 h20 , Auftrag übern. (/hq)
  4801. Gui, Hotkeys: Add, Text, x320 y270 w170 h20 , Auftrag erledigt (/hq)
  4802. Gui, Hotkeys: Add, Text, x320 y300 w170 h20 , Auftrag übern. (/d)
  4803. Gui, Hotkeys: Add, Text, x320 y330 w170 h20 , Auftrag erledigt (/d)
  4804. Gui, Hotkeys: Add, Text, x320 y360 w170 h20 , Kofferraumkontrolle
  4805. Gui, Hotkeys: Add, Text, x320 y390 w170 h20 , Kofferraum öffnen
  4806. Gui, Hotkeys: Add, Text, x320 y420 w170 h20 , Kofferraum durchsuchen
  4807. Gui, Hotkeys: Add, Text, x320 y450 w170 h20 , Kofferr. öffnen lassen
  4808. Gui, Hotkeys: Add, Hotkey, x490 y30 w120 h20 vbackupHotkey gSaveHotkey, %backupNoMods%
  4809. Gui, Hotkeys: Add, Hotkey, x490 y60 w120 h20 vbackupWhHotkey gSaveHotkey, %backupWhNoMods%
  4810. Gui, Hotkeys: Add, Hotkey, x490 y90 w120 h20 vnoBackupHotkey gSaveHotkey, %noBackupNoMods%
  4811. Gui, Hotkeys: Add, Hotkey, x490 y120 w120 h20 vhqPositionHotkey gSaveHotkey, %hqPositionNoMods%
  4812. Gui, Hotkeys: Add, Hotkey, x490 y150 w120 h20 vdPositionHotkey gSaveHotkey, %dPositionNoMods%
  4813. Gui, Hotkeys: Add, Hotkey, x490 y180 w120 h20 vfPositionHotkey gSaveHotkey, %fPositionNoMods%
  4814. Gui, Hotkeys: Add, Hotkey, x490 y210 w120 h20 vrPositionHotkey gSaveHotkey, %rPositionNoMods%
  4815. Gui, Hotkeys: Add, Hotkey, x490 y240 w120 h20 vacceptJobHotkey gSaveHotkey, %acceptJobNoMods%
  4816. Gui, Hotkeys: Add, Hotkey, x490 y270 w120 h20 vdoneJobHotkey gSaveHotkey, %doneJobNoMods%
  4817. Gui, Hotkeys: Add, Hotkey, x490 y300 w120 h20 vacceptJobDHotkey gSaveHotkey, %acceptJobDNoMods%
  4818. Gui, Hotkeys: Add, Hotkey, x490 y330 w120 h20 vdoneJobDHotkey gSaveHotkey, %doneJobDNoMods%
  4819. Gui, Hotkeys: Add, Hotkey, x490 y360 w120 h20 vaskTrunkCheckHotkey gSaveHotkey, %askTrunkCheckNoMods%
  4820. Gui, Hotkeys: Add, Hotkey, x490 y390 w120 h20 vopenTrunkHotkey gSaveHotkey, %openTrunkNoMods%
  4821. Gui, Hotkeys: Add, Hotkey, x490 y420 w120 h20 vcheckTrunkHotkey gSaveHotkey, %checkTrunkNoMods%
  4822. Gui, Hotkeys: Add, Hotkey, x490 y450 w120 h20 vaskTrunkOpenHotkey gSaveHotkey, %askTrunkOpenNoMods%
  4823. Gui, Hotkeys: Tab, Seite 3
  4824. Gui, Hotkeys: Add, Text, x10 y30 w170 h20 , Einsperren (auto)
  4825. Gui, Hotkeys: Add, Text, x10 y60 w170 h20 , Einsperren
  4826. Gui, Hotkeys: Add, Text, x10 y90 w170 h20 , Verbrecherliste anzeigen
  4827. Gui, Hotkeys: Add, Text, x10 y120 w170 h20 , Verbr.liste zurücksetzen
  4828. Gui, Hotkeys: Add, Text, x10 y150 w170 h20 , Festnehmen
  4829. Gui, Hotkeys: Add, Text, x10 y180 w170 h20 , Freilassen (/uncuff)
  4830. Gui, Hotkeys: Add, Text, x10 y210 w170 h20 , Kontrollieren
  4831. Gui, Hotkeys: Add, Text, x10 y240 w170 h20 , Kontrolle anfordern