Advertisement
Guest User

VKSamp

a guest
Apr 4th, 2018
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; <COMPILER: v1.1.22.02>
  2. global ERROR_OK                        := 0
  3. global ERROR_PROCESS_NOT_FOUND         := 1
  4. global ERROR_OPEN_PROCESS              := 2
  5. global ERROR_INVALID_HANDLE            := 3
  6. global ERROR_MODULE_NOT_FOUND          := 4
  7. global ERROR_ENUM_PROCESS_MODULES      := 5
  8. global ERROR_ZONE_NOT_FOUND            := 6
  9. global ERROR_CITY_NOT_FOUND            := 7
  10. global ERROR_READ_MEMORY               := 8
  11. global ERROR_WRITE_MEMORY              := 9
  12. global ERROR_ALLOC_MEMORY              := 10
  13. global ERROR_FREE_MEMORY               := 11
  14. global ERROR_WAIT_FOR_OBJECT           := 12
  15. global ERROR_CREATE_THREAD             := 13
  16. global ADDR_ZONECODE                   := 0xA49AD4
  17. global ADDR_POSITION_X                 := 0xB6F2E4
  18. global ADDR_POSITION_Y                 := 0xB6F2E8
  19. global ADDR_POSITION_Z                 := 0xB6F2EC
  20. global ADDR_CPED_PTR                   := 0xB6F5F0
  21. global ADDR_CPED_HPOFF                 := 0x540
  22. global ADDR_CPED_ARMOROFF              := 0x548
  23. global ADDR_VEHICLE_PTR                := 0xBA18FC
  24. global ADDR_VEHICLE_HPOFF              := 0x4C0
  25. global ADDR_CPED_MONEY                 := 0xB7CE50
  26. global ADDR_CPED_INTID                 := 0xA4ACE8
  27. global ADDR_VEHICLE_DOORSTATE          := 0x4F8
  28. global ADDR_VEHICLE_ENGINESTATE        := 0x428
  29. global ADDR_VEHICLE_LIGHTSTATE         := 0x428
  30. global ADDR_VEHICLE_MODEL              := 0x22
  31. global ADDR_VEHICLE_TYPE               := 0x590
  32. global ADDR_VEHICLE_DRIVER             := 0x460
  33. global oAirplaneModels                 := [417, 425, 447, 460, 469, 476, 487, 488, 497, 511, 512, 513, 519, 520, 548, 553, 563, 577, 592, 593]
  34. global oBikeModels                     := [481,509,510]
  35. 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"]
  36. global ADDR_SAMP_INCHAT_PTR            := 0x21A10C
  37. global ADDR_SAMP_INCHAT_PTR_OFF        := 0x55
  38. global ADDR_SAMP_USERNAME              := 0x219A6F
  39. global ADDR_SAMP_CHATMSG_PTR           := 0x21A0E4
  40. global ADDR_SAMP_SHOWDLG_PTR           := 0x21A0B8
  41. global FUNC_SAMP_SENDCMD               := 0x65C60
  42. global FUNC_SAMP_SENDSAY               := 0x57F0
  43. global FUNC_SAMP_ADDTOCHATWND          := 0x64520
  44. global FUNC_SAMP_SHOWGAMETEXT          := 0x9C2C0
  45. global FUNC_SAMP_PLAYAUDIOSTR          := 0x62DA0
  46. global FUNC_SAMP_STOPAUDIOSTR          := 0x629A0
  47. global FUNC_SAMP_SHOWDIALOG            := 0x6B9C0
  48. global FUNC_UPDATESCOREBOARD           := 0x8A10
  49. global SAMP_INFO_OFFSET                     := 0x21A0F8
  50. global SAMP_PPOOLS_OFFSET                   := 0x3CD
  51. global SAMP_PPOOL_PLAYER_OFFSET             := 0x18
  52. global SAMP_SLOCALPLAYERID_OFFSET           := 0x4
  53. global SAMP_ISTRLEN_LOCALPLAYERNAME_OFFSET  := 0x1A
  54. global SAMP_SZLOCALPLAYERNAME_OFFSET        := 0xA
  55. global SAMP_PSZLOCALPLAYERNAME_OFFSET       := 0xA
  56. global SAMP_PREMOTEPLAYER_OFFSET            := 0x2E
  57. global SAMP_ISTRLENNAME___OFFSET            := 0x1C
  58. global SAMP_SZPLAYERNAME_OFFSET             := 0xC
  59. global SAMP_PSZPLAYERNAME_OFFSET            := 0xC
  60. global SAMP_ILOCALPLAYERPING_OFFSET         := 0x26
  61. global SAMP_ILOCALPLAYERSCORE_OFFSET        := 0x2A
  62. global SAMP_IPING_OFFSET                    := 0x28
  63. global SAMP_ISCORE_OFFSET                   := 0x24
  64. global SAMP_ISNPC_OFFSET                    := 0x4
  65. global SAMP_PLAYER_MAX                      := 1004
  66. global SIZE_SAMP_CHATMSG               := 0xFC
  67. global hGTA                            := 0x0
  68. global dwGTAPID                        := 0x0
  69. global dwSAMP                          := 0x0
  70. global pMemory                         := 0x0
  71. global pParam1                         := 0x0
  72. global pParam2                         := 0x0
  73. global pParam3                         := 0x0
  74. global pInjectFunc                     := 0x0
  75. global nZone                           := 1
  76. global nCity                           := 1
  77. global bInitZaC                        := 0
  78. global iRefreshScoreboard              := 0
  79. global oScoreboardData                 := ""
  80. global iRefreshHandles                 := 0
  81. global iUpdateTick                     := 2500
  82. isInChat() {
  83. if(!checkHandles())
  84. return -1
  85. dwPtr := dwSAMP + ADDR_SAMP_INCHAT_PTR
  86. dwAddress := readDWORD(hGTA, dwPtr) + ADDR_SAMP_INCHAT_PTR_OFF
  87. if(ErrorLevel) {
  88. ErrorLevel := ERROR_READ_MEMORY
  89. return -1
  90. }
  91. dwInChat := readDWORD(hGTA, dwAddress)
  92. if(ErrorLevel) {
  93. ErrorLevel := ERROR_READ_MEMORY
  94. return -1
  95. }
  96. ErrorLevel := ERROR_OK
  97. if(dwInChat > 0) {
  98. return true
  99. } else {
  100. return false
  101. }
  102. }
  103. getUsername() {
  104. if(!checkHandles())
  105. return ""
  106. dwAddress := dwSAMP + ADDR_SAMP_USERNAME
  107. sUsername := readString(hGTA, dwAddress, 25)
  108. if(ErrorLevel) {
  109. ErrorLevel := ERROR_READ_MEMORY
  110. return ""
  111. }
  112. ErrorLevel := ERROR_OK
  113. return sUsername
  114. }
  115. getId() {
  116. s:=getUsername()
  117. return getPlayerIdByName(s)
  118. }
  119. sendChatMessage(wText) {
  120. wText := "" wText
  121. if(!checkHandles())
  122. return false
  123. dwFunc:=0
  124. if(SubStr(wText, 1, 1) == "/") {
  125. dwFunc := dwSAMP + FUNC_SAMP_SENDCMD
  126. } else {
  127. dwFunc := dwSAMP + FUNC_SAMP_SENDSAY
  128. }
  129. callWithParams(hGTA, dwFunc, [["s", wText]], false)
  130. ErrorLevel := ERROR_OK
  131. return true
  132. }
  133. addMessageToChatWindow(wText) {
  134. wText := "" wText
  135. if(!checkHandles())
  136. return false
  137. dwFunc := dwSAMP + FUNC_SAMP_ADDTOCHATWND
  138. dwChatInfo := readDWORD(hGTA, dwSAMP + ADDR_SAMP_CHATMSG_PTR)
  139. if(ErrorLevel) {
  140. ErrorLevel := ERROR_READ_MEMORY
  141. return false
  142. }
  143. callWithParams(hGTA, dwFunc, [["p", dwChatInfo], ["s", wText]], true)
  144. ErrorLevel := ERROR_OK
  145. return true
  146. }
  147. showGameText(wText, dwTime, dwSize) {
  148. wText := "" wText
  149. dwTime += 0
  150. dwTime := Floor(dwTime)
  151. dwSize += 0
  152. dwSize := Floor(dwSize)
  153. if(!checkHandles())
  154. return false
  155. dwFunc := dwSAMP + FUNC_SAMP_SHOWGAMETEXT
  156. callWithParams(hGTA, dwFunc, [["s", wText], ["i", dwTime], ["i", dwSize]], false)
  157. ErrorLevel := ERROR_OK
  158. return true
  159. }
  160. showDialog(dwStyle, wCaption, wInfo, wButton1 ) {
  161. dwStyle += 0
  162. dwStyle := Floor(dwStyle)
  163. wCaption := "" wCaption
  164. wInfo := "" wInfo
  165. wButton1 := "" wButton1
  166. if(!checkHandles())
  167. return false
  168. dwFunc := dwSAMP + FUNC_SAMP_SHOWDIALOG
  169. dwAddress := readDWORD(hGTA, dwSAMP + ADDR_SAMP_SHOWDLG_PTR)
  170. if(ErrorLevel || dwAddress==0) {
  171. ErrorLevel := ERROR_READ_MEMORY
  172. return false
  173. }
  174. writeString(hGTA, pParam1, wCaption)
  175. if(ErrorLevel)
  176. return false
  177. writeString(hGTA, pParam2, wInfo)
  178. if(ErrorLevel)
  179. return false
  180. writeString(hGTA, pParam3, wButton1)
  181. if(ErrorLevel)
  182. return false
  183. dwLen := 5 + 7*5 + 5 + 1
  184. VarSetCapacity(injectData, dwLen, 0)
  185. NumPut(0xB9, injectData, 0, "UChar")
  186. NumPut(dwAddress, injectData, 1, "UInt")
  187. NumPut(0x68, injectData, 5, "UChar")
  188. NumPut(0, injectData, 6, "UInt")
  189. NumPut(0x68, injectData, 10, "UChar")
  190. NumPut(pParam1+StrLen(wCaption), injectData, 11, "UInt")
  191. NumPut(0x68, injectData, 15, "UChar")
  192. NumPut(pParam3, injectData, 16, "UInt")
  193. NumPut(0x68, injectData, 20, "UChar")
  194. NumPut(pParam2, injectData, 21, "UInt")
  195. NumPut(0x68, injectData, 25, "UChar")
  196. NumPut(pParam1, injectData, 26, "UInt")
  197. NumPut(0x68, injectData, 30, "UChar")
  198. NumPut(dwStyle, injectData, 31, "UInt")
  199. NumPut(0x68, injectData, 35, "UChar")
  200. NumPut(1, injectData, 36, "UInt")
  201. NumPut(0xE8, injectData, 40, "UChar")
  202. offset := dwFunc - (pInjectFunc + 45)
  203. NumPut(offset, injectData, 41, "Int")
  204. NumPut(0xC3, injectData, 45, "UChar")
  205. writeRaw(hGTA, pInjectFunc, &injectData, dwLen)
  206. if(ErrorLevel)
  207. return false
  208. hThread := createRemoteThread(hGTA, 0, 0, pInjectFunc, 0, 0, 0)
  209. if(ErrorLevel)
  210. return false
  211. waitForSingleObject(hThread, 0xFFFFFFFF)
  212. closeProcess(hThread)
  213. return true
  214. }
  215. playAudioStream(wUrl) {
  216. wUrl := "" wUrl
  217. if(!checkHandles())
  218. return false
  219. dwFunc := dwSAMP + FUNC_SAMP_PLAYAUDIOSTR
  220. patchRadio()
  221. callWithParams(hGTA, dwFunc, [["s", wUrl], ["i", 0], ["i", 0], ["i", 0], ["i", 0], ["i", 0]], false)
  222. unPatchRadio()
  223. ErrorLevel := ERROR_OK
  224. return true
  225. }
  226. stopAudioStream() {
  227. if(!checkHandles())
  228. return false
  229. dwFunc := dwSAMP + FUNC_SAMP_STOPAUDIOSTR
  230. patchRadio()
  231. callWithParams(hGTA, dwFunc, [["i", 1]], false)
  232. unPatchRadio()
  233. ErrorLevel := ERROR_OK
  234. return true
  235. }
  236. blockChatInput() {
  237. if(!checkHandles())
  238. return false
  239. VarSetCapacity(nop, 2, 0)
  240. dwFunc := dwSAMP + FUNC_SAMP_SENDSAY
  241. NumPut(0x04C2,nop,0,"Short")
  242. writeRaw(hGTA, dwFunc, &nop, 2)
  243. dwFunc := dwSAMP + FUNC_SAMP_SENDCMD
  244. writeRaw(hGTA, dwFunc, &nop, 2)
  245. return true
  246. }
  247. unBlockChatInput() {
  248. if(!checkHandles())
  249. return false
  250. VarSetCapacity(nop, 2, 0)
  251. dwFunc := dwSAMP + FUNC_SAMP_SENDSAY
  252. NumPut(0xA164,nop,0,"Short")
  253. writeRaw(hGTA, dwFunc, &nop, 2)
  254. dwFunc := dwSAMP + FUNC_SAMP_SENDCMD
  255. writeRaw(hGTA, dwFunc, &nop, 2)
  256. return true
  257. }
  258. patchRadio() {
  259. if(!checkHandles())
  260. return false
  261. VarSetCapacity(nop, 4, 0)
  262. NumPut(0x90909090,nop,0,"UInt")
  263. dwFunc := dwSAMP + FUNC_SAMP_PLAYAUDIOSTR
  264. writeRaw(hGTA, dwFunc, &nop, 4)
  265. writeRaw(hGTA, dwFunc+4, &nop, 1)
  266. dwFunc := dwSAMP + FUNC_SAMP_STOPAUDIOSTR
  267. writeRaw(hGTA, dwFunc, &nop, 4)
  268. writeRaw(hGTA, dwFunc+4, &nop, 1)
  269. return true
  270. }
  271. unPatchRadio() {
  272. if(!checkHandles())
  273. return false
  274. VarSetCapacity(old, 4, 0)
  275. dwFunc := dwSAMP + FUNC_SAMP_PLAYAUDIOSTR
  276. NumPut(0x74003980,old,0,"UInt")
  277. writeRaw(hGTA, dwFunc, &old, 4)
  278. NumPut(0x39,old,0,"UChar")
  279. writeRaw(hGTA, dwFunc+4, &old, 1)
  280. dwFunc := dwSAMP + FUNC_SAMP_STOPAUDIOSTR
  281. NumPut(0x74003980,old,0,"UInt")
  282. writeRaw(hGTA, dwFunc, &old, 4)
  283. NumPut(0x09,old,0,"UChar")
  284. writeRaw(hGTA, dwFunc+4, &old, 1)
  285. return true
  286. }
  287. getPlayerNameById(dwId) {
  288. dwId += 0
  289. dwId := Floor(dwId)
  290. if(dwId < 0 || dwId >= SAMP_PLAYER_MAX)
  291. return ""
  292. if(iRefreshScoreboard+iUpdateTick > A_TickCount)
  293. {
  294. if(oScoreboardData[dwId])
  295. return oScoreboardData[dwId].NAME
  296. return ""
  297. }
  298. if(!updateOScoreboardData())
  299. return ""
  300. if(oScoreboardData[dwId])
  301. return oScoreboardData[dwId].NAME
  302. return ""
  303. }
  304. getPlayerIdByName(wName) {
  305. wName := "" wName
  306. if(StrLen(wName) < 1 || StrLen(wName) > 20)
  307. return -1
  308. if(iRefreshScoreboard+iUpdateTick > A_TickCount)
  309. {
  310. For i, o in oScoreboardData
  311. {
  312. if(InStr(o.NAME,wName)==1)
  313. return i
  314. }
  315. return -1
  316. }
  317. if(!updateOScoreboardData())
  318. return -1
  319. For i, o in oScoreboardData
  320. {
  321. if(InStr(o.NAME,wName)==1)
  322. return i
  323. }
  324. return -1
  325. }
  326. getPlayerScoreById(dwId) {
  327. dwId += 0
  328. dwId := Floor(dwId)
  329. if(dwId < 0 || dwId >= SAMP_PLAYER_MAX)
  330. return ""
  331. if(iRefreshScoreboard+iUpdateTick > A_TickCount)
  332. {
  333. if(oScoreboardData[dwId])
  334. return oScoreboardData[dwId].SCORE
  335. return ""
  336. }
  337. if(!updateOScoreboardData())
  338. return ""
  339. if(oScoreboardData[dwId])
  340. return oScoreboardData[dwId].SCORE
  341. return ""
  342. }
  343. getPlayerPingById(dwId) {
  344. dwId += 0
  345. dwId := Floor(dwId)
  346. if(dwId < 0 || dwId >= SAMP_PLAYER_MAX)
  347. return -1
  348. if(iRefreshScoreboard+iUpdateTick > A_TickCount)
  349. {
  350. if(oScoreboardData[dwId])
  351. return oScoreboardData[dwId].PING
  352. return -1
  353. }
  354. if(!updateOScoreboardData())
  355. return -1
  356. if(oScoreboardData[dwId])
  357. return oScoreboardData[dwId].PING
  358. return -1
  359. }
  360. isNPCById(dwId) {
  361. dwId += 0
  362. dwId := Floor(dwId)
  363. if(dwId < 0 || dwId >= SAMP_PLAYER_MAX)
  364. return -1
  365. if(iRefreshScoreboard+iUpdateTick > A_TickCount)
  366. {
  367. if(oScoreboardData[dwId])
  368. return oScoreboardData[dwId].ISNPC
  369. return -1
  370. }
  371. if(!updateOScoreboardData())
  372. return -1
  373. if(oScoreboardData[dwId])
  374. return oScoreboardData[dwId].ISNPC
  375. return -1
  376. }
  377. updateScoreboardDataEx() {
  378. if(!checkHandles())
  379. return false
  380. dwAddress := readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET)
  381. if(ErrorLevel || dwAddress==0) {
  382. ErrorLevel := ERROR_READ_MEMORY
  383. return false
  384. }
  385. dwFunc := dwSAMP + FUNC_UPDATESCOREBOARD
  386. VarSetCapacity(injectData, 11, 0)
  387. NumPut(0xB9, injectData, 0, "UChar")
  388. NumPut(dwAddress, injectData, 1, "UInt")
  389. NumPut(0xE8, injectData, 5, "UChar")
  390. offset := dwFunc - (pInjectFunc + 10)
  391. NumPut(offset, injectData, 6, "Int")
  392. NumPut(0xC3, injectData, 10, "UChar")
  393. writeRaw(hGTA, pInjectFunc, &injectData, 11)
  394. if(ErrorLevel)
  395. return false
  396. hThread := createRemoteThread(hGTA, 0, 0, pInjectFunc, 0, 0, 0)
  397. if(ErrorLevel)
  398. return false
  399. waitForSingleObject(hThread, 0xFFFFFFFF)
  400. closeProcess(hThread)
  401. return true
  402. }
  403. updateOScoreboardData() {
  404. if(!checkHandles())
  405. return 0
  406. oScoreboardData := []
  407. if(!updateScoreboardDataEx())
  408. return 0
  409. iRefreshScoreboard := A_TickCount
  410. dwAddress := readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET)
  411. if(ErrorLevel || dwAddress==0) {
  412. ErrorLevel := ERROR_READ_MEMORY
  413. return 0
  414. }
  415. dwAddress := readDWORD(hGTA, dwAddress + SAMP_PPOOLS_OFFSET)
  416. if(ErrorLevel || dwAddress==0) {
  417. ErrorLevel := ERROR_READ_MEMORY
  418. return 0
  419. }
  420. dwPlayers := readDWORD(hGTA, dwAddress + SAMP_PPOOL_PLAYER_OFFSET)
  421. if(ErrorLevel || dwPlayers==0) {
  422. ErrorLevel := ERROR_READ_MEMORY
  423. return 0
  424. }
  425. wID := readMem(hGTA, dwPlayers + SAMP_SLOCALPLAYERID_OFFSET, 2, "Short")
  426. if(ErrorLevel) {
  427. ErrorLevel := ERROR_READ_MEMORY
  428. return 0
  429. }
  430. dwPing := readMem(hGTA, dwPlayers + SAMP_ILOCALPLAYERPING_OFFSET, 4, "Int")
  431. if(ErrorLevel) {
  432. ErrorLevel := ERROR_READ_MEMORY
  433. return 0
  434. }
  435. dwScore := readMem(hGTA, dwPlayers + SAMP_ILOCALPLAYERSCORE_OFFSET, 4, "Int")
  436. if(ErrorLevel) {
  437. ErrorLevel := ERROR_READ_MEMORY
  438. return 0
  439. }
  440. dwTemp := readMem(hGTA, dwPlayers + SAMP_ISTRLEN_LOCALPLAYERNAME_OFFSET, 4, "Int")
  441. if(ErrorLevel) {
  442. ErrorLevel := ERROR_READ_MEMORY
  443. return 0
  444. }
  445. sUsername := ""
  446. if(dwTemp <= 0xf) {
  447. sUsername := readString(hGTA, dwPlayers + SAMP_SZLOCALPLAYERNAME_OFFSET, 16)
  448. if(ErrorLevel) {
  449. ErrorLevel := ERROR_READ_MEMORY
  450. return 0
  451. }
  452. }
  453. else {
  454. dwAddress := readDWORD(hGTA, dwPlayers + SAMP_PSZLOCALPLAYERNAME_OFFSET)
  455. if(ErrorLevel) {
  456. ErrorLevel := ERROR_READ_MEMORY
  457. return 0
  458. }
  459. sUsername := readString(hGTA, dwAddress, 25)
  460. if(ErrorLevel) {
  461. ErrorLevel := ERROR_READ_MEMORY
  462. return 0
  463. }
  464. }
  465. oScoreboardData[wID] := Object("NAME", sUsername, "ID", wID, "PING", dwPing, "SCORE", dwScore, "ISNPC", 0)
  466. Loop, % SAMP_PLAYER_MAX
  467. {
  468. i := A_Index-1
  469. dwRemoteplayer := readDWORD(hGTA, dwPlayers+SAMP_PREMOTEPLAYER_OFFSET+i*4)
  470. if(ErrorLevel) {
  471. ErrorLevel := ERROR_READ_MEMORY
  472. return 0
  473. }
  474. if(dwRemoteplayer==0)
  475. continue
  476. dwPing := readMem(hGTA, dwRemoteplayer + SAMP_IPING_OFFSET, 4, "Int")
  477. if(ErrorLevel) {
  478. ErrorLevel := ERROR_READ_MEMORY
  479. return 0
  480. }
  481. dwScore := readMem(hGTA, dwRemoteplayer + SAMP_ISCORE_OFFSET, 4, "Int")
  482. if(ErrorLevel) {
  483. ErrorLevel := ERROR_READ_MEMORY
  484. return 0
  485. }
  486. dwIsNPC := readMem(hGTA, dwRemoteplayer + SAMP_ISNPC_OFFSET, 4, "Int")
  487. if(ErrorLevel) {
  488. ErrorLevel := ERROR_READ_MEMORY
  489. return 0
  490. }
  491. dwTemp := readMem(hGTA, dwRemoteplayer + SAMP_ISTRLENNAME___OFFSET, 4, "Int")
  492. if(ErrorLevel) {
  493. ErrorLevel := ERROR_READ_MEMORY
  494. return 0
  495. }
  496. sUsername := ""
  497. if(dwTemp <= 0xf)
  498. {
  499. sUsername := readString(hGTA, dwRemoteplayer+SAMP_SZPLAYERNAME_OFFSET, 16)
  500. if(ErrorLevel) {
  501. ErrorLevel := ERROR_READ_MEMORY
  502. return 0
  503. }
  504. }
  505. else {
  506. dwAddress := readDWORD(hGTA, dwRemoteplayer + SAMP_PSZPLAYERNAME_OFFSET)
  507. if(ErrorLevel || dwAddress==0) {
  508. ErrorLevel := ERROR_READ_MEMORY
  509. return 0
  510. }
  511. sUsername := readString(hGTA, dwAddress, 25)
  512. if(ErrorLevel) {
  513. ErrorLevel := ERROR_READ_MEMORY
  514. return 0
  515. }
  516. }
  517. o := Object("NAME", sUsername, "ID", i, "PING", dwPing, "SCORE", dwScore, "ISNPC", dwIsNPC)
  518. oScoreboardData[i] := o
  519. }
  520. ErrorLevel := ERROR_OK
  521. return 1
  522. }
  523. getPlayerHealth() {
  524. if(!checkHandles())
  525. return -1
  526. dwCPedPtr := readDWORD(hGTA, ADDR_CPED_PTR)
  527. if(ErrorLevel) {
  528. ErrorLevel := ERROR_READ_MEMORY
  529. return -1
  530. }
  531. dwAddr := dwCPedPtr + ADDR_CPED_HPOFF
  532. fHealth := readFloat(hGTA, dwAddr)
  533. if(ErrorLevel) {
  534. ErrorLevel := ERROR_READ_MEMORY
  535. return -1
  536. }
  537. ErrorLevel := ERROR_OK
  538. return Round(fHealth)
  539. }
  540. getPlayerArmor() {
  541. if(!checkHandles())
  542. return -1
  543. dwCPedPtr := readDWORD(hGTA, ADDR_CPED_PTR)
  544. if(ErrorLevel) {
  545. ErrorLevel := ERROR_READ_MEMORY
  546. return -1
  547. }
  548. dwAddr := dwCPedPtr + ADDR_CPED_ARMOROFF
  549. fHealth := readFloat(hGTA, dwAddr)
  550. if(ErrorLevel) {
  551. ErrorLevel := ERROR_READ_MEMORY
  552. return -1
  553. }
  554. ErrorLevel := ERROR_OK
  555. return Round(fHealth)
  556. }
  557. getPlayerInteriorId() {
  558. if(!checkHandles())
  559. return -1
  560. iid := readMem(hGTA, ADDR_CPED_INTID, 4, "Int")
  561. if(ErrorLevel) {
  562. ErrorLevel := ERROR_READ_MEMORY
  563. return -1
  564. }
  565. ErrorLevel := ERROR_OK
  566. return iid
  567. }
  568. getPlayerMoney() {
  569. if(!checkHandles())
  570. return ""
  571. money := readMem(hGTA, ADDR_CPED_MONEY, 4, "Int")
  572. if(ErrorLevel) {
  573. ErrorLevel := ERROR_READ_MEMORY
  574. return ""
  575. }
  576. ErrorLevel := ERROR_OK
  577. return money
  578. }
  579. isPlayerInAnyVehicle()
  580. {
  581. if(!checkHandles())
  582. return -1
  583. dwVehPtr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
  584. if(ErrorLevel) {
  585. ErrorLevel := ERROR_READ_MEMORY
  586. return -1
  587. }
  588. return (dwVehPtr > 0)
  589. }
  590. isPlayerDriver() {
  591. if(!checkHandles())
  592. return -1
  593. dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
  594. if(ErrorLevel) {
  595. ErrorLevel := ERROR_READ_MEMORY
  596. return -1
  597. }
  598. if(!dwAddr)
  599. return -1
  600. dwCPedPtr := readDWORD(hGTA, ADDR_CPED_PTR)
  601. if(ErrorLevel) {
  602. ErrorLevel := ERROR_READ_MEMORY
  603. return -1
  604. }
  605. dwVal := readDWORD(hGTA, dwAddr + ADDR_VEHICLE_DRIVER)
  606. if(ErrorLevel) {
  607. ErrorLevel := ERROR_READ_MEMORY
  608. return -1
  609. }
  610. ErrorLevel := ERROR_OK
  611. return (dwVal==dwCPedPtr)
  612. }
  613. getVehicleHealth() {
  614. if(!checkHandles())
  615. return -1
  616. dwVehPtr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
  617. if(ErrorLevel) {
  618. ErrorLevel := ERROR_READ_MEMORY
  619. return -1
  620. }
  621. dwAddr := dwVehPtr + ADDR_VEHICLE_HPOFF
  622. fHealth := readFloat(hGTA, dwAddr)
  623. if(ErrorLevel) {
  624. ErrorLevel := ERROR_READ_MEMORY
  625. return -1
  626. }
  627. ErrorLevel := ERROR_OK
  628. return Round(fHealth)
  629. }
  630. getVehicleType() {
  631. if(!checkHandles())
  632. return 0
  633. dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
  634. if(ErrorLevel) {
  635. ErrorLevel := ERROR_READ_MEMORY
  636. return 0
  637. }
  638. if(!dwAddr)
  639. return 0
  640. cVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_TYPE, 1, "Char")
  641. if(ErrorLevel) {
  642. ErrorLevel := ERROR_READ_MEMORY
  643. return 0
  644. }
  645. ErrorLevel := ERROR_OK
  646. if(!cVal)
  647. {
  648. mid := getVehicleModelId()
  649. Loop % oAirplaneModels.MaxIndex()
  650. {
  651. if(oAirplaneModels[A_Index]==mid)
  652. return 5
  653. }
  654. return 1
  655. }
  656. else if(cVal==5)
  657. return 2
  658. else if(cVal==6)
  659. return 3
  660. else if(cVal==9)
  661. {
  662. mid := getVehicleModelId()
  663. Loop % oBikeModels.MaxIndex()
  664. {
  665. if(oBikeModels[A_Index]==mid)
  666. return 6
  667. }
  668. return 4
  669. }
  670. return 0
  671. }
  672. getVehicleModelId() {
  673. if(!checkHandles())
  674. return 0
  675. dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
  676. if(ErrorLevel) {
  677. ErrorLevel := ERROR_READ_MEMORY
  678. return 0
  679. }
  680. if(!dwAddr)
  681. return 0
  682. sVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_MODEL, 2, "Short")
  683. if(ErrorLevel) {
  684. ErrorLevel := ERROR_READ_MEMORY
  685. return 0
  686. }
  687. ErrorLevel := ERROR_OK
  688. return sVal
  689. }
  690. getVehicleModelName() {
  691. id:=getVehicleModelId()
  692. if(id>400 && id <611)
  693. {
  694. return ovehicleNames[id-399]
  695. }
  696. return ""
  697. }
  698. getVehicleLightState() {
  699. if(!checkHandles())
  700. return -1
  701. dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
  702. if(ErrorLevel) {
  703. ErrorLevel := ERROR_READ_MEMORY
  704. return -1
  705. }
  706. if(!dwAddr)
  707. return -1
  708. dwVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_LIGHTSTATE, 4, "Int")
  709. if(ErrorLevel) {
  710. ErrorLevel := ERROR_READ_MEMORY
  711. return -1
  712. }
  713. ErrorLevel := ERROR_OK
  714. return (dwVal>0)
  715. }
  716. getVehicleEngineState() {
  717. if(!checkHandles())
  718. return -1
  719. dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
  720. if(ErrorLevel) {
  721. ErrorLevel := ERROR_READ_MEMORY
  722. return -1
  723. }
  724. if(!dwAddr)
  725. return -1
  726. cVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_ENGINESTATE, 1, "Char")
  727. if(ErrorLevel) {
  728. ErrorLevel := ERROR_READ_MEMORY
  729. return -1
  730. }
  731. ErrorLevel := ERROR_OK
  732. return (cVal==24 || cVal==56 || cVal==88 || cVal==120)
  733. }
  734. getVehicleLockState() {
  735. if(!checkHandles())
  736. return -1
  737. dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
  738. if(ErrorLevel) {
  739. ErrorLevel := ERROR_READ_MEMORY
  740. return -1
  741. }
  742. if(!dwAddr)
  743. return -1
  744. dwVal := readDWORD(hGTA, dwAddr + ADDR_VEHICLE_DOORSTATE)
  745. if(ErrorLevel) {
  746. ErrorLevel := ERROR_READ_MEMORY
  747. return -1
  748. }
  749. ErrorLevel := ERROR_OK
  750. return (dwVal==2)
  751. }
  752. getCoordinates() {
  753. if(!checkHandles())
  754. return ""
  755. fX := readFloat(hGTA, ADDR_POSITION_X)
  756. if(ErrorLevel) {
  757. ErrorLevel := ERROR_READ_MEMORY
  758. return ""
  759. }
  760. fY := readFloat(hGTA, ADDR_POSITION_Y)
  761. if(ErrorLevel) {
  762. ErrorLevel := ERROR_READ_MEMORY
  763. return ""
  764. }
  765. fZ := readFloat(hGTA, ADDR_POSITION_Z)
  766. if(ErrorLevel) {
  767. ErrorLevel := ERROR_READ_MEMORY
  768. return ""
  769. }
  770. ErrorLevel := ERROR_OK
  771. return [fX, fY, fZ]
  772. }
  773. calculateZone(posX, posY, posZ) {
  774. posX += 0
  775. posY += 0
  776. posZ += 0
  777. if ( !bInitZaC )
  778. {
  779. initZonesAndCities()
  780. bInitZaC := 1
  781. }
  782. Loop % nZone-1
  783. {
  784. 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)
  785. {
  786. ErrorLevel := ERROR_OK
  787. return zone%A_Index%_name
  788. }
  789. }
  790. ErrorLevel := ERROR_ZONE_NOT_FOUND
  791. return ""
  792. }
  793. calculateCity(posX, posY, posZ) {
  794. posX += 0
  795. posY += 0
  796. posZ += 0
  797. if ( !bInitZaC )
  798. {
  799. initZonesAndCities()
  800. bInitZaC := 1
  801. }
  802. smallestCity := ""
  803. currentCitySize := 0
  804. smallestCitySize := 0
  805. Loop % nCity-1
  806. {
  807. 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)
  808. {
  809. 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))
  810. if (!smallestCity) || (currentCitySize < smallestCitySize)
  811. {
  812. smallestCity := city%A_Index%_name
  813. smallestCitySize := currentCitySize
  814. }
  815. }
  816. }
  817. if(!smallestCity) {
  818. ErrorLevel := ERROR_CITY_NOT_FOUND
  819. } else {
  820. ErrorLevel := ERROR_OK
  821. }
  822. return smallestCity
  823. }
  824. initZonesAndCities() {
  825. if(bInitZaC)
  826. return
  827. AddCity("Las Venturas", 685.0, 476.093, -500.0, 3000.0, 3000.0, 500.0)
  828. AddCity("San Fierro", -3000.0, -742.306, -500.0, -1270.53, 1530.24, 500.0)
  829. AddCity("San Fierro", -1270.53, -402.481, -500.0, -1038.45, 832.495, 500.0)
  830. AddCity("San Fierro", -1038.45, -145.539, -500.0, -897.546, 376.632, 500.0)
  831. AddCity("Los Santos", 480.0, -3000.0, -500.0, 3000.0, -850.0, 500.0)
  832. AddCity("Los Santos", 80.0, -2101.61, -500.0, 1075.0, -1239.61, 500.0)
  833. AddCity("Tierra Robada", -1213.91, 596.349, -242.99, -480.539, 1659.68, 900.0)
  834. AddCity("Red County", -1213.91, -768.027, -242.99, 2997.06, 596.349, 900.0)
  835. AddCity("Flint County", -1213.91, -2892.97, -242.99, 44.6147, -768.027, 900.0)
  836. AddCity("Whetstone", -2997.47, -2892.97, -242.99, -1213.91, -1115.58, 900.0)
  837. AddZone("Avispa Country Club", -2667.810, -302.135, -28.831, -2646.400, -262.320, 71.169)
  838. AddZone("Easter Bay Airport", -1315.420, -405.388, 15.406, -1264.400, -209.543, 25.406)
  839. AddZone("Avispa Country Club", -2550.040, -355.493, 0.000, -2470.040, -318.493, 39.700)
  840. AddZone("Easter Bay Airport", -1490.330, -209.543, 15.406, -1264.400, -148.388, 25.406)
  841. AddZone("Garcia", -2395.140, -222.589, -5.3, -2354.090, -204.792, 200.000)
  842. AddZone("Shady Cabin", -1632.830, -2263.440, -3.0, -1601.330, -2231.790, 200.000)
  843. AddZone("East Los Santos", 2381.680, -1494.030, -89.084, 2421.030, -1454.350, 110.916)
  844. AddZone("LVA Freight Depot", 1236.630, 1163.410, -89.084, 1277.050, 1203.280, 110.916)
  845. AddZone("Blackfield Intersection", 1277.050, 1044.690, -89.084, 1315.350, 1087.630, 110.916)
  846. AddZone("Avispa Country Club", -2470.040, -355.493, 0.000, -2270.040, -318.493, 46.100)
  847. AddZone("Temple", 1252.330, -926.999, -89.084, 1357.000, -910.170, 110.916)
  848. AddZone("Unity Station", 1692.620, -1971.800, -20.492, 1812.620, -1932.800, 79.508)
  849. AddZone("LVA Freight Depot", 1315.350, 1044.690, -89.084, 1375.600, 1087.630, 110.916)
  850. AddZone("Los Flores", 2581.730, -1454.350, -89.084, 2632.830, -1393.420, 110.916)
  851. AddZone("Starfish Casino", 2437.390, 1858.100, -39.084, 2495.090, 1970.850, 60.916)
  852. AddZone("Easter Bay Chemicals", -1132.820, -787.391, 0.000, -956.476, -768.027, 200.000)
  853. AddZone("Downtown Los Santos", 1370.850, -1170.870, -89.084, 1463.900, -1130.850, 110.916)
  854. AddZone("Esplanade East", -1620.300, 1176.520, -4.5, -1580.010, 1274.260, 200.000)
  855. AddZone("Market Station", 787.461, -1410.930, -34.126, 866.009, -1310.210, 65.874)
  856. AddZone("Linden Station", 2811.250, 1229.590, -39.594, 2861.250, 1407.590, 60.406)
  857. AddZone("Montgomery Intersection", 1582.440, 347.457, 0.000, 1664.620, 401.750, 200.000)
  858. AddZone("Frederick Bridge", 2759.250, 296.501, 0.000, 2774.250, 594.757, 200.000)
  859. AddZone("Yellow Bell Station", 1377.480, 2600.430, -21.926, 1492.450, 2687.360, 78.074)
  860. AddZone("Downtown Los Santos", 1507.510, -1385.210, 110.916, 1582.550, -1325.310, 335.916)
  861. AddZone("Jefferson", 2185.330, -1210.740, -89.084, 2281.450, -1154.590, 110.916)
  862. AddZone("Mulholland", 1318.130, -910.170, -89.084, 1357.000, -768.027, 110.916)
  863. AddZone("Avispa Country Club", -2361.510, -417.199, 0.000, -2270.040, -355.493, 200.000)
  864. AddZone("Jefferson", 1996.910, -1449.670, -89.084, 2056.860, -1350.720, 110.916)
  865. AddZone("Julius Thruway West", 1236.630, 2142.860, -89.084, 1297.470, 2243.230, 110.916)
  866. AddZone("Jefferson", 2124.660, -1494.030, -89.084, 2266.210, -1449.670, 110.916)
  867. AddZone("Julius Thruway North", 1848.400, 2478.490, -89.084, 1938.800, 2553.490, 110.916)
  868. AddZone("Rodeo", 422.680, -1570.200, -89.084, 466.223, -1406.050, 110.916)
  869. AddZone("Cranberry Station", -2007.830, 56.306, 0.000, -1922.000, 224.782, 100.000)
  870. AddZone("Downtown Los Santos", 1391.050, -1026.330, -89.084, 1463.900, -926.999, 110.916)
  871. AddZone("Redsands West", 1704.590, 2243.230, -89.084, 1777.390, 2342.830, 110.916)
  872. AddZone("Little Mexico", 1758.900, -1722.260, -89.084, 1812.620, -1577.590, 110.916)
  873. AddZone("Blackfield Intersection", 1375.600, 823.228, -89.084, 1457.390, 919.447, 110.916)
  874. AddZone("Los Santos International", 1974.630, -2394.330, -39.084, 2089.000, -2256.590, 60.916)
  875. AddZone("Beacon Hill", -399.633, -1075.520, -1.489, -319.033, -977.516, 198.511)
  876. AddZone("Rodeo", 334.503, -1501.950, -89.084, 422.680, -1406.050, 110.916)
  877. AddZone("Richman", 225.165, -1369.620, -89.084, 334.503, -1292.070, 110.916)
  878. AddZone("Downtown Los Santos", 1724.760, -1250.900, -89.084, 1812.620, -1150.870, 110.916)
  879. AddZone("The Strip", 2027.400, 1703.230, -89.084, 2137.400, 1783.230, 110.916)
  880. AddZone("Downtown Los Santos", 1378.330, -1130.850, -89.084, 1463.900, -1026.330, 110.916)
  881. AddZone("Blackfield Intersection", 1197.390, 1044.690, -89.084, 1277.050, 1163.390, 110.916)
  882. AddZone("Conference Center", 1073.220, -1842.270, -89.084, 1323.900, -1804.210, 110.916)
  883. AddZone("Montgomery", 1451.400, 347.457, -6.1, 1582.440, 420.802, 200.000)
  884. AddZone("Foster Valley", -2270.040, -430.276, -1.2, -2178.690, -324.114, 200.000)
  885. AddZone("Blackfield Chapel", 1325.600, 596.349, -89.084, 1375.600, 795.010, 110.916)
  886. AddZone("Los Santos International", 2051.630, -2597.260, -39.084, 2152.450, -2394.330, 60.916)
  887. AddZone("Mulholland", 1096.470, -910.170, -89.084, 1169.130, -768.027, 110.916)
  888. AddZone("Yellow Bell Gol Course", 1457.460, 2723.230, -89.084, 1534.560, 2863.230, 110.916)
  889. AddZone("The Strip", 2027.400, 1783.230, -89.084, 2162.390, 1863.230, 110.916)
  890. AddZone("Jefferson", 2056.860, -1210.740, -89.084, 2185.330, -1126.320, 110.916)
  891. AddZone("Mulholland", 952.604, -937.184, -89.084, 1096.470, -860.619, 110.916)
  892. AddZone("Aldea Malvada", -1372.140, 2498.520, 0.000, -1277.590, 2615.350, 200.000)
  893. AddZone("Las Colinas", 2126.860, -1126.320, -89.084, 2185.330, -934.489, 110.916)
  894. AddZone("Las Colinas", 1994.330, -1100.820, -89.084, 2056.860, -920.815, 110.916)
  895. AddZone("Richman", 647.557, -954.662, -89.084, 768.694, -860.619, 110.916)
  896. AddZone("LVA Freight Depot", 1277.050, 1087.630, -89.084, 1375.600, 1203.280, 110.916)
  897. AddZone("Julius Thruway North", 1377.390, 2433.230, -89.084, 1534.560, 2507.230, 110.916)
  898. AddZone("Willowfield", 2201.820, -2095.000, -89.084, 2324.000, -1989.900, 110.916)
  899. AddZone("Julius Thruway North", 1704.590, 2342.830, -89.084, 1848.400, 2433.230, 110.916)
  900. AddZone("Temple", 1252.330, -1130.850, -89.084, 1378.330, -1026.330, 110.916)
  901. AddZone("Little Mexico", 1701.900, -1842.270, -89.084, 1812.620, -1722.260, 110.916)
  902. AddZone("Queens", -2411.220, 373.539, 0.000, -2253.540, 458.411, 200.000)
  903. AddZone("Las Venturas Airport", 1515.810, 1586.400, -12.500, 1729.950, 1714.560, 87.500)
  904. AddZone("Richman", 225.165, -1292.070, -89.084, 466.223, -1235.070, 110.916)
  905. AddZone("Temple", 1252.330, -1026.330, -89.084, 1391.050, -926.999, 110.916)
  906. AddZone("East Los Santos", 2266.260, -1494.030, -89.084, 2381.680, -1372.040, 110.916)
  907. AddZone("Julius Thruway East", 2623.180, 943.235, -89.084, 2749.900, 1055.960, 110.916)
  908. AddZone("Willowfield", 2541.700, -1941.400, -89.084, 2703.580, -1852.870, 110.916)
  909. AddZone("Las Colinas", 2056.860, -1126.320, -89.084, 2126.860, -920.815, 110.916)
  910. AddZone("Julius Thruway East", 2625.160, 2202.760, -89.084, 2685.160, 2442.550, 110.916)
  911. AddZone("Rodeo", 225.165, -1501.950, -89.084, 334.503, -1369.620, 110.916)
  912. AddZone("Las Brujas", -365.167, 2123.010, -3.0, -208.570, 2217.680, 200.000)
  913. AddZone("Julius Thruway East", 2536.430, 2442.550, -89.084, 2685.160, 2542.550, 110.916)
  914. AddZone("Rodeo", 334.503, -1406.050, -89.084, 466.223, -1292.070, 110.916)
  915. AddZone("Vinewood", 647.557, -1227.280, -89.084, 787.461, -1118.280, 110.916)
  916. AddZone("Rodeo", 422.680, -1684.650, -89.084, 558.099, -1570.200, 110.916)
  917. AddZone("Julius Thruway North", 2498.210, 2542.550, -89.084, 2685.160, 2626.550, 110.916)
  918. AddZone("Downtown Los Santos", 1724.760, -1430.870, -89.084, 1812.620, -1250.900, 110.916)
  919. AddZone("Rodeo", 225.165, -1684.650, -89.084, 312.803, -1501.950, 110.916)
  920. AddZone("Jefferson", 2056.860, -1449.670, -89.084, 2266.210, -1372.040, 110.916)
  921. AddZone("Hampton Barns", 603.035, 264.312, 0.000, 761.994, 366.572, 200.000)
  922. AddZone("Temple", 1096.470, -1130.840, -89.084, 1252.330, -1026.330, 110.916)
  923. AddZone("Kincaid Bridge", -1087.930, 855.370, -89.084, -961.950, 986.281, 110.916)
  924. AddZone("Verona Beach", 1046.150, -1722.260, -89.084, 1161.520, -1577.590, 110.916)
  925. AddZone("Commerce", 1323.900, -1722.260, -89.084, 1440.900, -1577.590, 110.916)
  926. AddZone("Mulholland", 1357.000, -926.999, -89.084, 1463.900, -768.027, 110.916)
  927. AddZone("Rodeo", 466.223, -1570.200, -89.084, 558.099, -1385.070, 110.916)
  928. AddZone("Mulholland", 911.802, -860.619, -89.084, 1096.470, -768.027, 110.916)
  929. AddZone("Mulholland", 768.694, -954.662, -89.084, 952.604, -860.619, 110.916)
  930. AddZone("Julius Thruway South", 2377.390, 788.894, -89.084, 2537.390, 897.901, 110.916)
  931. AddZone("Idlewood", 1812.620, -1852.870, -89.084, 1971.660, -1742.310, 110.916)
  932. AddZone("Ocean Docks", 2089.000, -2394.330, -89.084, 2201.820, -2235.840, 110.916)
  933. AddZone("Commerce", 1370.850, -1577.590, -89.084, 1463.900, -1384.950, 110.916)
  934. AddZone("Julius Thruway North", 2121.400, 2508.230, -89.084, 2237.400, 2663.170, 110.916)
  935. AddZone("Temple", 1096.470, -1026.330, -89.084, 1252.330, -910.170, 110.916)
  936. AddZone("Glen Park", 1812.620, -1449.670, -89.084, 1996.910, -1350.720, 110.916)
  937. AddZone("Easter Bay Airport", -1242.980, -50.096, 0.000, -1213.910, 578.396, 200.000)
  938. AddZone("Martin Bridge", -222.179, 293.324, 0.000, -122.126, 476.465, 200.000)
  939. AddZone("The Strip", 2106.700, 1863.230, -89.084, 2162.390, 2202.760, 110.916)
  940. AddZone("Willowfield", 2541.700, -2059.230, -89.084, 2703.580, -1941.400, 110.916)
  941. AddZone("Marina", 807.922, -1577.590, -89.084, 926.922, -1416.250, 110.916)
  942. AddZone("Las Venturas Airport", 1457.370, 1143.210, -89.084, 1777.400, 1203.280, 110.916)
  943. AddZone("Idlewood", 1812.620, -1742.310, -89.084, 1951.660, -1602.310, 110.916)
  944. AddZone("Esplanade East", -1580.010, 1025.980, -6.1, -1499.890, 1274.260, 200.000)
  945. AddZone("Downtown Los Santos", 1370.850, -1384.950, -89.084, 1463.900, -1170.870, 110.916)
  946. AddZone("The Mako Span", 1664.620, 401.750, 0.000, 1785.140, 567.203, 200.000)
  947. AddZone("Rodeo", 312.803, -1684.650, -89.084, 422.680, -1501.950, 110.916)
  948. AddZone("Pershing Square", 1440.900, -1722.260, -89.084, 1583.500, -1577.590, 110.916)
  949. AddZone("Mulholland", 687.802, -860.619, -89.084, 911.802, -768.027, 110.916)
  950. AddZone("Gant Bridge", -2741.070, 1490.470, -6.1, -2616.400, 1659.680, 200.000)
  951. AddZone("Las Colinas", 2185.330, -1154.590, -89.084, 2281.450, -934.489, 110.916)
  952. AddZone("Mulholland", 1169.130, -910.170, -89.084, 1318.130, -768.027, 110.916)
  953. AddZone("Julius Thruway North", 1938.800, 2508.230, -89.084, 2121.400, 2624.230, 110.916)
  954. AddZone("Commerce", 1667.960, -1577.590, -89.084, 1812.620, -1430.870, 110.916)
  955. AddZone("Rodeo", 72.648, -1544.170, -89.084, 225.165, -1404.970, 110.916)
  956. AddZone("Roca Escalante", 2536.430, 2202.760, -89.084, 2625.160, 2442.550, 110.916)
  957. AddZone("Rodeo", 72.648, -1684.650, -89.084, 225.165, -1544.170, 110.916)
  958. AddZone("Market", 952.663, -1310.210, -89.084, 1072.660, -1130.850, 110.916)
  959. AddZone("Las Colinas", 2632.740, -1135.040, -89.084, 2747.740, -945.035, 110.916)
  960. AddZone("Mulholland", 861.085, -674.885, -89.084, 1156.550, -600.896, 110.916)
  961. AddZone("King's", -2253.540, 373.539, -9.1, -1993.280, 458.411, 200.000)
  962. AddZone("Redsands East", 1848.400, 2342.830, -89.084, 2011.940, 2478.490, 110.916)
  963. AddZone("Downtown", -1580.010, 744.267, -6.1, -1499.890, 1025.980, 200.000)
  964. AddZone("Conference Center", 1046.150, -1804.210, -89.084, 1323.900, -1722.260, 110.916)
  965. AddZone("Richman", 647.557, -1118.280, -89.084, 787.461, -954.662, 110.916)
  966. AddZone("Ocean Flats", -2994.490, 277.411, -9.1, -2867.850, 458.411, 200.000)
  967. AddZone("Greenglass College", 964.391, 930.890, -89.084, 1166.530, 1044.690, 110.916)
  968. AddZone("Glen Park", 1812.620, -1100.820, -89.084, 1994.330, -973.380, 110.916)
  969. AddZone("LVA Freight Depot", 1375.600, 919.447, -89.084, 1457.370, 1203.280, 110.916)
  970. AddZone("Regular Tom", -405.770, 1712.860, -3.0, -276.719, 1892.750, 200.000)
  971. AddZone("Verona Beach", 1161.520, -1722.260, -89.084, 1323.900, -1577.590, 110.916)
  972. AddZone("East Los Santos", 2281.450, -1372.040, -89.084, 2381.680, -1135.040, 110.916)
  973. AddZone("Caligula's Palace", 2137.400, 1703.230, -89.084, 2437.390, 1783.230, 110.916)
  974. AddZone("Idlewood", 1951.660, -1742.310, -89.084, 2124.660, -1602.310, 110.916)
  975. AddZone("Pilgrim", 2624.400, 1383.230, -89.084, 2685.160, 1783.230, 110.916)
  976. AddZone("Idlewood", 2124.660, -1742.310, -89.084, 2222.560, -1494.030, 110.916)
  977. AddZone("Queens", -2533.040, 458.411, 0.000, -2329.310, 578.396, 200.000)
  978. AddZone("Downtown", -1871.720, 1176.420, -4.5, -1620.300, 1274.260, 200.000)
  979. AddZone("Commerce", 1583.500, -1722.260, -89.084, 1758.900, -1577.590, 110.916)
  980. AddZone("East Los Santos", 2381.680, -1454.350, -89.084, 2462.130, -1135.040, 110.916)
  981. AddZone("Marina", 647.712, -1577.590, -89.084, 807.922, -1416.250, 110.916)
  982. AddZone("Richman", 72.648, -1404.970, -89.084, 225.165, -1235.070, 110.916)
  983. AddZone("Vinewood", 647.712, -1416.250, -89.084, 787.461, -1227.280, 110.916)
  984. AddZone("East Los Santos", 2222.560, -1628.530, -89.084, 2421.030, -1494.030, 110.916)
  985. AddZone("Rodeo", 558.099, -1684.650, -89.084, 647.522, -1384.930, 110.916)
  986. AddZone("Easter Tunnel", -1709.710, -833.034, -1.5, -1446.010, -730.118, 200.000)
  987. AddZone("Rodeo", 466.223, -1385.070, -89.084, 647.522, -1235.070, 110.916)
  988. AddZone("Redsands East", 1817.390, 2202.760, -89.084, 2011.940, 2342.830, 110.916)
  989. AddZone("The Clown's Pocket", 2162.390, 1783.230, -89.084, 2437.390, 1883.230, 110.916)
  990. AddZone("Idlewood", 1971.660, -1852.870, -89.084, 2222.560, -1742.310, 110.916)
  991. AddZone("Montgomery Intersection", 1546.650, 208.164, 0.000, 1745.830, 347.457, 200.000)
  992. AddZone("Willowfield", 2089.000, -2235.840, -89.084, 2201.820, -1989.900, 110.916)
  993. AddZone("Temple", 952.663, -1130.840, -89.084, 1096.470, -937.184, 110.916)
  994. AddZone("Prickle Pine", 1848.400, 2553.490, -89.084, 1938.800, 2863.230, 110.916)
  995. AddZone("Los Santos International", 1400.970, -2669.260, -39.084, 2189.820, -2597.260, 60.916)
  996. AddZone("Garver Bridge", -1213.910, 950.022, -89.084, -1087.930, 1178.930, 110.916)
  997. AddZone("Garver Bridge", -1339.890, 828.129, -89.084, -1213.910, 1057.040, 110.916)
  998. AddZone("Kincaid Bridge", -1339.890, 599.218, -89.084, -1213.910, 828.129, 110.916)
  999. AddZone("Kincaid Bridge", -1213.910, 721.111, -89.084, -1087.930, 950.022, 110.916)
  1000. AddZone("Verona Beach", 930.221, -2006.780, -89.084, 1073.220, -1804.210, 110.916)
  1001. AddZone("Verdant Bluffs", 1073.220, -2006.780, -89.084, 1249.620, -1842.270, 110.916)
  1002. AddZone("Vinewood", 787.461, -1130.840, -89.084, 952.604, -954.662, 110.916)
  1003. AddZone("Vinewood", 787.461, -1310.210, -89.084, 952.663, -1130.840, 110.916)
  1004. AddZone("Commerce", 1463.900, -1577.590, -89.084, 1667.960, -1430.870, 110.916)
  1005. AddZone("Market", 787.461, -1416.250, -89.084, 1072.660, -1310.210, 110.916)
  1006. AddZone("Rockshore West", 2377.390, 596.349, -89.084, 2537.390, 788.894, 110.916)
  1007. AddZone("Julius Thruway North", 2237.400, 2542.550, -89.084, 2498.210, 2663.170, 110.916)
  1008. AddZone("East Beach", 2632.830, -1668.130, -89.084, 2747.740, -1393.420, 110.916)
  1009. AddZone("Fallow Bridge", 434.341, 366.572, 0.000, 603.035, 555.680, 200.000)
  1010. AddZone("Willowfield", 2089.000, -1989.900, -89.084, 2324.000, -1852.870, 110.916)
  1011. AddZone("Chinatown", -2274.170, 578.396, -7.6, -2078.670, 744.170, 200.000)
  1012. AddZone("El Castillo del Diablo", -208.570, 2337.180, 0.000, 8.430, 2487.180, 200.000)
  1013. AddZone("Ocean Docks", 2324.000, -2145.100, -89.084, 2703.580, -2059.230, 110.916)
  1014. AddZone("Easter Bay Chemicals", -1132.820, -768.027, 0.000, -956.476, -578.118, 200.000)
  1015. AddZone("The Visage", 1817.390, 1703.230, -89.084, 2027.400, 1863.230, 110.916)
  1016. AddZone("Ocean Flats", -2994.490, -430.276, -1.2, -2831.890, -222.589, 200.000)
  1017. AddZone("Richman", 321.356, -860.619, -89.084, 687.802, -768.027, 110.916)
  1018. AddZone("Green Palms", 176.581, 1305.450, -3.0, 338.658, 1520.720, 200.000)
  1019. AddZone("Richman", 321.356, -768.027, -89.084, 700.794, -674.885, 110.916)
  1020. AddZone("Starfish Casino", 2162.390, 1883.230, -89.084, 2437.390, 2012.180, 110.916)
  1021. AddZone("East Beach", 2747.740, -1668.130, -89.084, 2959.350, -1498.620, 110.916)
  1022. AddZone("Jefferson", 2056.860, -1372.040, -89.084, 2281.450, -1210.740, 110.916)
  1023. AddZone("Downtown Los Santos", 1463.900, -1290.870, -89.084, 1724.760, -1150.870, 110.916)
  1024. AddZone("Downtown Los Santos", 1463.900, -1430.870, -89.084, 1724.760, -1290.870, 110.916)
  1025. AddZone("Garver Bridge", -1499.890, 696.442, -179.615, -1339.890, 925.353, 20.385)
  1026. AddZone("Julius Thruway South", 1457.390, 823.228, -89.084, 2377.390, 863.229, 110.916)
  1027. AddZone("East Los Santos", 2421.030, -1628.530, -89.084, 2632.830, -1454.350, 110.916)
  1028. AddZone("Greenglass College", 964.391, 1044.690, -89.084, 1197.390, 1203.220, 110.916)
  1029. AddZone("Las Colinas", 2747.740, -1120.040, -89.084, 2959.350, -945.035, 110.916)
  1030. AddZone("Mulholland", 737.573, -768.027, -89.084, 1142.290, -674.885, 110.916)
  1031. AddZone("Ocean Docks", 2201.820, -2730.880, -89.084, 2324.000, -2418.330, 110.916)
  1032. AddZone("East Los Santos", 2462.130, -1454.350, -89.084, 2581.730, -1135.040, 110.916)
  1033. AddZone("Ganton", 2222.560, -1722.330, -89.084, 2632.830, -1628.530, 110.916)
  1034. AddZone("Avispa Country Club", -2831.890, -430.276, -6.1, -2646.400, -222.589, 200.000)
  1035. AddZone("Willowfield", 1970.620, -2179.250, -89.084, 2089.000, -1852.870, 110.916)
  1036. AddZone("Esplanade North", -1982.320, 1274.260, -4.5, -1524.240, 1358.900, 200.000)
  1037. AddZone("The High Roller", 1817.390, 1283.230, -89.084, 2027.390, 1469.230, 110.916)
  1038. AddZone("Ocean Docks", 2201.820, -2418.330, -89.084, 2324.000, -2095.000, 110.916)
  1039. AddZone("Last Dime Motel", 1823.080, 596.349, -89.084, 1997.220, 823.228, 110.916)
  1040. AddZone("Bayside Marina", -2353.170, 2275.790, 0.000, -2153.170, 2475.790, 200.000)
  1041. AddZone("King's", -2329.310, 458.411, -7.6, -1993.280, 578.396, 200.000)
  1042. AddZone("El Corona", 1692.620, -2179.250, -89.084, 1812.620, -1842.270, 110.916)
  1043. AddZone("Blackfield Chapel", 1375.600, 596.349, -89.084, 1558.090, 823.228, 110.916)
  1044. AddZone("The Pink Swan", 1817.390, 1083.230, -89.084, 2027.390, 1283.230, 110.916)
  1045. AddZone("Julius Thruway West", 1197.390, 1163.390, -89.084, 1236.630, 2243.230, 110.916)
  1046. AddZone("Los Flores", 2581.730, -1393.420, -89.084, 2747.740, -1135.040, 110.916)
  1047. AddZone("The Visage", 1817.390, 1863.230, -89.084, 2106.700, 2011.830, 110.916)
  1048. AddZone("Prickle Pine", 1938.800, 2624.230, -89.084, 2121.400, 2861.550, 110.916)
  1049. AddZone("Verona Beach", 851.449, -1804.210, -89.084, 1046.150, -1577.590, 110.916)
  1050. AddZone("Robada Intersection", -1119.010, 1178.930, -89.084, -862.025, 1351.450, 110.916)
  1051. AddZone("Linden Side", 2749.900, 943.235, -89.084, 2923.390, 1198.990, 110.916)
  1052. AddZone("Ocean Docks", 2703.580, -2302.330, -89.084, 2959.350, -2126.900, 110.916)
  1053. AddZone("Willowfield", 2324.000, -2059.230, -89.084, 2541.700, -1852.870, 110.916)
  1054. AddZone("King's", -2411.220, 265.243, -9.1, -1993.280, 373.539, 200.000)
  1055. AddZone("Commerce", 1323.900, -1842.270, -89.084, 1701.900, -1722.260, 110.916)
  1056. AddZone("Mulholland", 1269.130, -768.027, -89.084, 1414.070, -452.425, 110.916)
  1057. AddZone("Marina", 647.712, -1804.210, -89.084, 851.449, -1577.590, 110.916)
  1058. AddZone("Battery Point", -2741.070, 1268.410, -4.5, -2533.040, 1490.470, 200.000)
  1059. AddZone("The Four Dragons Casino", 1817.390, 863.232, -89.084, 2027.390, 1083.230, 110.916)
  1060. AddZone("Blackfield", 964.391, 1203.220, -89.084, 1197.390, 1403.220, 110.916)
  1061. AddZone("Julius Thruway North", 1534.560, 2433.230, -89.084, 1848.400, 2583.230, 110.916)
  1062. AddZone("Yellow Bell Gol Course", 1117.400, 2723.230, -89.084, 1457.460, 2863.230, 110.916)
  1063. AddZone("Idlewood", 1812.620, -1602.310, -89.084, 2124.660, -1449.670, 110.916)
  1064. AddZone("Redsands West", 1297.470, 2142.860, -89.084, 1777.390, 2243.230, 110.916)
  1065. AddZone("Doherty", -2270.040, -324.114, -1.2, -1794.920, -222.589, 200.000)
  1066. AddZone("Hilltop Farm", 967.383, -450.390, -3.0, 1176.780, -217.900, 200.000)
  1067. AddZone("Las Barrancas", -926.130, 1398.730, -3.0, -719.234, 1634.690, 200.000)
  1068. AddZone("Pirates in Men's Pants", 1817.390, 1469.230, -89.084, 2027.400, 1703.230, 110.916)
  1069. AddZone("City Hall", -2867.850, 277.411, -9.1, -2593.440, 458.411, 200.000)
  1070. AddZone("Avispa Country Club", -2646.400, -355.493, 0.000, -2270.040, -222.589, 200.000)
  1071. AddZone("The Strip", 2027.400, 863.229, -89.084, 2087.390, 1703.230, 110.916)
  1072. AddZone("Hashbury", -2593.440, -222.589, -1.0, -2411.220, 54.722, 200.000)
  1073. AddZone("Los Santos International", 1852.000, -2394.330, -89.084, 2089.000, -2179.250, 110.916)
  1074. AddZone("Whitewood Estates", 1098.310, 1726.220, -89.084, 1197.390, 2243.230, 110.916)
  1075. AddZone("Sherman Reservoir", -789.737, 1659.680, -89.084, -599.505, 1929.410, 110.916)
  1076. AddZone("El Corona", 1812.620, -2179.250, -89.084, 1970.620, -1852.870, 110.916)
  1077. AddZone("Downtown", -1700.010, 744.267, -6.1, -1580.010, 1176.520, 200.000)
  1078. AddZone("Foster Valley", -2178.690, -1250.970, 0.000, -1794.920, -1115.580, 200.000)
  1079. AddZone("Las Payasadas", -354.332, 2580.360, 2.0, -133.625, 2816.820, 200.000)
  1080. AddZone("Valle Ocultado", -936.668, 2611.440, 2.0, -715.961, 2847.900, 200.000)
  1081. AddZone("Blackfield Intersection", 1166.530, 795.010, -89.084, 1375.600, 1044.690, 110.916)
  1082. AddZone("Ganton", 2222.560, -1852.870, -89.084, 2632.830, -1722.330, 110.916)
  1083. AddZone("Easter Bay Airport", -1213.910, -730.118, 0.000, -1132.820, -50.096, 200.000)
  1084. AddZone("Redsands East", 1817.390, 2011.830, -89.084, 2106.700, 2202.760, 110.916)
  1085. AddZone("Esplanade East", -1499.890, 578.396, -79.615, -1339.890, 1274.260, 20.385)
  1086. AddZone("Caligula's Palace", 2087.390, 1543.230, -89.084, 2437.390, 1703.230, 110.916)
  1087. AddZone("Royal Casino", 2087.390, 1383.230, -89.084, 2437.390, 1543.230, 110.916)
  1088. AddZone("Richman", 72.648, -1235.070, -89.084, 321.356, -1008.150, 110.916)
  1089. AddZone("Starfish Casino", 2437.390, 1783.230, -89.084, 2685.160, 2012.180, 110.916)
  1090. AddZone("Mulholland", 1281.130, -452.425, -89.084, 1641.130, -290.913, 110.916)
  1091. AddZone("Downtown", -1982.320, 744.170, -6.1, -1871.720, 1274.260, 200.000)
  1092. AddZone("Hankypanky Point", 2576.920, 62.158, 0.000, 2759.250, 385.503, 200.000)
  1093. AddZone("K.A.C.C. Military Fuels", 2498.210, 2626.550, -89.084, 2749.900, 2861.550, 110.916)
  1094. AddZone("Harry Gold Parkway", 1777.390, 863.232, -89.084, 1817.390, 2342.830, 110.916)
  1095. AddZone("Bayside Tunnel", -2290.190, 2548.290, -89.084, -1950.190, 2723.290, 110.916)
  1096. AddZone("Ocean Docks", 2324.000, -2302.330, -89.084, 2703.580, -2145.100, 110.916)
  1097. AddZone("Richman", 321.356, -1044.070, -89.084, 647.557, -860.619, 110.916)
  1098. AddZone("Randolph Industrial Estate", 1558.090, 596.349, -89.084, 1823.080, 823.235, 110.916)
  1099. AddZone("East Beach", 2632.830, -1852.870, -89.084, 2959.350, -1668.130, 110.916)
  1100. AddZone("Flint Water", -314.426, -753.874, -89.084, -106.339, -463.073, 110.916)
  1101. AddZone("Blueberry", 19.607, -404.136, 3.8, 349.607, -220.137, 200.000)
  1102. AddZone("Linden Station", 2749.900, 1198.990, -89.084, 2923.390, 1548.990, 110.916)
  1103. AddZone("Glen Park", 1812.620, -1350.720, -89.084, 2056.860, -1100.820, 110.916)
  1104. AddZone("Downtown", -1993.280, 265.243, -9.1, -1794.920, 578.396, 200.000)
  1105. AddZone("Redsands West", 1377.390, 2243.230, -89.084, 1704.590, 2433.230, 110.916)
  1106. AddZone("Richman", 321.356, -1235.070, -89.084, 647.522, -1044.070, 110.916)
  1107. AddZone("Gant Bridge", -2741.450, 1659.680, -6.1, -2616.400, 2175.150, 200.000)
  1108. AddZone("Lil' Probe Inn", -90.218, 1286.850, -3.0, 153.859, 1554.120, 200.000)
  1109. AddZone("Flint Intersection", -187.700, -1596.760, -89.084, 17.063, -1276.600, 110.916)
  1110. AddZone("Las Colinas", 2281.450, -1135.040, -89.084, 2632.740, -945.035, 110.916)
  1111. AddZone("Sobell Rail Yards", 2749.900, 1548.990, -89.084, 2923.390, 1937.250, 110.916)
  1112. AddZone("The Emerald Isle", 2011.940, 2202.760, -89.084, 2237.400, 2508.230, 110.916)
  1113. AddZone("El Castillo del Diablo", -208.570, 2123.010, -7.6, 114.033, 2337.180, 200.000)
  1114. AddZone("Santa Flora", -2741.070, 458.411, -7.6, -2533.040, 793.411, 200.000)
  1115. AddZone("Playa del Seville", 2703.580, -2126.900, -89.084, 2959.350, -1852.870, 110.916)
  1116. AddZone("Market", 926.922, -1577.590, -89.084, 1370.850, -1416.250, 110.916)
  1117. AddZone("Queens", -2593.440, 54.722, 0.000, -2411.220, 458.411, 200.000)
  1118. AddZone("Pilson Intersection", 1098.390, 2243.230, -89.084, 1377.390, 2507.230, 110.916)
  1119. AddZone("Spinybed", 2121.400, 2663.170, -89.084, 2498.210, 2861.550, 110.916)
  1120. AddZone("Pilgrim", 2437.390, 1383.230, -89.084, 2624.400, 1783.230, 110.916)
  1121. AddZone("Blackfield", 964.391, 1403.220, -89.084, 1197.390, 1726.220, 110.916)
  1122. AddZone("'The Big Ear'", -410.020, 1403.340, -3.0, -137.969, 1681.230, 200.000)
  1123. AddZone("Dillimore", 580.794, -674.885, -9.5, 861.085, -404.790, 200.000)
  1124. AddZone("El Quebrados", -1645.230, 2498.520, 0.000, -1372.140, 2777.850, 200.000)
  1125. AddZone("Esplanade North", -2533.040, 1358.900, -4.5, -1996.660, 1501.210, 200.000)
  1126. AddZone("Easter Bay Airport", -1499.890, -50.096, -1.0, -1242.980, 249.904, 200.000)
  1127. AddZone("Fisher's Lagoon", 1916.990, -233.323, -100.000, 2131.720, 13.800, 200.000)
  1128. AddZone("Mulholland", 1414.070, -768.027, -89.084, 1667.610, -452.425, 110.916)
  1129. AddZone("East Beach", 2747.740, -1498.620, -89.084, 2959.350, -1120.040, 110.916)
  1130. AddZone("San Andreas Sound", 2450.390, 385.503, -100.000, 2759.250, 562.349, 200.000)
  1131. AddZone("Shady Creeks", -2030.120, -2174.890, -6.1, -1820.640, -1771.660, 200.000)
  1132. AddZone("Market", 1072.660, -1416.250, -89.084, 1370.850, -1130.850, 110.916)
  1133. AddZone("Rockshore West", 1997.220, 596.349, -89.084, 2377.390, 823.228, 110.916)
  1134. AddZone("Prickle Pine", 1534.560, 2583.230, -89.084, 1848.400, 2863.230, 110.916)
  1135. AddZone("Easter Basin", -1794.920, -50.096, -1.04, -1499.890, 249.904, 200.000)
  1136. AddZone("Leafy Hollow", -1166.970, -1856.030, 0.000, -815.624, -1602.070, 200.000)
  1137. AddZone("LVA Freight Depot", 1457.390, 863.229, -89.084, 1777.400, 1143.210, 110.916)
  1138. AddZone("Prickle Pine", 1117.400, 2507.230, -89.084, 1534.560, 2723.230, 110.916)
  1139. AddZone("Blueberry", 104.534, -220.137, 2.3, 349.607, 152.236, 200.000)
  1140. AddZone("El Castillo del Diablo", -464.515, 2217.680, 0.000, -208.570, 2580.360, 200.000)
  1141. AddZone("Downtown", -2078.670, 578.396, -7.6, -1499.890, 744.267, 200.000)
  1142. AddZone("Rockshore East", 2537.390, 676.549, -89.084, 2902.350, 943.235, 110.916)
  1143. AddZone("San Fierro Bay", -2616.400, 1501.210, -3.0, -1996.660, 1659.680, 200.000)
  1144. AddZone("Paradiso", -2741.070, 793.411, -6.1, -2533.040, 1268.410, 200.000)
  1145. AddZone("The Camel's Toe", 2087.390, 1203.230, -89.084, 2640.400, 1383.230, 110.916)
  1146. AddZone("Old Venturas Strip", 2162.390, 2012.180, -89.084, 2685.160, 2202.760, 110.916)
  1147. AddZone("Juniper Hill", -2533.040, 578.396, -7.6, -2274.170, 968.369, 200.000)
  1148. AddZone("Juniper Hollow", -2533.040, 968.369, -6.1, -2274.170, 1358.900, 200.000)
  1149. AddZone("Roca Escalante", 2237.400, 2202.760, -89.084, 2536.430, 2542.550, 110.916)
  1150. AddZone("Julius Thruway East", 2685.160, 1055.960, -89.084, 2749.900, 2626.550, 110.916)
  1151. AddZone("Verona Beach", 647.712, -2173.290, -89.084, 930.221, -1804.210, 110.916)
  1152. AddZone("Foster Valley", -2178.690, -599.884, -1.2, -1794.920, -324.114, 200.000)
  1153. AddZone("Arco del Oeste", -901.129, 2221.860, 0.000, -592.090, 2571.970, 200.000)
  1154. AddZone("Fallen Tree", -792.254, -698.555, -5.3, -452.404, -380.043, 200.000)
  1155. AddZone("The Farm", -1209.670, -1317.100, 114.981, -908.161, -787.391, 251.981)
  1156. AddZone("The Sherman Dam", -968.772, 1929.410, -3.0, -481.126, 2155.260, 200.000)
  1157. AddZone("Esplanade North", -1996.660, 1358.900, -4.5, -1524.240, 1592.510, 200.000)
  1158. AddZone("Financial", -1871.720, 744.170, -6.1, -1701.300, 1176.420, 300.000)
  1159. AddZone("Garcia", -2411.220, -222.589, -1.14, -2173.040, 265.243, 200.000)
  1160. AddZone("Montgomery", 1119.510, 119.526, -3.0, 1451.400, 493.323, 200.000)
  1161. AddZone("Creek", 2749.900, 1937.250, -89.084, 2921.620, 2669.790, 110.916)
  1162. AddZone("Los Santos International", 1249.620, -2394.330, -89.084, 1852.000, -2179.250, 110.916)
  1163. AddZone("Santa Maria Beach", 72.648, -2173.290, -89.084, 342.648, -1684.650, 110.916)
  1164. AddZone("Mulholland Intersection", 1463.900, -1150.870, -89.084, 1812.620, -768.027, 110.916)
  1165. AddZone("Angel Pine", -2324.940, -2584.290, -6.1, -1964.220, -2212.110, 200.000)
  1166. AddZone("Verdant Meadows", 37.032, 2337.180, -3.0, 435.988, 2677.900, 200.000)
  1167. AddZone("Octane Springs", 338.658, 1228.510, 0.000, 664.308, 1655.050, 200.000)
  1168. AddZone("Come-A-Lot", 2087.390, 943.235, -89.084, 2623.180, 1203.230, 110.916)
  1169. AddZone("Redsands West", 1236.630, 1883.110, -89.084, 1777.390, 2142.860, 110.916)
  1170. AddZone("Santa Maria Beach", 342.648, -2173.290, -89.084, 647.712, -1684.650, 110.916)
  1171. AddZone("Verdant Bluffs", 1249.620, -2179.250, -89.084, 1692.620, -1842.270, 110.916)
  1172. AddZone("Las Venturas Airport", 1236.630, 1203.280, -89.084, 1457.370, 1883.110, 110.916)
  1173. AddZone("Flint Range", -594.191, -1648.550, 0.000, -187.700, -1276.600, 200.000)
  1174. AddZone("Verdant Bluffs", 930.221, -2488.420, -89.084, 1249.620, -2006.780, 110.916)
  1175. AddZone("Palomino Creek", 2160.220, -149.004, 0.000, 2576.920, 228.322, 200.000)
  1176. AddZone("Ocean Docks", 2373.770, -2697.090, -89.084, 2809.220, -2330.460, 110.916)
  1177. AddZone("Easter Bay Airport", -1213.910, -50.096, -4.5, -947.980, 578.396, 200.000)
  1178. AddZone("Whitewood Estates", 883.308, 1726.220, -89.084, 1098.310, 2507.230, 110.916)
  1179. AddZone("Calton Heights", -2274.170, 744.170, -6.1, -1982.320, 1358.900, 200.000)
  1180. AddZone("Easter Basin", -1794.920, 249.904, -9.1, -1242.980, 578.396, 200.000)
  1181. AddZone("Los Santos Inlet", -321.744, -2224.430, -89.084, 44.615, -1724.430, 110.916)
  1182. AddZone("Doherty", -2173.040, -222.589, -1.0, -1794.920, 265.243, 200.000)
  1183. AddZone("Mount Chiliad", -2178.690, -2189.910, -47.917, -2030.120, -1771.660, 576.083)
  1184. AddZone("Fort Carson", -376.233, 826.326, -3.0, 123.717, 1220.440, 200.000)
  1185. AddZone("Foster Valley", -2178.690, -1115.580, 0.000, -1794.920, -599.884, 200.000)
  1186. AddZone("Ocean Flats", -2994.490, -222.589, -1.0, -2593.440, 277.411, 200.000)
  1187. AddZone("Fern Ridge", 508.189, -139.259, 0.000, 1306.660, 119.526, 200.000)
  1188. AddZone("Bayside", -2741.070, 2175.150, 0.000, -2353.170, 2722.790, 200.000)
  1189. AddZone("Las Venturas Airport", 1457.370, 1203.280, -89.084, 1777.390, 1883.110, 110.916)
  1190. AddZone("Blueberry Acres", -319.676, -220.137, 0.000, 104.534, 293.324, 200.000)
  1191. AddZone("Palisades", -2994.490, 458.411, -6.1, -2741.070, 1339.610, 200.000)
  1192. AddZone("North Rock", 2285.370, -768.027, 0.000, 2770.590, -269.740, 200.000)
  1193. AddZone("Hunter Quarry", 337.244, 710.840, -115.239, 860.554, 1031.710, 203.761)
  1194. AddZone("Los Santos International", 1382.730, -2730.880, -89.084, 2201.820, -2394.330, 110.916)
  1195. AddZone("Missionary Hill", -2994.490, -811.276, 0.000, -2178.690, -430.276, 200.000)
  1196. AddZone("San Fierro Bay", -2616.400, 1659.680, -3.0, -1996.660, 2175.150, 200.000)
  1197. AddZone("Restricted Area", -91.586, 1655.050, -50.000, 421.234, 2123.010, 250.000)
  1198. AddZone("Mount Chiliad", -2997.470, -1115.580, -47.917, -2178.690, -971.913, 576.083)
  1199. AddZone("Mount Chiliad", -2178.690, -1771.660, -47.917, -1936.120, -1250.970, 576.083)
  1200. AddZone("Easter Bay Airport", -1794.920, -730.118, -3.0, -1213.910, -50.096, 200.000)
  1201. AddZone("The Panopticon", -947.980, -304.320, -1.1, -319.676, 327.071, 200.000)
  1202. AddZone("Shady Creeks", -1820.640, -2643.680, -8.0, -1226.780, -1771.660, 200.000)
  1203. AddZone("Back o Beyond", -1166.970, -2641.190, 0.000, -321.744, -1856.030, 200.000)
  1204. AddZone("Mount Chiliad", -2994.490, -2189.910, -47.917, -2178.690, -1115.580, 576.083)
  1205. AddZone("Tierra Robada", -1213.910, 596.349, -242.990, -480.539, 1659.680, 900.000)
  1206. AddZone("Flint County", -1213.910, -2892.970, -242.990, 44.615, -768.027, 900.000)
  1207. AddZone("Whetstone", -2997.470, -2892.970, -242.990, -1213.910, -1115.580, 900.000)
  1208. AddZone("Bone County", -480.539, 596.349, -242.990, 869.461, 2993.870, 900.000)
  1209. AddZone("Tierra Robada", -2997.470, 1659.680, -242.990, -480.539, 2993.870, 900.000)
  1210. AddZone("San Fierro", -2997.470, -1115.580, -242.990, -1213.910, 1659.680, 900.000)
  1211. AddZone("Las Venturas", 869.461, 596.349, -242.990, 2997.060, 2993.870, 900.000)
  1212. AddZone("Red County", -1213.910, -768.027, -242.990, 2997.060, 596.349, 900.000)
  1213. AddZone("Los Santos", 44.615, -2892.970, -242.990, 2997.060, -768.027, 900.000)
  1214. }
  1215. AddZone(sName, x1, y1, z1, x2, y2, z2) {
  1216. global
  1217. zone%nZone%_name := sName
  1218. zone%nZone%_x1 := x1
  1219. zone%nZone%_y1 := y1
  1220. zone%nZone%_z1 := z1
  1221. zone%nZone%_x2 := x2
  1222. zone%nZone%_y2 := y2
  1223. zone%nZone%_z2 := z2
  1224. nZone := nZone + 1
  1225. }
  1226. AddCity(sName, x1, y1, z1, x2, y2, z2) {
  1227. global
  1228. city%nCity%_name := sName
  1229. city%nCity%_x1 := x1
  1230. city%nCity%_y1 := y1
  1231. city%nCity%_z1 := z1
  1232. city%nCity%_x2 := x2
  1233. city%nCity%_y2 := y2
  1234. city%nCity%_z2 := z2
  1235. nCity := nCity + 1
  1236. }
  1237. checkHandles() {
  1238. if(iRefreshHandles+500>A_TickCount)
  1239. return true
  1240. iRefreshHandles:=A_TickCount
  1241. if(!refreshGTA() || !refreshSAMP() || !refreshMemory()) {
  1242. return false
  1243. } else {
  1244. return true
  1245. }
  1246. return true
  1247. }
  1248. refreshGTA() {
  1249. newPID := getPID("GTA:SA:MP")
  1250. if(!newPID) {
  1251. if(hGTA) {
  1252. virtualFreeEx(hGTA, pMemory, 0, 0x8000)
  1253. closeProcess(hGTA)
  1254. hGTA := 0x0
  1255. }
  1256. dwGTAPID := 0
  1257. hGTA := 0x0
  1258. dwSAMP := 0x0
  1259. pMemory := 0x0
  1260. return false
  1261. }
  1262. if(!hGTA || (dwGTAPID != newPID)) {
  1263. hGTA := openProcess(newPID)
  1264. if(ErrorLevel) {
  1265. dwGTAPID := 0
  1266. hGTA := 0x0
  1267. dwSAMP := 0x0
  1268. pMemory := 0x0
  1269. return false
  1270. }
  1271. dwGTAPID := newPID
  1272. dwSAMP := 0x0
  1273. pMemory := 0x0
  1274. return true
  1275. }
  1276. return true
  1277. }
  1278. refreshSAMP() {
  1279. if(dwSAMP)
  1280. return true
  1281. dwSAMP := getModuleBaseAddress("samp.dll", hGTA)
  1282. if(!dwSAMP)
  1283. return false
  1284. return true
  1285. }
  1286. refreshMemory() {
  1287. if(!pMemory) {
  1288. pMemory     := virtualAllocEx(hGTA, 4096, 0x1000 | 0x2000, 0x40)
  1289. if(ErrorLevel) {
  1290. pMemory := 0x0
  1291. return false
  1292. }
  1293. pParam1     := pMemory
  1294. pParam2     := pMemory + 1024
  1295. pParam3     := pMemory + 2048
  1296. pInjectFunc := pMemory + 3072
  1297. }
  1298. return true
  1299. }
  1300. getPID(szWindow) {
  1301. local dwPID := 0
  1302. WinGet, dwPID, PID, %szWindow%
  1303. return dwPID
  1304. }
  1305. openProcess(dwPID, dwRights = 0x1F0FFF) {
  1306. hProcess := DllCall("OpenProcess"
  1307. , "UInt", dwRights
  1308. , "int",  0
  1309. , "UInt", dwPID
  1310. , "Uint")
  1311. if(hProcess == 0) {
  1312. ErrorLevel := ERROR_OPEN_PROCESS
  1313. return 0
  1314. }
  1315. ErrorLevel := ERROR_OK
  1316. return hProcess
  1317. }
  1318. closeProcess(hProcess) {
  1319. if(hProcess == 0) {
  1320. ErrorLevel := ERROR_INVALID_HANDLE
  1321. return 0
  1322. }
  1323. dwRet := DllCall(    "CloseHandle"
  1324. , "Uint", hProcess
  1325. , "UInt")
  1326. ErrorLevel := ERROR_OK
  1327. }
  1328. getModuleBaseAddress(sModule, hProcess) {
  1329. if(!sModule) {
  1330. ErrorLevel := ERROR_MODULE_NOT_FOUND
  1331. return 0
  1332. }
  1333. if(!hProcess) {
  1334. ErrorLevel := ERROR_INVALID_HANDLE
  1335. return 0
  1336. }
  1337. dwSize = 1024*4
  1338. VarSetCapacity(hMods, dwSize)
  1339. VarSetCapacity(cbNeeded, 4)
  1340. dwRet := DllCall(    "Psapi.dll\EnumProcessModules"
  1341. , "UInt", hProcess
  1342. , "UInt", &hMods
  1343. , "UInt", dwSize
  1344. , "UInt*", cbNeeded
  1345. , "UInt")
  1346. if(dwRet == 0) {
  1347. ErrorLevel := ERROR_ENUM_PROCESS_MODULES
  1348. return 0
  1349. }
  1350. dwMods := cbNeeded / 4
  1351. i := 0
  1352. VarSetCapacity(hModule, 4)
  1353. VarSetCapacity(sCurModule, 260)
  1354. while(i < dwMods) {
  1355. hModule := NumGet(hMods, i*4)
  1356. DllCall("Psapi.dll\GetModuleFileNameEx"
  1357. , "UInt", hProcess
  1358. , "UInt", hModule
  1359. , "Str", sCurModule
  1360. , "UInt", 260)
  1361. SplitPath, sCurModule, sFilename
  1362. if(sModule == sFilename) {
  1363. ErrorLevel := ERROR_OK
  1364. return hModule
  1365. }
  1366. i := i + 1
  1367. }
  1368. ErrorLevel := ERROR_MODULE_NOT_FOUND
  1369. return 0
  1370. }
  1371. readString(hProcess, dwAddress, dwLen) {
  1372. if(!hProcess) {
  1373. ErrorLevel := ERROR_INVALID_HANDLE
  1374. return 0
  1375. }
  1376. VarSetCapacity(sRead, dwLen)
  1377. dwRet := DllCall(    "ReadProcessMemory"
  1378. , "UInt", hProcess
  1379. , "UInt", dwAddress
  1380. , "Str", sRead
  1381. , "UInt", dwLen
  1382. , "UInt*", 0
  1383. , "UInt")
  1384. if(dwRet == 0) {
  1385. ErrorLevel := ERROR_READ_MEMORY
  1386. return 0
  1387. }
  1388. ErrorLevel := ERROR_OK
  1389. if A_IsUnicode
  1390. return __ansiToUnicode(sRead)
  1391. return sRead
  1392. }
  1393. readFloat(hProcess, dwAddress) {
  1394. if(!hProcess) {
  1395. ErrorLevel := ERROR_INVALID_HANDLE
  1396. return 0
  1397. }
  1398. VarSetCapacity(dwRead, 4)
  1399. dwRet := DllCall(    "ReadProcessMemory"
  1400. , "UInt",  hProcess
  1401. , "UInt",  dwAddress
  1402. , "Str",   dwRead
  1403. , "UInt",  4
  1404. , "UInt*", 0
  1405. , "UInt")
  1406. if(dwRet == 0) {
  1407. ErrorLevel := ERROR_READ_MEMORY
  1408. return 0
  1409. }
  1410. ErrorLevel := ERROR_OK
  1411. return NumGet(dwRead, 0, "Float")
  1412. }
  1413. readDWORD(hProcess, dwAddress) {
  1414. if(!hProcess) {
  1415. ErrorLevel := ERROR_INVALID_HANDLE
  1416. return 0
  1417. }
  1418. VarSetCapacity(dwRead, 4)
  1419. dwRet := DllCall(    "ReadProcessMemory"
  1420. , "UInt",  hProcess
  1421. , "UInt",  dwAddress
  1422. , "Str",   dwRead
  1423. , "UInt",  4
  1424. , "UInt*", 0)
  1425. if(dwRet == 0) {
  1426. ErrorLevel := ERROR_READ_MEMORY
  1427. return 0
  1428. }
  1429. ErrorLevel := ERROR_OK
  1430. return NumGet(dwRead, 0, "UInt")
  1431. }
  1432. readMem(hProcess, dwAddress, dwLen=4, type="UInt") {
  1433. if(!hProcess) {
  1434. ErrorLevel := ERROR_INVALID_HANDLE
  1435. return 0
  1436. }
  1437. VarSetCapacity(dwRead, dwLen)
  1438. dwRet := DllCall(    "ReadProcessMemory"
  1439. , "UInt",  hProcess
  1440. , "UInt",  dwAddress
  1441. , "Str",   dwRead
  1442. , "UInt",  dwLen
  1443. , "UInt*", 0)
  1444. if(dwRet == 0) {
  1445. ErrorLevel := ERROR_READ_MEMORY
  1446. return 0
  1447. }
  1448. ErrorLevel := ERROR_OK
  1449. return NumGet(dwRead, 0, type)
  1450. }
  1451. writeString(hProcess, dwAddress, wString) {
  1452. if(!hProcess) {
  1453. ErrorLevel := ERROR_INVALID_HANDLE
  1454. return false
  1455. }
  1456. sString := wString
  1457. if A_IsUnicode
  1458. sString := __unicodeToAnsi(wString)
  1459. dwRet := DllCall(    "WriteProcessMemory"
  1460. , "UInt", hProcess
  1461. , "UInt", dwAddress
  1462. , "Str", sString
  1463. , "UInt", StrLen(wString) + 1
  1464. , "UInt", 0
  1465. , "UInt")
  1466. if(dwRet == 0) {
  1467. ErrorLEvel := ERROR_WRITE_MEMORY
  1468. return false
  1469. }
  1470. ErrorLevel := ERROR_OK
  1471. return true
  1472. }
  1473. writeRaw(hProcess, dwAddress, pBuffer, dwLen) {
  1474. if(!hProcess) {
  1475. ErrorLevel := ERROR_INVALID_HANDLE
  1476. return false
  1477. }
  1478. dwRet := DllCall(    "WriteProcessMemory"
  1479. , "UInt", hProcess
  1480. , "UInt", dwAddress
  1481. , "UInt", pBuffer
  1482. , "UInt", dwLen
  1483. , "UInt", 0
  1484. , "UInt")
  1485. if(dwRet == 0) {
  1486. ErrorLEvel := ERROR_WRITE_MEMORY
  1487. return false
  1488. }
  1489. ErrorLevel := ERROR_OK
  1490. return true
  1491. }
  1492. callWithParams(hProcess, dwFunc, aParams, bCleanupStack = true) {
  1493. if(!hProcess) {
  1494. ErrorLevel := ERROR_INVALID_HANDLE
  1495. return false
  1496. }
  1497. validParams := 0
  1498. i := aParams.MaxIndex()
  1499. dwLen := i * 5    + 5    + 1
  1500. if(bCleanupStack)
  1501. dwLen += 3
  1502. VarSetCapacity(injectData, i * 5    + 5       + 3       + 1, 0)
  1503. i_ := 1
  1504. while(i > 0) {
  1505. if(aParams[i][1] != "") {
  1506. dwMemAddress := 0x0
  1507. if(aParams[i][1] == "p") {
  1508. dwMemAddress := aParams[i][2]
  1509. } else if(aParams[i][1] == "s") {
  1510. if(i_>3)
  1511. return false
  1512. dwMemAddress := pParam%i_%
  1513. writeString(hProcess, dwMemAddress, aParams[i][2])
  1514. if(ErrorLevel)
  1515. return false
  1516. i_ += 1
  1517. } else if(aParams[i][1] == "i") {
  1518. dwMemAddress := aParams[i][2]
  1519. } else {
  1520. return false
  1521. }
  1522. NumPut(0x68, injectData, validParams * 5, "UChar")
  1523. NumPut(dwMemAddress, injectData, validParams * 5 + 1, "UInt")
  1524. validParams += 1
  1525. }
  1526. i -= 1
  1527. }
  1528. offset := dwFunc - ( pInjectFunc + validParams * 5 + 5 )
  1529. NumPut(0xE8, injectData, validParams * 5, "UChar")
  1530. NumPut(offset, injectData, validParams * 5 + 1, "Int")
  1531. if(bCleanupStack) {
  1532. NumPut(0xC483, injectData, validParams * 5 + 5, "UShort")
  1533. NumPut(validParams*4, injectData, validParams * 5 + 7, "UChar")
  1534. NumPut(0xC3, injectData, validParams * 5 + 8, "UChar")
  1535. } else {
  1536. NumPut(0xC3, injectData, validParams * 5 + 5, "UChar")
  1537. }
  1538. writeRaw(hGTA, pInjectFunc, &injectData, dwLen)
  1539. if(ErrorLevel)
  1540. return false
  1541. hThread := createRemoteThread(hGTA, 0, 0, pInjectFunc, 0, 0, 0)
  1542. if(ErrorLevel)
  1543. return false
  1544. waitForSingleObject(hThread, 0xFFFFFFFF)
  1545. closeProcess(hThread)
  1546. return true
  1547. }
  1548. virtualAllocEx(hProcess, dwSize, flAllocationType, flProtect) {
  1549. if(!hProcess) {
  1550. ErrorLevel := ERROR_INVALID_HANDLE
  1551. return 0
  1552. }
  1553. dwRet := DllCall(    "VirtualAllocEx"
  1554. , "UInt", hProcess
  1555. , "UInt", 0
  1556. , "UInt", dwSize
  1557. , "UInt", flAllocationType
  1558. , "UInt", flProtect
  1559. , "UInt")
  1560. if(dwRet == 0) {
  1561. ErrorLEvel := ERROR_ALLOC_MEMORY
  1562. return 0
  1563. }
  1564. ErrorLevel := ERROR_OK
  1565. return dwRet
  1566. }
  1567. virtualFreeEx(hProcess, lpAddress, dwSize, dwFreeType) {
  1568. if(!hProcess) {
  1569. ErrorLevel := ERROR_INVALID_HANDLE
  1570. return 0
  1571. }
  1572. dwRet := DllCall(    "VirtualFreeEx"
  1573. , "UInt", hProcess
  1574. , "UInt", lpAddress
  1575. , "UInt", dwSize
  1576. , "UInt", dwFreeType
  1577. , "UInt")
  1578. if(dwRet == 0) {
  1579. ErrorLEvel := ERROR_FREE_MEMORY
  1580. return 0
  1581. }
  1582. ErrorLevel := ERROR_OK
  1583. return dwRet
  1584. }
  1585. createRemoteThread(hProcess, lpThreadAttributes, dwStackSize, lpStartAddress, lpParameter, dwCreationFlags, lpThreadId) {
  1586. if(!hProcess) {
  1587. ErrorLevel := ERROR_INVALID_HANDLE
  1588. return 0
  1589. }
  1590. dwRet := DllCall(    "CreateRemoteThread"
  1591. , "UInt", hProcess
  1592. , "UInt", lpThreadAttributes
  1593. , "UInt", dwStackSize
  1594. , "UInt", lpStartAddress
  1595. , "UInt", lpParameter
  1596. , "UInt", dwCreationFlags
  1597. , "UInt", lpThreadId
  1598. , "UInt")
  1599. if(dwRet == 0) {
  1600. ErrorLEvel := ERROR_ALLOC_MEMORY
  1601. return 0
  1602. }
  1603. ErrorLevel := ERROR_OK
  1604. return dwRet
  1605. }
  1606. waitForSingleObject(hThread, dwMilliseconds) {
  1607. if(!hThread) {
  1608. ErrorLevel := ERROR_INVALID_HANDLE
  1609. return 0
  1610. }
  1611. dwRet := DllCall(    "WaitForSingleObject"
  1612. , "UInt", hThread
  1613. , "UInt", dwMilliseconds
  1614. , "UInt")
  1615. if(dwRet == 0xFFFFFFFF) {
  1616. ErrorLEvel := ERROR_WAIT_FOR_OBJECT
  1617. return 0
  1618. }
  1619. ErrorLevel := ERROR_OK
  1620. return dwRet
  1621. }
  1622. __ansiToUnicode(sString, nLen = 0) {
  1623. If !nLen
  1624. {
  1625. nLen := DllCall("MultiByteToWideChar"
  1626. , "Uint", 0
  1627. , "Uint", 0
  1628. , "Uint", &sString
  1629. , "int",  -1
  1630. , "Uint", 0
  1631. , "int",  0)
  1632. }
  1633. VarSetCapacity(wString, nLen * 2)
  1634. DllCall("MultiByteToWideChar"
  1635. , "Uint", 0
  1636. , "Uint", 0
  1637. , "Uint", &sString
  1638. , "int",  -1
  1639. , "Uint", &wString
  1640. , "int",  nLen)
  1641. return wString
  1642. }
  1643. __unicodeToAnsi(wString, nLen = 0) {
  1644. pString := wString + 1 > 65536 ? wString : &wString
  1645. If !nLen
  1646. {
  1647. nLen := DllCall("WideCharToMultiByte"
  1648. , "Uint", 0
  1649. , "Uint", 0
  1650. , "Uint", pString
  1651. , "int",  -1
  1652. , "Uint", 0
  1653. , "int",  0
  1654. , "Uint", 0
  1655. , "Uint", 0)
  1656. }
  1657. VarSetCapacity(sString, nLen)
  1658. DllCall("WideCharToMultiByte"
  1659. , "Uint", 0
  1660. , "Uint", 0
  1661. , "Uint", pString
  1662. , "int",  -1
  1663. , "str",  sString
  1664. , "int",  nLen
  1665. , "Uint", 0
  1666. , "Uint", 0)
  1667. return sString
  1668. }
  1669. Ping(strHost)
  1670. {
  1671. Loop 4
  1672. bRet := ComObjGet("winmgmts:").Get("Win32_PingStatus.address='" . strHost . "'").StatusCode = 0
  1673. until bRet
  1674. return bRet
  1675. }
  1676. Utf8ToAnsi(ByRef Utf8String, CodePage = 1251)
  1677. {
  1678. If (NumGet(Utf8String) & 0xFFFFFF) = 0xBFBBEF
  1679. BOM = 3
  1680. Else
  1681. BOM = 0
  1682. UniSize := DllCall("MultiByteToWideChar", "UInt", 65001, "UInt", 0
  1683. , "UInt", &Utf8String + BOM, "Int", -1
  1684. , "Int", 0, "Int", 0)
  1685. VarSetCapacity(UniBuf, UniSize * 2)
  1686. DllCall("MultiByteToWideChar", "UInt", 65001, "UInt", 0
  1687. , "UInt", &Utf8String + BOM, "Int", -1
  1688. , "UInt", &UniBuf, "Int", UniSize)
  1689. AnsiSize := DllCall("WideCharToMultiByte", "UInt", CodePage, "UInt", 0
  1690. , "UInt", &UniBuf, "Int", -1
  1691. , "Int", 0, "Int", 0
  1692. , "Int", 0, "Int", 0)
  1693. VarSetCapacity(AnsiString, AnsiSize)
  1694. DllCall("WideCharToMultiByte", "UInt", CodePage, "UInt", 0
  1695. , "UInt", &UniBuf, "Int", -1
  1696. , "Str", AnsiString, "Int", AnsiSize
  1697. , "Int", 0, "Int", 0)
  1698. Return AnsiString
  1699. }
  1700. FileInstall, C:\Users\DUGINI.DUGINI-PC\Desktop\AHK\VKsamp\vksamp.dll, %A_Temp%\vksamp.dll, 1
  1701. path = %A_Temp%\vksamp.dll
  1702. PATH_SAMP_API := PathCombine(A_ScriptDir, path)
  1703. hModule := DllCall("LoadLibrary", Str, PATH_SAMP_API)
  1704. if(hModule == -1 || hModule == 0)
  1705. {
  1706. MsgBox, 48, Ошибка #32, Что-то пошло не так, эта ошибка вообще не должна появляться :С`nПерезапуститесь и сообщите разработчику скрипта, если ошибка повторится.`nСкрипт запустится, но просмотр фотографий работать не будет.
  1707. goto, gui
  1708. }
  1709. Init_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "Init")
  1710. SetParam_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "SetParam")
  1711. IsMenuOpen_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "IsMenuOpen")
  1712. WorldToScreen_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "WorldToScreen")
  1713. GetPlayerCPed_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "GetPlayerCPed")
  1714. GetPlayerHealth_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "GetPlayerHealth")
  1715. GetPlayerArmor_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "GetPlayerArmor")
  1716. GetPlayerMoney_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "GetPlayerMoney")
  1717. GetPlayerSkinID_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "GetPlayerSkinID")
  1718. GetPlayerWeaponID_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "GetPlayerWeaponID")
  1719. GetPlayerWeaponType_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "GetPlayerWeaponType")
  1720. IsPlayerInAnyVehicle_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "IsPlayerInAnyVehicle")
  1721. IsPlayerDriver_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "IsPlayerDriver")
  1722. IsPlayerPassenger_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "IsPlayerPassenger")
  1723. IsPlayerInInterior_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "IsPlayerInInterior")
  1724. GetPlayerX_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "GetPlayerX")
  1725. GetPlayerY_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "GetPlayerY")
  1726. GetPlayerZ_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "GetPlayerZ")
  1727. GetPlayerPosition_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "GetPlayerPosition")
  1728. IsPlayerInRange2D_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "IsPlayerInRange2D")
  1729. IsPlayerInRange3D_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "IsPlayerInRange3D")
  1730. GetCityName_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "GetCityName")
  1731. GetZoneName_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "GetZoneName")
  1732. TextCreate_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "TextCreate")
  1733. TextDestroy_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "TextDestroy")
  1734. TextSetShadow_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "TextSetShadow")
  1735. TextSetShown_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "TextSetShown")
  1736. TextSetColor_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "TextSetColor")
  1737. TextSetPos_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "TextSetPos")
  1738. TextSetString_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "TextSetString")
  1739. TextUpdate_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "TextUpdate")
  1740. BoxCreate_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "BoxCreate")
  1741. BoxDestroy_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "BoxDestroy")
  1742. BoxSetShown_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "BoxSetShown")
  1743. BoxSetBorder_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "BoxSetBorder")
  1744. BoxSetBorderColor_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "BoxSetBorderColor")
  1745. BoxSetColor_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "BoxSetColor")
  1746. BoxSetHeight_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "BoxSetHeight")
  1747. BoxSetPos_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "BoxSetPos")
  1748. BoxSetWidth_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "BoxSetWidth")
  1749. LineCreate_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "LineCreate")
  1750. LineDestroy_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "LineDestroy")
  1751. LineSetShown_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "LineSetShown")
  1752. LineSetColor_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "LineSetColor")
  1753. LineSetWidth_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "LineSetWidth")
  1754. LineSetPos_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "LineSetPos")
  1755. ImageCreate_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "ImageCreate")
  1756. ImageDestroy_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "ImageDestroy")
  1757. ImageSetShown_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "ImageSetShown")
  1758. ImageSetAlign_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "ImageSetAlign")
  1759. ImageSetPos_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "ImageSetPos")
  1760. ImageSetRotation_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "ImageSetRotation")
  1761. DestroyAllVisual_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "DestroyAllVisual")
  1762. ShowAllVisual_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "ShowAllVisual")
  1763. HideAllVisual_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "HideAllVisual")
  1764. GetFrameRate_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "GetFrameRate")
  1765. GetScreenSpecs_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "GetScreenSpecs")
  1766. SetCalculationRatio_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "SetCalculationRatio")
  1767. SetOverlayPriority_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "SetOverlayPriority")
  1768. SetOverlayCalculationEnabled_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "SetOverlayCalculationEnabled")
  1769. SendChat_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "SendChat")
  1770. ShowGameText_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "ShowGameText")
  1771. AddChatMessage_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "AddChatMessage")
  1772. GetPlayerNameByID_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "GetPlayerNameByID")
  1773. GetPlayerIDByName_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "GetPlayerIDByName")
  1774. IsChatOpen_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "IsChatOpen")
  1775. IsDialogOpen_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "IsDialogOpen")
  1776. GetVehiclePointer_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "GetVehiclePointer")
  1777. GetVehicleSpeed_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "GetVehicleSpeed")
  1778. GetVehicleHealth_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "GetVehicleHealth")
  1779. GetVehicleModelId_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "GetVehicleModelId")
  1780. GetVehicleModelName_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "GetVehicleModelName")
  1781. GetVehicleModelNameById_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "GetVehicleModelNameById")
  1782. GetVehicleType_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "GetVehicleType")
  1783. GetVehicleFreeSeats_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "GetVehicleFreeSeats")
  1784. GetVehicleFirstColor_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "GetVehicleFirstColor")
  1785. GetVehicleSecondColor_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "GetVehicleSecondColor")
  1786. GetVehicleColor_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "GetVehicleColor")
  1787. IsVehicleSeatUsed_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "IsVehicleSeatUsed")
  1788. IsVehicleLocked_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "IsVehicleLocked")
  1789. IsVehicleHornEnabled_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "IsVehicleHornEnabled")
  1790. IsVehicleSirenEnabled_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "IsVehicleSirenEnabled")
  1791. IsVehicleAlternateSirenEnabled_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "IsVehicleAlternateSirenEnabled")
  1792. IsVehicleEngineEnabled_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "IsVehicleEngineEnabled")
  1793. IsVehicleLightEnabled_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "IsVehicleLightEnabled")
  1794. IsVehicleCar_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "IsVehicleCar")
  1795. IsVehiclePlane_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "IsVehiclePlane")
  1796. IsVehicleBoat_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "IsVehicleBoat")
  1797. IsVehicleTrain_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "IsVehicleTrain")
  1798. IsVehicleBike_func := DllCall("GetProcAddress", "UInt", hModule, "Str", "IsVehicleBike")
  1799. Init()
  1800. {
  1801. global Init_func
  1802. return DllCall(Init_func)
  1803. }
  1804. SetParam(_szParamName, _szParamValue)
  1805. {
  1806. global SetParam_func
  1807. return DllCall(SetParam_func, "Str", _szParamName, "Str", _szParamValue)
  1808. }
  1809. IsMenuOpen()
  1810. {
  1811. global IsMenuOpen_func
  1812. return DllCall(IsMenuOpen_func)
  1813. }
  1814. WorldToScreen(x, y, z, ByRef screenX, ByRef screenY)
  1815. {
  1816. global WorldToScreen_func
  1817. return DllCall(WorldToScreen_func, "Float", x, "Float", y, "Float", z, "FloatP", screenX, "FloatP", screenY)
  1818. }
  1819. GetPlayerCPed()
  1820. {
  1821. global GetPlayerCPed_func
  1822. return DllCall(GetPlayerCPed_func)
  1823. }
  1824. GetPlayerX(ByRef posX)
  1825. {
  1826. global GetPlayerX_func
  1827. return DllCall(GetPlayerX_func, "FloatP", posX)
  1828. }
  1829. GetPlayerY(ByRef posY)
  1830. {
  1831. global GetPlayerY_func
  1832. return DllCall(GetPlayerY_func, "FloatP", posY)
  1833. }
  1834. GetPlayerZ(ByRef posZ)
  1835. {
  1836. global GetPlayerZ_func
  1837. return DllCall(GetPlayerZ_func, "FloatP", posZ)
  1838. }
  1839. GetPlayerPosition(ByRef posX, ByRef posY, ByRef posZ)
  1840. {
  1841. global GetPlayerPosition_func
  1842. return DllCall(GetPlayerPosition_func, "FloatP", posX, "FloatP", posY, "FloatP", posZ)
  1843. }
  1844. IsPlayerInRange2D(posX, posY, radius)
  1845. {
  1846. global IsPlayerInRange2D_func
  1847. return DllCall(IsPlayerInRange2D_func, "Float", posX, "Float", posY, "Float", radius)
  1848. }
  1849. IsPlayerInRange3D(posX, posY, posZ, radius)
  1850. {
  1851. global IsPlayerInRange3D_func
  1852. return DllCall(IsPlayerInRange3D_func, "Float", posX, "Float", posY, "Float", posZ, "Float", radius)
  1853. }
  1854. GetCityName(ByRef cityName, max_len)
  1855. {
  1856. global GetCityName_func
  1857. VarSetCapacity(cityName, 32, 0)
  1858. return DllCall(GetCityName_func, "StrP", cityName, "Int", max_len)
  1859. }
  1860. GetZoneName(ByRef zoneName, max_len)
  1861. {
  1862. global GetZoneName_func
  1863. VarSetCapacity(zoneName, 32, 0)
  1864. return DllCall(GetZoneName_func, "StrP", zoneName, "Int", max_len)
  1865. }
  1866. TextCreate(Font, FontSize, bBold, bItalic, x, y, color, text, bShadow, bShow)
  1867. {
  1868. global TextCreate_func
  1869. return DllCall(TextCreate_func, "Str", Font, "Int", FontSize, "UChar", bBold, "UChar", bItalic, "Int", x, "Int", y, "UInt", color, "Str", text, "UChar", bShadow, "UChar", bShow)
  1870. }
  1871. TextDestroy(ID)
  1872. {
  1873. global TextDestroy_func
  1874. return DllCall(TextDestroy_func, "Int", ID)
  1875. }
  1876. TextSetShadow(id, b)
  1877. {
  1878. global TextSetShadow_func
  1879. return DllCall(TextSetShadow_func, "Int", id, "UChar", b)
  1880. }
  1881. TextSetShown(id, b)
  1882. {
  1883. global TextSetShown_func
  1884. return DllCall(TextSetShown_func, "Int", id, "UChar", b)
  1885. }
  1886. TextSetColor(id, color)
  1887. {
  1888. global TextSetColor_func
  1889. return DllCall(TextSetColor_func, "Int", id, "UInt", color)
  1890. }
  1891. TextSetPos(id, x, y)
  1892. {
  1893. global TextSetPos_func
  1894. return DllCall(TextSetPos_func, "Int", id, "Int", x, "Int", y)
  1895. }
  1896. TextSetString(id, str)
  1897. {
  1898. global TextSetString_func
  1899. return DllCall(TextSetString_func, "Int", id, "Str", str)
  1900. }
  1901. TextUpdate(id, Font, FontSize, bBold, bItalic)
  1902. {
  1903. global TextUpdate_func
  1904. return DllCall(TextUpdate_func, "Int", id, "Str", Font, "Int", FontSize, "UChar", bBold, "UChar", bItalic)
  1905. }
  1906. BoxCreate(x, y, w, h, dwColor, bShow)
  1907. {
  1908. global BoxCreate_func
  1909. return DllCall(BoxCreate_func, "Int", x, "Int", y, "Int", w, "Int", h, "UInt", dwColor, "UChar", bShow)
  1910. }
  1911. BoxDestroy(id)
  1912. {
  1913. global BoxDestroy_func
  1914. return DllCall(BoxDestroy_func, "Int", id)
  1915. }
  1916. BoxSetShown(id, bShown)
  1917. {
  1918. global BoxSetShown_func
  1919. return DllCall(BoxSetShown_func, "Int", id, "UChar", bShown)
  1920. }
  1921. BoxSetBorder(id, height, bShown)
  1922. {
  1923. global BoxSetBorder_func
  1924. return DllCall(BoxSetBorder_func, "Int", id, "Int", height, "UChar", bShown)
  1925. }
  1926. BoxSetBorderColor(id, dwColor)
  1927. {
  1928. global BoxSetBorderColor_func
  1929. return DllCall(BoxSetBorderColor_func, "Int", id, "UInt", dwColor)
  1930. }
  1931. BoxSetColor(id, dwColor)
  1932. {
  1933. global BoxSetColor_func
  1934. return DllCall(BoxSetColor_func, "Int", id, "UInt", dwColor)
  1935. }
  1936. BoxSetHeight(id, height)
  1937. {
  1938. global BoxSetHeight_func
  1939. return DllCall(BoxSetHeight_func, "Int", id, "Int", height)
  1940. }
  1941. BoxSetPos(id, x, y)
  1942. {
  1943. global BoxSetPos_func
  1944. return DllCall(BoxSetPos_func, "Int", id, "Int", x, "Int", y)
  1945. }
  1946. BoxSetWidth(id, width)
  1947. {
  1948. global BoxSetWidth_func
  1949. return DllCall(BoxSetWidth_func, "Int", id, "Int", width)
  1950. }
  1951. LineCreate(x1, y1, x2, y2, width, color, bShow)
  1952. {
  1953. global LineCreate_func
  1954. return DllCall(LineCreate_func, "Int", x1, "Int", y1, "Int", x2, "Int", y2, "Int", width, "UInt", color, "UChar", bShow)
  1955. }
  1956. LineDestroy(id)
  1957. {
  1958. global LineDestroy_func
  1959. return DllCall(LineDestroy_func, "Int", id)
  1960. }
  1961. LineSetShown(id, bShown)
  1962. {
  1963. global LineSetShown_func
  1964. return DllCall(LineSetShown_func, "Int", id, "UChar", bShown)
  1965. }
  1966. LineSetColor(id, color)
  1967. {
  1968. global LineSetColor_func
  1969. return DllCall(LineSetColor_func, "Int", id, "UInt", color)
  1970. }
  1971. LineSetWidth(id, width)
  1972. {
  1973. global LineSetWidth_func
  1974. return DllCall(LineSetWidth_func, "Int", id, "Int", width)
  1975. }
  1976. LineSetPos(id, x1, y1, x2, y2)
  1977. {
  1978. global LineSetPos_func
  1979. return DllCall(LineSetPos_func, "Int", id, "Int", x1, "Int", y1, "Int", x2, "Int", y2)
  1980. }
  1981. ImageCreate(path, x, y, rotation, align, bShow)
  1982. {
  1983. global ImageCreate_func
  1984. return DllCall(ImageCreate_func, "Str", path, "Int", x, "Int", y, "Int", rotation, "Int", align, "UChar", bShow)
  1985. }
  1986. ImageDestroy(id)
  1987. {
  1988. global ImageDestroy_func
  1989. return DllCall(ImageDestroy_func, "Int", id)
  1990. }
  1991. ImageSetShown(id, bShown)
  1992. {
  1993. global ImageSetShown_func
  1994. return DllCall(ImageSetShown_func, "Int", id, "UChar", bShown)
  1995. }
  1996. ImageSetAlign(id, align)
  1997. {
  1998. global ImageSetAlign_func
  1999. return DllCall(ImageSetAlign_func, "Int", id, "Int", align)
  2000. }
  2001. ImageSetPos(id, x, y)
  2002. {
  2003. global ImageSetPos_func
  2004. return DllCall(ImageSetPos_func, "Int", id, "Int", x, "Int", y)
  2005. }
  2006. ImageSetRotation(id, rotation)
  2007. {
  2008. global ImageSetRotation_func
  2009. return DllCall(ImageSetRotation_func, "Int", id, "Int", rotation)
  2010. }
  2011. DestroyAllVisual()
  2012. {
  2013. global DestroyAllVisual_func
  2014. return DllCall(DestroyAllVisual_func)
  2015. }
  2016. ShowAllVisual()
  2017. {
  2018. global ShowAllVisual_func
  2019. return DllCall(ShowAllVisual_func)
  2020. }
  2021. HideAllVisual()
  2022. {
  2023. global HideAllVisual_func
  2024. return DllCall(HideAllVisual_func)
  2025. }
  2026. GetFrameRate()
  2027. {
  2028. global GetFrameRate_func
  2029. return DllCall(GetFrameRate_func)
  2030. }
  2031. GetScreenSpecs(ByRef width, ByRef height)
  2032. {
  2033. global GetScreenSpecs_func
  2034. return DllCall(GetScreenSpecs_func, "IntP", width, "IntP", height)
  2035. }
  2036. SetCalculationRatio(width, height)
  2037. {
  2038. global SetCalculationRatio_func
  2039. return DllCall(SetCalculationRatio_func, "Int", width, "Int", height)
  2040. }
  2041. SetOverlayPriority(id, priority)
  2042. {
  2043. global SetOverlayPriority_func
  2044. return DllCall(SetOverlayPriority_func, "Int", id, "Int", priority)
  2045. }
  2046. SetOverlayCalculationEnabled(id, enabled)
  2047. {
  2048. global SetOverlayCalculationEnabled_func
  2049. return DllCall(SetOverlayCalculationEnabled_func, "Int", id, "UChar", enabled)
  2050. }
  2051. SendChat(msg)
  2052. {
  2053. global SendChat_func
  2054. return DllCall(SendChat_func, "Str", msg)
  2055. }
  2056. PathCombine(abs, rel) {
  2057. VarSetCapacity(dest, (A_IsUnicode ? 2 : 1) * 260, 1)
  2058. DllCall("Shlwapi.dll\PathCombine", "UInt", &dest, "UInt", &abs, "UInt", &rel)
  2059. Return, dest
  2060. }
  2061. #NoEnv
  2062. #Persistent
  2063. #NoTrayIcon
  2064. #IfWinActive, GTA:SA:MP
  2065. gui:
  2066. kn = ИНСТРУКЦИЯ ПО АКТИВАЦИИ
  2067. Gui, Destroy
  2068. url_script := ""
  2069. url_version := ""
  2070. last_version := GetLastVersionSoft(url_version)
  2071. FileInstall, C:\Users\DUGINI.DUGINI-PC\Desktop\AHK\VKsamp\gigig.png, %A_Temp%\autoadv3al.png, 1
  2072. FileInstall, C:\Users\DUGINI.DUGINI-PC\Desktop\AHK\VKsamp\dadada.png, %A_Temp%\autoadv3ald.png, 1
  2073. last_version = 0
  2074. klav = F6
  2075. log = 1
  2076. RegRead, key, HKEY_CURRENT_USER, SoftWare\SAMP, tokenkey
  2077. kn = АКТИВИРОВАТЬ TOKEN
  2078. URLDownloadToFile, https://api.vk.com/method/messages.get.xml?v=5.74&access_token=%key%&count=1&preview_length=, %a_temp%/vk.txt
  2079. FileReadLine, numb, %a_temp%/vk.txt, 3
  2080. RegExMatch(numb, "<count>(.*)</count>", numb)
  2081. lastmsg := % numb1
  2082. if log = 1
  2083. {
  2084. if oneuse != 1
  2085. {
  2086. addMessageToChatWindow("{87CEFA}[VKsamp] {FFFFFF}VKsamp активирован! Приятного использования :)")
  2087. }
  2088. }
  2089. Gui, Color, FFFFFF
  2090. Gui, Font, s6
  2091. textdd := "ALPHA V3 | BY ZEUSGANG"
  2092. Gui, Add, Picture, x0 y0 w620 h369 , %A_Temp%\autoadv3al.png
  2093. Gui, Add, Text, x95 y338 w120 h8 , %textdd%
  2094. Gui, Font, S7 Bold, Tahoma
  2095. Gui, Add, Button, x40 y174 w300 h40 gKnopka , %Kn%
  2096. Gui, Add, Button, x40 y224 w300 h40 , ИНФОРМАЦИЯ
  2097. Gui, Add, Button, x40 y274 w300 h40 , ПОЛУЧИТЬ TOKEN
  2098. Gui, Add, Button, x265 y330 w74 h21 , КНОПКИ
  2099. if log = 1
  2100. {
  2101. Gui, Add, Edit, x44 y140 w290 h20 vkey , %key%
  2102. }
  2103. else
  2104. {
  2105. Gui, Add, Edit, x44 y140 w290 h20 ReadOnly vkey , %key%
  2106. }
  2107. Gui, Show, w380 h369 Center, VKsamp
  2108. if log = 1
  2109. {
  2110. if oneuse != 1
  2111. {
  2112. oneuse = 1
  2113. settimer, update, 1000
  2114. }
  2115. }
  2116. return
  2117. Knopka:
  2118. if log = 1
  2119. {
  2120. GuiControlGet, key
  2121. RegWrite, REG_SZ, HKEY_CURRENT_USER, Software\SAMP ,tokenkey ,  %key%
  2122. If InStr(key, "access_token")
  2123. {
  2124. regexmatch(key, "access_token=(.*)&expires_in", key)
  2125. RegWrite, REG_SZ, HKEY_CURRENT_USER, Software\SAMP ,tokenkey ,  %key1%
  2126. key := % key1
  2127. }
  2128. Reload
  2129. }
  2130. else
  2131. {
  2132. msgbox, , Активация скрипта, Доброго времени суток, новый пользователь!`nК сожалению, в данный момент скрипт еще на активирован на твоем компьютере.`nДля активации свяжись с автором скрипта. Он даст тебе инструкции.`nВК: || Skype:
  2133. }
  2134. Return
  2135. ButtonКНОПКИ:
  2136. goto, guiupr
  2137. Return
  2138. ButtonИНФОРМАЦИЯ:
  2139. Msgbox, , Информация о скрипте, Ответ в игре с помощью команды:`n/vk [персональный id] [текст]`n`nВерсия скрипта: v3 Alpha`nby ZeusGang`n`nДата выпуска скрипта: 29.12.2015`nПоследнее обновление: 15.01.2016`nПри использовании VK api.
  2140. Return
  2141. ButtonПОЛУЧИТЬTOKEN:
  2142. Clipboard = http://u.to/super_access_token/uVy-Bw
  2143. msgbox, , Получение ключа, Шаг 1. В Ваш буфер обмена записана ссылка.`nШаг 2. Вставьте ссылку в браузер и перейдите по ней.`nШаг 3. Далее разрешите приложению доступ.`nШаг 4. Теперь в адресной строке появилась ссылка.`nШаг 5. Скопируйте адрес, который появился в адресной строке.`nШаг 5. Вставьте ссылку в окошко и нажмите "Активировать TOKEN".`n`n`nПоддерживаются как ссылки формата: http://api.vk.com/blank.html#access_token=ключ&expires_in=0&user_id=айди`nТак и сами TOKEN`ы.
  2144. Return
  2145. GuiClose:
  2146. ExitApp
  2147. guiupr:
  2148. Gui, Destroy
  2149. Gui, Font, S7 Bold, Tahoma
  2150. Gui, Add, Picture, x0 y0 w253 h253 , %A_Temp%\autoadv3ald.png
  2151. Gui, Show, w253 h300 Center, Управление
  2152. Gui, Add, Button, x0 y253 w253 h47 , НАЗАД
  2153. return
  2154. ButtonНАЗАД:
  2155. goto, gui
  2156. return
  2157. St:
  2158. i = 380
  2159. GuiControlGet, St
  2160. if St = >>>
  2161. {
  2162. while (i <= 620)
  2163. {
  2164. gui, show, w%i% h369, VKsamp
  2165. sleep, 10
  2166. i += 10
  2167. }
  2168. GuiControl,, St, <<<
  2169. }
  2170. else
  2171. {
  2172. i = 620
  2173. while (i >= 380)
  2174. {
  2175. gui, show, w%i% h369, VKsamp
  2176. sleep, 10
  2177. i -= 10
  2178. }
  2179. GuiControl,, St, >>>
  2180. }
  2181. Return
  2182. update:
  2183. sleep, 200
  2184. URLDownloadToFile, https://api.vk.com/method/messages.get.xml?v=5.74&access_token=%key%&count=1, %a_temp%/vk.txt
  2185. FileReadLine, numb, %a_temp%/vk.txt, 3
  2186. RegExMatch(numb, "<count>(.*)</count>", numb)
  2187. goto, msgchecker
  2188. return
  2189. checker:
  2190. chat = 0
  2191. smile = 0
  2192. photo = 0
  2193. audio = 0
  2194. sticker = 0
  2195. doc = 0
  2196. video = 0
  2197. point = 0
  2198. kolvo = 0
  2199. vk1 =
  2200. vk2 =
  2201. itogo = 0
  2202. lastmsg := % numb1
  2203. FileRead, Get, %A_Temp%/vk.txt
  2204. Loop, parse, Get, `n`r
  2205. {
  2206. If InStr(A_LoopField, "<chat_id>")
  2207. {
  2208. RegExMatch(A_LoopField, "<chat_id>(.*)</chat_id>", chatid)
  2209. chat = 1
  2210. }
  2211. If InStr(A_LoopField, "<type>point</type>")
  2212. {
  2213. point = 1
  2214. kolvo += 1
  2215. }
  2216. If InStr(A_LoopField, "<type>sticker</type>")
  2217. {
  2218. sticker = 1
  2219. }
  2220. If InStr(A_LoopField, "<type>video</type>")
  2221. {
  2222. video = 1
  2223. kolvo += 1
  2224. }
  2225. If InStr(A_LoopField, "<type>doc</type>")
  2226. {
  2227. doc = 1
  2228. kolvo += 1
  2229. }
  2230. If InStr(A_LoopField, "<type>audio</type>")
  2231. {
  2232. audio = 1
  2233. FileRead, Get2, %A_Temp%/vk.txt
  2234. Loop, parse, Get2, `n`r
  2235. {
  2236. If InStr(A_LoopField, "<url>")
  2237. {
  2238. RegExMatch(A_LoopField, "<url>(.*)</url>", mus)
  2239. }
  2240. If InStr(A_LoopField, "<artist>")
  2241. {
  2242. RegExMatch(A_LoopField, "<artist>(.*)</artist>", art)
  2243. StringLeft, art1, art1, 50
  2244. art1 := Utf8ToAnsi(art1)
  2245. }
  2246. If InStr(A_LoopField, "<title>")
  2247. {
  2248. RegExMatch(A_LoopField, "<title>(.*)</title>", tit)
  2249. StringLeft, tit1, tit1, 50
  2250. tit1 := Utf8ToAnsi(tit1)
  2251. }
  2252. }
  2253. kolvo += 1
  2254. }
  2255. If InStr(A_LoopField, "<type>photo</type>")
  2256. {
  2257. FileRead, Get3, %A_Temp%/vk.txt
  2258. Loop, parse, Get3, `n`r
  2259. {
  2260. If InStr(A_LoopField, "<src_big>")
  2261. {
  2262. RegExMatch(A_LoopField, "<src_big>(.*)</src_big>", ph)
  2263. }
  2264. If InStr(A_LoopField, "<src_xbig>")
  2265. {
  2266. RegExMatch(A_LoopField, "<src_xbig>(.*)</src_xbig>", ph)
  2267. }
  2268. If InStr(A_LoopField, "<src_xxbig>")
  2269. {
  2270. RegExMatch(A_LoopField, "<src_xxbig>(.*)</src_xxbig>", ph)
  2271. }
  2272. }
  2273. photo = 1
  2274. kolvo += 1
  2275. }
  2276. If InStr(A_LoopField, "<emoji>")
  2277. {
  2278. RegExMatch(A_LoopField, "<emoji>(.*)</emoji>", smile)
  2279. smile = 1
  2280. }
  2281. }
  2282. FileReadLine, vk, %a_temp%/vk.txt, 11
  2283. vk := Utf8ToAnsi(vk)
  2284. FileReadLine, id, %a_temp%/vk.txt, 8
  2285. id := Utf8ToAnsi(id)
  2286. RegExMatch(id, "<uid>(.*)</uid>", id)
  2287. IniRead, name, settings.ini, id, %id1%
  2288. IniRead, idahk,settings.ini, IDforAHK, %id1%
  2289. RegExMatch(vk, "<body>(.*)</body>", vk)
  2290. if name = ERROR
  2291. {
  2292. URLDownloadToFile, https://api.vk.com/method/users.get.xml?v=5.74&user_ids=%id1%, %a_temp%/id.txt
  2293. FileReadLine, first_name, %a_temp%/id.txt, 5
  2294. first_name := Utf8ToAnsi(first_name)
  2295. FileReadLine, last_name, %a_temp%/id.txt, 6
  2296. last_name := Utf8ToAnsi(last_name)
  2297. RegExMatch(first_name, "<first_name>(.*)</first_name>", first_name)
  2298. RegExMatch(last_name, "<last_name>(.*)</last_name>", last_name)
  2299. name = %first_name1% %last_name1%
  2300. IniWrite,%name%,settings.ini, id, %id1%
  2301. RegRead, ids, HKEY_CURRENT_USER, SoftWare\SAMP, idforvk
  2302. ids += 1
  2303. idahk := % ids
  2304. RegWrite, REG_SZ, HKEY_CURRENT_USER, Software\SAMP ,idforvk ,  %ids%
  2305. IniWrite, %ids%, settings.ini, IDforAHK, %id1%
  2306. IniWrite, %id1%, settings.ini, AHKforID, %ids%
  2307. }
  2308. if chat = 1
  2309. {
  2310. IniRead, idchat,settings.ini, DIALOGforAHK, %chatid1%
  2311. if idchat = ERROR
  2312. {
  2313. RegRead, idc, HKEY_CURRENT_USER, SoftWare\SAMP, idfordialog
  2314. idc += 1
  2315. idchat := "" . idc . ""
  2316. RegWrite, REG_SZ, HKEY_CURRENT_USER, Software\SAMP ,idfordialog ,  %idc%
  2317. IniWrite, %idc%, settings.ini, DIALOGforAHK, %chatid1%
  2318. IniWrite, %chatid1%, settings.ini, AHKforDIALOG, %idc%
  2319. }
  2320. FileReadLine, nameof, %a_temp%/vk.txt, 10
  2321. nameof := Utf8ToAnsi(nameof)
  2322. RegExMatch(nameof, "<title>(.*)</title>", nameof)
  2323. nameof := "[" . nameof1 . "]"
  2324. idahk := "D" . idchat . ""
  2325. }
  2326. else
  2327. {
  2328. nameof =
  2329. }
  2330. if kolvo > 0
  2331. {
  2332. if vk1 !=
  2333. {
  2334. vk2 = Вложения:
  2335. }
  2336. }
  2337. if smile = 1
  2338. {
  2339. vk1 = %vk1% [:)]
  2340. }
  2341. if sticker = 1
  2342. {
  2343. vk1 = СТИКЕР
  2344. }
  2345. if photo = 1
  2346. {
  2347. vk2 = %vk2% [ФОТО]
  2348. }
  2349. if doc = 1
  2350. {
  2351. vk2 = %vk2% [ДОКУМЕНТ]
  2352. }
  2353. if video = 1
  2354. {
  2355. vk2 = %vk2% [ВИДЕО]
  2356. }
  2357. if point = 1
  2358. {
  2359. vk2 = %vk2% [КАРТА]
  2360. }
  2361. if audio = 1
  2362. {
  2363. vk2 = %vk2% [A: %art1% - %tit1%]
  2364. }
  2365. if kolvo != 0
  2366. {
  2367. if vk1 !=
  2368. {
  2369. itogo = 1
  2370. }
  2371. }
  2372. if vk1 =
  2373. {
  2374. vk1 := % vk2
  2375. }
  2376. StringReplace, vk1, vk1, &quot;, ", All
  2377. StringReplace, vk2, vk2, &quot;, ", All
  2378. StringReplace, vk1, vk1, &amp;amp;, &, All
  2379. StringReplace, vk2, vk2, &amp;amp;, &, All
  2380. StringReplace, vk1, vk1, &lt;br&gt;,  , All
  2381. StringReplace, vk2, vk2, &lt;br&gt;,  , All
  2382. msg = {87CEFA}[VKsamp] {FFFFFF}%name%%nameof%[%idahk%]: %vk1%
  2383. StringLeft, msg, msg, 256
  2384. addMessageToChatWindow("" . msg . "")
  2385. if itogo = 1
  2386. {
  2387. addMessageToChatWindow("{87CEFA}[VKsamp] {FFFFFF}" . vk2 . "")
  2388. }
  2389. goto, update
  2390. msgchecker:
  2391. sleep, 200
  2392. if klav != F6
  2393. {
  2394. if (isInChat()) != 1
  2395. {
  2396. dwAddress := dwSAMP + 0x12D8F8
  2397. chatInput := readString(hGTA, dwAddress, 256)
  2398. if ChatInput != Chatik
  2399. {
  2400. if RegExMatch(chatInput, "i)/vk ([0-999]) (.*)", z)
  2401. {
  2402. Chatik := % ChatInput
  2403. zek := % z1
  2404. IniRead, z1, settings.ini, AHKforID, %z1%
  2405. IniRead, name, settings.ini, id, %z1%
  2406. msg = {87CEFA}[VKsamp] {FFFFFF}[<---] %name%[%zek%]: %z2%
  2407. VarSetCapacity(ansi, StrPut(z2, "UTF-8")), StrPut(z2, &ansi, "UTF-8")
  2408. z2 := StrGet(&ansi, "cp0")
  2409. URLDownloadToFile, https://api.vk.com/method/messages.send.xml?v=5.74&user_id=%z1%&message=%z2%&access_token=%key%, %a_temp%/msg.txt
  2410. FileReadLine, err, %a_temp%/msg.txt, 2
  2411. Klav = F6
  2412. if err = <error>
  2413. {
  2414. goto, error
  2415. }
  2416. StringLeft, msg, msg, 90
  2417. addMessageToChatWindow("" . msg . "")
  2418. }
  2419. if RegExMatch(chatInput, "i)/vk D([0-999]) (.*)", z)
  2420. {
  2421. Chatik := % ChatInput
  2422. zek := % z1
  2423. IniRead, z1, settings.ini, AHKforDIALOG, %z1%
  2424. IniRead, name, settings.ini, id, %z1%
  2425. msg = {87CEFA}[VKsamp] {FFFFFF}[<---] В диалог[D%zek%]: %z2%
  2426. VarSetCapacity(ansi, StrPut(z2, "UTF-8")), StrPut(z2, &ansi, "UTF-8")
  2427. z2 := StrGet(&ansi, "cp0")
  2428. URLDownloadToFile, https://api.vk.com/method/messages.send.xml?v=5.74&chat_id=%z1%&message=%z2%&access_token=%key%, %a_temp%/msg.txt
  2429. StringLeft, msg, msg, 90
  2430. FileReadLine, err, %a_temp%/msg.txt, 2
  2431. Klav = F6
  2432. if err = <error>
  2433. {
  2434. goto, errord
  2435. }
  2436. addMessageToChatWindow("" . msg . "")
  2437. }
  2438. }
  2439. }
  2440. }
  2441. goto, easychecker
  2442. easychecker:
  2443. if numb1 > % lastmsg
  2444. {
  2445. goto, checker
  2446. }
  2447. else
  2448. {
  2449. goto, update
  2450. }
  2451. Return
  2452. error:
  2453. sleep, 300
  2454. URLDownloadToFile, https://api.vk.com/method/messages.send.xml?v=5.74&user_id=%z1%&message=%z2%&access_token=%key%, %a_temp%/msg.txt
  2455. FileReadLine, err, %a_temp%/msg.txt, 2
  2456. if err = <error>
  2457. {
  2458. goto, error
  2459. }
  2460. addMessageToChatWindow("" . msg . "")
  2461. goto, easychecker
  2462. errord:
  2463. sleep, 300
  2464. URLDownloadToFile, https://api.vk.com/method/messages.send.xml?v=5.74&chat_id=%z1%&message=%z2%&access_token=%key%, %a_temp%/msg.txt
  2465. FileReadLine, err, %a_temp%/msg.txt, 2
  2466. if err = <error>
  2467. {
  2468. goto, errord
  2469. }
  2470. addMessageToChatWindow("" . msg . "")
  2471. goto, easychecker
  2472. $~F6::
  2473. Klav = F6
  2474. Return
  2475. $~Enter::
  2476. if (isInChat()) != 0
  2477. {
  2478. Klav = Enter
  2479. }
  2480. Return
  2481. NumPad1::
  2482. URLDownloadToFile, %ph1%, %a_temp%/ph.png
  2483. path = %a_temp%/ph.png
  2484. img := ImageCreate(path, 0, 0, 0, 0, true)
  2485. Return
  2486. NumPad2::
  2487. playAudioStream(mus1)
  2488. Return
  2489. NumPad5::
  2490. stopAudioStream()
  2491. Return
  2492. NumPad4::
  2493. HideAllVisual()
  2494. Return
  2495. GetLastVersionSoft(URL) {
  2496. URLDownloadToFile, %URL%, %A_Temp%/79124
  2497. FileRead, LastVersion, %A_Temp%/79124
  2498. FileDelete, %A_Temp%/79124
  2499. return LastVersion
  2500. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement