daily pastebin goal
8%
SHARE
TWEET

Lyd Fahrschulkeybinder by RaizinG

a guest Jan 20th, 2017 279 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #IfWinActive, GTA:SA:MP
  2. #SingleInstance, force
  3. #UseHook
  4. #NoEnv
  5. #Persistent
  6. Process, Priority, , Realtime
  7. #NoEnv
  8. API_ERROR_NONE                              := 0
  9. API_ERROR_SNAPSHOT_FAILED                   := 1
  10. API_ERROR_SAMP_NOT_FOUND                    := 2
  11. API_ERROR_REMOTE_MEMORY_ALLOCATION_FAILED   := 3
  12. API_ERROR_WRITEPROCESSMEMORY_FAILED         := 4
  13. API_ERROR_GETPROCADDRESS_FAILED             := 5
  14. API_ERROR_REMOTETHREAD_FAILED               := 6
  15. API_ERROR_INVALID_GTA_HANDLE                := 7
  16. API_ERROR_PIPE_DOESNT_RESPOND               := 8
  17. API_ERROR_STRING_TOO_LONG                   := 9
  18. PLAYER_STATE_LEAVING_VEHICLE                := 0
  19. PLAYER_STATE_NORMAL                         := 1
  20. PLAYER_STATE_DRIVING                        := 50
  21. PLAYER_STATE_DYING                          := 54
  22. PLAYER_STATE_DEAD                           := 55
  23. CALLBACK_HEAL                               := 0
  24. CALLBACK_ARMOR                              := 1
  25. CALLBACK_POSITION                           := 2
  26. CALLBACK_ENTEREXIT                          := 3
  27. CALLBACK_VEHICLE_ENTEREXIT                  := 4
  28. CALLBACK_VEHICLE_HEALTH                     := 5
  29. CALLBACK_VEHICLE_ENGINE                     := 6
  30. CALLBACK_VEHICLE_LOCK                       := 7
  31. CALLBACK_VEHICLE_SPEED                      := 8
  32. CALLBACK_WEAPON_CLIP                        := 9
  33. CALLBACK_WEAPON_TOTALCLIP                   := 10
  34. CALLBACK_WEAPON_SWITCH                      := 11
  35. CALLBACK_CHATLOG                            := 12
  36. PATH_API := RelToAbs(A_ScriptDir, "API.dll")
  37. hModule := DllCall("LoadLibrary", Str, PATH_API)
  38. if(hModule == -1 || hModule == 0)
  39. {
  40. MsgBox, 16, API.dll nicht gefunden!, API.dll konnte nicht gefunden werden.
  41. ExitApp
  42. }
  43. Init_func               := DllCall("GetProcAddress", UInt, hModule, Str, "API_Init")
  44. SetParam_func           := DllCall("GetProcAddress", UInt, hModule, Str, "API_SetParam")
  45. ReadMemory_func         := DllCall("GetProcAddress", UInt, hModule, Str, "API_ReadMemory")
  46. GetBasePointer_func     := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetBasePointer")
  47. GetCommandLine_func     := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetCommandLine")
  48. GetLastError_func       := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetLastError")
  49. SetLastError_func       := DllCall("GetProcAddress", UInt, hModule, Str, "API_SetLastError")
  50. SendChat_func           := DllCall("GetProcAddress", UInt, hModule, Str, "API_SendChat")
  51. ShowGameText_func       := DllCall("GetProcAddress", UInt, hModule, Str, "API_ShowGameText")
  52. AddChatMessage_func     := DllCall("GetProcAddress", UInt, hModule, Str, "API_AddChatMessage")
  53. ShowDialog_func         := DllCall("GetProcAddress", UInt, hModule, Str, "API_ShowDialog")
  54. IsDialogOpen_func       := DllCall("GetProcAddress", UInt, hModule, Str, "API_IsDialogOpen")
  55. GetLastDialogId_func    := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetLastDialogId")
  56. GetLastDialogType_func  := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetLastDialogType")
  57. BlockChatInput_func     := DllCall("GetProcAddress", UInt, hModule, Str, "API_BlockChatInput")
  58. GetChatLine_func        := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetChatLine")
  59. GetChatLineFromFile_func:= DllCall("GetProcAddress", UInt, hModule, Str, "API_GetChatLineFromFile")
  60. IsChatOpen_func         := DllCall("GetProcAddress", UInt, hModule, Str, "API_IsChatOpen")
  61. GetScreenSizeX_func     := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetScreenSizeX")
  62. GetScreenSizeY_func     := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetScreenSizeY")
  63. GetFramerate_func       := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetFramerate")
  64. GetCurrentWeatherId_func    := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetCurrentWeatherId")
  65. GetZoneName_func        := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetZoneName")
  66. GetCityName_func        := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetCityName")
  67. GetZoneNameByCoords_func:= DllCall("GetProcAddress", UInt, hModule, Str, "API_GetZoneNameByCoords")
  68. GetCityNameByCoords_func:= DllCall("GetProcAddress", UInt, hModule, Str, "API_GetCityNameByCoords")
  69. GetMarkerPos_func       := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetMarkerPos")
  70. GetLastMousePosOnMenuMap_func := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetLastMousePosOnMenuMap")
  71. GetMapMarkerPos_func        := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetMapMarkerPos")
  72. FindGroundZForPosition_func := DllCall("GetProcAddress", UInt, hModule, Str, "API_FindGroundZForPosition")
  73. WorldToScreen_func  := DllCall("GetProcAddress", UInt, hModule, Str, "API_WorldToScreen")
  74. ScreenToWorld_func  := DllCall("GetProcAddress", UInt, hModule, Str, "API_ScreenToWorld")
  75. RegisterTextBind_func       := DllCall("GetProcAddress", UInt, hModule, Str, "API_RegisterTextBind")
  76. UnregisterTextBind_func     := DllCall("GetProcAddress", UInt, hModule, Str, "API_UnregisterTextBind")
  77. UnregisterAllTextBinds_func     := DllCall("GetProcAddress", UInt, hModule, Str, "API_UnregisterAllTextBinds")
  78. TextBindTimer_func      := DllCall("GetProcAddress", UInt, hModule, Str, "API_TextBindTimer")
  79. IsMenuOpen_func         := DllCall("GetProcAddress", UInt, hModule, Str, "API_IsMenuOpen")
  80. GetPlayerId_func        := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetPlayerId")
  81. GetPlayerName_func      := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetPlayerName")
  82. GetServerIp_func        := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetServerIp")
  83. GetServerPort_func      := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetServerPort")
  84. GetPlayerCPed_func      := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetPlayerCPed")
  85. GetPlayerHealth_func    := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetPlayerHealth")
  86. GetPlayerArmor_func     := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetPlayerArmor")
  87. GetPlayerMoney_func     := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetPlayerMoney")
  88. GetPlayerWanteds_func   := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetPlayerWanteds")
  89. GetPlayerPosition_func  := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetPlayerPosition")
  90. IsPlayerInRangeOfPoint_func := DllCall("GetProcAddress", UInt, hModule, Str, "API_IsPlayerInRangeOfPoint")
  91. IsPlayerInRangeOfPoint2D_func := DllCall("GetProcAddress", UInt, hModule, Str, "API_IsPlayerInRangeOfPoint2D")
  92. IsPlayerInAnyInterior_func := DllCall("GetProcAddress", UInt, hModule, Str, "API_IsPlayerInAnyInterior")
  93. IsPlayerFrozen_func := DllCall("GetProcAddress", UInt, hModule, Str, "API_IsPlayerFrozen")
  94. GetPlayerWeaponSlot_func    := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetPlayerWeaponSlot")
  95. GetPlayerWeaponId_func  := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetPlayerWeaponId")
  96. GetPlayerWeaponName_func    := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetPlayerWeaponName")
  97. GetPlayerWeaponClip_func    := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetPlayerWeaponClip")
  98. GetPlayerWeaponTotalClip_func   := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetPlayerWeaponTotalClip")
  99. GetPlayerWeaponState_func   := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetPlayerWeaponState")
  100. GetPlayerState_func     := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetPlayerState")
  101. GetVehiclePointer_func  := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetVehiclePointer")
  102. GetVehicleModelId_func      := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetVehicleModelId")
  103. GetVehicleModelName_func        := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetVehicleModelName")
  104. GetVehicleModelNameById_func        := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetVehicleModelNameById")
  105. GetVehicleType_func     := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetVehicleType")
  106. GetVehicleHealth_func   := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetVehicleHealth")
  107. GetVehicleRadioStation_func := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetVehicleRadioStation")
  108. GetVehicleRadioStationName_func := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetVehicleRadioStationName")
  109. GetVehicleFreeSeats_func := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetVehicleFreeSeats")
  110. GetVehicleSpeed_func := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetVehicleSpeed")
  111. GetVehicleFirstColor_func := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetVehicleFirstColor")
  112. GetVehicleSecondColor_func := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetVehicleSecondColor")
  113. GetVehicleColor_func := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetVehicleColor")
  114. GetVehicleColorRGB_func := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetVehicleColorRGB")
  115. GetVehicleColorARGB_func := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetVehicleColorARGB")
  116. IsPlayerInAnyVehicle_func := DllCall("GetProcAddress", UInt, hModule, Str, "API_IsPlayerInAnyVehicle")
  117. IsPlayerDriver_func     := DllCall("GetProcAddress", UInt, hModule, Str, "API_IsPlayerDriver")
  118. IsPlayerPassenger_func  := DllCall("GetProcAddress", UInt, hModule, Str, "API_IsPlayerPassenger")
  119. IsVehicleSeatUsed_func  := DllCall("GetProcAddress", UInt, hModule, Str, "API_IsVehicleSeatUsed")
  120. IsVehicleLocked_func    := DllCall("GetProcAddress", UInt, hModule, Str, "API_IsVehicleLocked")
  121. IsVehicleSirenEnabled_func  := DllCall("GetProcAddress", UInt, hModule, Str, "API_IsVehicleSirenEnabled")
  122. IsVehicleHornEnabled_func   := DllCall("GetProcAddress", UInt, hModule, Str, "API_IsVehicleHornEnabled")
  123. IsVehicleAlternateSirenEnabled_func     := DllCall("GetProcAddress", UInt, hModule, Str, "API_IsVehicleAlternateSirenEnabled")
  124. IsVehicleEngineEnabled_func := DllCall("GetProcAddress", UInt, hModule, Str, "API_IsVehicleEngineEnabled")
  125. IsVehicleLightEnabled_func := DllCall("GetProcAddress", UInt, hModule, Str, "API_IsVehicleLightEnabled")
  126. IsPlayerInCar_func      := DllCall("GetProcAddress", UInt, hModule, Str, "API_IsPlayerInCar")
  127. IsPlayerInPlane_func    := DllCall("GetProcAddress", UInt, hModule, Str, "API_IsPlayerInPlane")
  128. IsPlayerInBoat_func     := DllCall("GetProcAddress", UInt, hModule, Str, "API_IsPlayerInBoat")
  129. IsPlayerInTrain_func    := DllCall("GetProcAddress", UInt, hModule, Str, "API_IsPlayerInTrain")
  130. IsPlayerInBike_func     := DllCall("GetProcAddress", UInt, hModule, Str, "API_IsPlayerInBike")
  131. TextCreate_func         := DllCall("GetProcAddress", UInt, hModule, Str, "API_TextCreate")
  132. TextDestroy_func        := DllCall("GetProcAddress", UInt, hModule, Str, "API_TextDestroy")
  133. TextSetShadow_func      := DllCall("GetProcAddress", UInt, hModule, Str, "API_TextSetShadow")
  134. TextSetShown_func       := DllCall("GetProcAddress", UInt, hModule, Str, "API_TextSetShown")
  135. TextSetColor_func       := DllCall("GetProcAddress", UInt, hModule, Str, "API_TextSetColor")
  136. TextSetPos_func         := DllCall("GetProcAddress", UInt, hModule, Str, "API_TextSetPos")
  137. TextSetString_func      := DllCall("GetProcAddress", UInt, hModule, Str, "API_TextSetString")
  138. TextUpdate_func         := DllCall("GetProcAddress", UInt, hModule, Str, "API_")
  139. BoxCreate_func          := DllCall("GetProcAddress", UInt, hModule, Str, "API_BoxCreate")
  140. BoxDestroy_func         := DllCall("GetProcAddress", UInt, hModule, Str, "API_BoxDestroy")
  141. BoxSetShown_func        := DllCall("GetProcAddress", UInt, hModule, Str, "API_BoxSetShown")
  142. BoxSetBorder_func       := DllCall("GetProcAddress", UInt, hModule, Str, "API_BoxSetBorder")
  143. BoxSetBorderColor_func  := DllCall("GetProcAddress", UInt, hModule, Str, "API_BoxSetBorderColor")
  144. BoxSetColor_func        := DllCall("GetProcAddress", UInt, hModule, Str, "API_BoxSetColor")
  145. BoxSetHeight_func       := DllCall("GetProcAddress", UInt, hModule, Str, "API_BoxSetHeight")
  146. BoxSetPos_func          := DllCall("GetProcAddress", UInt, hModule, Str, "API_BoxSetPos")
  147. BoxSetWidth_func        := DllCall("GetProcAddress", UInt, hModule, Str, "API_BoxSetWidth")
  148. LineCreate_func         := DllCall("GetProcAddress", UInt, hModule, Str, "API_LineCreate")
  149. LineDestroy_func        := DllCall("GetProcAddress", UInt, hModule, Str, "API_LineDestroy")
  150. LineSetShown_func       := DllCall("GetProcAddress", UInt, hModule, Str, "API_LineSetShown")
  151. LineSetColor_func       := DllCall("GetProcAddress", UInt, hModule, Str, "API_LineSetColor")
  152. LineSetWidth_func       := DllCall("GetProcAddress", UInt, hModule, Str, "API_LineSetWidth")
  153. LineSetPos_func         := DllCall("GetProcAddress", UInt, hModule, Str, "API_LineSetPos")
  154. ImageCreate_func        := DllCall("GetProcAddress", UInt, hModule, Str, "API_ImageCreate")
  155. ImageDestroy_func       := DllCall("GetProcAddress", UInt, hModule, Str, "API_ImageDestroy")
  156. ImageSetShown_func      := DllCall("GetProcAddress", UInt, hModule, Str, "API_ImageSetShown")
  157. ImageSetAlign_func      := DllCall("GetProcAddress", UInt, hModule, Str, "API_ImageSetAlign")
  158. ImageSetPos_func        := DllCall("GetProcAddress", UInt, hModule, Str, "API_ImageSetPos")
  159. ImageSetRotation_func   := DllCall("GetProcAddress", UInt, hModule, Str, "API_ImageSetRotation")
  160. DestroyAllVisual_func   := DllCall("GetProcAddress", UInt, hModule, Str, "API_DestroyAllVisual")
  161. ShowAllVisual_func      := DllCall("GetProcAddress", UInt, hModule, Str, "API_ShowAllVisual")
  162. HideAllVisual_func      := DllCall("GetProcAddress", UInt, hModule, Str, "API_HideAllVisual")
  163. SetCallbackPointer_func     := DllCall("GetProcAddress", UInt, hModule, Str, "API_SetCallbackPointer")
  164. UnSetCallbackPointer_func   := DllCall("GetProcAddress", UInt, hModule, Str, "API_UnSetCallbackPointer")
  165. SetListenCallback_func      := DllCall("GetProcAddress", UInt, hModule, Str, "API_SetListenCallback")
  166. UnSetListenCallback_func    := DllCall("GetProcAddress", UInt, hModule, Str, "API_UnSetListenCallback")
  167. UnSetListenCallbackAll_func := DllCall("GetProcAddress", UInt, hModule, Str, "API_UnSetListenCallbackAll")
  168. UpdateServerData_func           := DllCall("GetProcAddress", UInt, hModule, Str, "API_UpdateServerData")
  169. GetPlayerNameById_func          := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetPlayerNameById")
  170. GetPlayerIdByName_func          := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetPlayerIdByName")
  171. Init()
  172. {
  173. global Init_func
  174. res := DllCall(Init_func)
  175. return res
  176. }
  177. SetParam(str_Name, str_Value)
  178. {
  179. global SetParam_func
  180. res := DllCall(SetParam_func, Str, str_Name, Str, str_Value)
  181. return res
  182. }
  183. ReadMemory(addr, size, ByRef data)
  184. {
  185. global ReadMemory_func
  186. VarSetCapacity(data,size)
  187. res := DllCall(ReadMemory_func, UInt, addr, UInt, size, StrP, data)
  188. return res
  189. }
  190. GetBasePointer(dll)
  191. {
  192. global GetBasePointer_func
  193. res :=DllCall(GetBasePointer_func, Str, dll)
  194. return res
  195. }
  196. GetCommandLine(ByRef line)
  197. {
  198. global GetCommandLine_func
  199. VarSetCapacity(line,512,0)
  200. res := DllCall(GetCommandLine_func, StrP, line)
  201. return res
  202. }
  203. GetLastError()
  204. {
  205. global GetLastError_func
  206. res:=DllCall(GetLastError_func)
  207. return res
  208. }
  209. SetLastError(error)
  210. {
  211. global SetLastError_func
  212. res := DllCall(SetLastError_func, Int, error)
  213. return res
  214. }
  215. SendChat(msg)
  216. {
  217. global SendChat_func
  218. res := DllCall(SendChat_func, Str, msg)
  219. return res
  220. }
  221. ShowGameText(str_Text, int_Time, int_Style)
  222. {
  223. global ShowGameText_func
  224. res := DllCall(ShowGameText_func,Str , str_Text, Int, int_Time, Int, int_Style)
  225. return res
  226. }
  227. AddChatMessage_api(int_Color, str_Text)
  228. {
  229. global AddChatMessage_func
  230. res := DllCall(AddChatMessage_func, Int, int_Color, Str, str_Text)
  231. return res
  232. }
  233. ShowDialog(style, caption, text, button)
  234. {
  235. global ShowDialog_func
  236. res := DllCall(ShowDialog_func, Int, style, Str, caption, Str, text, Str, button)
  237. return res
  238. }
  239. IsDialogOpen()
  240. {
  241. global IsDialogOpen_func
  242. res := DllCall(IsDialogOpen_func)
  243. return res
  244. }
  245. GetLastDialogId()
  246. {
  247. global GetLastDialogId_func
  248. res := DllCall(GetLastDialogId_func)
  249. return res
  250. }
  251. GetLastDialogType()
  252. {
  253. global GetLastDialogType_func
  254. res := DllCall(GetLastDialogType_func)
  255. return res
  256. }
  257. BlockChatInput(block)
  258. {
  259. global BlockChatInput_func
  260. res := DllCall(BlockChatInput_func,UChar,block)
  261. return res
  262. }
  263. GetChatLine(id, ByRef line)
  264. {
  265. global GetChatLine_func
  266. VarSetCapacity(line,256,0)
  267. res := DllCall(GetChatLine_func,Int,id,StrP,line)
  268. return res
  269. }
  270. GetChatLineFromFile(id, ByRef line)
  271. {
  272. global GetChatLineFromFile_func
  273. VarSetCapacity(line,256,0)
  274. res := DllCall(GetChatLineFromFile_func,Int,id,StrP,line)
  275. return res
  276. }
  277. IsChatOpen()
  278. {
  279. global IsChatOpen_func
  280. res := DllCall(IsChatOpen_func)
  281. return res
  282. }
  283. GetScreenSizeX()
  284. {
  285. global GetScreenSizeX_func
  286. res := DllCall(GetScreenSizeX_func)
  287. return res
  288. }
  289. GetScreenSizeY()
  290. {
  291. global GetScreenSizeY_func
  292. res := DllCall(GetScreenSizeY_func)
  293. return res
  294. }
  295. GetFramerate()
  296. {
  297. global GetFramerate_func
  298. res := DllCall(GetFramerate_func)
  299. return res
  300. }
  301. GetCurrentWeatherId()
  302. {
  303. global GetCurrentWeatherId_func
  304. res := DllCall(GetCurrentWeatherId_func)
  305. return res
  306. }
  307. GetZoneName( ByRef str_ZoneName)
  308. {
  309. global GetZoneName_func
  310. VarSetCapacity(str_ZoneName, 32)
  311. res := DllCall(GetZoneName_func, StrP, str_ZoneName)
  312. return res
  313. }
  314. GetCityName( ByRef str_CityName)
  315. {
  316. global GetCityName_func
  317. VarSetCapacity(str_CityName, 32)
  318. res := DllCall(GetCityName_func, StrP, str_CityName)
  319. return res
  320. }
  321. GetZoneNameByCoords(x, y, ByRef str_ZoneName)
  322. {
  323. global GetZoneNameByCoords_func
  324. VarSetCapacity(str_ZoneName, 32)
  325. res := DllCall(GetZoneNameByCoords_func, Float, x, Float, y, StrP, str_ZoneName)
  326. return res
  327. }
  328. GetCityNameByCoords(x, y, ByRef str_CityName)
  329. {
  330. global GetCityNameByCoords_func
  331. VarSetCapacity(str_CityName, 32)
  332. res := DllCall(GetCityNameByCoords_func, Float, x, Float, y, StrP, str_CityName)
  333. return res
  334. }
  335. GetMarkerPos(ByRef x, ByRef y, ByRef z)
  336. {
  337. global GetMarkerPos_func
  338. res := DllCall(GetMarkerPos_func, FloatP, x, FloatP, y, FloatP, z)
  339. return res
  340. }
  341. GetLastMousePosOnMenuMap(ByRef x, ByRef y)
  342. {
  343. global GetLastMousePosOnMenuMap_func
  344. res := DllCall(GetLastMousePosOnMenuMap_func, FloatP, x, FloatP, y)
  345. return res
  346. }
  347. GetMapMarkerPos(ByRef x, ByRef y)
  348. {
  349. global GetMapMarkerPos_func
  350. res := DllCall(GetMapMarkerPos_func, FloatP, x, FloatP, y)
  351. return res
  352. }
  353. FindGroundZForPosition(x,y)
  354. {
  355. global FindGroundZForPosition_func
  356. res := DllCall(FindGroundZForPosition_func, Float, x, Float, y, "Cdecl float")
  357. return res
  358. }
  359. WorldToScreen(worldX, worldY, worldZ, ByRef screenX, ByRef screenY)
  360. {
  361. global WorldToScreen_func
  362. res := DllCall(WorldToScreen_func, Float, worldX, Float, worldY, Float, worldZ, FloatP, screenX, FloatP, screenY)
  363. return res
  364. }
  365. ScreenToWorld(screenX, screenY, ByRef worldX, ByRef worldY, ByRef worldZ)
  366. {
  367. global ScreenToWorld_func
  368. res := DllCall(ScreenToWorld_func, Float, screenX, Float, screenY, FloatP, worldX, FloatP, worldY, FloatP, worldZ)
  369. return res
  370. }
  371. RegisterTextBind(str_TextBind, float_PosX, float_PosY, float_PosZ, float_Radius, int_Delay, int_Loop, int_GroupId, int_isChild, int_Timeout)
  372. {
  373. global RegisterTextBind_func
  374. res := DllCall(RegisterTextBind_func, Str, str_TextBind, Float, float_PosX, Float, float_PosY, Float, float_PosZ, Float, float_Radius, Int, int_Delay, Int, int_Loop, Int, int_GroupId, Int, int_isChild, Int, int_Timeout)
  375. return res
  376. }
  377. UnregisterTextBind(int_TextBindId)
  378. {
  379. global UnregisterTextBind_func
  380. res := DllCall(UnregisterTextBind_func, Int, int_TextBindId)
  381. return res
  382. }
  383. UnregisterAllTextBinds()
  384. {
  385. global UnregisterAllTextBinds_func
  386. res := DllCall(UnregisterAllTextBinds_func)
  387. return res
  388. }
  389. TextBindTimer(int_TextBindSleep)
  390. {
  391. global TextBindTimer_func
  392. res := DllCall(TextBindTimer_func, Int, int_TextBindSleep)
  393. return res
  394. }
  395. IsMenuOpen()
  396. {
  397. global IsMenuOpen_func
  398. res := DllCall(IsMenuOpen_func)
  399. return res
  400. }
  401. GetPlayerId()
  402. {
  403. global GetPlayerId_func
  404. res := DllCall(GetPlayerId_func)
  405. return res
  406. }
  407. GetPlayerName(ByRef szName)
  408. {
  409. global GetPlayerName_func
  410. VarSetCapacity(szName,25)
  411. res := DllCall(GetPlayerName_func, StrP, szName)
  412. return res
  413. }
  414. GetServerIp(ByRef szHost)
  415. {
  416. global GetServerIp_func
  417. VarSetCapacity(szHost, 30)
  418. res := DllCall(GetServerIp_func, StrP, szHost)
  419. return res
  420. }
  421. GetServerPort()
  422. {
  423. global GetServerPort_func
  424. res := DllCall(GetServerPort_func)
  425. return res
  426. }
  427. GetPlayerCPed()
  428. {
  429. global GetPlayerCPed_func
  430. res :=DllCall(GetPlayerCPed_func)
  431. return res
  432. }
  433. GetPlayerHealth()
  434. {
  435. global GetPlayerHealth_func
  436. res := DllCall(GetPlayerHealth_func)
  437. return res
  438. }
  439. GetPlayerArmor()
  440. {
  441. global GetPlayerArmor_func
  442. res := DllCall(GetPlayerArmor_func)
  443. return res
  444. }
  445. GetPlayerMoney()
  446. {
  447. global GetPlayerMoney_func
  448. res := DllCall(GetPlayerMoney_func)
  449. return res
  450. }
  451. GetPlayerWanteds()
  452. {
  453. global GetPlayerWanteds_func
  454. res := DllCall(GetPlayerWanteds_func)
  455. return res
  456. }
  457. GetPlayerPosition(ByRef flo_posX, ByRef flo_posY, ByRef flo_posZ, ByRef flo_Rotation)
  458. {
  459. global GetPlayerPosition_func
  460. res := DllCall(GetPlayerPosition_func, FloatP, flo_posX, FloatP, flo_posY, FloatP, flo_posZ,  FloatP, flo_Rotation)
  461. return res
  462. }
  463. IsPlayerInRangeOfPoint(flo_posX, flo_posY, flo_posZ, flo_posRadius)
  464. {
  465. global IsPlayerInRangeOfPoint_func
  466. res := DllCall(IsPlayerInRangeOfPoint_func, Float, flo_posX, Float, flo_posY, Float, flo_posZ, Float, flo_posRadius)
  467. return res
  468. }
  469. IsPlayerInRangeOfPoint2D(flo_posX, flo_posY, flo_posRadius)
  470. {
  471. global IsPlayerInRangeOfPoint2D_func
  472. res := DllCall(IsPlayerInRangeOfPoint2D_func, Float, flo_posX, Float, flo_posY, Float, flo_posRadius)
  473. return res
  474. }
  475. IsPlayerInAnyInterior()
  476. {
  477. global IsPlayerInAnyInterior_func
  478. res := DllCall(IsPlayerInAnyInterior_func)
  479. return res
  480. }
  481. IsPlayerFrozen()
  482. {
  483. global IsPlayerFrozen_func
  484. res := DllCall(IsPlayerFrozen_func)
  485. return res
  486. }
  487. GetPlayerWeaponSlot()
  488. {
  489. global GetPlayerWeaponSlot_func
  490. res := DllCall(GetPlayerWeaponSlot_func)
  491. return res
  492. }
  493. GetPlayerWeaponId(int_WeaponSlot)
  494. {
  495. global GetPlayerWeaponId_func
  496. res := DllCall(GetPlayerWeaponId_func, Int, int_WeaponSlot)
  497. return res
  498. }
  499. GetPlayerWeaponName(int_WeaponSlot, ByRef str_WeapName)
  500. {
  501. global GetPlayerWeaponName_func
  502. VarSetCapacity(str_WeapName, 32)
  503. res := DllCall(GetPlayerWeaponName_func, Int, int_WeaponSlot, StrP, str_WeapName)
  504. return res
  505. }
  506. GetPlayerWeaponClip(int_WeaponSlot)
  507. {
  508. global GetPlayerWeaponClip_func
  509. res := DllCall(GetPlayerWeaponClip_func, Int, int_WeaponSlot)
  510. return res
  511. }
  512. GetPlayerWeaponTotalClip(int_WeaponSlot)
  513. {
  514. global GetPlayerWeaponTotalClip_func
  515. res := DllCall(GetPlayerWeaponTotalClip_func, Int, int_WeaponSlot)
  516. return res
  517. }
  518. GetPlayerWeaponState()
  519. {
  520. global GetPlayerWeaponState_func
  521. res := DllCall(GetPlayerWeaponState_func)
  522. return res
  523. }
  524. GetPlayerState()
  525. {
  526. global GetPlayerState_func
  527. res := DllCall(GetPlayerState_func)
  528. return res
  529. }
  530. GetVehiclePointer()
  531. {
  532. global GetVehiclePointer_func
  533. res := DllCall(GetVehiclePointer_func)
  534. return res
  535. }
  536. GetVehicleModelId()
  537. {
  538. global GetVehicleModelId_func
  539. res := DllCall(GetVehicleModelId_func)
  540. return res
  541. }
  542. GetVehicleModelName(ByRef str_VehicleName)
  543. {
  544. global GetVehicleModelName_func
  545. VarSetCapacity(str_VehicleName, 32)
  546. res := DllCall(GetVehicleModelName_func, StrP, str_VehicleName)
  547. return res
  548. }
  549. GetVehicleModelNameById(int_VehicleId, ByRef str_VehicleName)
  550. {
  551. global GetVehicleModelNameById_func
  552. VarSetCapacity(str_VehicleName, 32)
  553. res := DllCall(GetVehicleModelNameById_func, Int, int_VehicleId, StrP, str_VehicleName)
  554. return res
  555. }
  556. GetVehicleType()
  557. {
  558. global GetVehicleType_func
  559. res := DllCall(GetVehicleType_func)
  560. return res
  561. }
  562. GetVehicleHealth()
  563. {
  564. global GetVehicleHealth_func
  565. res := DllCall(GetVehicleHealth_func)
  566. return res
  567. }
  568. GetVehicleRadioStation()
  569. {
  570. global GetVehicleRadioStation_func
  571. res := DllCall(GetVehicleRadioStation_func)
  572. return res
  573. }
  574. GetVehicleRadioStationName(ByRef str_RadioName)
  575. {
  576. global GetVehicleRadioStationName_func
  577. VarSetCapacity(str_RadioName, 32)
  578. res := DllCall(GetVehicleRadioStationName_func, StrP, str_RadioName)
  579. return res
  580. }
  581. GetVehicleFreeSeats(ByRef int_SeatFL, ByRef int_SeatFR, ByRef int_SeatBL, ByRef int_SeatBR)
  582. {
  583. global GetVehicleFreeSeats_func
  584. res := DllCall(GetVehicleFreeSeats_func, IntP, int_SeatFL, IntP, int_SeatFR, IntP, int_SeatBL, IntP, int_SeatBR)
  585. return res
  586. }
  587. GetVehicleSpeed(float_SpeedMult)
  588. {
  589. global GetVehicleSpeed_func
  590. res := DllCall(GetVehicleSpeed_func, Float, float_SpeedMult)
  591. return res
  592. }
  593. GetVehicleFirstColor()
  594. {
  595. global GetVehicleFirstColor_func
  596. res := DllCall(GetVehicleFirstColor_func)
  597. return res
  598. }
  599. GetVehicleSecondColor()
  600. {
  601. global GetVehicleSecondColor_func
  602. res := DllCall(GetVehicleSecondColor_func)
  603. return res
  604. }
  605. GetVehicleColor(ByRef int_ColorFirst, ByRef int_ColorSecond)
  606. {
  607. global GetVehicleColor_func
  608. res := DllCall(GetVehicleColor_func, IntP, int_ColorFirst, IntP, int_ColorSecond)
  609. return res
  610. }
  611. GetVehicleColorRGB(int_Color, ByRef uint_ColorRGB)
  612. {
  613. global GetVehicleColorRGB_func
  614. res := DllCall(GetVehicleColorRGB_func, Int, int_Color, UIntP, uint_ColorRGB)
  615. return res
  616. }
  617. GetVehicleColorARGB(int_Color, ByRef uint_ColorARGB)
  618. {
  619. global GetVehicleColorARGB_func
  620. res := DllCall(GetVehicleColorARGB_func, Int, int_Color, UIntP, uint_ColorARGB)
  621. return res
  622. }
  623. IsPlayerInAnyVehicle()
  624. {
  625. global IsPlayerInAnyVehicle_func
  626. res := DllCall(IsPlayerInAnyVehicle_func)
  627. return res
  628. }
  629. IsPlayerDriver()
  630. {
  631. global IsPlayerDriver_func
  632. res := DllCall(IsPlayerDriver_func)
  633. return res
  634. }
  635. IsPlayerPassenger()
  636. {
  637. global IsPlayerPassenger_func
  638. res := DllCall(IsPlayerPassenger_func)
  639. return res
  640. }
  641. IsVehicleSeatUsed(int_SeatId)
  642. {
  643. global IsVehicleSeatUsed_func
  644. res := DllCall(IsVehicleSeatUsed_func, int, int_SeatId)
  645. return res
  646. }
  647. IsVehicleLocked()
  648. {
  649. global IsVehicleLocked_func
  650. res := DllCall(IsVehicleLocked_func)
  651. return res
  652. }
  653. IsVehicleSirenEnabled()
  654. {
  655. global IsVehicleSirenEnabled_func
  656. res := DllCall(IsVehicleSirenEnabled_func)
  657. return res
  658. }
  659. IsVehicleHornEnabled()
  660. {
  661. global IsVehicleHornEnabled_func
  662. res := DllCall(IsVehicleHornEnabled_func)
  663. return res
  664. }
  665. IsVehicleAlternateSirenEnabled()
  666. {
  667. global IsVehicleAlternateSirenEnabled_func
  668. res := DllCall(IsVehicleAlternateSirenEnabled_func)
  669. return res
  670. }
  671. IsVehicleEngineEnabled()
  672. {
  673. global IsVehicleEngineEnabled_func
  674. res := DllCall(IsVehicleEngineEnabled_func)
  675. return res
  676. }
  677. IsVehicleLightEnabled()
  678. {
  679. global IsVehicleLightEnabled_func
  680. res := DllCall(IsVehicleLightEnabled_func)
  681. return res
  682. }
  683. IsPlayerInCar()
  684. {
  685. global IsPlayerInCar_func
  686. res := DllCall(IsPlayerInCar_func)
  687. return res
  688. }
  689. IsPlayerInPlane()
  690. {
  691. global IsPlayerInPlane_func
  692. res := DllCall(IsPlayerInPlane_func)
  693. return res
  694. }
  695. IsPlayerInBoat()
  696. {
  697. global IsPlayerInBoat_func
  698. res := DllCall(IsPlayerInBoat_func)
  699. return res
  700. }
  701. IsPlayerInTrain()
  702. {
  703. global IsPlayerInTrain_func
  704. res := DllCall(IsPlayerInTrain_func)
  705. return res
  706. }
  707. IsPlayerInBike()
  708. {
  709. global IsPlayerInBike_func
  710. res := DllCall(IsPlayerInBike_func)
  711. return res
  712. }
  713. TextCreate(Font, fontsize, bold, italic, x, y, color, text, shadow, show)
  714. {
  715. global TextCreate_func
  716. res := DllCall(TextCreate_func,Str,Font,Int,fontsize,UChar,bold,UChar,italic,Int,x,Int,y,UInt,color,Str,text,UChar,shadow,UChar,show)
  717. return res
  718. }
  719. TextDestroy(id)
  720. {
  721. global TextDestroy_func
  722. res := DllCall(TextDestroy_func,Int,id)
  723. return res
  724. }
  725. TextSetShadow(id, shadow)
  726. {
  727. global TextSetShadow_func
  728. res := DllCall(TextSetShadow_func,Int,id,UChar,shadow)
  729. return res
  730. }
  731. TextSetShown(id, show)
  732. {
  733. global TextSetShown_func
  734. res := DllCall(TextSetShown_func,Int,id,UChar,show)
  735. return res
  736. }
  737. TextSetColor(id,color)
  738. {
  739. global TextSetColor_func
  740. res := DllCall(TextSetColor_func,Int,id,UInt,color)
  741. return res
  742. }
  743. TextSetPos(id,x,y)
  744. {
  745. global TextSetPos_func
  746. res := DllCall(TextSetPos_func,Int,id,Int,x,Int,y)
  747. return res
  748. }
  749. TextSetString(id,Text)
  750. {
  751. global TextSetString_func
  752. res := DllCall(TextSetString_func,Int,id,Str,Text)
  753. return res
  754. }
  755. TextUpdate(id,Font,Fontsize,bold,italic)
  756. {
  757. global TextUpdate_func
  758. res := DllCall(TextUpdate_func,Int,id,Str,Font,int,Fontsize,UChar,bold,UChar,italic)
  759. return res
  760. }
  761. BoxCreate(x,y,width,height,Color,show)
  762. {
  763. global BoxCreate_func
  764. res := DllCall(BoxCreate_func,Int,x,Int,y,Int,width,Int,height,UInt,Color,UChar,show)
  765. return res
  766. }
  767. BoxDestroy(id)
  768. {
  769. global BoxDestroy_func
  770. res := DllCall(BoxDestroy_func,Int,id)
  771. return res
  772. }
  773. BoxSetShown(id,Show)
  774. {
  775. global BoxSetShown_func
  776. res := DllCall(BoxSetShown_func,Int,id,UChar,Show)
  777. return res
  778. }
  779. BoxSetBorder(id,height,Show)
  780. {
  781. global BoxSetBorder_func
  782. res := DllCall(BoxSetBorder_func,Int,id,Int,height,Int,Show)
  783. return res
  784. }
  785. BoxSetBorderColor(id,Color)
  786. {
  787. global BoxSetBorderColor_func
  788. res := DllCall(BoxSetBorderColor_func,Int,id,UInt,Color)
  789. return res
  790. }
  791. BoxSetColor(id,Color)
  792. {
  793. global BoxSetColor_func
  794. res := DllCall(BoxSetColor_func,Int,id,UInt,Color)
  795. return res
  796. }
  797. BoxSetHeight(id,height)
  798. {
  799. global BoxSetHeight_func
  800. res := DllCall(BoxSetHeight_func,Int,id,Int,height)
  801. return res
  802. }
  803. BoxSetPos(id,x,y)
  804. {
  805. global BoxSetPos_func
  806. res := DllCall(BoxSetPos_func,Int,id,Int,x,Int,y)
  807. return res
  808. }
  809. BoxSetWidth(id,width)
  810. {
  811. global BoxSetWidth_func
  812. res := DllCall(BoxSetWidth_func,Int,id,Int,width)
  813. return res
  814. }
  815. LineCreate(x1,y1,x2,y2,width,color,show)
  816. {
  817. global LineCreate_func
  818. res := DllCall(LineCreate_func,Int,x1,Int,y1,Int,x2,Int,y2,Int,Width,UInt,color,UChar,show)
  819. return res
  820. }
  821. LineDestroy(id)
  822. {
  823. global LineDestroy_func
  824. res := DllCall(LineDestroy_func,Int,id)
  825. return res
  826. }
  827. LineSetShown(id,show)
  828. {
  829. global LineSetShown_func
  830. res := DllCall(LineSetShown_func,Int,id,UChar,show)
  831. return res
  832. }
  833. LineSetColor(id,color)
  834. {
  835. global LineSetColor_func
  836. res := DllCall(LineSetColor_func,Int,id,UInt,color)
  837. return res
  838. }
  839. LineSetWidth(id, width)
  840. {
  841. global LineSetWidth_func
  842. res := DllCall(LineSetWidth_func,Int,id,Int,width)
  843. return res
  844. }
  845. LineSetPos(id,x1,y1,x2,y2)
  846. {
  847. global LineSetPos_func
  848. res := DllCall(LineSetPos_func,Int,id,Int,x1,Int,y1,Int,x2,Int,y2)
  849. return res
  850. }
  851. ImageCreate(path, x, y, rotation, align, show)
  852. {
  853. global ImageCreate_func
  854. res := DllCall(ImageCreate_func, Str, path, Int, x, Int, y, Int, rotation, Int, align, UChar, show)
  855. return res
  856. }
  857. ImageDestroy(id)
  858. {
  859. global ImageDestroy_func
  860. res := DllCall(ImageDestroy_func,Int,id)
  861. return res
  862. }
  863. ImageSetShown(id,show)
  864. {
  865. global ImageSetShown_func
  866. res := DllCall(ImageSetShown_func,Int,id,UChar,show)
  867. return res
  868. }
  869. ImageSetAlign(id,align)
  870. {
  871. global ImageSetAlign_func
  872. res := DllCall(ImageSetAlign_func,Int,id,Int,align)
  873. return res
  874. }
  875. ImageSetPos(id, x, y)
  876. {
  877. global ImageSetPos_func
  878. res := DllCall(ImageSetPos_func,Int,id,Int,x, Int, y)
  879. return res
  880. }
  881. ImageSetRotation(id, rotation)
  882. {
  883. global ImageSetRotation_func
  884. res := DllCall(ImageSetRotation_func,Int,id,Int, rotation)
  885. return res
  886. }
  887. DestroyAllVisual()
  888. {
  889. global DestroyAllVisual_func
  890. res := DllCall(DestroyAllVisual_func)
  891. return res
  892. }
  893. ShowAllVisual()
  894. {
  895. global ShowAllVisual_func
  896. res := DllCall(ShowAllVisual_func)
  897. return res
  898. }
  899. HideAllVisual()
  900. {
  901. global HideAllVisual_func
  902. res := DllCall(HideAllVisual_func )
  903. return res
  904. }
  905. SetListenCallback(int_Id)
  906. {
  907. global SetListenCallback_func
  908. res := DllCall(SetListenCallback_func, Int, int_Id)
  909. return res
  910. }
  911. UnSetCallbackPointer()
  912. {
  913. global UnSetCallbackPointer_func
  914. res := DllCall(UnSetCallbackPointer_func)
  915. return res
  916. }
  917. SetCallbackPointer(int_Id)
  918. {
  919. global SetCallbackPointer_func
  920. res := DllCall(SetCallbackPointer_func, Int, int_Id)
  921. return res
  922. }
  923. UnSetListenCallback(int_Id)
  924. {
  925. global UnSetListenCallback_func
  926. res := DllCall(UnSetListenCallback_func, Int, int_Id)
  927. return res
  928. }
  929. UnSetListenCallbackAll()
  930. {
  931. global UnSetListenCallbackAll_func
  932. res := DllCall(UnSetListenCallbackAll_func)
  933. return res
  934. }
  935. GetCallbackHealParams(ptr_HealStruct, ByRef iOldHeal, ByRef iNewHeal)
  936. {
  937. ioldHeal := NumGet(ptr_HealStruct+0, "int")
  938. inewHeal := NumGet(ptr_HealStruct+4, "int")
  939. }
  940. GetCallbackArmorParams(ptr_ArmorStruct, ByRef iOldArmor, ByRef iNewArmor)
  941. {
  942. ioldArmor := NumGet(ptr_ArmorStruct+0, "int")
  943. inewArmor := NumGet(ptr_ArmorStruct+4, "int")
  944. }
  945. GetCallbackPositionParams(ptr_PositionStruct, ByRef fOldPosX, ByRef fOldPosY, ByRef fOldPosZ, ByRef fOldPosR, ByRef fNewPosX, ByRef fNewPosY, ByRef fNewPosZ, ByRef fNewPosR)
  946. {
  947. fOldPosX := NumGet(ptr_PositionStruct+0, "float")
  948. fOldPosY := NumGet(ptr_PositionStruct+4, "float")
  949. fOldPosZ := NumGet(ptr_PositionStruct+8, "float")
  950. fOldPosR := NumGet(ptr_PositionStruct+12, "float")
  951. fNewPosX := NumGet(ptr_PositionStruct+16, "float")
  952. fNewPosY := NumGet(ptr_PositionStruct+20, "float")
  953. fNewPosZ := NumGet(ptr_PositionStruct+24, "float")
  954. fNewPosR := NumGet(ptr_PositionStruct+28, "float")
  955. }
  956. GetCallbackEnterExitParams(ptr_EnterExitStruct, ByRef iOldInteriorState, ByRef iNewInteriorState)
  957. {
  958. iOldInteriorState := NumGet(ptr_EnterExitStruct+0, "int")
  959. iNewInteriorState := NumGet(ptr_EnterExitStruct+4, "int")
  960. }
  961. GetCallbackVehicleEnterExitParams(ptr_VehicleEnterExitStruct, ByRef iOldVehicleEnterExit, ByRef iNewVehicleEnterExit)
  962. {
  963. iOldVehicleEnterExit := NumGet(ptr_VehicleEnterExitStruct+0, "int")
  964. iNewVehicleEnterExit := NumGet(ptr_VehicleEnterExitStruct+4, "int")
  965. }
  966. GetCallbackVehicleHealthParams(ptr_VehicleHealthStruct, ByRef iOldVehicleHealth, ByRef iNewVehicleHealth)
  967. {
  968. iOldVehicleHealth := NumGet(ptr_VehicleHealthStruct+0, "int")
  969. iNewVehicleHealth := NumGet(ptr_VehicleHealthStruct+4, "int")
  970. }
  971. GetCallbackVehicleEngineParams(ptr_VehicleEngineStruct, ByRef iOldVehicleEngine, ByRef iNewVehicleEngine)
  972. {
  973. iOldVehicleEngine := NumGet(ptr_VehicleEngineStruct+0, "int")
  974. iNewVehicleEngine := NumGet(ptr_VehicleEngineStruct+4, "int")
  975. }
  976. GetCallbackVehicleLockParams(ptr_VehicleLockStruct, ByRef iOldVehicleLock, ByRef iNewVehicleLock)
  977. {
  978. iOldVehicleLock := NumGet(ptr_VehicleLockStruct+0, "int")
  979. iNewVehicleLock := NumGet(ptr_VehicleLockStruct+4, "int")
  980. }
  981. GetCallbackVehicleSpeedParams(ptr_VehicleSpeedStruct, ByRef iOldVehicleSpeed, ByRef iNewVehicleSpeed)
  982. {
  983. iOldVehicleSpeed := NumGet(ptr_VehicleSpeedStruct+0, "int")
  984. iNewVehicleSpeed := NumGet(ptr_VehicleSpeedStruct+4, "int")
  985. }
  986. GetCallbackWeaponSwitchParams(ptr_WeaponSwitchStruct, ByRef iOldWeaponId, ByRef iNewWeaponId)
  987. {
  988. iOldWeaponId := NumGet(ptr_WeaponSwitchStruct+0, "int")
  989. iNewWeaponId := NumGet(ptr_WeaponSwitchStruct+4, "int")
  990. }
  991. GetCallbackWeaponClipParams(ptr_WeaponClipStruct, ByRef iOldWeaponClip, ByRef iNewWeaponClip)
  992. {
  993. iOldWeaponClip := NumGet(ptr_WeaponClipStruct+0, "int")
  994. iNewWeaponClip := NumGet(ptr_WeaponClipStruct+4, "int")
  995. }
  996. GetCallbackWeaponTotalClipParams(ptr_WeaponTotalClipStruct, ByRef iOldWeaponTotalClip, ByRef iNewWeaponTotalClip)
  997. {
  998. iOldWeaponTotalClip := NumGet(ptr_WeaponTotalClipStruct+0, "int")
  999. iNewWeaponTotalClip := NumGet(ptr_WeaponTotalClipStruct+4, "int")
  1000. }
  1001. GetCallbackChatlogParams(ptr_ChatlogStruct, ByRef string)
  1002. {
  1003. VarSetCapacity(string, 256, 0)
  1004. string := StrGet(ptr_ChatlogStruct)
  1005. }
  1006. UpdateServerData()
  1007. {
  1008. global UpdateServerData_func
  1009. res := DllCall(UpdateServerData_func)
  1010. return res
  1011. }
  1012. GetPlayerNameById(id,ByRef name)
  1013. {
  1014. VarSetCapacity(name,24,0)
  1015. global GetPlayerNameById_func
  1016. res := DllCall(GetPlayerNameById_func,UShort,id,StrP,name)
  1017. return res
  1018. }
  1019. GetPlayerIdByName(name)
  1020. {
  1021. global GetPlayerIdByName_func
  1022. res := DllCall(GetPlayerIdByName_func,Str,name)
  1023. return res
  1024. }
  1025. DecimalToHex(Var){
  1026. SetFormat, IntegerFast, hex
  1027. Dec2Hex += Var
  1028. Dec2Hex .= ""
  1029. SetFormat, IntegerFast, d
  1030. StringTrimLeft, Dec2Hex, Dec2Hex, 2
  1031. StringUpper, Dec2Hex, Dec2Hex
  1032. sDec2Hex .= Dec2Hex
  1033. return sDec2Hex
  1034. }
  1035. RelToAbs(root, dir, s = "\") {
  1036. pr := SubStr(root, 1, len := InStr(root, s, "", InStr(root, s . s) + 2) - 1)
  1037. , root := SubStr(root, len + 1), sk := 0
  1038. If InStr(root, s, "", 0) = StrLen(root)
  1039. StringTrimRight, root, root, 1
  1040. If InStr(dir, s, "", 0) = StrLen(dir)
  1041. StringTrimRight, dir, dir, 1
  1042. Loop, Parse, dir, %s%
  1043. {
  1044. If A_LoopField = ..
  1045. StringLeft, root, root, InStr(root, s, "", 0) - 1
  1046. Else If A_LoopField =
  1047. root =
  1048. Else If A_LoopField != .
  1049. Continue
  1050. StringReplace, dir, dir, %A_LoopField%%s%
  1051. }
  1052. Return, pr . root . s . dir
  1053. }
  1054. global ERROR_OK                     := 0
  1055. global ERROR_PROCESS_NOT_FOUND      := 1
  1056. global ERROR_OPEN_PROCESS           := 2
  1057. global ERROR_INVALID_HANDLE         := 3
  1058. global ERROR_MODULE_NOT_FOUND       := 4
  1059. global ERROR_ENUM_PROCESS_MODULES   := 5
  1060. global ERROR_ZONE_NOT_FOUND         := 6
  1061. global ERROR_CITY_NOT_FOUND         := 7
  1062. global ERROR_READ_MEMORY            := 8
  1063. global ERROR_WRITE_MEMORY           := 9
  1064. global ERROR_ALLOC_MEMORY           := 10
  1065. global ERROR_FREE_MEMORY            := 11
  1066. global ERROR_WAIT_FOR_OBJECT        := 12
  1067. global ERROR_CREATE_THREAD          := 13
  1068. global ADDR_ZONECODE                := 0xA49AD4
  1069. global ADDR_POSITION_X              := 0xB6F2E4
  1070. global ADDR_POSITION_Y              := 0xB6F2E8
  1071. global ADDR_POSITION_Z              := 0xB6F2EC
  1072. global ADDR_CPED_PTR                := 0xB6F5F0
  1073. global ADDR_CPED_HPOFF              := 0x540
  1074. global ADDR_CPED_ARMOROFF           := 0x548
  1075. global ADDR_CPED_MONEY              := 0x0B7CE54
  1076. global ADDR_CPED_INTID              := 0xA4ACE8
  1077. global ADDR_CPED_SKINIDOFF          := 0x22
  1078. global ADDR_VEHICLE_PTR             := 0xBA18FC
  1079. global ADDR_VEHICLE_HPOFF           := 0x4C0
  1080. global ADDR_VEHICLE_DOORSTATE       := 0x4F8
  1081. global ADDR_VEHICLE_ENGINESTATE     := 0x428
  1082. global ADDR_VEHICLE_LIGHTSTATE      := 0x584
  1083. global ADDR_VEHICLE_MODEL           := 0x22
  1084. global ADDR_VEHICLE_TYPE            := 0x590
  1085. global ADDR_VEHICLE_DRIVER          := 0x460
  1086. global ADDR_VEHICLE_X               := 0x44
  1087. global ADDR_VEHICLE_Y               := 0x48
  1088. global ADDR_VEHICLE_Z               := 0x4C
  1089. global oAirplaneModels := [417, 425, 447, 460, 469, 476, 487, 488, 497, 511, 512, 513, 519, 520, 548, 553, 563, 577, 592, 593]
  1090. global oBikeModels := [481,509,510]
  1091. 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"]
  1092. global oweaponNames := ["Fist","Brass Knuckles","Golf Club","Nightstick","Knife","Baseball Bat","Shovel","Pool Cue","Katana","Chainsaw","Purple Dildo","Dildo","Vibrator","Silver Vibrator","Flowers","Cane","Grenade","Tear Gas","Molotov Cocktail", "", "", "", "9mm","Silenced 9mm","21Desert Eagle","Shotgun","Sawnoff Shotgun","Combat Shotgun","Micro SMG/Uzi","MP5","AK-47","M4","Tec-9","Country Rifle","Sniper Rifle","RPG","HS Rocket","Flamethrower","Minigun","Satchel Charge","Detonator","Spraycan","Fire Extinguisher","Camera","Night Vis Goggles","Thermal Goggles","Parachute"]
  1093. global oradiostationNames := ["Playback FM", "K Rose", "K-DST", "Bounce FM", "SF-UR", "Radio Los Santos", "Radio X", "CSR 103.9", "K-JAH West", "Master Sounds 98.3", "WCTR Talk Radio", "User Track Player", "Radio Off"]
  1094. global oweatherNames := ["EXTRASUNNY_LA", "SUNNY_LA", "EXTRASUNNY_SMOG_LA", "SUNNY_SMOG_LA", "CLOUDY_LA", "SUNNY_SF", "EXTRASUNNY_SF", "CLOUDY_SF", "RAINY_SF", "FOGGY_SF", "SUNNY_VEGAS", "EXTRASUNNY_VEGAS", "CLOUDY_VEGAS", "EXTRASUNNY_COUNTRYSIDE", "SUNNY_COUNTRYSIDE", "CLOUDY_COUNTRYSIDE", "RAINY_COUNTRYSIDE", "EXTRASUNNY_DESERT", "SUNNY_DESERT", "SANDSTORM_DESERT", "UNDERWATER", "EXTRACOLOURS_1", "EXTRACOLOURS_2"]
  1095. global ADDR_SAMP_INCHAT_PTR             := 0x21a10c
  1096. global ADDR_SAMP_INCHAT_PTR_OFF         := 0x55
  1097. global ADDR_SAMP_USERNAME               := 0x219A6F
  1098. global FUNC_SAMP_SENDCMD                := 0x65c60
  1099. global FUNC_SAMP_SENDSAY                := 0x57f0
  1100. global FUNC_SAMP_ADDTOCHATWND           := 0x64520
  1101. global ADDR_SAMP_CHATMSG_PTR            := 0x21a0e4
  1102. global FUNC_SAMP_SHOWGAMETEXT           := 0x9c2c0
  1103. global FUNC_SAMP_SHOWDIALOG             := 0x6B9C0
  1104. global ADDR_SAMP_SHOWDLG_PTR            := 0x21a0b8
  1105. global FUNC_SAMP_PLAYAUDIOSTR           := 0x62da0
  1106. global FUNC_SAMP_STOPAUDIOSTR           := 0x629a0
  1107. global FUNC_UPDATESCOREBOARD                := 0x8A10
  1108. global SAMP_INFO_OFFSET                     := 0x21A0F8
  1109. global SAMP_PPOOLS_OFFSET                   := 0x3CD
  1110. global SAMP_PPOOL_PLAYER_OFFSET             := 0x18
  1111. global SAMP_SLOCALPLAYERID_OFFSET           := 0x4
  1112. global SAMP_ISTRLEN_LOCALPLAYERNAME_OFFSET  := 0x1A
  1113. global SAMP_SZLOCALPLAYERNAME_OFFSET        := 0xA
  1114. global SAMP_PSZLOCALPLAYERNAME_OFFSET       := 0xA
  1115. global SAMP_PREMOTEPLAYER_OFFSET            := 0x2E
  1116. global SAMP_ISTRLENNAME___OFFSET            := 0x1C
  1117. global SAMP_SZPLAYERNAME_OFFSET             := 0xC
  1118. global SAMP_PSZPLAYERNAME_OFFSET            := 0xC
  1119. global SAMP_ILOCALPLAYERPING_OFFSET         := 0x26
  1120. global SAMP_ILOCALPLAYERSCORE_OFFSET        := 0x2A
  1121. global SAMP_IPING_OFFSET                    := 0x28
  1122. global SAMP_ISCORE_OFFSET                   := 0x24
  1123. global SAMP_ISNPC_OFFSET                    := 0x4
  1124. global SAMP_PLAYER_MAX                      := 1004
  1125. global SIZE_SAMP_CHATMSG    := 0xFC
  1126. global hGTA                 := 0x0
  1127. global dwGTAPID             := 0x0
  1128. global dwSAMP               := 0x0
  1129. global pMemory              := 0x0
  1130. global pParam1              := 0x0
  1131. global pParam2              := 0x0
  1132. global pParam3              := 0x0
  1133. global pInjectFunc          := 0x0
  1134. global nZone                := 1
  1135. global nCity                := 1
  1136. global bInitZaC             := 0
  1137. global iRefreshScoreboard   := 0
  1138. global oScoreboardData      := ""
  1139. global iRefreshHandles      := 0
  1140. global iUpdateTick          := 2500
  1141. IsSAMPAvailable() {
  1142. if(!checkHandles())
  1143. return false
  1144. dwChatInfo := readDWORD(hGTA, dwSAMP + ADDR_SAMP_CHATMSG_PTR)
  1145. if(dwChatInfo == 0 || dwChatInfo == "ERROR")
  1146. {
  1147. return false
  1148. }
  1149. else
  1150. {
  1151. return true
  1152. }
  1153. }
  1154. isInChat() {
  1155. if(!checkHandles())
  1156. return -1
  1157. dwPtr := dwSAMP + ADDR_SAMP_INCHAT_PTR
  1158. dwAddress := readDWORD(hGTA, dwPtr) + ADDR_SAMP_INCHAT_PTR_OFF
  1159. if(ErrorLevel) {
  1160. ErrorLevel := ERROR_READ_MEMORY
  1161. return -1
  1162. }
  1163. dwInChat := readDWORD(hGTA, dwAddress)
  1164. if(ErrorLevel) {
  1165. ErrorLevel := ERROR_READ_MEMORY
  1166. return -1
  1167. }
  1168. ErrorLevel := ERROR_OK
  1169. if(dwInChat > 0) {
  1170. return true
  1171. } else {
  1172. return false
  1173. }
  1174. }
  1175. getId() {
  1176. s:=getUsername()
  1177. return getPlayerIdByName(s)
  1178. }
  1179. playAudioStream(wUrl) {
  1180. wUrl := "" wUrl
  1181. if(!checkHandles())
  1182. return false
  1183. dwFunc := dwSAMP + FUNC_SAMP_PLAYAUDIOSTR
  1184. patchRadio()
  1185. callWithParams(hGTA, dwFunc, [["s", wUrl], ["i", 0], ["i", 0], ["i", 0], ["i", 0], ["i", 0]], false)
  1186. unPatchRadio()
  1187. ErrorLevel := ERROR_OK
  1188. return true
  1189. }
  1190. stopAudioStream() {
  1191. if(!checkHandles())
  1192. return false
  1193. dwFunc := dwSAMP + FUNC_SAMP_STOPAUDIOSTR
  1194. patchRadio()
  1195. callWithParams(hGTA, dwFunc, [["i", 1]], false)
  1196. unPatchRadio()
  1197. ErrorLevel := ERROR_OK
  1198. return true
  1199. }
  1200. getServerName() {
  1201. if(!checkHandles())
  1202. return -1
  1203. dwAdress := readMem(hGTA, dwSAMP + 0x21A0F8, 4, "int")
  1204. if(ErrorLevel) {
  1205. ErrorLevel := ERROR_READ_MEMORY
  1206. return -1
  1207. }
  1208. if(!dwAdress)
  1209. return -1
  1210. ServerName := readString(hGTA, dwAdress + 0x121, 200)
  1211. if(ErrorLevel) {
  1212. ErrorLevel := ERROR_READ_MEMORY
  1213. return -1
  1214. }
  1215. ErrorLevel := ERROR_OK
  1216. return ServerName
  1217. }
  1218. getWeatherID() {
  1219. if(!checkHandles())
  1220. return -1
  1221. dwGTA := getModuleBaseAddress("gta_sa.exe", hGTA)
  1222. WeatherID := readMem(hGTA, dwGTA + 0xC81320, 2, "byte")
  1223. if(ErrorLevel) {
  1224. ErrorLevel := ERROR_READ_MEMORY
  1225. return -1
  1226. }
  1227. ErrorLevel := ERROR_OK
  1228. return WeatherID
  1229. }
  1230. getWeatherName() {
  1231. if(isPlayerInAnyVehicle() == 0)
  1232. return -1
  1233. if(id >= 0 && id < 23)
  1234. {
  1235. return oweatherNames[id-1]
  1236. }
  1237. return ""
  1238. }
  1239. patchRadio()
  1240. {
  1241. if(!checkHandles())
  1242. return false
  1243. VarSetCapacity(nop, 4, 0)
  1244. NumPut(0x90909090,nop,0,"UInt")
  1245. dwFunc := dwSAMP + FUNC_SAMP_PLAYAUDIOSTR
  1246. writeRaw(hGTA, dwFunc, &nop, 4)
  1247. writeRaw(hGTA, dwFunc+4, &nop, 1)
  1248. dwFunc := dwSAMP + FUNC_SAMP_STOPAUDIOSTR
  1249. writeRaw(hGTA, dwFunc, &nop, 4)
  1250. writeRaw(hGTA, dwFunc+4, &nop, 1)
  1251. return true
  1252. }
  1253. unPatchRadio()
  1254. {
  1255. if(!checkHandles())
  1256. return false
  1257. VarSetCapacity(old, 4, 0)
  1258. dwFunc := dwSAMP + FUNC_SAMP_PLAYAUDIOSTR
  1259. NumPut(0x74003980,old,0,"UInt")
  1260. writeRaw(hGTA, dwFunc, &old, 4)
  1261. NumPut(0x39,old,0,"UChar")
  1262. writeRaw(hGTA, dwFunc+4, &old, 1)
  1263. dwFunc := dwSAMP + FUNC_SAMP_STOPAUDIOSTR
  1264. NumPut(0x74003980,old,0,"UInt")
  1265. writeRaw(hGTA, dwFunc, &old, 4)
  1266. NumPut(0x09,old,0,"UChar")
  1267. writeRaw(hGTA, dwFunc+4, &old, 1)
  1268. return true
  1269. }
  1270. calcScreenCoors(fX,fY,fZ)
  1271. {
  1272. if(!checkHandles())
  1273. return false
  1274. dwM := 0xB6FA2C
  1275. m_11 := readFloat(hGTA, dwM + 0*4)
  1276. if(ErrorLevel) {
  1277. ErrorLevel := ERROR_READ_MEMORY
  1278. return false
  1279. }
  1280. m_12 := readFloat(hGTA, dwM + 1*4)
  1281. m_13 := readFloat(hGTA, dwM + 2*4)
  1282. m_21 := readFloat(hGTA, dwM + 4*4)
  1283. m_22 := readFloat(hGTA, dwM + 5*4)
  1284. m_23 := readFloat(hGTA, dwM + 6*4)
  1285. m_31 := readFloat(hGTA, dwM + 8*4)
  1286. m_32 := readFloat(hGTA, dwM + 9*4)
  1287. m_33 := readFloat(hGTA, dwM + 10*4)
  1288. m_41 := readFloat(hGTA, dwM + 12*4)
  1289. m_42 := readFloat(hGTA, dwM + 13*4)
  1290. m_43 := readFloat(hGTA, dwM + 14*4)
  1291. dwLenX := readDWORD(hGTA, 0xC17044)
  1292. if(ErrorLevel) {
  1293. ErrorLevel := ERROR_READ_MEMORY
  1294. return false
  1295. }
  1296. dwLenY := readDWORD(hGTA, 0xC17048)
  1297. frX := fZ * m_31 + fY * m_21 + fX * m_11 + m_41
  1298. frY := fZ * m_32 + fY * m_22 + fX * m_12 + m_42
  1299. frZ := fZ * m_33 + fY * m_23 + fX * m_13 + m_43
  1300. fRecip := 1.0/frZ
  1301. frX *= fRecip * dwLenX
  1302. frY *= fRecip * dwLenY
  1303. if(frX<=dwLenX && frY<=dwLenY && frZ>1)
  1304. return [frX,frY,frZ]
  1305. }
  1306. CountOnlinePlayers() {
  1307. if(!checkHandles())
  1308. return -1
  1309. dwOnline := readDWORD(hGTA, dwSAMP + 0x21A0B4)
  1310. if(ErrorLevel) {
  1311. ErrorLevel := ERROR_READ_MEMORY
  1312. return -1
  1313. }
  1314. dwAddr := dwOnline + 0x4
  1315. OnlinePlayers := readDWORD(hGTA, dwAddr)
  1316. if(ErrorLevel) {
  1317. ErrorLevel := ERROR_READ_MEMORY
  1318. return -1
  1319. }
  1320. ErrorLevel := ERROR_OK
  1321. return OnlinePlayers
  1322. }
  1323. getPedCoordinates(dwPED) {
  1324. dwPED += 0
  1325. dwPED := Floor(dwPED)
  1326. if(!dwPED)
  1327. return ""
  1328. if(!checkHandles())
  1329. return ""
  1330. dwAddress := readDWORD(hGTA, dwPED + 0x14)
  1331. if(ErrorLevel || dwAddress==0) {
  1332. ErrorLevel := ERROR_READ_MEMORY
  1333. return ""
  1334. }
  1335. fX := readFloat(hGTA, dwAddress + 0x30)
  1336. if(ErrorLevel) {
  1337. ErrorLevel := ERROR_READ_MEMORY
  1338. return ""
  1339. }
  1340. fY := readFloat(hGTA, dwAddress + 0x34)
  1341. if(ErrorLevel) {
  1342. ErrorLevel := ERROR_READ_MEMORY
  1343. return ""
  1344. }
  1345. fZ := readFloat(hGTA, dwAddress + 0x38)
  1346. if(ErrorLevel) {
  1347. ErrorLevel := ERROR_READ_MEMORY
  1348. return ""
  1349. }
  1350. ErrorLevel := ERROR_OK
  1351. return [fX, fY, fZ]
  1352. }
  1353. getTargetPos(dwId) {
  1354. dwId += 0
  1355. dwId := Floor(dwId)
  1356. if(dwId < 0 || dwId >= SAMP_PLAYER_MAX)
  1357. return ""
  1358. if(iRefreshScoreboard+iUpdateTick > A_TickCount)
  1359. {
  1360. if(oScoreboardData[dwId])
  1361. {
  1362. if(oScoreboardData[dwId].HasKey("PED"))
  1363. return getPedCoordinates(oScoreboardData[dwId].PED)
  1364. if(oScoreboardData[dwId].HasKey("MPOS"))
  1365. return oScoreboardData[dwId].MPOS
  1366. }
  1367. return ""
  1368. }
  1369. if(oScoreboardData[dwId])
  1370. {
  1371. if(oScoreboardData[dwId].HasKey("PED"))
  1372. return getPedCoordinates(oScoreboardData[dwId].PED)
  1373. if(oScoreboardData[dwId].HasKey("MPOS"))
  1374. return oScoreboardData[dwId].MPOS
  1375. }
  1376. return ""
  1377. }
  1378. getTargetPlayerSkinIdByPed(dwPED) {
  1379. if(!checkHandles())
  1380. return -1
  1381. dwAddr := dwPED + ADDR_CPED_SKINIDOFF
  1382. SkinID := readMem(hGTA, dwAddr, 2, "byte")
  1383. if(ErrorLevel) {
  1384. ErrorLevel := ERROR_READ_MEMORY
  1385. return -1
  1386. }
  1387. ErrorLevel := ERROR_OK
  1388. return SkinID
  1389. }
  1390. getTargetPlayerSkinIdById(dwId) {
  1391. if(!checkHandles())
  1392. return -1
  1393. dwPED := getPedById(dwId)
  1394. dwAddr := dwPED + ADDR_CPED_SKINIDOFF
  1395. SkinID := readMem(hGTA, dwAddr, 2, "byte")
  1396. if(ErrorLevel) {
  1397. ErrorLevel := ERROR_READ_MEMORY
  1398. return -1
  1399. }
  1400. ErrorLevel := ERROR_OK
  1401. return SkinID
  1402. }
  1403. getVehiclePointerByPed(dwPED) {
  1404. dwPED += 0
  1405. dwPED := Floor(dwPED)
  1406. if(!dwPED)
  1407. return 0
  1408. if(!checkHandles())
  1409. return 0
  1410. dwAddress := readDWORD(hGTA, dwPED + 0x58C)
  1411. if(ErrorLevel) {
  1412. ErrorLevel := ERROR_READ_MEMORY
  1413. return 0
  1414. }
  1415. ErrorLevel := ERROR_OK
  1416. return dwAddress
  1417. }
  1418. getVehiclePointerById(dwId) {
  1419. if(!dwId)
  1420. return 0
  1421. if(!checkHandles())
  1422. return 0
  1423. dwPed_By_Id := getPedById(dwId)
  1424. dwAddress := readDWORD(hGTA, dwPed_By_Id + 0x58C)
  1425. if(ErrorLevel) {
  1426. ErrorLevel := ERROR_READ_MEMORY
  1427. return 0
  1428. }
  1429. ErrorLevel := ERROR_OK
  1430. return dwAddress
  1431. }
  1432. isTargetInAnyVehicleByPed(dwPED)
  1433. {
  1434. if(!checkHandles())
  1435. return -1
  1436. dwVehiclePointer := getVehiclePointerByPed(dwPedPointer)
  1437. if(dwVehiclePointer > 0)
  1438. {
  1439. return 1
  1440. }
  1441. else if(dwVehiclePointer <= 0)
  1442. {
  1443. return 0
  1444. }
  1445. else
  1446. {
  1447. return -1
  1448. }
  1449. }
  1450. isTargetInAnyVehiclebyId(dwId)
  1451. {
  1452. if(!checkHandles())
  1453. return -1
  1454. dwPedPointer := getPedById(dwId)
  1455. dwVehiclePointer := getVehiclePointerByPed(dwPedPointer)
  1456. if(dwVehiclePointer > 0)
  1457. {
  1458. return 1
  1459. }
  1460. else if(dwVehiclePointer <= 0)
  1461. {
  1462. return 0
  1463. }
  1464. else
  1465. {
  1466. return -1
  1467. }
  1468. }
  1469. getTargetVehicleHealthByPed(dwPed) {
  1470. if(!checkHandles())
  1471. return -1
  1472. dwVehPtr := getVehiclePointerByPed(dwPed)
  1473. dwAddr := dwVehPtr + ADDR_VEHICLE_HPOFF
  1474. fHealth := readFloat(hGTA, dwAddr)
  1475. if(ErrorLevel) {
  1476. ErrorLevel := ERROR_READ_MEMORY
  1477. return -1
  1478. }
  1479. ErrorLevel := ERROR_OK
  1480. return Round(fHealth)
  1481. }
  1482. getTargetVehicleHealthById(dwId) {
  1483. if(!checkHandles())
  1484. return -1
  1485. dwVehPtr := getVehiclePointerById(dwId)
  1486. dwAddr := dwVehPtr + ADDR_VEHICLE_HPOFF
  1487. fHealth := readFloat(hGTA, dwAddr)
  1488. if(ErrorLevel) {
  1489. ErrorLevel := ERROR_READ_MEMORY
  1490. return -1
  1491. }
  1492. ErrorLevel := ERROR_OK
  1493. return Round(fHealth)
  1494. }
  1495. getTargetVehicleTypeByPed(dwPED) {
  1496. if(!checkHandles())
  1497. return 0
  1498. dwAddr := getVehiclePointerByPed(dwPED)
  1499. if(!dwAddr)
  1500. return 0
  1501. cVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_TYPE, 1, "Char")
  1502. if(ErrorLevel) {
  1503. ErrorLevel := ERROR_READ_MEMORY
  1504. return 0
  1505. }
  1506. ErrorLevel := ERROR_OK
  1507. if(!cVal)
  1508. {
  1509. mid := getVehicleModelId()
  1510. Loop % oAirplaneModels.MaxIndex()
  1511. {
  1512. if(oAirplaneModels[A_Index]==mid)
  1513. return 5
  1514. }
  1515. return 1
  1516. }
  1517. else if(cVal==5)
  1518. return 2
  1519. else if(cVal==6)
  1520. return 3
  1521. else if(cVal==9)
  1522. {
  1523. mid := getVehicleModelId()
  1524. Loop % oBikeModels.MaxIndex()
  1525. {
  1526. if(oBikeModels[A_Index]==mid)
  1527. return 6
  1528. }
  1529. return 4
  1530. }
  1531. return 0
  1532. }
  1533. getTargetVehicleTypeById(dwId) {
  1534. if(!checkHandles())
  1535. return 0
  1536. dwAddr := getVehiclePointerById(dwId)
  1537. if(!dwAddr)
  1538. return 0
  1539. cVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_TYPE, 1, "Char")
  1540. if(ErrorLevel) {
  1541. ErrorLevel := ERROR_READ_MEMORY
  1542. return 0
  1543. }
  1544. ErrorLevel := ERROR_OK
  1545. if(!cVal)
  1546. {
  1547. mid := getVehicleModelId()
  1548. Loop % oAirplaneModels.MaxIndex()
  1549. {
  1550. if(oAirplaneModels[A_Index]==mid)
  1551. return 5
  1552. }
  1553. return 1
  1554. }
  1555. else if(cVal==5)
  1556. return 2
  1557. else if(cVal==6)
  1558. return 3
  1559. else if(cVal==9)
  1560. {
  1561. mid := getVehicleModelId()
  1562. Loop % oBikeModels.MaxIndex()
  1563. {
  1564. if(oBikeModels[A_Index]==mid)
  1565. return 6
  1566. }
  1567. return 4
  1568. }
  1569. return 0
  1570. }
  1571. getTargetVehicleModelIdByPed(dwPED) {
  1572. if(!checkHandles())
  1573. return 0
  1574. dwAddr := getVehiclePointerByPed(dwPED)
  1575. if(!dwAddr)
  1576. return 0
  1577. sVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_MODEL, 2, "Short")
  1578. if(ErrorLevel) {
  1579. ErrorLevel := ERROR_READ_MEMORY
  1580. return 0
  1581. }
  1582. ErrorLevel := ERROR_OK
  1583. return sVal
  1584. }
  1585. getTargetVehicleModelIdById(dwId) {
  1586. if(!checkHandles())
  1587. return 0
  1588. dwAddr := getVehiclePointerById(dwId)
  1589. if(!dwAddr)
  1590. return 0
  1591. sVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_MODEL, 2, "Short")
  1592. if(ErrorLevel) {
  1593. ErrorLevel := ERROR_READ_MEMORY
  1594. return 0
  1595. }
  1596. ErrorLevel := ERROR_OK
  1597. return sVal
  1598. }
  1599. getTargetVehicleModelNameByPed(dwPED) {
  1600. id := getTargetVehicleModelIdByPed(dwPED)
  1601. if(id > 400 && id < 611)
  1602. {
  1603. return ovehicleNames[id-399]
  1604. }
  1605. return ""
  1606. }
  1607. getTargetVehicleModelNameById(dwId) {
  1608. id := getTargetVehicleModelIdById(dwId)
  1609. if(id > 400 && id < 611)
  1610. {
  1611. return ovehicleNames[id-399]
  1612. }
  1613. return ""
  1614. }
  1615. getTargetVehicleLightStateByPed(dwPED) {
  1616. if(!checkHandles())
  1617. return -1
  1618. dwAddr := getVehiclePointerByPed(dwPED)
  1619. if(!dwAddr)
  1620. return -1
  1621. dwVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_LIGHTSTATE, 4, "Int")
  1622. if(ErrorLevel) {
  1623. ErrorLevel := ERROR_READ_MEMORY
  1624. return -1
  1625. }
  1626. ErrorLevel := ERROR_OK
  1627. return (dwVal>0)
  1628. }
  1629. getTargetVehicleLightStateById(dwId) {
  1630. if(!checkHandles())
  1631. return -1
  1632. dwAddr := getVehiclePointerById(dwId)
  1633. if(!dwAddr)
  1634. return -1
  1635. dwVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_LIGHTSTATE, 4, "Int")
  1636. if(ErrorLevel) {
  1637. ErrorLevel := ERROR_READ_MEMORY
  1638. return -1
  1639. }
  1640. ErrorLevel := ERROR_OK
  1641. return (dwVal>0)
  1642. }
  1643. getTargetVehicleLockStateByPed(dwPED) {
  1644. if(!checkHandles())
  1645. return -1
  1646. dwAddr := getVehiclePointerByPed(dwPED)
  1647. if(!dwAddr)
  1648. return -1
  1649. dwVal := readDWORD(hGTA, dwAddr + ADDR_VEHICLE_DOORSTATE)
  1650. if(ErrorLevel) {
  1651. ErrorLevel := ERROR_READ_MEMORY
  1652. return -1
  1653. }
  1654. ErrorLevel := ERROR_OK
  1655. return (dwVal==2)
  1656. }
  1657. getTargetVehicleLockStateById(dwId) {
  1658. if(!checkHandles())
  1659. return -1
  1660. dwAddr := getVehiclePointerById(dwId)
  1661. if(!dwAddr)
  1662. return -1
  1663. dwVal := readDWORD(hGTA, dwAddr + ADDR_VEHICLE_DOORSTATE)
  1664. if(ErrorLevel) {
  1665. ErrorLevel := ERROR_READ_MEMORY
  1666. return -1
  1667. }
  1668. ErrorLevel := ERROR_OK
  1669. return (dwVal==2)
  1670. }
  1671. getTargetVehicleColor1byPed(dwPED) {
  1672. if(!checkHandles())
  1673. return 0
  1674. dwAddr := getVehiclePointerByPed(dwPED)
  1675. if(!dwAddr)
  1676. return 0
  1677. sVal := readMem(hGTA, dwAddr + 1076, 1, "byte")
  1678. if(ErrorLevel) {
  1679. ErrorLevel := ERROR_READ_MEMORY
  1680. return 0
  1681. }
  1682. ErrorLevel := ERROR_OK
  1683. return sVal
  1684. }
  1685. getTargetVehicleColor1byId(dwId) {
  1686. if(!checkHandles())
  1687. return 0
  1688. dwAddr := getVehiclePointerById(dwId)
  1689. if(!dwAddr)
  1690. return 0
  1691. sVal := readMem(hGTA, dwAddr + 1076, 1, "byte")
  1692. if(ErrorLevel) {
  1693. ErrorLevel := ERROR_READ_MEMORY
  1694. return 0
  1695. }
  1696. ErrorLevel := ERROR_OK
  1697. return sVal
  1698. }
  1699. getTargetVehicleColor2byPed(dwPED) {
  1700. if(!checkHandles())
  1701. return 0
  1702. dwAddr := getVehiclePointerByPed(dwPED)
  1703. if(!dwAddr)
  1704. return 0
  1705. sVal := readMem(hGTA, dwAddr + 1077, 1, "byte")
  1706. if(ErrorLevel) {
  1707. ErrorLevel := ERROR_READ_MEMORY
  1708. return 0
  1709. }
  1710. ErrorLevel := ERROR_OK
  1711. return sVal
  1712. }
  1713. getTargetVehicleColor2byId(dwId) {
  1714. if(!checkHandles())
  1715. return 0
  1716. dwAddr := getVehiclePointerById(dwId)
  1717. if(!dwAddr)
  1718. return 0
  1719. sVal := readMem(hGTA, dwAddr + 1077, 1, "byte")
  1720. if(ErrorLevel) {
  1721. ErrorLevel := ERROR_READ_MEMORY
  1722. return 0
  1723. }
  1724. ErrorLevel := ERROR_OK
  1725. return sVal
  1726. }
  1727. getTargetVehicleSpeedByPed(dwPED) {
  1728. if(!checkHandles())
  1729. return -1
  1730. dwAddr := getVehiclePointerByPed(dwPED)
  1731. fSpeedX := readMem(hGTA, dwAddr + ADDR_VEHICLE_X, 4, "float")
  1732. fSpeedY := readMem(hGTA, dwAddr + ADDR_VEHICLE_Y, 4, "float")
  1733. fSpeedZ := readMem(hGTA, dwAddr + ADDR_VEHICLE_Z, 4, "float")
  1734. fVehicleSpeed :=  sqrt((fSpeedX * fSpeedX) + (fSpeedY * fSpeedY) + (fSpeedZ * fSpeedZ))
  1735. fVehicleSpeed := (fVehicleSpeed * 100) * 1.43
  1736. return fVehicleSpeed
  1737. }
  1738. getTargetVehicleSpeedById(dwId) {
  1739. if(!checkHandles())
  1740. return -1
  1741. dwAddr := getVehiclePointerById(dwId)
  1742. fSpeedX := readMem(hGTA, dwAddr + ADDR_VEHICLE_X, 4, "float")
  1743. fSpeedY := readMem(hGTA, dwAddr + ADDR_VEHICLE_Y, 4, "float")
  1744. fSpeedZ := readMem(hGTA, dwAddr + ADDR_VEHICLE_Z, 4, "float")
  1745. fVehicleSpeed :=  sqrt((fSpeedX * fSpeedX) + (fSpeedY * fSpeedY) + (fSpeedZ * fSpeedZ))
  1746. fVehicleSpeed := (fVehicleSpeed * 100) * 1.43
  1747. return fVehicleSpeed
  1748. }
  1749. getPlayerInteriorId() {
  1750. if(!checkHandles())
  1751. return -1
  1752. iid := readMem(hGTA, ADDR_CPED_INTID, 4, "Int")
  1753. if(ErrorLevel) {
  1754. ErrorLevel := ERROR_READ_MEMORY
  1755. return -1
  1756. }
  1757. ErrorLevel := ERROR_OK
  1758. return iid
  1759. }
  1760. IsPlayerInMenu() {
  1761. if(!checkHandles())
  1762. return -1
  1763. IsInMenu := readMem(hGTA, 0xBA67A4, 4, "byte")
  1764. if(ErrorLevel) {
  1765. ErrorLevel := ERROR_READ_MEMORY
  1766. return -1
  1767. }
  1768. ErrorLevel := ERROR_OK
  1769. return IsInMenu
  1770. }
  1771. getPlayerMapPosX() {
  1772. if(!checkHandles())
  1773. return -1
  1774. MapPosX := readFloat(hGTA, 0xBA67B8)
  1775. if(ErrorLevel) {
  1776. ErrorLevel := ERROR_READ_MEMORY
  1777. return -1
  1778. }
  1779. ErrorLevel := ERROR_OK
  1780. return MapPosX
  1781. }
  1782. getPlayerMapPosY() {
  1783. if(!checkHandles())
  1784. return -1
  1785. MapPosY := readFloat(hGTA, 0xBA67BC)
  1786. if(ErrorLevel) {
  1787. ErrorLevel := ERROR_READ_MEMORY
  1788. return -1
  1789. }
  1790. ErrorLevel := ERROR_OK
  1791. return MapPosY
  1792. }
  1793. getPlayerMapZoom() {
  1794. if(!checkHandles())
  1795. return -1
  1796. MapZoom := readFloat(hGTA, 0xBA67AC)
  1797. if(ErrorLevel) {
  1798. ErrorLevel := ERROR_READ_MEMORY
  1799. return -1
  1800. }
  1801. ErrorLevel := ERROR_OK
  1802. return MapZoom
  1803. }
  1804. IsPlayerFreezed() {
  1805. if(!checkHandles())
  1806. return -1
  1807. dwGTA := getModuleBaseAddress("gta_sa.exe", hGTA)
  1808. IPF := readMem(hGTA, dwGTA + 0x690495, 2, "byte")
  1809. if(ErrorLevel) {
  1810. ErrorLevel := ERROR_READ_MEMORY
  1811. return -1
  1812. }
  1813. ErrorLevel := ERROR_OK
  1814. return IPF
  1815. }
  1816. getVehicleColor1() {
  1817. if(!checkHandles())
  1818. return 0
  1819. dwAddr := readDWORD(hGTA, 0xBA18FC)
  1820. if(ErrorLevel) {
  1821. ErrorLevel := ERROR_READ_MEMORY
  1822. return 0
  1823. }
  1824. if(!dwAddr)
  1825. return 0
  1826. sVal := readMem(hGTA, dwAddr + 1076, 1, "byte")
  1827. if(ErrorLevel) {
  1828. ErrorLevel := ERROR_READ_MEMORY
  1829. return 0
  1830. }
  1831. ErrorLevel := ERROR_OK
  1832. return sVal
  1833. }
  1834. getVehicleColor2() {
  1835. if(!checkHandles())
  1836. return 0
  1837. dwAddr := readDWORD(hGTA, 0xBA18FC)
  1838. if(ErrorLevel) {
  1839. ErrorLevel := ERROR_READ_MEMORY
  1840. return 0
  1841. }
  1842. if(!dwAddr)
  1843. return 0
  1844. sVal := readMem(hGTA, dwAddr + 1077, 1, "byte")
  1845. if(ErrorLevel) {
  1846. ErrorLevel := ERROR_READ_MEMORY
  1847. return 0
  1848. }
  1849. ErrorLevel := ERROR_OK
  1850. return sVal
  1851. }
  1852. getPlayerRadiostationID() {
  1853. if(!checkHandles())
  1854. return -1
  1855. if(isPlayerInAnyVehicle() == 0)
  1856. return -1
  1857. dwGTA := getModuleBaseAddress("gta_sa.exe", hGTA)
  1858. RadioStationID := readMem(hGTA, dwGTA + 0x4CB7E1, 1, "byte")
  1859. if(ErrorLevel) {
  1860. ErrorLevel := ERROR_READ_MEMORY
  1861. return -1
  1862. }
  1863. return RadioStationID
  1864. }
  1865. getPlayerRadiostationName() {
  1866. if(isPlayerInAnyVehicle() == 0)
  1867. return -1
  1868. id := getPlayerRadiostationID()
  1869. if(id == 0)
  1870. return -1
  1871. if(id >= 0 && id < 14)
  1872. {
  1873. return oradiostationNames[id]
  1874. }
  1875. return ""
  1876. }
  1877. getCoordinates() {
  1878. if(!checkHandles())
  1879. return ""
  1880. fX := readFloat(hGTA, ADDR_POSITION_X)
  1881. if(ErrorLevel) {
  1882. ErrorLevel := ERROR_READ_MEMORY
  1883. return ""
  1884. }
  1885. fY := readFloat(hGTA, ADDR_POSITION_Y)
  1886. if(ErrorLevel) {
  1887. ErrorLevel := ERROR_READ_MEMORY
  1888. return ""
  1889. }
  1890. fZ := readFloat(hGTA, ADDR_POSITION_Z)
  1891. if(ErrorLevel) {
  1892. ErrorLevel := ERROR_READ_MEMORY
  1893. return ""
  1894. }
  1895. ErrorLevel := ERROR_OK
  1896. return [fX, fY, fZ]
  1897. }
  1898. GetPlayerPos(ByRef fX,ByRef fY,ByRef fZ) {
  1899. if(!checkHandles())
  1900. return 0
  1901. fX := readFloat(hGTA, ADDR_POSITION_X)
  1902. if(ErrorLevel) {
  1903. ErrorLevel := ERROR_READ_MEMORY
  1904. return 0
  1905. }
  1906. fY := readFloat(hGTA, ADDR_POSITION_Y)
  1907. if(ErrorLevel) {
  1908. ErrorLevel := ERROR_READ_MEMORY
  1909. return 0
  1910. }
  1911. fZ := readFloat(hGTA, ADDR_POSITION_Z)
  1912. if(ErrorLevel) {
  1913. ErrorLevel := ERROR_READ_MEMORY
  1914. return 0
  1915. }
  1916. ErrorLevel := ERROR_OK
  1917. }
  1918. initZonesAndCities() {
  1919. AddCity("Las Venturas", 685.0, 476.093, -500.0, 3000.0, 3000.0, 500.0)
  1920. AddCity("San Fierro", -3000.0, -742.306, -500.0, -1270.53, 1530.24, 500.0)
  1921. AddCity("San Fierro", -1270.53, -402.481, -500.0, -1038.45, 832.495, 500.0)
  1922. AddCity("San Fierro", -1038.45, -145.539, -500.0, -897.546, 376.632, 500.0)
  1923. AddCity("Los Santos", 480.0, -3000.0, -500.0, 3000.0, -850.0, 500.0)
  1924. AddCity("Los Santos", 80.0, -2101.61, -500.0, 1075.0, -1239.61, 500.0)
  1925. AddCity("Tierra Robada", -1213.91, 596.349, -242.99, -480.539, 1659.68, 900.0)
  1926. AddCity("Red County", -1213.91, -768.027, -242.99, 2997.06, 596.349, 900.0)
  1927. AddCity("Flint County", -1213.91, -2892.97, -242.99, 44.6147, -768.027, 900.0)
  1928. AddCity("Whetstone", -2997.47, -2892.97, -242.99, -1213.91, -1115.58, 900.0)
  1929. AddZone("Avispa Country Club", -2667.810, -302.135, -28.831, -2646.400, -262.320, 71.169)
  1930. AddZone("Easter Bay Airport", -1315.420, -405.388, 15.406, -1264.400, -209.543, 25.406)
  1931. AddZone("Avispa Country Club", -2550.040, -355.493, 0.000, -2470.040, -318.493, 39.700)
  1932. AddZone("Easter Bay Airport", -1490.330, -209.543, 15.406, -1264.400, -148.388, 25.406)
  1933. AddZone("Garcia", -2395.140, -222.589, -5.3, -2354.090, -204.792, 200.000)
  1934. AddZone("Shady Cabin", -1632.830, -2263.440, -3.0, -1601.330, -2231.790, 200.000)
  1935. AddZone("East Los Santos", 2381.680, -1494.030, -89.084, 2421.030, -1454.350, 110.916)
  1936. AddZone("LVA Freight Depot", 1236.630, 1163.410, -89.084, 1277.050, 1203.280, 110.916)
  1937. AddZone("Blackfield Intersection", 1277.050, 1044.690, -89.084, 1315.350, 1087.630, 110.916)
  1938. AddZone("Avispa Country Club", -2470.040, -355.493, 0.000, -2270.040, -318.493, 46.100)
  1939. AddZone("Temple", 1252.330, -926.999, -89.084, 1357.000, -910.170, 110.916)
  1940. AddZone("Unity Station", 1692.620, -1971.800, -20.492, 1812.620, -1932.800, 79.508)
  1941. AddZone("LVA Freight Depot", 1315.350, 1044.690, -89.084, 1375.600, 1087.630, 110.916)
  1942. AddZone("Los Flores", 2581.730, -1454.350, -89.084, 2632.830, -1393.420, 110.916)
  1943. AddZone("Starfish Casino", 2437.390, 1858.100, -39.084, 2495.090, 1970.850, 60.916)
  1944. AddZone("Easter Bay Chemicals", -1132.820, -787.391, 0.000, -956.476, -768.027, 200.000)
  1945. AddZone("Downtown Los Santos", 1370.850, -1170.870, -89.084, 1463.900, -1130.850, 110.916)
  1946. AddZone("Esplanade East", -1620.300, 1176.520, -4.5, -1580.010, 1274.260, 200.000)
  1947. AddZone("Market Station", 787.461, -1410.930, -34.126, 866.009, -1310.210, 65.874)
  1948. AddZone("Linden Station", 2811.250, 1229.590, -39.594, 2861.250, 1407.590, 60.406)
  1949. AddZone("Montgomery Intersection", 1582.440, 347.457, 0.000, 1664.620, 401.750, 200.000)
  1950. AddZone("Frederick Bridge", 2759.250, 296.501, 0.000, 2774.250, 594.757, 200.000)
  1951. AddZone("Yellow Bell Station", 1377.480, 2600.430, -21.926, 1492.450, 2687.360, 78.074)
  1952. AddZone("Downtown Los Santos", 1507.510, -1385.210, 110.916, 1582.550, -1325.310, 335.916)
  1953. AddZone("Jefferson", 2185.330, -1210.740, -89.084, 2281.450, -1154.590, 110.916)
  1954. AddZone("Mulholland", 1318.130, -910.170, -89.084, 1357.000, -768.027, 110.916)
  1955. AddZone("Avispa Country Club", -2361.510, -417.199, 0.000, -2270.040, -355.493, 200.000)
  1956. AddZone("Jefferson", 1996.910, -1449.670, -89.084, 2056.860, -1350.720, 110.916)
  1957. AddZone("Julius Thruway West", 1236.630, 2142.860, -89.084, 1297.470, 2243.230, 110.916)
  1958. AddZone("Jefferson", 2124.660, -1494.030, -89.084, 2266.210, -1449.670, 110.916)
  1959. AddZone("Julius Thruway North", 1848.400, 2478.490, -89.084, 1938.800, 2553.490, 110.916)
  1960. AddZone("Rodeo", 422.680, -1570.200, -89.084, 466.223, -1406.050, 110.916)
  1961. AddZone("Cranberry Station", -2007.830, 56.306, 0.000, -1922.000, 224.782, 100.000)
  1962. AddZone("Downtown Los Santos", 1391.050, -1026.330, -89.084, 1463.900, -926.999, 110.916)
  1963. AddZone("Redsands West", 1704.590, 2243.230, -89.084, 1777.390, 2342.830, 110.916)
  1964. AddZone("Little Mexico", 1758.900, -1722.260, -89.084, 1812.620, -1577.590, 110.916)
  1965. AddZone("Blackfield Intersection", 1375.600, 823.228, -89.084, 1457.390, 919.447, 110.916)
  1966. AddZone("Los Santos International", 1974.630, -2394.330, -39.084, 2089.000, -2256.590, 60.916)
  1967. AddZone("Beacon Hill", -399.633, -1075.520, -1.489, -319.033, -977.516, 198.511)
  1968. AddZone("Rodeo", 334.503, -1501.950, -89.084, 422.680, -1406.050, 110.916)
  1969. AddZone("Richman", 225.165, -1369.620, -89.084, 334.503, -1292.070, 110.916)
  1970. AddZone("Downtown Los Santos", 1724.760, -1250.900, -89.084, 1812.620, -1150.870, 110.916)
  1971. AddZone("The Strip", 2027.400, 1703.230, -89.084, 2137.400, 1783.230, 110.916)
  1972. AddZone("Downtown Los Santos", 1378.330, -1130.850, -89.084, 1463.900, -1026.330, 110.916)
  1973. AddZone("Blackfield Intersection", 1197.390, 1044.690, -89.084, 1277.050, 1163.390, 110.916)
  1974. AddZone("Conference Center", 1073.220, -1842.270, -89.084, 1323.900, -1804.210, 110.916)
  1975. AddZone("Montgomery", 1451.400, 347.457, -6.1, 1582.440, 420.802, 200.000)
  1976. AddZone("Foster Valley", -2270.040, -430.276, -1.2, -2178.690, -324.114, 200.000)
  1977. AddZone("Blackfield Chapel", 1325.600, 596.349, -89.084, 1375.600, 795.010, 110.916)
  1978. AddZone("Los Santos International", 2051.630, -2597.260, -39.084, 2152.450, -2394.330, 60.916)
  1979. AddZone("Mulholland", 1096.470, -910.170, -89.084, 1169.130, -768.027, 110.916)
  1980. AddZone("Yellow Bell Gol Course", 1457.460, 2723.230, -89.084, 1534.560, 2863.230, 110.916)
  1981. AddZone("The Strip", 2027.400, 1783.230, -89.084, 2162.390, 1863.230, 110.916)
  1982. AddZone("Jefferson", 2056.860, -1210.740, -89.084, 2185.330, -1126.320, 110.916)
  1983. AddZone("Mulholland", 952.604, -937.184, -89.084, 1096.470, -860.619, 110.916)
  1984. AddZone("Aldea Malvada", -1372.140, 2498.520, 0.000, -1277.590, 2615.350, 200.000)
  1985. AddZone("Las Colinas", 2126.860, -1126.320, -89.084, 2185.330, -934.489, 110.916)
  1986. AddZone("Las Colinas", 1994.330, -1100.820, -89.084, 2056.860, -920.815, 110.916)
  1987. AddZone("Richman", 647.557, -954.662, -89.084, 768.694, -860.619, 110.916)
  1988. AddZone("LVA Freight Depot", 1277.050, 1087.630, -89.084, 1375.600, 1203.280, 110.916)
  1989. AddZone("Julius Thruway North", 1377.390, 2433.230, -89.084, 1534.560, 2507.230, 110.916)
  1990. AddZone("Willowfield", 2201.820, -2095.000, -89.084, 2324.000, -1989.900, 110.916)
  1991. AddZone("Julius Thruway North", 1704.590, 2342.830, -89.084, 1848.400, 2433.230, 110.916)
  1992. AddZone("Temple", 1252.330, -1130.850, -89.084, 1378.330, -1026.330, 110.916)
  1993. AddZone("Little Mexico", 1701.900, -1842.270, -89.084, 1812.620, -1722.260, 110.916)
  1994. AddZone("Queens", -2411.220, 373.539, 0.000, -2253.540, 458.411, 200.000)
  1995. AddZone("Las Venturas Airport", 1515.810, 1586.400, -12.500, 1729.950, 1714.560, 87.500)
  1996. AddZone("Richman", 225.165, -1292.070, -89.084, 466.223, -1235.070, 110.916)
  1997. AddZone("Temple", 1252.330, -1026.330, -89.084, 1391.050, -926.999, 110.916)
  1998. AddZone("East Los Santos", 2266.260, -1494.030, -89.084, 2381.680, -1372.040, 110.916)
  1999. AddZone("Julius Thruway East", 2623.180, 943.235, -89.084, 2749.900, 1055.960, 110.916)
  2000. AddZone("Willowfield", 2541.700, -1941.400, -89.084, 2703.580, -1852.870, 110.916)
  2001. AddZone("Las Colinas", 2056.860, -1126.320, -89.084, 2126.860, -920.815, 110.916)
  2002. AddZone("Julius Thruway East", 2625.160, 2202.760, -89.084, 2685.160, 2442.550, 110.916)
  2003. AddZone("Rodeo", 225.165, -1501.950, -89.084, 334.503, -1369.620, 110.916)
  2004. AddZone("Las Brujas", -365.167, 2123.010, -3.0, -208.570, 2217.680, 200.000)
  2005. AddZone("Julius Thruway East", 2536.430, 2442.550, -89.084, 2685.160, 2542.550, 110.916)
  2006. AddZone("Rodeo", 334.503, -1406.050, -89.084, 466.223, -1292.070, 110.916)
  2007. AddZone("Vinewood", 647.557, -1227.280, -89.084, 787.461, -1118.280, 110.916)
  2008. AddZone("Rodeo", 422.680, -1684.650, -89.084, 558.099, -1570.200, 110.916)
  2009. AddZone("Julius Thruway North", 2498.210, 2542.550, -89.084, 2685.160, 2626.550, 110.916)
  2010. AddZone("Downtown Los Santos", 1724.760, -1430.870, -89.084, 1812.620, -1250.900, 110.916)
  2011. AddZone("Rodeo", 225.165, -1684.650, -89.084, 312.803, -1501.950, 110.916)
  2012. AddZone("Jefferson", 2056.860, -1449.670, -89.084, 2266.210, -1372.040, 110.916)
  2013. AddZone("Hampton Barns", 603.035, 264.312, 0.000, 761.994, 366.572, 200.000)
  2014. AddZone("Temple", 1096.470, -1130.840, -89.084, 1252.330, -1026.330, 110.916)
  2015. AddZone("Kincaid Bridge", -1087.930, 855.370, -89.084, -961.950, 986.281, 110.916)
  2016. AddZone("Verona Beach", 1046.150, -1722.260, -89.084, 1161.520, -1577.590, 110.916)
  2017. AddZone("Commerce", 1323.900, -1722.260, -89.084, 1440.900, -1577.590, 110.916)
  2018. AddZone("Mulholland", 1357.000, -926.999, -89.084, 1463.900, -768.027, 110.916)
  2019. AddZone("Rodeo", 466.223, -1570.200, -89.084, 558.099, -1385.070, 110.916)
  2020. AddZone("Mulholland", 911.802, -860.619, -89.084, 1096.470, -768.027, 110.916)
  2021. AddZone("Mulholland", 768.694, -954.662, -89.084, 952.604, -860.619, 110.916)
  2022. AddZone("Julius Thruway South", 2377.390, 788.894, -89.084, 2537.390, 897.901, 110.916)
  2023. AddZone("Idlewood", 1812.620, -1852.870, -89.084, 1971.660, -1742.310, 110.916)
  2024. AddZone("Ocean Docks", 2089.000, -2394.330, -89.084, 2201.820, -2235.840, 110.916)
  2025. AddZone("Commerce", 1370.850, -1577.590, -89.084, 1463.900, -1384.950, 110.916)
  2026. AddZone("Julius Thruway North", 2121.400, 2508.230, -89.084, 2237.400, 2663.170, 110.916)
  2027. AddZone("Temple", 1096.470, -1026.330, -89.084, 1252.330, -910.170, 110.916)
  2028. AddZone("Glen Park", 1812.620, -1449.670, -89.084, 1996.910, -1350.720, 110.916)
  2029. AddZone("Easter Bay Airport", -1242.980, -50.096, 0.000, -1213.910, 578.396, 200.000)
  2030. AddZone("Martin Bridge", -222.179, 293.324, 0.000, -122.126, 476.465, 200.000)
  2031. AddZone("The Strip", 2106.700, 1863.230, -89.084, 2162.390, 2202.760, 110.916)
  2032. AddZone("Willowfield", 2541.700, -2059.230, -89.084, 2703.580, -1941.400, 110.916)
  2033. AddZone("Marina", 807.922, -1577.590, -89.084, 926.922, -1416.250, 110.916)
  2034. AddZone("Las Venturas Airport", 1457.370, 1143.210, -89.084, 1777.400, 1203.280, 110.916)
  2035. AddZone("Idlewood", 1812.620, -1742.310, -89.084, 1951.660, -1602.310, 110.916)
  2036. AddZone("Esplanade East", -1580.010, 1025.980, -6.1, -1499.890, 1274.260, 200.000)
  2037. AddZone("Downtown Los Santos", 1370.850, -1384.950, -89.084, 1463.900, -1170.870, 110.916)
  2038. AddZone("The Mako Span", 1664.620, 401.750, 0.000, 1785.140, 567.203, 200.000)
  2039. AddZone("Rodeo", 312.803, -1684.650, -89.084, 422.680, -1501.950, 110.916)
  2040. AddZone("Pershing Square", 1440.900, -1722.260, -89.084, 1583.500, -1577.590, 110.916)
  2041. AddZone("Mulholland", 687.802, -860.619, -89.084, 911.802, -768.027, 110.916)
  2042. AddZone("Gant Bridge", -2741.070, 1490.470, -6.1, -2616.400, 1659.680, 200.000)
  2043. AddZone("Las Colinas", 2185.330, -1154.590, -89.084, 2281.450, -934.489, 110.916)
  2044. AddZone("Mulholland", 1169.130, -910.170, -89.084, 1318.130, -768.027, 110.916)
  2045. AddZone("Julius Thruway North", 1938.800, 2508.230, -89.084, 2121.400, 2624.230, 110.916)
  2046. AddZone("Commerce", 1667.960, -1577.590, -89.084, 1812.620, -1430.870, 110.916)
  2047. AddZone("Rodeo", 72.648, -1544.170, -89.084, 225.165, -1404.970, 110.916)
  2048. AddZone("Roca Escalante", 2536.430, 2202.760, -89.084, 2625.160, 2442.550, 110.916)
  2049. AddZone("Rodeo", 72.648, -1684.650, -89.084, 225.165, -1544.170, 110.916)
  2050. AddZone("Market", 952.663, -1310.210, -89.084, 1072.660, -1130.850, 110.916)
  2051. AddZone("Las Colinas", 2632.740, -1135.040, -89.084, 2747.740, -945.035, 110.916)
  2052. AddZone("Mulholland", 861.085, -674.885, -89.084, 1156.550, -600.896, 110.916)
  2053. AddZone("King's", -2253.540, 373.539, -9.1, -1993.280, 458.411, 200.000)
  2054. AddZone("Redsands East", 1848.400, 2342.830, -89.084, 2011.940, 2478.490, 110.916)
  2055. AddZone("Downtown", -1580.010, 744.267, -6.1, -1499.890, 1025.980, 200.000)
  2056. AddZone("Conference Center", 1046.150, -1804.210, -89.084, 1323.900, -1722.260, 110.916)
  2057. AddZone("Richman", 647.557, -1118.280, -89.084, 787.461, -954.662, 110.916)
  2058. AddZone("Ocean Flats", -2994.490, 277.411, -9.1, -2867.850, 458.411, 200.000)
  2059. AddZone("Greenglass College", 964.391, 930.890, -89.084, 1166.530, 1044.690, 110.916)
  2060. AddZone("Glen Park", 1812.620, -1100.820, -89.084, 1994.330, -973.380, 110.916)
  2061. AddZone("LVA Freight Depot", 1375.600, 919.447, -89.084, 1457.370, 1203.280, 110.916)
  2062. AddZone("Regular Tom", -405.770, 1712.860, -3.0, -276.719, 1892.750, 200.000)
  2063. AddZone("Verona Beach", 1161.520, -1722.260, -89.084, 1323.900, -1577.590, 110.916)
  2064. AddZone("East Los Santos", 2281.450, -1372.040, -89.084, 2381.680, -1135.040, 110.916)
  2065. AddZone("Caligula's Palace", 2137.400, 1703.230, -89.084, 2437.390, 1783.230, 110.916)
  2066. AddZone("Idlewood", 1951.660, -1742.310, -89.084, 2124.660, -1602.310, 110.916)
  2067. AddZone("Pilgrim", 2624.400, 1383.230, -89.084, 2685.160, 1783.230, 110.916)
  2068. AddZone("Idlewood", 2124.660, -1742.310, -89.084, 2222.560, -1494.030, 110.916)
  2069. AddZone("Queens", -2533.040, 458.411, 0.000, -2329.310, 578.396, 200.000)
  2070. AddZone("Downtown", -1871.720, 1176.420, -4.5, -1620.300, 1274.260, 200.000)
  2071. AddZone("Commerce", 1583.500, -1722.260, -89.084, 1758.900, -1577.590, 110.916)
  2072. AddZone("East Los Santos", 2381.680, -1454.350, -89.084, 2462.130, -1135.040, 110.916)
  2073. AddZone("Marina", 647.712, -1577.590, -89.084, 807.922, -1416.250, 110.916)
  2074. AddZone("Richman", 72.648, -1404.970, -89.084, 225.165, -1235.070, 110.916)
  2075. AddZone("Vinewood", 647.712, -1416.250, -89.084, 787.461, -1227.280, 110.916)
  2076. AddZone("East Los Santos", 2222.560, -1628.530, -89.084, 2421.030, -1494.030, 110.916)
  2077. AddZone("Rodeo", 558.099, -1684.650, -89.084, 647.522, -1384.930, 110.916)
  2078. AddZone("Easter Tunnel", -1709.710, -833.034, -1.5, -1446.010, -730.118, 200.000)
  2079. AddZone("Rodeo", 466.223, -1385.070, -89.084, 647.522, -1235.070, 110.916)
  2080. AddZone("Redsands East", 1817.390, 2202.760, -89.084, 2011.940, 2342.830, 110.916)
  2081. AddZone("The Clown's Pocket", 2162.390, 1783.230, -89.084, 2437.390, 1883.230, 110.916)
  2082. AddZone("Idlewood", 1971.660, -1852.870, -89.084, 2222.560, -1742.310, 110.916)
  2083. AddZone("Montgomery Intersection", 1546.650, 208.164, 0.000, 1745.830, 347.457, 200.000)
  2084. AddZone("Willowfield", 2089.000, -2235.840, -89.084, 2201.820, -1989.900, 110.916)
  2085. AddZone("Temple", 952.663, -1130.840, -89.084, 1096.470, -937.184, 110.916)
  2086. AddZone("Prickle Pine", 1848.400, 2553.490, -89.084, 1938.800, 2863.230, 110.916)
  2087. AddZone("Los Santos International", 1400.970, -2669.260, -39.084, 2189.820, -2597.260, 60.916)
  2088. AddZone("Garver Bridge", -1213.910, 950.022, -89.084, -1087.930, 1178.930, 110.916)
  2089. AddZone("Garver Bridge", -1339.890, 828.129, -89.084, -1213.910, 1057.040, 110.916)
  2090. AddZone("Kincaid Bridge", -1339.890, 599.218, -89.084, -1213.910, 828.129, 110.916)
  2091. AddZone("Kincaid Bridge", -1213.910, 721.111, -89.084, -1087.930, 950.022, 110.916)
  2092. AddZone("Verona Beach", 930.221, -2006.780, -89.084, 1073.220, -1804.210, 110.916)
  2093. AddZone("Verdant Bluffs", 1073.220, -2006.780, -89.084, 1249.620, -1842.270, 110.916)
  2094. AddZone("Vinewood", 787.461, -1130.840, -89.084, 952.604, -954.662, 110.916)
  2095. AddZone("Vinewood", 787.461, -1310.210, -89.084, 952.663, -1130.840, 110.916)
  2096. AddZone("Commerce", 1463.900, -1577.590, -89.084, 1667.960, -1430.870, 110.916)
  2097. AddZone("Market", 787.461, -1416.250, -89.084, 1072.660, -1310.210, 110.916)
  2098. AddZone("Rockshore West", 2377.390, 596.349, -89.084, 2537.390, 788.894, 110.916)
  2099. AddZone("Julius Thruway North", 2237.400, 2542.550, -89.084, 2498.210, 2663.170, 110.916)
  2100. AddZone("East Beach", 2632.830, -1668.130, -89.084, 2747.740, -1393.420, 110.916)
  2101. AddZone("Fallow Bridge", 434.341, 366.572, 0.000, 603.035, 555.680, 200.000)
  2102. AddZone("Willowfield", 2089.000, -1989.900, -89.084, 2324.000, -1852.870, 110.916)
  2103. AddZone("Chinatown", -2274.170, 578.396, -7.6, -2078.670, 744.170, 200.000)
  2104. AddZone("El Castillo del Diablo", -208.570, 2337.180, 0.000, 8.430, 2487.180, 200.000)
  2105. AddZone("Ocean Docks", 2324.000, -2145.100, -89.084, 2703.580, -2059.230, 110.916)
  2106. AddZone("Easter Bay Chemicals", -1132.820, -768.027, 0.000, -956.476, -578.118, 200.000)
  2107. AddZone("The Visage", 1817.390, 1703.230, -89.084, 2027.400, 1863.230, 110.916)
  2108. AddZone("Ocean Flats", -2994.490, -430.276, -1.2, -2831.890, -222.589, 200.000)
  2109. AddZone("Richman", 321.356, -860.619, -89.084, 687.802, -768.027, 110.916)
  2110. AddZone("Green Palms", 176.581, 1305.450, -3.0, 338.658, 1520.720, 200.000)
  2111. AddZone("Richman", 321.356, -768.027, -89.084, 700.794, -674.885, 110.916)
  2112. AddZone("Starfish Casino", 2162.390, 1883.230, -89.084, 2437.390, 2012.180, 110.916)
  2113. AddZone("East Beach", 2747.740, -1668.130, -89.084, 2959.350, -1498.620, 110.916)
  2114. AddZone("Jefferson", 2056.860, -1372.040, -89.084, 2281.450, -1210.740, 110.916)
  2115. AddZone("Downtown Los Santos", 1463.900, -1290.870, -89.084, 1724.760, -1150.870, 110.916)
  2116. AddZone("Downtown Los Santos", 1463.900, -1430.870, -89.084, 1724.760, -1290.870, 110.916)
  2117. AddZone("Garver Bridge", -1499.890, 696.442, -179.615, -1339.890, 925.353, 20.385)
  2118. AddZone("Julius Thruway South", 1457.390, 823.228, -89.084, 2377.390, 863.229, 110.916)
  2119. AddZone("East Los Santos", 2421.030, -1628.530, -89.084, 2632.830, -1454.350, 110.916)
  2120. AddZone("Greenglass College", 964.391, 1044.690, -89.084, 1197.390, 1203.220, 110.916)
  2121. AddZone("Las Colinas", 2747.740, -1120.040, -89.084, 2959.350, -945.035, 110.916)
  2122. AddZone("Mulholland", 737.573, -768.027, -89.084, 1142.290, -674.885, 110.916)
  2123. AddZone("Ocean Docks", 2201.820, -2730.880, -89.084, 2324.000, -2418.330, 110.916)
  2124. AddZone("East Los Santos", 2462.130, -1454.350, -89.084, 2581.730, -1135.040, 110.916)
  2125. AddZone("Ganton", 2222.560, -1722.330, -89.084, 2632.830, -1628.530, 110.916)
  2126. AddZone("Avispa Country Club", -2831.890, -430.276, -6.1, -2646.400, -222.589, 200.000)
  2127. AddZone("Willowfield", 1970.620, -2179.250, -89.084, 2089.000, -1852.870, 110.916)
  2128. AddZone("Esplanade North", -1982.320, 1274.260, -4.5, -1524.240, 1358.900, 200.000)
  2129. AddZone("The High Roller", 1817.390, 1283.230, -89.084, 2027.390, 1469.230, 110.916)
  2130. AddZone("Ocean Docks", 2201.820, -2418.330, -89.084, 2324.000, -2095.000, 110.916)
  2131. AddZone("Last Dime Motel", 1823.080, 596.349, -89.084, 1997.220, 823.228, 110.916)
  2132. AddZone("Bayside Marina", -2353.170, 2275.790, 0.000, -2153.170, 2475.790, 200.000)
  2133. AddZone("King's", -2329.310, 458.411, -7.6, -1993.280, 578.396, 200.000)
  2134. AddZone("El Corona", 1692.620, -2179.250, -89.084, 1812.620, -1842.270, 110.916)
  2135. AddZone("Blackfield Chapel", 1375.600, 596.349, -89.084, 1558.090, 823.228, 110.916)
  2136. AddZone("The Pink Swan", 1817.390, 1083.230, -89.084, 2027.390, 1283.230, 110.916)
  2137. AddZone("Julius Thruway West", 1197.390, 1163.390, -89.084, 1236.630, 2243.230, 110.916)
  2138. AddZone("Los Flores", 2581.730, -1393.420, -89.084, 2747.740, -1135.040, 110.916)
  2139. AddZone("The Visage", 1817.390, 1863.230, -89.084, 2106.700, 2011.830, 110.916)
  2140. AddZone("Prickle Pine", 1938.800, 2624.230, -89.084, 2121.400, 2861.550, 110.916)
  2141. AddZone("Verona Beach", 851.449, -1804.210, -89.084, 1046.150, -1577.590, 110.916)
  2142. AddZone("Robada Intersection", -1119.010, 1178.930, -89.084, -862.025, 1351.450, 110.916)
  2143. AddZone("Linden Side", 2749.900, 943.235, -89.084, 2923.390, 1198.990, 110.916)
  2144. AddZone("Ocean Docks", 2703.580, -2302.330, -89.084, 2959.350, -2126.900, 110.916)
  2145. AddZone("Willowfield", 2324.000, -2059.230, -89.084, 2541.700, -1852.870, 110.916)
  2146. AddZone("King's", -2411.220, 265.243, -9.1, -1993.280, 373.539, 200.000)
  2147. AddZone("Commerce", 1323.900, -1842.270, -89.084, 1701.900, -1722.260, 110.916)
  2148. AddZone("Mulholland", 1269.130, -768.027, -89.084, 1414.070, -452.425, 110.916)
  2149. AddZone("Marina", 647.712, -1804.210, -89.084, 851.449, -1577.590, 110.916)
  2150. AddZone("Battery Point", -2741.070, 1268.410, -4.5, -2533.040, 1490.470, 200.000)
  2151. AddZone("The Four Dragons Casino", 1817.390, 863.232, -89.084, 2027.390, 1083.230, 110.916)
  2152. AddZone("Blackfield", 964.391, 1203.220, -89.084, 1197.390, 1403.220, 110.916)
  2153. AddZone("Julius Thruway North", 1534.560, 2433.230, -89.084, 1848.400, 2583.230, 110.916)
  2154. AddZone("Yellow Bell Gol Course", 1117.400, 2723.230, -89.084, 1457.460, 2863.230, 110.916)
  2155. AddZone("Idlewood", 1812.620, -1602.310, -89.084, 2124.660, -1449.670, 110.916)
  2156. AddZone("Redsands West", 1297.470, 2142.860, -89.084, 1777.390, 2243.230, 110.916)
  2157. AddZone("Doherty", -2270.040, -324.114, -1.2, -1794.920, -222.589, 200.000)
  2158. AddZone("Hilltop Farm", 967.383, -450.390, -3.0, 1176.780, -217.900, 200.000)
  2159. AddZone("Las Barrancas", -926.130, 1398.730, -3.0, -719.234, 1634.690, 200.000)
  2160. AddZone("Pirates in Men's Pants", 1817.390, 1469.230, -89.084, 2027.400, 1703.230, 110.916)
  2161. AddZone("City Hall", -2867.850, 277.411, -9.1, -2593.440, 458.411, 200.000)
  2162. AddZone("Avispa Country Club", -2646.400, -355.493, 0.000, -2270.040, -222.589, 200.000)
  2163. AddZone("The Strip", 2027.400, 863.229, -89.084, 2087.390, 1703.230, 110.916)
  2164. AddZone("Hashbury", -2593.440, -222.589, -1.0, -2411.220, 54.722, 200.000)
  2165. AddZone("Los Santos International", 1852.000, -2394.330, -89.084, 2089.000, -2179.250, 110.916)
  2166. AddZone("Whitewood Estates", 1098.310, 1726.220, -89.084, 1197.390, 2243.230, 110.916)
  2167. AddZone("Sherman Reservoir", -789.737, 1659.680, -89.084, -599.505, 1929.410, 110.916)
  2168. AddZone("El Corona", 1812.620, -2179.250, -89.084, 1970.620, -1852.870, 110.916)
  2169. AddZone("Downtown", -1700.010, 744.267, -6.1, -1580.010, 1176.520, 200.000)
  2170. AddZone("Foster Valley", -2178.690, -1250.970, 0.000, -1794.920, -1115.580, 200.000)
  2171. AddZone("Las Payasadas", -354.332, 2580.360, 2.0, -133.625, 2816.820, 200.000)
  2172. AddZone("Valle Ocultado", -936.668, 2611.440, 2.0, -715.961, 2847.900, 200.000)
  2173. AddZone("Blackfield Intersection", 1166.530, 795.010, -89.084, 1375.600, 1044.690, 110.916)
  2174. AddZone("Ganton", 2222.560, -1852.870, -89.084, 2632.830, -1722.330, 110.916)
  2175. AddZone("Easter Bay Airport", -1213.910, -730.118, 0.000, -1132.820, -50.096, 200.000)
  2176. AddZone("Redsands East", 1817.390, 2011.830, -89.084, 2106.700, 2202.760, 110.916)
  2177. AddZone("Esplanade East", -1499.890, 578.396, -79.615, -1339.890, 1274.260, 20.385)
  2178. AddZone("Caligula's Palace", 2087.390, 1543.230, -89.084, 2437.390, 1703.230, 110.916)
  2179. AddZone("Royal Casino", 2087.390, 1383.230, -89.084, 2437.390, 1543.230, 110.916)
  2180. AddZone("Richman", 72.648, -1235.070, -89.084, 321.356, -1008.150, 110.916)
  2181. AddZone("Starfish Casino", 2437.390, 1783.230, -89.084, 2685.160, 2012.180, 110.916)
  2182. AddZone("Mulholland", 1281.130, -452.425, -89.084, 1641.130, -290.913, 110.916)
  2183. AddZone("Downtown", -1982.320, 744.170, -6.1, -1871.720, 1274.260, 200.000)
  2184. AddZone("Hankypanky Point", 2576.920, 62.158, 0.000, 2759.250, 385.503, 200.000)
  2185. AddZone("K.A.C.C. Military Fuels", 2498.210, 2626.550, -89.084, 2749.900, 2861.550, 110.916)
  2186. AddZone("Harry Gold Parkway", 1777.390, 863.232, -89.084, 1817.390, 2342.830, 110.916)
  2187. AddZone("Bayside Tunnel", -2290.190, 2548.290, -89.084, -1950.190, 2723.290, 110.916)
  2188. AddZone("Ocean Docks", 2324.000, -2302.330, -89.084, 2703.580, -2145.100, 110.916)
  2189. AddZone("Richman", 321.356, -1044.070, -89.084, 647.557, -860.619, 110.916)
  2190. AddZone("Randolph Industrial Estate", 1558.090, 596.349, -89.084, 1823.080, 823.235, 110.916)
  2191. AddZone("East Beach", 2632.830, -1852.870, -89.084, 2959.350, -1668.130, 110.916)
  2192. AddZone("Flint Water", -314.426, -753.874, -89.084, -106.339, -463.073, 110.916)
  2193. AddZone("Blueberry", 19.607, -404.136, 3.8, 349.607, -220.137, 200.000)
  2194. AddZone("Linden Station", 2749.900, 1198.990, -89.084, 2923.390, 1548.990, 110.916)
  2195. AddZone("Glen Park", 1812.620, -1350.720, -89.084, 2056.860, -1100.820, 110.916)
  2196. AddZone("Downtown", -1993.280, 265.243, -9.1, -1794.920, 578.396, 200.000)
  2197. AddZone("Redsands West", 1377.390, 2243.230, -89.084, 1704.590, 2433.230, 110.916)
  2198. AddZone("Richman", 321.356, -1235.070, -89.084, 647.522, -1044.070, 110.916)
  2199. AddZone("Gant Bridge", -2741.450, 1659.680, -6.1, -2616.400, 2175.150, 200.000)
  2200. AddZone("Lil' Probe Inn", -90.218, 1286.850, -3.0, 153.859, 1554.120, 200.000)
  2201. AddZone("Flint Intersection", -187.700, -1596.760, -89.084, 17.063, -1276.600, 110.916)
  2202. AddZone("Las Colinas", 2281.450, -1135.040, -89.084, 2632.740, -945.035, 110.916)
  2203. AddZone("Sobell Rail Yards", 2749.900, 1548.990, -89.084, 2923.390, 1937.250, 110.916)
  2204. AddZone("The Emerald Isle", 2011.940, 2202.760, -89.084, 2237.400, 2508.230, 110.916)
  2205. AddZone("El Castillo del Diablo", -208.570, 2123.010, -7.6, 114.033, 2337.180, 200.000)
  2206. AddZone("Santa Flora", -2741.070, 458.411, -7.6, -2533.040, 793.411, 200.000)
  2207. AddZone("Playa del Seville", 2703.580, -2126.900, -89.084, 2959.350, -1852.870, 110.916)
  2208. AddZone("Market", 926.922, -1577.590, -89.084, 1370.850, -1416.250, 110.916)
  2209. AddZone("Queens", -2593.440, 54.722, 0.000, -2411.220, 458.411, 200.000)
  2210. AddZone("Pilson Intersection", 1098.390, 2243.230, -89.084, 1377.390, 2507.230, 110.916)
  2211. AddZone("Spinybed", 2121.400, 2663.170, -89.084, 2498.210, 2861.550, 110.916)
  2212. AddZone("Pilgrim", 2437.390, 1383.230, -89.084, 2624.400, 1783.230, 110.916)
  2213. AddZone("Blackfield", 964.391, 1403.220, -89.084, 1197.390, 1726.220, 110.916)
  2214. AddZone("'The Big Ear'", -410.020, 1403.340, -3.0, -137.969, 1681.230, 200.000)
  2215. AddZone("Dillimore", 580.794, -674.885, -9.5, 861.085, -404.790, 200.000)
  2216. AddZone("El Quebrados", -1645.230, 2498.520, 0.000, -1372.140, 2777.850, 200.000)
  2217. AddZone("Esplanade North", -2533.040, 1358.900, -4.5, -1996.660, 1501.210, 200.000)
  2218. AddZone("Easter Bay Airport", -1499.890, -50.096, -1.0, -1242.980, 249.904, 200.000)
  2219. AddZone("Fisher's Lagoon", 1916.990, -233.323, -100.000, 2131.720, 13.800, 200.000)
  2220. AddZone("Mulholland", 1414.070, -768.027, -89.084, 1667.610, -452.425, 110.916)
  2221. AddZone("East Beach", 2747.740, -1498.620, -89.084, 2959.350, -1120.040, 110.916)
  2222. AddZone("San Andreas Sound", 2450.390, 385.503, -100.000, 2759.250, 562.349, 200.000)
  2223. AddZone("Shady Creeks", -2030.120, -2174.890, -6.1, -1820.640, -1771.660, 200.000)
  2224. AddZone("Market", 1072.660, -1416.250, -89.084, 1370.850, -1130.850, 110.916)
  2225. AddZone("Rockshore West", 1997.220, 596.349, -89.084, 2377.390, 823.228, 110.916)
  2226. AddZone("Prickle Pine", 1534.560, 2583.230, -89.084, 1848.400, 2863.230, 110.916)
  2227. AddZone("Easter Basin", -1794.920, -50.096, -1.04, -1499.890, 249.904, 200.000)
  2228. AddZone("Leafy Hollow", -1166.970, -1856.030, 0.000, -815.624, -1602.070, 200.000)
  2229. AddZone("LVA Freight Depot", 1457.390, 863.229, -89.084, 1777.400, 1143.210, 110.916)
  2230. AddZone("Prickle Pine", 1117.400, 2507.230, -89.084, 1534.560, 2723.230, 110.916)
  2231. AddZone("Blueberry", 104.534, -220.137, 2.3, 349.607, 152.236, 200.000)
  2232. AddZone("El Castillo del Diablo", -464.515, 2217.680, 0.000, -208.570, 2580.360, 200.000)
  2233. AddZone("Downtown", -2078.670, 578.396, -7.6, -1499.890, 744.267, 200.000)
  2234. AddZone("Rockshore East", 2537.390, 676.549, -89.084, 2902.350, 943.235, 110.916)
  2235. AddZone("San Fierro Bay", -2616.400, 1501.210, -3.0, -1996.660, 1659.680, 200.000)
  2236. AddZone("Paradiso", -2741.070, 793.411, -6.1, -2533.040, 1268.410, 200.000)
  2237. AddZone("The Camel's Toe", 2087.390, 1203.230, -89.084, 2640.400, 1383.230, 110.916)
  2238. AddZone("Old Venturas Strip", 2162.390, 2012.180, -89.084, 2685.160, 2202.760, 110.916)
  2239. AddZone("Juniper Hill", -2533.040, 578.396, -7.6, -2274.170, 968.369, 200.000)
  2240. AddZone("Juniper Hollow", -2533.040, 968.369, -6.1, -2274.170, 1358.900, 200.000)
  2241. AddZone("Roca Escalante", 2237.400, 2202.760, -89.084, 2536.430, 2542.550, 110.916)
  2242. AddZone("Julius Thruway East", 2685.160, 1055.960, -89.084, 2749.900, 2626.550, 110.916)
  2243. AddZone("Verona Beach", 647.712, -2173.290, -89.084, 930.221, -1804.210, 110.916)
  2244. AddZone("Foster Valley", -2178.690, -599.884, -1.2, -1794.920, -324.114, 200.000)
  2245. AddZone("Arco del Oeste", -901.129, 2221.860, 0.000, -592.090, 2571.970, 200.000)
  2246. AddZone("Fallen Tree", -792.254, -698.555, -5.3, -452.404, -380.043, 200.000)
  2247. AddZone("The Farm", -1209.670, -1317.100, 114.981, -908.161, -787.391, 251.981)
  2248. AddZone("The Sherman Dam", -968.772, 1929.410, -3.0, -481.126, 2155.260, 200.000)
  2249. AddZone("Esplanade North", -1996.660, 1358.900, -4.5, -1524.240, 1592.510, 200.000)
  2250. AddZone("Financial", -1871.720, 744.170, -6.1, -1701.300, 1176.420, 300.000)
  2251. AddZone("Garcia", -2411.220, -222.589, -1.14, -2173.040, 265.243, 200.000)
  2252. AddZone("Montgomery", 1119.510, 119.526, -3.0, 1451.400, 493.323, 200.000)
  2253. AddZone("Creek", 2749.900, 1937.250, -89.084, 2921.620, 2669.790, 110.916)
  2254. AddZone("Los Santos International", 1249.620, -2394.330, -89.084, 1852.000, -2179.250, 110.916)
  2255. AddZone("Santa Maria Beach", 72.648, -2173.290, -89.084, 342.648, -1684.650, 110.916)
  2256. AddZone("Mulholland Intersection", 1463.900, -1150.870, -89.084, 1812.620, -768.027, 110.916)
  2257. AddZone("Angel Pine", -2324.940, -2584.290, -6.1, -1964.220, -2212.110, 200.000)
  2258. AddZone("Verdant Meadows", 37.032, 2337.180, -3.0, 435.988, 2677.900, 200.000)
  2259. AddZone("Octane Springs", 338.658, 1228.510, 0.000, 664.308, 1655.050, 200.000)
  2260. AddZone("Come-A-Lot", 2087.390, 943.235, -89.084, 2623.180, 1203.230, 110.916)
  2261. AddZone("Redsands West", 1236.630, 1883.110, -89.084, 1777.390, 2142.860, 110.916)
  2262. AddZone("Santa Maria Beach", 342.648, -2173.290, -89.084, 647.712, -1684.650, 110.916)
  2263. AddZone("Verdant Bluffs", 1249.620, -2179.250, -89.084, 1692.620, -1842.270, 110.916)
  2264. AddZone("Las Venturas Airport", 1236.630, 1203.280, -89.084, 1457.370, 1883.110, 110.916)
  2265. AddZone("Flint Range", -594.191, -1648.550, 0.000, -187.700, -1276.600, 200.000)
  2266. AddZone("Verdant Bluffs", 930.221, -2488.420, -89.084, 1249.620, -2006.780, 110.916)
  2267. AddZone("Palomino Creek", 2160.220, -149.004, 0.000, 2576.920, 228.322, 200.000)
  2268. AddZone("Ocean Docks", 2373.770, -2697.090, -89.084, 2809.220, -2330.460, 110.916)
  2269. AddZone("Easter Bay Airport", -1213.910, -50.096, -4.5, -947.980, 578.396, 200.000)
  2270. AddZone("Whitewood Estates", 883.308, 1726.220, -89.084, 1098.310, 2507.230, 110.916)
  2271. AddZone("Calton Heights", -2274.170, 744.170, -6.1, -1982.320, 1358.900, 200.000)
  2272. AddZone("Easter Basin", -1794.920, 249.904, -9.1, -1242.980, 578.396, 200.000)
  2273. AddZone("Los Santos Inlet", -321.744, -2224.430, -89.084, 44.615, -1724.430, 110.916)
  2274. AddZone("Doherty", -2173.040, -222.589, -1.0, -1794.920, 265.243, 200.000)
  2275. AddZone("Mount Chiliad", -2178.690, -2189.910, -47.917, -2030.120, -1771.660, 576.083)
  2276. AddZone("Fort Carson", -376.233, 826.326, -3.0, 123.717, 1220.440, 200.000)
  2277. AddZone("Foster Valley", -2178.690, -1115.580, 0.000, -1794.920, -599.884, 200.000)
  2278. AddZone("Ocean Flats", -2994.490, -222.589, -1.0, -2593.440, 277.411, 200.000)
  2279. AddZone("Fern Ridge", 508.189, -139.259, 0.000, 1306.660, 119.526, 200.000)
  2280. AddZone("Bayside", -2741.070, 2175.150, 0.000, -2353.170, 2722.790, 200.000)
  2281. AddZone("Las Venturas Airport", 1457.370, 1203.280, -89.084, 1777.390, 1883.110, 110.916)
  2282. AddZone("Blueberry Acres", -319.676, -220.137, 0.000, 104.534, 293.324, 200.000)
  2283. AddZone("Palisades", -2994.490, 458.411, -6.1, -2741.070, 1339.610, 200.000)
  2284. AddZone("North Rock", 2285.370, -768.027, 0.000, 2770.590, -269.740, 200.000)
  2285. AddZone("Hunter Quarry", 337.244, 710.840, -115.239, 860.554, 1031.710, 203.761)
  2286. AddZone("Los Santos International", 1382.730, -2730.880, -89.084, 2201.820, -2394.330, 110.916)
  2287. AddZone("Missionary Hill", -2994.490, -811.276, 0.000, -2178.690, -430.276, 200.000)
  2288. AddZone("San Fierro Bay", -2616.400, 1659.680, -3.0, -1996.660, 2175.150, 200.000)
  2289. AddZone("Restricted Area", -91.586, 1655.050, -50.000, 421.234, 2123.010, 250.000)
  2290. AddZone("Mount Chiliad", -2997.470, -1115.580, -47.917, -2178.690, -971.913, 576.083)
  2291. AddZone("Mount Chiliad", -2178.690, -1771.660, -47.917, -1936.120, -1250.970, 576.083)
  2292. AddZone("Easter Bay Airport", -1794.920, -730.118, -3.0, -1213.910, -50.096, 200.000)
  2293. AddZone("The Panopticon", -947.980, -304.320, -1.1, -319.676, 327.071, 200.000)
  2294. AddZone("Shady Creeks", -1820.640, -2643.680, -8.0, -1226.780, -1771.660, 200.000)
  2295. AddZone("Back o Beyond", -1166.970, -2641.190, 0.000, -321.744, -1856.030, 200.000)
  2296. AddZone("Mount Chiliad", -2994.490, -2189.910, -47.917, -2178.690, -1115.580, 576.083)
  2297. AddZone("Tierra Robada", -1213.910, 596.349, -242.990, -480.539, 1659.680, 900.000)
  2298. AddZone("Flint County", -1213.910, -2892.970, -242.990, 44.615, -768.027, 900.000)
  2299. AddZone("Whetstone", -2997.470, -2892.970, -242.990, -1213.910, -1115.580, 900.000)
  2300. AddZone("Bone County", -480.539, 596.349, -242.990, 869.461, 2993.870, 900.000)
  2301. AddZone("Tierra Robada", -2997.470, 1659.680, -242.990, -480.539, 2993.870, 900.000)
  2302. AddZone("San Fierro", -2997.470, -1115.580, -242.990, -1213.910, 1659.680, 900.000)
  2303. AddZone("Las Venturas", 869.461, 596.349, -242.990, 2997.060, 2993.870, 900.000)
  2304. AddZone("Red County", -1213.910, -768.027, -242.990, 2997.060, 596.349, 900.000)
  2305. AddZone("Los Santos", 44.615, -2892.970, -242.990, 2997.060, -768.027, 900.000)
  2306. }
  2307. calculateZone(posX, posY, posZ) {
  2308. if ( bInitZaC == 0 )
  2309. {
  2310. initZonesAndCities()
  2311. bInitZaC := 1
  2312. }
  2313. Loop % nZone-1
  2314. {
  2315. 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)
  2316. {
  2317. ErrorLevel := ERROR_OK
  2318. return zone%A_Index%_name
  2319. }
  2320. }
  2321. ErrorLevel := ERROR_ZONE_NOT_FOUND
  2322. return "Unbekannt"
  2323. }
  2324. calculateCity(posX, posY, posZ) {
  2325. if ( bInitZaC == 0 )
  2326. {
  2327. initZonesAndCities()
  2328. bInitZaC := 1
  2329. }
  2330. smallestCity := "Unbekannt"
  2331. currentCitySize := 0
  2332. smallestCitySize := 0
  2333. Loop % nCity-1
  2334. {
  2335. 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)
  2336. {
  2337. 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))
  2338. if (smallestCity == "Unbekannt") || (currentCitySize < smallestCitySize)
  2339. {
  2340. smallestCity := city%A_Index%_name
  2341. smallestCitySize := currentCitySize
  2342. }
  2343. }
  2344. }
  2345. if(smallestCity == "Unbekannt") {
  2346. ErrorLevel := ERROR_CITY_NOT_FOUND
  2347. } else {
  2348. ErrorLevel := ERROR_OK
  2349. }
  2350. return smallestCity
  2351. }
  2352. AddZone(sName, x1, y1, z1, x2, y2, z2) {
  2353. global
  2354. zone%nZone%_name := sName
  2355. zone%nZone%_x1 := x1
  2356. zone%nZone%_y1 := y1
  2357. zone%nZone%_z1 := z1
  2358. zone%nZone%_x2 := x2
  2359. zone%nZone%_y2 := y2
  2360. zone%nZone%_z2 := z2
  2361. nZone := nZone + 1
  2362. }
  2363. AddCity(sName, x1, y1, z1, x2, y2, z2) {
  2364. global
  2365. city%nCity%_name := sName
  2366. city%nCity%_x1 := x1
  2367. city%nCity%_y1 := y1
  2368. city%nCity%_z1 := z1
  2369. city%nCity%_x2 := x2
  2370. city%nCity%_y2 := y2
  2371. city%nCity%_z2 := z2
  2372. nCity := nCity + 1
  2373. }
  2374. getPlayerZone()
  2375. {
  2376. aktPos := getCoordinates()
  2377. return calculateZone(aktPos[1], aktPos[2], aktPos[3])
  2378. }
  2379. getPlayerCity()
  2380. {
  2381. aktPos := getCoordinates()
  2382. return calculateCity(aktPos[1], aktPos[2], aktPos[3])
  2383. }
  2384. checkHandles() {
  2385. if(iRefreshHandles+500>A_TickCount)
  2386. return true
  2387. iRefreshHandles:=A_TickCount
  2388. if(!refreshGTA() || !refreshSAMP() || !refreshMemory()) {
  2389. return false
  2390. } else {
  2391. return true
  2392. }
  2393. return true
  2394. }
  2395. readMem(hProcess, dwAddress, dwLen=4, type="UInt") {
  2396. if(!hProcess) {
  2397. ErrorLevel := ERROR_INVALID_HANDLE
  2398. return 0
  2399. }
  2400. VarSetCapacity(dwRead, dwLen)
  2401. dwRet := DllCall(    "ReadProcessMemory"
  2402. , "UInt",  hProcess
  2403. , "UInt",  dwAddress
  2404. , "Str",   dwRead
  2405. , "UInt",  dwLen
  2406. , "UInt*", 0)
  2407. if(dwRet == 0) {
  2408. ErrorLevel := ERROR_READ_MEMORY
  2409. return 0
  2410. }
  2411. ErrorLevel := ERROR_OK
  2412. return NumGet(dwRead, 0, type)
  2413. }
  2414. Memory_ReadByte(process_handle, address) {
  2415. VarSetCapacity(value, 1, 0)
  2416. DllCall("ReadProcessMemory", "UInt", process_handle, "UInt", address, "Str", value, "UInt", 1, "UInt *", 0)
  2417. return, NumGet(value, 0, "Byte")
  2418. }
  2419. ScreenX := readDWORD(hGTA, 0xC17044)
  2420. ScreenY := readDWORD(hGTA, 0xC17048)
  2421. #CommentFlag //
  2422. global ERROR_OK := 0
  2423. global ERROR_PROCESS_NOT_FOUND := 1
  2424. global ERROR_OPEN_PROCESS := 2
  2425. global ERROR_INVALID_HANDLE := 3
  2426. global ERROR_MODULE_NOT_FOUND := 4
  2427. global ERROR_ENUM_PROCESS_MODULES := 5
  2428. global ERROR_ZONE_NOT_FOUND := 6
  2429. global ERROR_CITY_NOT_FOUND := 7
  2430. global ERROR_READ_MEMORY := 8
  2431. global ERROR_WRITE_MEMORY := 9
  2432. global ERROR_ALLOC_MEMORY := 10
  2433. global ERROR_FREE_MEMORY := 11
  2434. global ERROR_WAIT_FOR_OBJECT := 12
  2435. global ERROR_CREATE_THREAD := 13
  2436. global PI := 3.1415926535
  2437. ,global ADDR_NOSPREAD := [0xC8C450, 0xC8C530, 0xC8C6F0, 0xC8C760, 0xC8C7D0, 0xC8C840, 0xC8C8B0,0xC8C4C0, 0xC8C5A0, 0xC8C610, 0xC8C680, 0xC8B960, 0xC8B9D0, 0xC8BB90]
  2438. ,global ADDR_MOVESPEED := [0xC8D644, 0xC8AAF4, 0xC8AB64, 0xC8ABD4, 0xC8AC44, 0xC8ACB4, 0xC8AD24, 0xC8AD94, 0xC8AE04, 0xC8AE74, 0xC8AEE4, 0xC8AF54, 0xC8AFC4, 0xC8B034, 0xC8B0A4, 0xC8B114, 0xC8B184, 0xC8B1F4, 0xC8B264, 0xC8B2D4, 0xC8B344, 0xC8B3B4, 0xC8B424, 0xC8B494, 0xC8B504, 0xC8B574, 0xC8B5E4, 0xC8B654, 0xC8B6C4, 0xC8B734, 0xC8B7A4, 0xC8B814, 0xC8B884, 0xC8B8F4, 0xC8B964, 0xC8B9D4, 0xC8BA44, 0xC8BAB4, 0xC8BB24, 0xC8BB94, 0xC8BC04, 0xC8BC74, 0xC8BCE4, 0xC8BD54, 0xC8BDC4, 0xC8BE34, 0xC8BEA4, 0xC8BF14, 0xC8BF84, 0xC8BFF4, 0xC8C064, 0xC8C0D4, 0xC8C144, 0xC8C1B4, 0xC8C224, 0xC8C294, 0xC8C304, 0xC8C374, 0xC8C3E4, 0xC8C454, 0xC8C4C4, 0xC8C534, 0xC8C5A4, 0xC8C614, 0xC8C684, 0xC8C6F4, 0xC8C764, 0xC8C7D4, 0xC8C844, 0xC8C8B4, 0xC8C924, 0xC8C994, 0xC8CA04, 0xC8CA74, 0xC8CAE4, 0xC8CB54, 0xC8CBC4, 0xC8CC34, 0xC8CCA4, 0xC8CD14, 0xC8CD84, 0xC8CDF4, 0xC8CE64, 0xC8CED4, 0xC8CF44, 0xC8CFB4, 0xC8D024, 0xC8D094, 0xC8D104, 0xC8D174, 0xC8D1E4, 0xC8D254, 0xC8D2C4, 0xC8D334, 0xC8D3A4, 0xC8D414, 0xC8D484, 0xC8D4F4, 0xC8D564, 0xC8D5D4, 0xC8D644]
  2439. ,global VALUE_MOVESPEED := [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.2, 1.2, 1.1, 1.1, 1.0, 1.0, 1.3, 1.0, 1.0, 1.0, 1.2, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.1, 0.9, 0.9, 1.0, 1.0, 1.5, 1.5, 1.3, 1.3, 1.2, 1.0, 1.5, 1.1, 1.1, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
  2440. ,global oAirplaneModels := [417, 425, 447, 460, 469, 476, 487, 488, 497, 511, 512, 513, 519, 520, 548, 553, 563, 577, 592, 593]
  2441. ,global oBikeModels := [481,509,510]
  2442. ,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","BalistaCompact","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"]
  2443. ,global ADDR_CPED_PTR            := 0xB6F5F0
  2444. ,global ADDR_CVEHICLE_PTR        := 0xB6F980
  2445. ,global ADDR_VEHICLE_PTR         := 0xBA18FC
  2446. ,global OFFSET_MATRIX            := 0x14
  2447. ,global OFFSET_POSX              := 0x30
  2448. ,global OFFSET_POSY              := 0x34
  2449. ,global OFFSET_POSZ              := 0x38
  2450. ,global OFFSET_ROTATION_X        := 0x10
  2451. ,global OFFSET_ROTATION_Y        := 0x14
  2452. ,global ADDR_ZONECODE            := 0xA49AD4
  2453. ,global ADDR_POSITION_X          := 0xB6F2E4
  2454. ,global ADDR_POSITION_Y          := 0xB6F2E8
  2455. ,global ADDR_POSITION_Z          := 0xB6F2EC
  2456. ,global ADDR_REDMARKER_POSX      := 0xC7DEC8
  2457. ,global ADDR_REDMARKER_POSY      := 0xC7DECC
  2458. ,global ADDR_REDMARKER_POSZ      := 0xC7DED0
  2459. ,global OFFSET_CPED_HP           := 0x540
  2460. ,global OFFSET_CPED_ARMOR        := 0x548
  2461. ,global OFFSET_CPED_SKINID       := 0x22
  2462. ,global OFFSET_CPED_OTARGET      := 0x79C
  2463. ,global OFFSET_CPED_FLAGS        := 0x42
  2464. ,global OFFSET_CPED_ROTATION     := 0x558
  2465. ,global OFFSET_CPED_ZANGLE       := 0x55C
  2466. ,global OFFSET_CPED_FLAGS        := 0x42
  2467. ,global OFFSET_CPED_STATE        := 0x530
  2468. ,global OFFSET_CPED_CHECK        := 0x46C
  2469. ,global OFFSET_CPED_LOCALPLAYER  := 0x22
  2470. ,global OFFSET_VEH_SPEED_X       := 0x44
  2471. ,global OFFSET_VEH_SPEED_Y       := 0x48
  2472. ,global OFFSET_VEH_SPEED_Z       := 0x4C
  2473. ,global OFFSET_VEH_SPIN_X        := 0x50
  2474. ,global OFFSET_VEH_SPIN_Y        := 0x54
  2475. ,global OFFSET_VEH_SPIN_Z        := 0x58
  2476. ,global OFFSET_VEH_HPOFF         := 0x4C0
  2477. ,global OFFSET_VEH_DOORSTATE     := 0x4F8
  2478. ,global OFFSET_VEH_ENGINESTATE   := 0x428
  2479. ,global OFFSET_VEH_LIGHTSTATE    := 0x584
  2480. ,global OFFSET_VEH_MODEL         := 0x22
  2481. ,global OFFSET_VEH_TYPE          := 0x590
  2482. ,global OFFSET_VEH_DRIVER        := 0x460
  2483. ,global OFFSET_VEH_MODELID       := 0x22
  2484. ,global OFFSET_VEH_LASTVEH       := 0x58C
  2485. ,global OFFSET_VEH_COLOR1        := 1076
  2486. ,global OFFSET_VEH_COLOR2        := 1077
  2487. ,global ADDR_CAMERA_ROTATION     := 0xB6F178
  2488. ,global ADDR_CAMERA_POS_X        := 0xB6F9CC
  2489. ,global ADDR_CAMERA_POS_Y        := 0xB6F9D0
  2490. ,global ADDR_CAMERA_CURR_X       := 0xB6F258
  2491. ,global ADDR_CAMERA_ANGLE_X      := 0xB6F104
  2492. ,global ADDR_CAMERA_ANGLE_Y      := 0xB6F108
  2493. ,global ADDR_CAMERA_ANGLE_Z      := 0x00B6F248
  2494. ,global ADDR_WEAPON_TARGET       := 0xB6F3B8
  2495. ,global ADDR_WEAPON_DATA         := 0xC8AAB8
  2496. ,global ADDR_WEAPON_NOSPREAD     := 0x740676
  2497. ,global OFFSET_WEAPON_MAX        := 100
  2498. ,global OFFSET_WEAPON_STACK      := 0x70
  2499. ,global OFFSET_WEAPON_TRANGE     := 0x4
  2500. ,global OFFSET_WEAPON_ID         := 0x740
  2501. ,global OFFSET_WEAPON_SLOT       := 0x718
  2502. ,global OFFSET_WEAPON_DMG        := 0x760
  2503. ,global ADDR_SA_WHEELSONLY       := 0x96914B
  2504. ,global ADDR_SA_HANDLING         := 0x96914C
  2505. ,global ADDR_SA_WATERDRIVE       := 0x969152
  2506. ,global ADDR_SA_BIKEBUNNY        := 0x969161
  2507. ,global ADDR_SA_CARSHAVENITRO    := 0x969165
  2508. ,global ADDR_SA_MEGAJUMP         := 0x96916C
  2509. ,global ADDR_SA_OXYGEN           := 0x96916E
  2510. ,global ADDR_SA_DRIVEAIM         := 0x969179
  2511. ,global ADDR_SA_HITMANWEAPONS    := 0x969183
  2512. ,global ADDR_SA_FIREPROOF        := 0xB7CEE6
  2513. ,global ADDR_SA_NIGHTVISION      := 0xC402B8
  2514. ,global ADDR_SA_THERMVISION      := 0xC402B9
  2515. ,global ADDR_SA_UNDERWATER       := 0x6C2759
  2516. ,global ADDR_BIKEFALL1           := 0x4BA3B9
  2517. ,global ADDR_BIKEFALL2           := 0x4BA3BA
  2518. ,global ADDR_BIKEFALL3           := 0x4BA3BB
  2519. ,global ADDR_SA_MONEY            := 0x0B7CE54
  2520. ,global ADDR_SA_INTID            := 0xA4ACE8
  2521. ,global ADDR_WORLD_GRAVITY       := 0x863984
  2522. ,global ADDR_WORLD_MAPX          := 0xBA67B8
  2523. ,global ADDR_WORLD_MAPY          := 0xBA67BC
  2524. ,global FUNC_GETBONEPOS          := 0x5E4280
  2525. ,global SAMPFUNCS_FUNC_DBGCHECK  := 0x65098
  2526. ,global SAMPFUNCS_FUNC_SETSKIN   := 0x65090
  2527. ,global VEHPOOL_iVehicleCount    := 0x0
  2528. ,global VEHPOOL_pSAMP_Vehicle    := 0xFA4
  2529. ,global VEHPOOL_iIsListed        := 0x3074
  2530. ,global VEHPOOL_pGTA_Vehicle     := 0x4FB4
  2531. ,global pData_iAFKState          := 0x1D1
  2532. ,global pData_iGlobalMarkers     := 0x1E9
  2533. ,global pData_iMapX              := 0x1ED
  2534. ,global pData_iMapY              := 0x1F1
  2535. ,global pData_iMapZ              := 0x1F5
  2536. ,global pData_iGTAPed            := 0x2A4
  2537. ,global pData_iHP                := 0x1BC
  2538. ,global pData_iArmor             := 0x1B8
  2539. ,global SPECIAL_ACTION_NONE             := 0
  2540. ,global SPECIAL_ACTION_USEJETPACK       := 2
  2541. ,global SPECIAL_ACTION_DANCE1           := 5
  2542. ,global SPECIAL_ACTION_DANCE2           := 6
  2543. ,global SPECIAL_ACTION_DANCE3           := 7
  2544. ,global SPECIAL_ACTION_DANCE4           := 8
  2545. ,global SPECIAL_ACTION_HANDSUP          := 10
  2546. ,global SPECIAL_ACTION_USECELLPHONE     := 11
  2547. ,global SPECIAL_ACTION_SITTING          := 12
  2548. ,global SPECIAL_ACTION_STOPUSECELLPHONE := 13
  2549. ,global SPECIAL_ACTION_DUCK             := 1
  2550. ,global SPECIAL_ACTION_ENTER_VEHICLE    := 3
  2551. ,global SPECIAL_ACTION_EXIT_VEHICLE     := 4
  2552. ,global SPECIAL_ACTION_DRINK_BEER       := 20
  2553. ,global SPECIAL_ACTION_SMOKE_CIGGY      := 21
  2554. ,global SPECIAL_ACTION_DRINK_WINE       := 22
  2555. ,global SPECIAL_ACTION_DRINK_SPRUNK     := 23
  2556. ,global SPECIAL_ACTION_PISSING          := 68
  2557. ,global ADDR_SAMP_FPSUNLOCK := 0x9D9D0
  2558. ,global ADDR_SAMP_CRASHREPORT := 0x5CF2C
  2559. ,global ADDR_SAMP_INCHAT_PTR := 0x21a10c
  2560. ,global ADDR_SAMP_INCHAT_PTR_OFF := 0x55
  2561. ,global ADDR_SAMP_USERNAME := 0x219A6F
  2562. ,global ADDR_SAMP_CHATMSG_PTR := 0x21A0E4
  2563. ,global ADDR_SAMP_SHOWDLG_PTR := 0x21A0B8
  2564. ,global FUNC_SAMP_SENDCMD := 0x65c60
  2565. ,global FUNC_SAMP_SENDSAY := 0x57f0
  2566. ,global FUNC_SAMP_ADDTOCHATWND := 0x64520
  2567. ,global FUNC_SAMP_SHOWGAMETEXT := 0x9C2C0
  2568. ,global FUNC_SAMP_PLAYAUDIOSTR := 0x62dA0
  2569. ,global FUNC_SAMP_STOPAUDIOSTR := 0x629A0
  2570. ,global FUNC_SAMP_SHOWDIALOG := 0x6B9C0
  2571. ,global FUNC_UPDATESCOREBOARD := 0x8A10
  2572. ,global SAMP_INFO_OFFSET := 0x21A0F8
  2573. ,global SAMP_COLOR_OFFSET := 0x216378
  2574. ,global SAMP_SETTINGS_OFFSET := 0x3C5
  2575. ,global SAMP_PPOOLS_OFFSET := 0x3CD
  2576. ,global SAMP_PPOOL_PLAYER_OFFSET := 0x18
  2577. ,global SAMP_PPOOL_VEHICLE_OFFSET := 0x1C
  2578. ,global SAMP_PPOOL_PICKUP_OFFSET  := 0x20
  2579. ,global SAMP_PPOOL_OBJECT_OFFSET := 0x4
  2580. ,global SAMP_PPOOL_TEXTDRAW_OFFSET := 0x10
  2581. ,global ADDR_SAMP_INPUT_INFO_OFFSET  := 0x21A0E8
  2582. ,global FUNC_SAMP_PUSH_SENT_MSG := 0x65930
  2583. ,global SAMP_SLOCALPLAYERID_OFFSET := 0x4
  2584. ,global SAMP_ISTRLEN_LOCALPLAYERNAME_OFFSET := 0x1A
  2585. ,global SAMP_SZLOCALPLAYERNAME_OFFSET := 0xA
  2586. ,global SAMP_PSZLOCALPLAYERNAME_OFFSET := 0xA
  2587. ,global SAMP_PREMOTEPLAYER_OFFSET := 0x2E
  2588. ,global SAMP_ISTRLENNAME___OFFSET := 0x1C
  2589. ,global SAMP_SZPLAYERNAME_OFFSET := 0xC
  2590. ,global SAMP_PSZPLAYERNAME_OFFSET := 0xC
  2591. ,global SAMP_ILOCALPLAYERPING_OFFSET := 0x26
  2592. ,global SAMP_ILOCALPLAYERSCORE_OFFSET := 0x2A
  2593. ,global SAMP_IPING_OFFSET := 0x28
  2594. ,global SAMP_ISCORE_OFFSET := 0x24
  2595. ,global SAMP_ISNPC_OFFSET := 0x4
  2596. ,global SAMP_SZIP_OFFSET := 0x20
  2597. ,global SAMP_NAMETAG_DISTANCE := 0x27
  2598. ,global SAMP_NAMETAGS_WALL := 0x2F
  2599. ,global SAMP_SHOWNAMETAGS := 0x38
  2600. ,global SAMP_SZHOSTNAME_OFFSET := 0x121
  2601. ,global SAMP_PLAYER_MAX                              := 1000
  2602. ,global SAMP_MAX_VEHICLES                            := 2000
  2603. ,global SAMP_MAX_PICKUPS                             := 4096
  2604. ,global SAMP_MAX_OBJECTS                             := 1000
  2605. ,global SAMP_MAX_GANGZONES                           := 1024
  2606. ,global SAMP_MAX_3DTEXTS                             := 2048
  2607. ,global SAMP_MAX_TEXTDRAWS                           := 2048
  2608. ,global SAMP_MAX_PLAYERTEXTDRAWS                     := 256
  2609. ,global SAMP_MAX_CLIENTCMDS                          := 144
  2610. ,global SAMP_MAX_MENUS                               := 128
  2611. ,global SAMP_MAX_PLAYER_NAME                         := 24
  2612. ,global SAMP_ALLOWED_PLAYER_NAME_LENGTH              := 20
  2613. ,global SIZE_SAMP_CHATMSG := 0xFC
  2614. ,global hGTA := 0x0
  2615. ,global dwGTAPID := 0x0
  2616. ,global dwSAMP := 0x0
  2617. ,global pMemory := 0x0
  2618. ,global pParam1 := 0x0
  2619. ,global pParam2 := 0x0
  2620. ,global pParam3 := 0x0
  2621. ,global pInjectFunc := 0x0
  2622. ,global bInitZaC := 0
  2623. ,global iRefreshScoreboard := 0
  2624. ,global oScoreboardData := ""
  2625. ,global iRefreshHandles := 0
  2626. ,global iUpdateTick := 200
  2627. ,global iRefreshVeh := 0
  2628. ,global oVehiclePoolData := ""
  2629. ,global iUpdateTickVeh := 1000
  2630. SAMP() {
  2631. if(iRefreshHandles+500>A_TickCount)
  2632. return true
  2633. iRefreshHandles:=A_TickCount
  2634. if(!refreshGTA() || !refreshSAMP() || !refreshMemory()) {
  2635. return false
  2636. } else {
  2637. return true
  2638. }
  2639. return true
  2640. }
  2641. refreshGTA() {
  2642. newPID := getPID("GTA:SA:MP")
  2643. if(!newPID) {
  2644. if(hGTA) {
  2645. virtualFreeEx(hGTA, pMemory, 0, 0x8000)
  2646. closeProcess(hGTA)
  2647. hGTA := 0x0
  2648. }
  2649. dwGTAPID := 0
  2650. hGTA := 0x0
  2651. dwSAMP := 0x0
  2652. pMemory := 0x0
  2653. return false
  2654. }
  2655. if(!hGTA || (dwGTAPID != newPID)) {
  2656. hGTA := openProcess(newPID)
  2657. if(ErrorLevel) {
  2658. dwGTAPID := 0
  2659. hGTA := 0x0
  2660. dwSAMP := 0x0
  2661. pMemory := 0x0
  2662. return false
  2663. }
  2664. dwGTAPID := newPID
  2665. dwSAMP := 0x0
  2666. pMemory := 0x0
  2667. return true
  2668. }
  2669. return true
  2670. }
  2671. refreshSAMP() {
  2672. if(dwSAMP)
  2673. return true
  2674. dwSAMP := getModuleBaseAddress("samp.dll", hGTA)
  2675. if(!dwSAMP)
  2676. return false
  2677. return true
  2678. }
  2679. refreshMemory() {
  2680. if(!pMemory) {
  2681. pMemory     := virtualAllocEx(hGTA, 4096, 0x1000 | 0x2000, 0x40)
  2682. if(ErrorLevel) {
  2683. pMemory := 0x0
  2684. return false
  2685. }
  2686. pParam1     := pMemory
  2687. pParam2     := pMemory + 1024
  2688. pParam3     := pMemory + 2048
  2689. pInjectFunc := pMemory + 3072
  2690. }
  2691. return true
  2692. }
  2693. getPID(szWindow) {
  2694. local dwPID := 0
  2695. WinGet, dwPID, PID, %szWindow%
  2696. return dwPID
  2697. }
  2698. openProcess(dwPID, dwRights = 0x1F0FFF) {
  2699. hProcess := DllCall("OpenProcess"
  2700. , "UInt", dwRights
  2701. , "int",  0
  2702. , "UInt", dwPID
  2703. , "Uint")
  2704. if(hProcess == 0) {
  2705. ErrorLevel := ERROR_OPEN_PROCESS
  2706. return 0
  2707. }
  2708. ErrorLevel := ERROR_OK
  2709. return hProcess
  2710. }
  2711. closeProcess(hProcess) {
  2712. if(hProcess == 0) {
  2713. ErrorLevel := ERROR_INVALID_HANDLE
  2714. return 0
  2715. }
  2716. dwRet := DllCall(    "CloseHandle"
  2717. , "Uint", hProcess
  2718. , "UInt")
  2719. ErrorLevel := ERROR_OK
  2720. }
  2721. getModuleBaseAddress(sModule, hProcess) {
  2722. if(!sModule) {
  2723. ErrorLevel := ERROR_MODULE_NOT_FOUND
  2724. return 0
  2725. }
  2726. if(!hProcess) {
  2727. ErrorLevel := ERROR_INVALID_HANDLE
  2728. return 0
  2729. }
  2730. dwSize = 1024*4
  2731. VarSetCapacity(hMods, dwSize)
  2732. VarSetCapacity(cbNeeded, 4)
  2733. dwRet := DllCall(    "Psapi.dll\EnumProcessModules"
  2734. , "UInt", hProcess
  2735. , "UInt", &hMods
  2736. , "UInt", dwSize
  2737. , "UInt*", cbNeeded
  2738. , "UInt")
  2739. if(dwRet == 0) {
  2740. ErrorLevel := ERROR_ENUM_PROCESS_MODULES
  2741. return 0
  2742. }
  2743. dwMods := cbNeeded / 4
  2744. i := 0
  2745. VarSetCapacity(hModule, 4)
  2746. VarSetCapacity(sCurModule, 260)
  2747. while(i < dwMods) {
  2748. hModule := NumGet(hMods, i*4)
  2749. DllCall("Psapi.dll\GetModuleFileNameEx"
  2750. , "UInt", hProcess
  2751. , "UInt", hModule
  2752. , "Str", sCurModule
  2753. , "UInt", 260)
  2754. SplitPath, sCurModule, sFilename
  2755. if(sModule == sFilename) {
  2756. ErrorLevel := ERROR_OK
  2757. return hModule
  2758. }
  2759. i := i + 1
  2760. }
  2761. ErrorLevel := ERROR_MODULE_NOT_FOUND
  2762. return 0
  2763. }
  2764. readString(hProcess, dwAddress, dwLen) {
  2765. if(!hProcess) {
  2766. ErrorLevel := ERROR_INVALID_HANDLE
  2767. return 0
  2768. }
  2769. VarSetCapacity(sRead, dwLen)
  2770. dwRet := DllCall(    "ReadProcessMemory"
  2771. , "UInt", hProcess
  2772. , "UInt", dwAddress
  2773. , "Str", sRead
  2774. , "UInt", dwLen
  2775. , "UInt*", 0
  2776. , "UInt")
  2777. if(dwRet == 0) {
  2778. ErrorLevel := ERROR_READ_MEMORY
  2779. return 0
  2780. }
  2781. ErrorLevel := ERROR_OK
  2782. if A_IsUnicode
  2783. return __ansiToUnicode(sRead)
  2784. return sRead
  2785. }
  2786. readFloat(hProcess, dwAddress) {
  2787. if(!hProcess) {
  2788. ErrorLevel := ERROR_INVALID_HANDLE
  2789. return 0
  2790. }
  2791. VarSetCapacity(dwRead, 4)
  2792. dwRet := DllCall(    "ReadProcessMemory"
  2793. , "UInt",  hProcess
  2794. , "UInt",  dwAddress
  2795. , "Str",   dwRead
  2796. , "UInt",  4
  2797. , "UInt*", 0
  2798. , "UInt")
  2799. if(dwRet == 0) {
  2800. ErrorLevel := ERROR_READ_MEMORY
  2801. return 0
  2802. }
  2803. ErrorLevel := ERROR_OK
  2804. return NumGet(dwRead, 0, "Float")
  2805. }
  2806. readDWORD(hProcess, dwAddress) {
  2807. if(!hProcess) {
  2808. ErrorLevel := ERROR_INVALID_HANDLE
  2809. return 0
  2810. }
  2811. VarSetCapacity(dwRead, 4)
  2812. dwRet := DllCall(    "ReadProcessMemory"
  2813. , "UInt",  hProcess
  2814. , "UInt",  dwAddress
  2815. , "Str",   dwRead
  2816. , "UInt",  4
  2817. , "UInt*", 0)
  2818. if(dwRet == 0) {
  2819. ErrorLevel := ERROR_READ_MEMORY
  2820. return 0
  2821. }
  2822. ErrorLevel := ERROR_OK
  2823. return NumGet(dwRead, 0, "UInt")
  2824. }
  2825. writeString(hProcess, dwAddress, wString) {
  2826. if(!hProcess) {
  2827. ErrorLevel := ERROR_INVALID_HANDLE
  2828. return false
  2829. }
  2830. sString := wString
  2831. if A_IsUnicode
  2832. sString := __unicodeToAnsi(wString)
  2833. dwRet := DllCall(    "WriteProcessMemory"
  2834. , "UInt", hProcess
  2835. , "UInt", dwAddress
  2836. , "Str", sString
  2837. , "UInt", StrLen(wString) + 1
  2838. , "UInt", 0
  2839. , "UInt")
  2840. if(dwRet == 0) {
  2841. ErrorLEvel := ERROR_WRITE_MEMORY
  2842. return false
  2843. }
  2844. ErrorLevel := ERROR_OK
  2845. return true
  2846. }
  2847. writeMemory(hProcess,address,writevalue,length=4, datatype="int") {
  2848. if(!hProcess) {
  2849. ErrorLevel := ERROR_INVALID_HANDLE
  2850. return false
  2851. }
  2852. VarSetCapacity(finalvalue,length, 0)
  2853. NumPut(writevalue,finalvalue,0,datatype)
  2854. dwRet :=  DllCall(  "WriteProcessMemory"
  2855. ,"Uint",hProcess
  2856. ,"Uint",address
  2857. ,"Uint",&finalvalue
  2858. ,"Uint",length
  2859. ,"Uint",0)
  2860. if(dwRet == 0) {
  2861. ErrorLevel := ERROR_WRITE_MEMORY
  2862. return false
  2863. }
  2864. ErrorLevel := ERROR_OK
  2865. return true
  2866. }
  2867. writeRaw(hProcess, dwAddress, pBuffer, dwLen) {
  2868. if(!hProcess) {
  2869. ErrorLevel := ERROR_INVALID_HANDLE
  2870. return false
  2871. }
  2872. dwRet := DllCall(    "WriteProcessMemory"
  2873. , "UInt", hProcess
  2874. , "UInt", dwAddress
  2875. , "UInt", pBuffer
  2876. , "UInt", dwLen
  2877. , "UInt", 0
  2878. , "UInt")
  2879. if(dwRet == 0) {
  2880. ErrorLEvel := ERROR_WRITE_MEMORY
  2881. return false
  2882. }
  2883. ErrorLevel := ERROR_OK
  2884. return true
  2885. }
  2886. writeByteCode(handle, address, byteCodeAsStringn){
  2887. StringReplace, byteCodeAsString, byteCodeAsString, %A_SPACE%, , All
  2888. StringReplace, byteCodeAsString, byteCodeAsString, x, , All
  2889. StringReplace, byteCodeAsString, byteCodeAsString, \, , All
  2890. byteCodeLen := StrLen(byteCodeAsString)/2
  2891. VarSetCapacity(injectInstruction, byteCodeLen, 0)
  2892. Loop %byteCodeLen% {
  2893. oneByte := SubStr(byteCodeAsString, ((A_INDEX-1)*2)+1, 2)
  2894. oneByte := "0x" oneByte
  2895. NumPut(oneByte, injectInstruction, A_INDEX-1, "UChar")
  2896. }
  2897. writeRaw(handle, address, &injectInstruction, byteCodeLen)
  2898. }
  2899. callWithParams(hProcess, dwFunc, aParams, bCleanupStack = true, thiscall = false) {
  2900. if(!hProcess) {
  2901. ErrorLevel := ERROR_INVALID_HANDLE
  2902. return false
  2903. }
  2904. validParams := 0
  2905. i := aParams.MaxIndex()
  2906. dwLen := i * 5 + 5 + 1
  2907. if(bCleanupStack)
  2908. dwLen += 3
  2909. VarSetCapacity(injectData, i * 5 + 5 + 3 + 1, 0)
  2910. i_ := 1
  2911. while(i > 0) {
  2912. if(aParams[i][1] != "") {
  2913. dwMemAddress := 0x0
  2914. if(aParams[i][1] == "p") {
  2915. dwMemAddress := aParams[i][2]
  2916. } else if(aParams[i][1] == "s") {
  2917. if(i_>3)
  2918. return false
  2919. dwMemAddress := pParam%i_%
  2920. writeString(hProcess, dwMemAddress, aParams[i][2])
  2921. if(ErrorLevel)
  2922. return false
  2923. i_ += 1
  2924. } else if(aParams[i][1] == "i") {
  2925. dwMemAddress := aParams[i][2]
  2926. } else {
  2927. return false
  2928. }
  2929. NumPut((thiscall && i == 1 ? 0xB9 : 0x68), injectData, validParams * 5, "UChar")
  2930. NumPut(dwMemAddress, injectData, validParams * 5 + 1, "UInt")
  2931. validParams += 1
  2932. }
  2933. i -= 1
  2934. }
  2935. offset := dwFunc - ( pInjectFunc + validParams * 5 + 5 )
  2936. NumPut(0xE8, injectData, validParams * 5, "UChar")
  2937. NumPut(offset, injectData, validParams * 5 + 1, "Int")
  2938. if(bCleanupStack) {
  2939. NumPut(0xC483, injectData, validParams * 5 + 5, "UShort")
  2940. NumPut(validParams*4, injectData, validParams * 5 + 7, "UChar")
  2941. NumPut(0xC3, injectData, validParams * 5 + 8, "UChar")
  2942. } else {
  2943. NumPut(0xC3, injectData, validParams * 5 + 5, "UChar")
  2944. }
  2945. writeRaw(hGTA, pInjectFunc, &injectData, dwLen)
  2946. if(ErrorLevel)
  2947. return false
  2948. hThread := createRemoteThread(hGTA, 0, 0, pInjectFunc, 0, 0, 0)
  2949. if(ErrorLevel)
  2950. return false
  2951. waitForSingleObject(hThread, 0xFFFFFFFF)
  2952. closeProcess(hThread)
  2953. return true
  2954. }
  2955. virtualAllocEx(hProcess, dwSize, flAllocationType, flProtect) {
  2956. if(!hProcess) {
  2957. ErrorLevel := ERROR_INVALID_HANDLE
  2958. return 0
  2959. }
  2960. dwRet := DllCall(    "VirtualAllocEx"
  2961. , "UInt", hProcess
  2962. , "UInt", 0
  2963. , "UInt", dwSize
  2964. , "UInt", flAllocationType
  2965. , "UInt", flProtect
  2966. , "UInt")
  2967. if(dwRet == 0) {
  2968. ErrorLEvel := ERROR_ALLOC_MEMORY
  2969. return 0
  2970. }
  2971. ErrorLevel := ERROR_OK
  2972. return dwRet
  2973. }
  2974. virtualFreeEx(hProcess, lpAddress, dwSize, dwFreeType) {
  2975. if(!hProcess) {
  2976. ErrorLevel := ERROR_INVALID_HANDLE
  2977. return 0
  2978. }
  2979. dwRet := DllCall(    "VirtualFreeEx"
  2980. , "UInt", hProcess
  2981. , "UInt", lpAddress
  2982. , "UInt", dwSize
  2983. , "UInt", dwFreeType
  2984. , "UInt")
  2985. if(dwRet == 0) {
  2986. ErrorLEvel := ERROR_FREE_MEMORY
  2987. return 0
  2988. }
  2989. ErrorLevel := ERROR_OK
  2990. return dwRet
  2991. }
  2992. createRemoteThread(hProcess, lpThreadAttributes, dwStackSize, lpStartAddress, lpParameter, dwCreationFlags, lpThreadId) {
  2993. if(!hProcess) {
  2994. ErrorLevel := ERROR_INVALID_HANDLE
  2995. return 0
  2996. }
  2997. dwRet := DllCall(    "CreateRemoteThread"
  2998. , "UInt", hProcess
  2999. , "UInt", lpThreadAttributes
  3000. , "UInt", dwStackSize
  3001. , "UInt", lpStartAddress
  3002. , "UInt", lpParameter
  3003. , "UInt", dwCreationFlags
  3004. , "UInt", lpThreadId
  3005. , "UInt")
  3006. if(dwRet == 0) {
  3007. ErrorLEvel := ERROR_ALLOC_MEMORY
  3008. return 0
  3009. }
  3010. ErrorLevel := ERROR_OK
  3011. return dwRet
  3012. }
  3013. waitForSingleObject(hThread, dwMilliseconds) {
  3014. if(!hThread) {
  3015. ErrorLevel := ERROR_INVALID_HANDLE
  3016. return 0
  3017. }
  3018. dwRet := DllCall(    "WaitForSingleObject"
  3019. , "UInt", hThread
  3020. , "UInt", dwMilliseconds
  3021. , "UInt")
  3022. if(dwRet == 0xFFFFFFFF) {
  3023. ErrorLEvel := ERROR_WAIT_FOR_OBJECT
  3024. return 0
  3025. }
  3026. ErrorLevel := ERROR_OK
  3027. return dwRet
  3028. }
  3029. __ansiToUnicode(sString, nLen = 0) {
  3030. If !nLen
  3031. {
  3032. nLen := DllCall("MultiByteToWideChar"
  3033. , "Uint", 0
  3034. , "Uint", 0
  3035. , "Uint", &sString
  3036. , "int",  -1
  3037. , "Uint", 0
  3038. , "int",  0)
  3039. }
  3040. VarSetCapacity(wString, nLen * 2)
  3041. DllCall("MultiByteToWideChar"
  3042. , "Uint", 0
  3043. , "Uint", 0
  3044. , "Uint", &sString
  3045. , "int",  -1
  3046. , "Uint", &wString
  3047. , "int",  nLen)
  3048. return wString
  3049. }
  3050. __unicodeToAnsi(wString, nLen = 0) {
  3051. pString := wString + 1 > 65536 ? wString : &wString
  3052. If !nLen
  3053. {
  3054. nLen := DllCall("WideCharToMultiByte"
  3055. , "Uint", 0
  3056. , "Uint", 0
  3057. , "Uint", pString
  3058. , "int",  -1
  3059. , "Uint", 0
  3060. , "int",  0
  3061. , "Uint", 0
  3062. , "Uint", 0)
  3063. }
  3064. VarSetCapacity(sString, nLen)
  3065. DllCall("WideCharToMultiByte"
  3066. , "Uint", 0
  3067. , "Uint", 0
  3068. , "Uint", pString
  3069. , "int",  -1
  3070. , "str",  sString
  3071. , "int",  nLen
  3072. , "Uint", 0
  3073. , "Uint", 0)
  3074. return sString
  3075. }
  3076. global SPECIAL_ACTION_NONE                  := 0
  3077. global SAMP_PPOOL_PLAYER_OFFSET             := 0x18
  3078. global SAMP_PPOOL_VEHICLE_OFFSET            := 0x1C
  3079. global SAMP_PPOOL_PICKUP_OFFSET             := 0x20
  3080. global SAMP_PPOOL_OBJECT_OFFSET             := 0x4
  3081. global SAMP_COLOR_OFFSET                    := 0x216378
  3082. global DIALOG_STYLE_MSGBOX                  := 0
  3083. global DIALOG_STYLE_INPUT                   := 1
  3084. global DIALOG_STYLE_LIST                    := 2
  3085. global DIALOG_STYLE_PASSWORD                := 3
  3086. global DIALOG_STYLE_TABLIST                 := 4
  3087. global DIALOG_STYLE_TABLIST_HEADERS         := 5
  3088. global SAMP_DIALOG_STRUCT_PTR               := 0x21A0B8
  3089. global SAMP_DIALOG_PTR1_OFFSET              := 0x1C
  3090. global SAMP_DIALOG_LINES_OFFSET             := 0x44C
  3091. global SAMP_DIALOG_INDEX_OFFSET             := 0x443
  3092. global SAMP_DIALOG_BUTTON_HOVERING_OFFSET   := 0x465
  3093. global SAMP_DIALOG_BUTTON_CLICKED_OFFSET    := 0x466
  3094. global SAMP_DIALOG_PTR2_OFFSET              := 0x20
  3095. global SAMP_DIALOG_LINECOUNT_OFFSET         := 0x150
  3096. global SAMP_DIALOG_OPEN_OFFSET              := 0x28
  3097. global SAMP_DIALOG_STYLE_OFFSET             := 0x2C
  3098. global SAMP_DIALOG_ID_OFFSET                := 0x30
  3099. global SAMP_DIALOG_TEXT_PTR_OFFSET          := 0x34
  3100. global SAMP_DIALOG_CAPTION_OFFSET           := 0x40
  3101. global FUNC_SAMP_SHOWDIALOG                 := 0x6B9C0
  3102. global FUNC_SAMP_CLOSEDIALOG                := 0x6C040
  3103. global SAMP_INFO_OFFSET                     := 0x21A0F8
  3104. global SAMP_PPOOLS_OFFSET                   := 0x3CD
  3105. global SAMP_PPOOL_PLAYER_OFFSET             := 0x18
  3106. global SAMP_LOCALPLAYER_OFFSET              := 0x22
  3107. global SAMP_ENGINE                          := 0x12472748
  3108. global CPed                                 := readDWORD(hGTA, 0xB6F5F0)
  3109. global functionPatches := {}
  3110. functionPatches.Push(Object("NAME", "SetPlayerName", "OFFSET", 0x01A4F0, "PATCH", 0xC390))
  3111. functionPatches.Push(Object("NAME", "SetPlayerPos", "OFFSET", 0x015970, "PATCH", 0xC390))
  3112. functionPatches.Push(Object("NAME", "SetPlayerPosFindZ", "OFFSET", 0x015A90, "PATCH", 0xC390))
  3113. functionPatches.Push(Object("NAME", "SetPlayerHealth", "OFFSET", 0x015BA0, "PATCH", 0xC390))
  3114. functionPatches.Push(Object("NAME", "TogglePlayerControllable", "OFFSET", 0x0168E0, "PATCH", 0xC390))
  3115. functionPatches.Push(Object("NAME", "PlaySound", "OFFSET", 0x016980, "PATCH", 0xC390))
  3116. functionPatches.Push(Object("NAME", "SetPlayerWorldBounds", "OFFSET", 0x016A60, "PATCH", 0xC390))
  3117. functionPatches.Push(Object("NAME", "GivePlayerMoney", "OFFSET", 0x016B50, "PATCH", 0xC390))
  3118. functionPatches.Push(Object("NAME", "SetPlayerFacingAngle", "OFFSET", 0x016BF0, "PATCH", 0xC390))
  3119. functionPatches.Push(Object("NAME", "ResetPlayerMoney", "OFFSET", 0x014780, "PATCH", 0xC390))
  3120. functionPatches.Push(Object("NAME", "ResetPlayerWeapons", "OFFSET", 0x014790, "PATCH", 0xC390))
  3121. functionPatches.Push(Object("NAME", "GivePlayerWeapon", "OFFSET", 0x016C90, "PATCH", 0xC390))
  3122. functionPatches.Push(Object("NAME", "SetVehicleParamsEx", "OFFSET", 0x00E370, "PATCH", 0xC390))
  3123. functionPatches.Push(Object("NAME", "EnterVehicle", "OFFSET", 0x00E650, "PATCH", 0xC390))
  3124. functionPatches.Push(Object("NAME", "EnterEditObject", "OFFSET", 0x00BA90, "PATCH", 0xC390))
  3125. functionPatches.Push(Object("NAME", "CancelEdit", "OFFSET", 0x00BB50, "PATCH", 0xC390))
  3126. functionPatches.Push(Object("NAME", "SetPlayerTime", "OFFSET", 0x00C4E0, "PATCH", 0xC390))
  3127. functionPatches.Push(Object("NAME", "ToggleClock", "OFFSET", 0x00C5C0, "PATCH", 0xC390))
  3128. functionPatches.Push(Object("NAME", "WorldPlayerAdd", "OFFSET", 0x00DBB0, "PATCH", 0xC390))
  3129. functionPatches.Push(Object("NAME", "SetPlayerShopName", "OFFSET", 0x014540, "PATCH", 0xC390))
  3130. functionPatches.Push(Object("NAME", "SetPlayerSkillLevel", "OFFSET", 0x00C6A0, "PATCH", 0xC390))
  3131. functionPatches.Push(Object("NAME", "SetPlayerDrunkLevel", "OFFSET", 0x015490, "PATCH", 0xC390))
  3132. functionPatches.Push(Object("NAME", "Create3DTextLabel", "OFFSET", 0x00C7D0, "PATCH", 0xC390))
  3133. functionPatches.Push(Object("NAME", "DisableCheckpoint", "OFFSET", 0x00B780, "PATCH", 0xC390))
  3134. functionPatches.Push(Object("NAME", "SetRaceCheckpoint", "OFFSET", 0x00D330, "PATCH", 0xC390))
  3135. functionPatches.Push(Object("NAME", "DisableRaceCheckpoint", "OFFSET", 0x00B790, "PATCH", 0xC390))
  3136. functionPatches.Push(Object("NAME", "GameModeRestart", "OFFSET", 0x00B830, "PATCH", 0xC390))
  3137. functionPatches.Push(Object("NAME", "PlayAudioStream", "OFFSET", 0x019990, "PATCH", 0xC390))
  3138. functionPatches.Push(Object("NAME", "StopAudioStream", "OFFSET", 0x0147E0, "PATCH", 0xC390))
  3139. functionPatches.Push(Object("NAME", "RemoveBuildingForPlayer", "OFFSET", 0x019B00, "PATCH", 0xC390))
  3140. functionPatches.Push(Object("NAME", "CreateObject", "OFFSET", 0x017980, "PATCH", 0xC390))
  3141. functionPatches.Push(Object("NAME", "SetObjectPos", "OFFSET", 0x018050, "PATCH", 0xC390))
  3142. functionPatches.Push(Object("NAME", "SetObjectRot", "OFFSET", 0x018160, "PATCH", 0xC390))
  3143. functionPatches.Push(Object("NAME", "DestroyObject", "OFFSET", 0x018260, "PATCH", 0xC390))
  3144. functionPatches.Push(Object("NAME", "DeathMessage", "OFFSET", 0x01A290, "PATCH", 0xC390))
  3145. functionPatches.Push(Object("NAME", "SetPlayerMapIcon", "OFFSET", 0x016DE0, "PATCH", 0xC390))
  3146. functionPatches.Push(Object("NAME", "RemoveVehicleComponent", "OFFSET", 0x018C00, "PATCH", 0xC390))
  3147. functionPatches.Push(Object("NAME", "Update3DTextLabel", "OFFSET", 0x00C980, "PATCH", 0xC390))
  3148. functionPatches.Push(Object("NAME", "ChatBubble", "OFFSET", 0x00CA40, "PATCH", 0xC390))
  3149. functionPatches.Push(Object("NAME", "UpdateSystemTime", "OFFSET", 0x00CFE0, "PATCH", 0xC390))
  3150. functionPatches.Push(Object("NAME", "ShowDialog", "OFFSET", 0x00CBB0, "PATCH", 0xC390))
  3151. functionPatches.Push(Object("NAME", "DestroyPickup", "OFFSET", 0x00C200, "PATCH", 0xC390))
  3152. functionPatches.Push(Object("NAME", "WeaponPickupDestroy", "OFFSET", 0x016D50, "PATCH", 0xC390))
  3153. functionPatches.Push(Object("NAME", "LinkVehicleToInterior", "OFFSET", 0x016580, "PATCH", 0xC390))
  3154. functionPatches.Push(Object("NAME", "SetPlayerArmour", "OFFSET", 0x0171A0, "PATCH", 0xC390))
  3155. functionPatches.Push(Object("NAME", "SetPlayerArmedWeapon", "OFFSET", 0x015530, "PATCH", 0xC390))
  3156. functionPatches.Push(Object("NAME", "SetSpawnInfo", "OFFSET", 0x014640, "PATCH", 0xC390))
  3157. functionPatches.Push(Object("NAME", "SetPlayerTeam", "OFFSET", 0x015D60, "PATCH", 0xC390))
  3158. functionPatches.Push(Object("NAME", "PutPlayerInVehicle", "OFFSET", 0x015C50, "PATCH", 0xC390))
  3159. functionPatches.Push(Object("NAME", "RemovePlayerFromVehicle", "OFFSET", 0x0146E0, "PATCH", 0xC390))
  3160. functionPatches.Push(Object("NAME", "SetPlayerColor", "OFFSET", 0x015E50, "PATCH", 0xC390))
  3161. functionPatches.Push(Object("NAME", "DisplayGameText", "OFFSET", 0x015F40, "PATCH", 0xC390))
  3162. functionPatches.Push(Object("NAME", "ForceClassSelection", "OFFSET", 0x0147C0, "PATCH", 0xC390))
  3163. functionPatches.Push(Object("NAME", "AttachObjectToPlayer", "OFFSET", 0x018CE0, "PATCH", 0xC390))
  3164. functionPatches.Push(Object("NAME", "InitMenu", "OFFSET", 0x018EA0, "PATCH", 0xC390))
  3165. functionPatches.Push(Object("NAME", "ShowMenu", "OFFSET", 0x019160, "PATCH", 0xC390))
  3166. functionPatches.Push(Object("NAME", "HideMenu", "OFFSET", 0x019210, "PATCH", 0xC390))
  3167. functionPatches.Push(Object("NAME", "CreateExplosion", "OFFSET", 0x018350, "PATCH", 0xC390))
  3168. functionPatches.Push(Object("NAME", "ShowPlayerNameTagForPlayer", "OFFSET", 0x018460, "PATCH", 0xC390))
  3169. functionPatches.Push(Object("NAME", "AttachCameraToObject", "OFFSET", 0x016640, "PATCH", 0xC390))
  3170. functionPatches.Push(Object("NAME", "InterpolateCamera", "OFFSET", 0x016740, "PATCH", 0xC390))
  3171. functionPatches.Push(Object("NAME", "ClickTextDraw", "OFFSET", 0x019C20, "PATCH", 0xC390))
  3172. functionPatches.Push(Object("NAME", "SetObjectMaterial", "OFFSET", 0x017CE0, "PATCH", 0xC390))
  3173. functionPatches.Push(Object("NAME", "GangZoneStopFlash", "OFFSET", 0x0198E0, "PATCH", 0xC390))
  3174. functionPatches.Push(Object("NAME", "ApplyAnimation", "OFFSET", 0x016FA0, "PATCH", 0xC390))
  3175. functionPatches.Push(Object("NAME", "ClearAnimations", "OFFSET", 0x014C70, "PATCH", 0xC390))
  3176. functionPatches.Push(Object("NAME", "SetPlayerSpecialAction", "OFFSET", 0x014D80, "PATCH", 0xC390))
  3177. functionPatches.Push(Object("NAME", "SetPlayerFightingStyle", "OFFSET", 0x014E30, "PATCH", 0xC390))
  3178. functionPatches.Push(Object("NAME", "SetPlayerVelocity", "OFFSET", 0x014F30, "PATCH", 0xC390))
  3179. functionPatches.Push(Object("NAME", "SetVehicleVelocity", "OFFSET", 0x015030, "PATCH", 0xC390))
  3180. functionPatches.Push(Object("NAME", "SetPlayerDrunkVisuals", "OFFSET", 0x015330, "PATCH", 0xC390))
  3181. functionPatches.Push(Object("NAME", "ClientMessage", "OFFSET", 0x00C050, "PATCH", 0xC390))
  3182. functionPatches.Push(Object("NAME", "SetWorldTime", "OFFSET", 0x00BFB0, "PATCH", 0xC390))
  3183. functionPatches.Push(Object("NAME", "CreatePickup", "OFFSET", 0x00C140, "PATCH", 0xC390))
  3184. functionPatches.Push(Object("NAME", "SCMEvent", "OFFSET", 0x00C340, "PATCH", 0xC390))
  3185. functionPatches.Push(Object("NAME", "SetVehicleTireStatus", "OFFSET", 0x015250, "PATCH", 0xC390))
  3186. functionPatches.Push(Object("NAME", "MoveObject", "OFFSET", 0x018540, "PATCH", 0xC390))
  3187. functionPatches.Push(Object("NAME", "Chat", "OFFSET", 0x00EEA0, "PATCH", 0xC390))
  3188. functionPatches.Push(Object("NAME", "SrvNetStats", "OFFSET", 0x00B7A0, "PATCH", 0xC390))
  3189. functionPatches.Push(Object("NAME", "ClientCheck", "OFFSET", 0x00EAF0, "PATCH", 0xC390))
  3190. functionPatches.Push(Object("NAME", "EnableStuntBonusForPlayer", "OFFSET", 0x014440, "PATCH", 0xC390))
  3191. functionPatches.Push(Object("NAME", "TextDrawSetString", "OFFSET", 0x019540, "PATCH", 0xC390))
  3192. functionPatches.Push(Object("NAME", "DamageVehicle", "OFFSET", 0x00E240, "PATCH", 0xC390))
  3193. functionPatches.Push(Object("NAME", "SetCheckpoint", "OFFSET", 0x00D220, "PATCH", 0xC390))
  3194. functionPatches.Push(Object("NAME", "GangZoneCreate", "OFFSET", 0x019650, "PATCH", 0xC390))
  3195. functionPatches.Push(Object("NAME", "PlayCrimeReport", "OFFSET", 0x015720, "PATCH", 0xC390))
  3196. functionPatches.Push(Object("NAME", "SetPlayerAttachedObject", "OFFSET", 0x0155E0, "PATCH", 0xC390))
  3197. functionPatches.Push(Object("NAME", "EditAttachedObject", "OFFSET", 0x00E860, "PATCH", 0xC390))
  3198. functionPatches.Push(Object("NAME", "EditObject", "OFFSET", 0x00E920, "PATCH", 0xC390))
  3199. functionPatches.Push(Object("NAME", "GangZoneDestroy", "OFFSET", 0x019770, "PATCH", 0xC390))
  3200. functionPatches.Push(Object("NAME", "GangZoneFlash", "OFFSET", 0x019820, "PATCH", 0xC390))
  3201. functionPatches.Push(Object("NAME", "StopObject", "OFFSET", 0x0186F0, "PATCH", 0xC390))
  3202. functionPatches.Push(Object("NAME", "SetNumberPlate", "OFFSET", 0x018870, "PATCH", 0xC390))
  3203. functionPatches.Push(Object("NAME", "TogglePlayerSpectating", "OFFSET", 0x018990, "PATCH", 0xC390))
  3204. functionPatches.Push(Object("NAME", "PlayerSpectatePlayer", "OFFSET", 0x018A40, "PATCH", 0xC390))
  3205. functionPatches.Push(Object("NAME", "PlayerSpectateVehicle", "OFFSET", 0x018B20, "PATCH", 0xC390))
  3206. functionPatches.Push(Object("NAME", "RequestClass", "OFFSET", 0x00D080, "PATCH", 0xC390))
  3207. functionPatches.Push(Object("NAME", "RequestSpawn", "OFFSET", 0x00D150, "PATCH", 0xC390))
  3208. functionPatches.Push(Object("NAME", "SetPlayerWantedLevel", "OFFSET", 0x0192C0, "PATCH", 0xC390))
  3209. functionPatches.Push(Object("NAME", "ShowTextDraw", "OFFSET", 0x019360, "PATCH", 0xC390))
  3210. functionPatches.Push(Object("NAME", "TextDrawHideForPlayer", "OFFSET", 0x019490, "PATCH", 0xC390))
  3211. functionPatches.Push(Object("NAME", "ServerJoin", "OFFSET", 0x00CDA0, "PATCH", 0xC390))
  3212. functionPatches.Push(Object("NAME", "ServerQuit", "OFFSET", 0x00CF20, "PATCH", 0xC390))
  3213. functionPatches.Push(Object("NAME", "InitGame", "OFFSET", 0x00D710, "PATCH", 0xC390))
  3214. functionPatches.Push(Object("NAME", "RemovePlayerMapIcon", "OFFSET", 0x016F00, "PATCH", 0xC390))
  3215. functionPatches.Push(Object("NAME", "SetPlayerAmmo", "OFFSET", 0x017250, "PATCH", 0xC390))
  3216. functionPatches.Push(Object("NAME", "SetPlayerGravity", "OFFSET", 0x017310, "PATCH", 0xC390))
  3217. functionPatches.Push(Object("NAME", "SetVehicleHealth", "OFFSET", 0x0173B0, "PATCH", 0xC390))
  3218. functionPatches.Push(Object("NAME", "AttachTrailerToVehicle", "OFFSET", 0x017490, "PATCH", 0xC390))
  3219. functionPatches.Push(Object("NAME", "DetachTrailerFromVehicle", "OFFSET", 0x0175D0, "PATCH", 0xC390))
  3220. functionPatches.Push(Object("NAME", "SetPlayerDrunkHandling", "OFFSET", 0x0153E0, "PATCH", 0xC390))
  3221. functionPatches.Push(Object("NAME", "DestroyPickups", "OFFSET", 0x00C2A0, "PATCH", 0xC390))
  3222. functionPatches.Push(Object("NAME", "SetWeather", "OFFSET", 0x00C430, "PATCH", 0xC390))
  3223. functionPatches.Push(Object("NAME", "SetPlayerSkin", "OFFSET", 0x015860, "PATCH", 0xC390))
  3224. functionPatches.Push(Object("NAME", "ExitVehicle", "OFFSET", 0x00E770, "PATCH", 0xC390))
  3225. functionPatches.Push(Object("NAME", "UpdateScoresPingsIPs", "OFFSET", 0x00D490, "PATCH", 0xC390))
  3226. functionPatches.Push(Object("NAME", "SetPlayerInterior", "OFFSET", 0x016050, "PATCH", 0xC390))
  3227. functionPatches.Push(Object("NAME", "SetPlayerCameraPos", "OFFSET", 0x0160F0, "PATCH", 0xC390))
  3228. functionPatches.Push(Object("NAME", "SetPlayerCameraLookAt", "OFFSET", 0x0161C0, "PATCH", 0xC390))
  3229. functionPatches.Push(Object("NAME", "SetVehiclePos", "OFFSET", 0x0162C0, "PATCH", 0xC390))
  3230. functionPatches.Push(Object("NAME", "SetVehicleZAngle", "OFFSET", 0x0163D0, "PATCH", 0xC390))
  3231. functionPatches.Push(Object("NAME", "SetVehicleParamsForPlayer", "OFFSET", 0x0164B0, "PATCH", 0xC390))
  3232. functionPatches.Push(Object("NAME", "SetCameraBehindPlayer", "OFFSET", 0x014770, "PATCH", 0xC390))
  3233. functionPatches.Push(Object("NAME", "WorldPlayerRemove", "OFFSET", 0x00DEA0, "PATCH", 0xC390))
  3234. functionPatches.Push(Object("NAME", "WorldVehicleAdd", "OFFSET", 0x00B850, "PATCH", 0xC390))
  3235. functionPatches.Push(Object("NAME", "WorldVehicleRemove", "OFFSET", 0x00DF70, "PATCH", 0xC390))
  3236. functionPatches.Push(Object("NAME", "WorldPlayerDeath", "OFFSET", 0x00DDE0, "PATCH", 0xC390))
  3237. CPed(matrix){
  3238. If(!SAMP())
  3239. return false
  3240. If(!matrix)
  3241. return readDWORD(hGTA, ADDR_CPED_PTR)
  3242. else return Matrix(readDWORD(hGTA, ADDR_CPED_PTR))
  3243. }
  3244. LocalPlayer(){
  3245. If(!SAMP())
  3246. return false
  3247. return readDWORD(hGTA, SAMP_pPool("Player") + OFFSET_CPED_LOCALPLAYER)
  3248. }
  3249. Vehicle(matrix){
  3250. If(!SAMP())
  3251. return false
  3252. If(!matrix)
  3253. return readDWORD(hGTA, ADDR_VEHICLE_PTR)
  3254. else return Matrix(readDWORD(hGTA, ADDR_VEHICLE_PTR))
  3255. }
  3256. Matrix(pointer){
  3257. If(!SAMP())
  3258. return false
  3259. return readDWORD(hGTA, pointer + OFFSET_MATRIX)
  3260. }
  3261. InfoOffset(settings){
  3262. If(!SAMP())
  3263. return false
  3264. If(!settings)
  3265. return readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET)
  3266. else return readDWORD(hGTA, readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET) + SAMP_SETTINGS_OFFSET)
  3267. }
  3268. SAMP_pPool(pool){
  3269. If(!SAMP())
  3270. return false
  3271. If(pool == "Player")
  3272. pool := SAMP_PPOOL_PLAYER_OFFSET
  3273. else if(pool == "Vehicle")
  3274. pool := SAMP_PPOOL_VEHICLE_OFFSET
  3275. else if(pool == "Pickup")
  3276. pool := SAMP_PPOOL_PICKUP_OFFSET
  3277. else if(pool == "Object")
  3278. pool := SAMP_PPOOL_OBJECT_OFFSET
  3279. return readDWORD(hGTA, readDWORD(hGTA, InfoOffset(0) + SAMP_PPOOLS_OFFSET) + pool)
  3280. }
  3281. GetPositionByPed(ped){
  3282. If(!SAMP())
  3283. return false
  3284. pMatrix := Matrix(ped)
  3285. return [readFloat(hGTA, pMatrix + OFFSET_POSX), readFloat(hGTA, pMatrix + OFFSET_POSY), readFloat(hGTA, pMatrix+ OFFSET_POSZ)]
  3286. }
  3287. GetPlayerHP(){
  3288. If(!SAMP())
  3289. return false
  3290. return Round(readFloat(hGTA, mainCPED + OFFSET_CPED_HP))
  3291. }
  3292. GetPlayerRotation(){
  3293. If(!SAMP())
  3294. return false
  3295. return [readFloat(hGTA, mainMatrix + OFFSET_ROTATION_X), readFloat(hGTA, mainMatrix + OFFSET_ROTATION_Y)]
  3296. }
  3297. GetPlayerTargetRotation(){
  3298. If(!SAMP())
  3299. return false
  3300. return readFloat(hGTA, mainCPED + OFFSET_CPED_ZANGLE)
  3301. }
  3302. GetLastVehiclePointer(){
  3303. If(!SAMP())
  3304. return false
  3305. return readDWORD(hGTA, mainCPED + OFFSET_VEH_LASTVEH)
  3306. }
  3307. GetPlayersInVehicle(){
  3308. If(!SAMP())
  3309. return false
  3310. dw := Vehicle(0)
  3311. return [getIdByPed(readDWORD(hGTA, dw + 0x460)),getIdByPed(readDWORD(hGTA, dw + 0x464)),getIdByPed(readDWORD(hGTA, dw + 0x468)),getIdByPed(readDWORD(hGTA, dw + 0x46C))]
  3312. }
  3313. IsCarLocked(){
  3314. If(!SAMP())
  3315. return false
  3316. return (readDWORD(hGTA, Vehicle(0) + ADDR_VEHICLE_DOORSTATE) == 2)
  3317. }
  3318. GetCarSpeed() {
  3319. If(!SAMP())
  3320. return false
  3321. dwVeh := Vehicle(0)
  3322. fSpeedX := readFloat(hGTA, dwVeh + OFFSET_VEH_SPEED_X)
  3323. fSpeedY := readFloat(hGTA, dwVeh + OFFSET_VEH_SPEED_Y)
  3324. fSpeedZ := readFloat(hGTA, dwVeh + OFFSET_VEH_SPEED_Y)
  3325. return Round((SQRT((fSpeedX * fSpeedX) + (fSpeedY * fSpeedY) + (fSpeedZ * fSpeedZ)) *100) *1.61)
  3326. }
  3327. GetUsername() {
  3328. If(!SAMP())
  3329. return false
  3330. return readString(hGTA, dwSAMP + ADDR_SAMP_USERNAME, 25)
  3331. }
  3332. getPlayerColor(playerid){
  3333. if(!SAMP())
  3334. return false
  3335. idColor := readDWORD(hGTA, dwSAMP + SAMP_COLOR_OFFSET + 4 * playerid)
  3336. hex := IntToHex(idColor)
  3337. rgbhex := SubStr(IntToHex(idColor), 3, 6)
  3338. return rgbhex
  3339. }
  3340. AntiCrash(){
  3341. If(!SAMP())
  3342. return false
  3343. cReport := ADDR_SAMP_CRASHREPORT
  3344. writeMemory(hGTA, dwSAMP + cReport, 0x90909090, 4)
  3345. cReport += 0x4
  3346. writeMemory(hGTA, dwSAMP + cReport, 0x90, 1)
  3347. cReport += 0x9
  3348. writeMemory(hGTA, dwSAMP + cReport, 0x90909090, 4)
  3349. cReport += 0x4
  3350. writeMemory(hGTA, dwSAMP + cReport, 0x90, 1)
  3351. }
  3352. SetHudEnabled(toggle){
  3353. If(!SAMP())
  3354. return false
  3355. writeMemory(hGTA, 0xA444A0, toggle, 1, "UChar")
  3356. }
  3357. ChangeInterfaceColor(id, color){
  3358. If(!SAMP())
  3359. return false
  3360. dwAddr := 0xBAB22C
  3361. dw := 4 * id, dwAddr += dw
  3362. writeMemory(hGTA, dwAddr, 0xFFFFFFFF, 4, "Int")
  3363. }
  3364. SetPercentageHealthAndArmor(toggle){
  3365. If(!SAMP())
  3366. return false
  3367. writeMemory(hGTA, 0x589355, toggle, 1, "UChar")
  3368. writeMemory(hGTA, 0x589131, toggle, 1, "UChar")
  3369. }
  3370. UpdateTextdrawPool(){
  3371. global
  3372. if(!SAMP())
  3373. return 0
  3374. strData := []
  3375. dwAddress := readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET)
  3376. dwAddress := readDWORD(hGTA, dwAddress + SAMP_PPOOLS_OFFSET)
  3377. dwTextDraws := readDWORD(hGTA, dwAddress + 0x10)
  3378. Loop, % SAMP_MAX_TEXTDRAWS
  3379. {
  3380. i := A_Index-1
  3381. iIsListed := readDWORD(hGTA, dwTextDraws + i * 0x4)
  3382. If(iIsListed == 0)
  3383. continue
  3384. dwAddr := readDWORD(hGTA, dwTextDraws + 0x2400 + i * 0x4)
  3385. If(dwAddr == 0)
  3386. continue
  3387. strOUT := readString(hGTA, dwAddr, 256)
  3388. if(strOUT == 0)
  3389. continue
  3390. strData[i] := strOUT
  3391. }
  3392. }
  3393. CountStreamedVehicles(){
  3394. If(!SAMP())
  3395. return false
  3396. iCount := 0
  3397. for i, o in oVehiclePoolData
  3398. iCount++
  3399. return iCount
  3400. }
  3401. CountTextraws(){
  3402. If(!SAMP())
  3403. return false
  3404. if(!UpdateTextdrawPool())
  3405. return -1
  3406. iCount := 0
  3407. for i, o in strData
  3408. iCount++
  3409. return iCount
  3410. }
  3411. getPedById(dwId) {
  3412. dwId += 0
  3413. dwId := Floor(dwId)
  3414. if(dwId < 0 || dwId >= SAMP_PLAYER_MAX)
  3415. return 0
  3416. if(iRefreshScoreboard+iUpdateTick > A_TickCount)
  3417. {
  3418. if(oScoreboardData[dwId])
  3419. {
  3420. if(oScoreboardData[dwId].HasKey("PED"))
  3421. return oScoreboardData[dwId].PED
  3422. }
  3423. return 0
  3424. }
  3425. if(oScoreboardData[dwId])
  3426. {
  3427. if(oScoreboardData[dwId].HasKey("PED"))
  3428. return oScoreboardData[dwId].PED
  3429. }
  3430. return 0
  3431. }
  3432. getIdByPed(dwPed) {
  3433. dwPed += 0
  3434. dwPed := Floor(dwPed)
  3435. if(!dwPed)
  3436. return -1
  3437. if(iRefreshScoreboard+iUpdateTick > A_TickCount)
  3438. {
  3439. For i, o in oScoreboardData
  3440. {
  3441. if(o.HasKey("PED"))
  3442. {
  3443. if(o.PED==dwPed)
  3444. return i
  3445. }
  3446. }
  3447. return -1
  3448. }
  3449. For i, o in oScoreboardData
  3450. {
  3451. if(o.HasKey("PED"))
  3452. {
  3453. if(o.PED==dwPed)
  3454. return i
  3455. }
  3456. }
  3457. return -1
  3458. }
  3459. getPlayerScoreById(dwId) {
  3460. dwId += 0
  3461. dwId := Floor(dwId)
  3462. if(dwId < 0 || dwId >= SAMP_PLAYER_MAX)
  3463. return ""
  3464. if(iRefreshScoreboard+iUpdateTick > A_TickCount)
  3465. {
  3466. if(oScoreboardData[dwId])
  3467. return oScoreboardData[dwId].SCORE
  3468. return ""
  3469. }
  3470. if(oScoreboardData[dwId])
  3471. return oScoreboardData[dwId].SCORE
  3472. return ""
  3473. }
  3474. getPlayerPingById(dwId) {
  3475. dwId += 0
  3476. dwId := Floor(dwId)
  3477. if(dwId < 0 || dwId >= SAMP_PLAYER_MAX)
  3478. return -1
  3479. if(iRefreshScoreboard+iUpdateTick > A_TickCount)
  3480. {
  3481. if(oScoreboardData[dwId])
  3482. return oScoreboardData[dwId].PING
  3483. return -1
  3484. }
  3485. if(oScoreboardData[dwId])
  3486. return oScoreboardData[dwId].PING
  3487. return -1
  3488. }
  3489. isNPCById(dwId) {
  3490. dwId += 0
  3491. dwId := Floor(dwId)
  3492. if(dwId < 0 || dwId >= SAMP_PLAYER_MAX)
  3493. return -1
  3494. if(iRefreshScoreboard+iUpdateTick > A_TickCount)
  3495. {
  3496. if(oScoreboardData[dwId])
  3497. return oScoreboardData[dwId].ISNPC
  3498. return -1
  3499. }
  3500. if(oScoreboardData[dwId])
  3501. return oScoreboardData[dwId].ISNPC
  3502. return -1
  3503. }
  3504. StableVehicleCam()
  3505. {
  3506. If(IsPlayerInAnyVehicle() && WinActive("GTA:SA:MP"))
  3507. {
  3508. DllCall("mouse_event", uint,1, int,1, int,0, uint,0, int,0)
  3509. sleep, 3
  3510. DllCall("mouse_event", uint,1, int,-1, int,0, uint,0, int,0)
  3511. }
  3512. }
  3513. UnlockFPS(){
  3514. If(!SAMP())
  3515. return false
  3516. writeMemory(hGTA, dwSAMP + ADDR_SAMP_FPSUNLOCK, 0x5051FF15, 4, "UChar")
  3517. }
  3518. GetTargetPed(){
  3519. If(!SAMP())
  3520. return false
  3521. return readDWORD(hGTA, readDWORD(hGTA, ADDR_WEAPON_TARGET) + OFFSET_CPED_OTARGET)
  3522. }
  3523. GetCameraPosition(writeable=0){
  3524. If(!SAMP())
  3525. return false
  3526. If(!writeable)
  3527. return [readFloat(hGTA, ADDR_CAMERA_POS_X), readFloat(hGTA, ADDR_CAMERA_POS_Y)]
  3528. else return readFloat(hGTA, ADDR_CAMERA_CURR_X)
  3529. }
  3530. GetCameraRotation(){
  3531. If(!SAMP())
  3532. return false
  3533. return readFloat(hGTA, ADDR_CAMERA_ROTATION)
  3534. }
  3535. GetCameraXAngle(){
  3536. If(!SAMP())
  3537. return false
  3538. angle := 0
  3539. angle := 360 + atan2(readFloat(hGTA, ADDR_CAMERA_ANGLE_X), readFloat(hGTA, ADDR_CAMERA_ANGLE_Y) *180/PI)
  3540. If(angle > 360.0)
  3541. angle -= 360.0
  3542. return angle
  3543. }
  3544. GetCameraZAngle(){
  3545. If(!SAMP())
  3546. return false
  3547. val := readFloat(hGTA, 0x00B6F248)
  3548. if(val > -1.2 & val < 1.2)
  3549. return val
  3550. }
  3551. IntToHex(int){
  3552. CurrentFormat := A_FormatInteger
  3553. SetFormat, integer, hex
  3554. int += 0
  3555. SetFormat, integer, %CurrentFormat%
  3556. return int
  3557. }
  3558. getDist(pos1,pos2) {
  3559. if(!pos1 || !pos2)
  3560. return 0
  3561. return Sqrt((pos1[1]-pos2[1])*(pos1[1]-pos2[1])+(pos1[2]-pos2[2])*(pos1[2]-pos2[2])+(pos1[3]-pos2[3])*(pos1[3]-pos2[3]))
  3562. }
  3563. atan2(x, y) {
  3564. Return dllcall("msvcrt\atan2","Double",y, "Double",x, "CDECL Double")
  3565. }
  3566. tobin(byref addr, str)
  3567. {
  3568. if(!RegExMatch(str,"^([a-fA-F0-9][a-fA-F0-9])*$"))
  3569. {
  3570. msgbox % "fail tobin"
  3571. return
  3572. }
  3573. i:=Strlen(str)/2
  3574. VarSetCapacity(addr, i)
  3575. dataddr := &addr
  3576. x:=""
  3577. loop,parse,str
  3578. {
  3579. if(A_Index & 1)
  3580. x := A_Loopfield
  3581. else
  3582. {
  3583. DllCall("RtlFillMemory"
  3584. , "UInt", dataddr
  3585. , "UInt", 1
  3586. , "UChar", "0x" x A_Loopfield)
  3587. dataddr++
  3588. }
  3589. }
  3590. }
  3591. getVehicleSpeed2() {
  3592. if(!checkHandles())
  3593. return -1
  3594. dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
  3595. if(ErrorLevel) {
  3596. ErrorLevel := ERROR_READ_MEMORY
  3597. return ""
  3598. }
  3599. fSpeedX := readMem(hGTA, dwAddr + ADDR_VEHICLE_X, 4, "float")
  3600. fSpeedY := readMem(hGTA, dwAddr + ADDR_VEHICLE_Y, 4, "float")
  3601. fSpeedZ := readMem(hGTA, dwAddr + ADDR_VEHICLE_Z, 4, "float")
  3602. fVehicleSpeed :=  sqrt((fSpeedX * fSpeedX) + (fSpeedY * fSpeedY) + (fSpeedZ * fSpeedZ))
  3603. fVehicleSpeed := (fVehicleSpeed * 100) * 1.43
  3604. return fVehicleSpeed
  3605. }
  3606. stringMath(string) {
  3607. while(position := RegExMatch(string, "\(([^\(\)]+)\)", regex_)) {
  3608. string := RegExReplace(string, "\(([^\(\)]+)\)", stringMath(regex_1), blahblah, 1, position)
  3609. }
  3610. while(position := RegExMatch(string, "(\+|-)? *((?:\+|-)?\d+)\^((?:\+|-)?\d+)", regex_)) {
  3611. string := RegExReplace(string, "(\+|-)? *((?:\+|-)?\d+)\^((?:\+|-)?\d+)", regex_1 . regex_2**regex_3, blahblah, 1, position)
  3612. }
  3613. while(position := RegExMatch(string, "(\+|-)? *((?:\+|-)?\d+(?:[\.\,]\d+)?) *(\*|/) *((?:\+|-)?\d+(?:[\.\,]\d+)?) *", regex_)) {
  3614. if(regex_3 == "*")
  3615. string := RegExReplace(string, "(\+|-)? *((?:\+|-)?\d+(?:[\.\,]\d+)?) *\* *((?:\+|-)?\d+(?:[\.\,]\d+)?) *", regex_1 . regex_2*regex_4, blahblah, 1, position)
  3616. if(regex_3 == "/")
  3617. string := RegExReplace(string, "(\+|-)? *((?:\+|-)?\d+(?:[\.\,]\d+)?) */ *((?:\+||)?\d+(?:[\.\,]\d+)?) *", regex_1 . regex_2/regex_4, blahblah, 1, position)
  3618. }
  3619. while(position := RegExMatch(string, " *((?:\+|-)?\d+(?:[\.\,]\d+)?) *(\+|-) *((?:\+|-)?\d+(?:[\.\,]\d+)?) *", regex_)) {
  3620. if(regex_2 == "+")
  3621. string := RegExReplace(string, " *((?:\+|-)?\d+(?:[\.\,]\d+)?) *\+ *((?:\+|-)?\d+(?:[\.\,]\d+)?) *", regex_1+regex_3, blahblah, 1, position)
  3622. if(regex_2 == "-")
  3623. string := RegExReplace(string, " *((?:\+|-)?\d+(?:[\.\,]\d+)?) *- *((?:\+|-)?\d+(?:[\.\,]\d+)?) *", regex_1-regex_3, blahblah, 1, position)
  3624. }
  3625. if(RegExMatch(string, "^-?\d+(?:\.\d+)?$"))
  3626. return string
  3627. return "ERROR"
  3628. }
  3629. PlayerInput(text){
  3630. s := A_IsSuspended
  3631. Suspend On
  3632. KeyWait Enter
  3633. BlockChatInput(block)
  3634. SendInput t^a{backspace}%text%
  3635. Input, var, v, {enter}
  3636. SendInput ^a{backspace 100}{enter}
  3637. Sleep, 20
  3638. BlockChatInput(unblock)
  3639. if(!s)
  3640. Suspend Off
  3641. return var
  3642. }
  3643. getWeaponName(id) {
  3644. weapons := {0: "Faust", 1: "Schlagring", 2: "Golfschläger", 3: "Schlagstock", 4: "Messer", 5: "Baseball Schläger", 6: "Schaufel", 7: "Billiardstick", 8: "Katana", 9: "Kettensäge", 10: "Lila Dildo", 11: "Dildo", 12: "Vibrator", 13: "Silber Vibrator", 14: "Blumen", 15: "Kanne", 16: "Granate", 17: "Tränen Gas", 18: "Molotov Cocktail", 22: "9mm", 23: "Silenced 9mm", 24: "Desert Eagle", 25: "Shotgun", 26: "Sawnoff Shotgun", 27: "Combat Shotgun", 28: "Micro SMG", 29: "MP5", 30: "AK-47", 31: "M4", 32: "Tec-9", 33: "Country Rifle", 34: "Sniper", 35: "RPG", 36: "HS Rocket", 37: "Flammenwerfer", 38: "Minigun", 39: "Satchel Charge", 40: "Zünder", 41: "Sprühdose", 42: "Feuerlöscher", 43: "Kamera", 44: "Nachtsichtgerät", 45: "Thermal Brille", 46: "Fallschirm", 47: "Fake Pistole", 49: "Fahrzeug", 50: "Helikopter", 51: "Explosion", 53: "Drowned", 54: "Splat", 255: "Suicide"}
  3645. if(weapons[id]) {
  3646. return weapons[id]
  3647. }
  3648. return "Unbekannt"
  3649. }
  3650. getPlayerColorById(playerid){
  3651. if(!checkHandles())
  3652. return false
  3653. idColor := readDWORD(hGTA, dwSAMP + SAMP_COLOR_OFFSET + 4 * playerid)
  3654. rgbhex := SubStr(IntToHex(idColor), 3, 6)
  3655. StringUpper, playercolor, rgbhex
  3656. return playercolor
  3657. }
  3658. SendClearMessage(anzahl)
  3659. {
  3660. loop, %anzahl%
  3661. {
  3662. AddChatMessage(" ")
  3663. }
  3664. }
  3665. getKilledPlayers(bReset := false) {
  3666. if (!checkHandles() || !updateOScoreboardData())
  3667. return -1
  3668. kills := []
  3669. for i, o in oScoreboardData {
  3670. if (!o.PED || o.HP > 0 || o.ISNPC)
  3671. continue
  3672. dwMurderer := readDWORD(hGTA, o.PED + 0x764)
  3673. if (!dwMurderer)
  3674. continue
  3675. dwLocalPED := readDWORD(hGTA, ADDR_CPED_PTR)
  3676. if (dwLocalPED != dwMurderer)
  3677. continue
  3678. weapon := readMem(hGTA, o.PED + 0x760, 4, "UInt")
  3679. if (bReset)
  3680. writeMemory(hGTA, o.PED + 0x764, 0, "UInt", 4)
  3681. kills.Push(Object("ID", o.ID, "WEAPON", weapon))
  3682. }
  3683. return kills
  3684. }
  3685. updateScoreboardDataEx() {
  3686. if(!checkHandles())
  3687. return false
  3688. dwAddress := readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET)
  3689. if(ErrorLevel || dwAddress==0) {
  3690. ErrorLevel := ERROR_READ_MEMORY
  3691. return false
  3692. }
  3693. dwFunc := dwSAMP + FUNC_UPDATESCOREBOARD
  3694. VarSetCapacity(injectData, 11, 0)
  3695. NumPut(0xB9, injectData, 0, "UChar")
  3696. NumPut(dwAddress, injectData, 1, "UInt")
  3697. NumPut(0xE8, injectData, 5, "UChar")
  3698. offset := dwFunc - (pInjectFunc + 10)
  3699. NumPut(offset, injectData, 6, "Int")
  3700. NumPut(0xC3, injectData, 10, "UChar")
  3701. writeRaw(hGTA, pInjectFunc, &injectData, 11)
  3702. if(ErrorLevel)
  3703. return false
  3704. hThread := createRemoteThread(hGTA, 0, 0, pInjectFunc, 0, 0, 0)
  3705. if(ErrorLevel)
  3706. return false
  3707. waitForSingleObject(hThread, 0xFFFFFFFF)
  3708. closeProcess(hThread)
  3709. return true
  3710. }
  3711. updateOScoreboardData() {
  3712. if(!checkHandles())
  3713. return 0
  3714. oScoreboardData := []
  3715. if(!updateScoreboardDataEx())
  3716. return 0
  3717. iRefreshScoreboard := A_TickCount
  3718. dwAddress := readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET)
  3719. if(ErrorLevel || dwAddress==0) {
  3720. ErrorLevel := ERROR_READ_MEMORY
  3721. return 0
  3722. }
  3723. dwAddress := readDWORD(hGTA, dwAddress + SAMP_PPOOLS_OFFSET)
  3724. if(ErrorLevel || dwAddress==0) {
  3725. ErrorLevel := ERROR_READ_MEMORY
  3726. return 0
  3727. }
  3728. dwPlayers := readDWORD(hGTA, dwAddress + SAMP_PPOOL_PLAYER_OFFSET)
  3729. if(ErrorLevel || dwPlayers==0) {
  3730. ErrorLevel := ERROR_READ_MEMORY
  3731. return 0
  3732. }
  3733. wID := readMem(hGTA, dwPlayers + SAMP_SLOCALPLAYERID_OFFSET, 2, "Short")
  3734. if(ErrorLevel) {
  3735. ErrorLevel := ERROR_READ_MEMORY
  3736. return 0
  3737. }
  3738. dwPing := readMem(hGTA, dwPlayers + SAMP_ILOCALPLAYERPING_OFFSET, 4, "Int")
  3739. if(ErrorLevel) {
  3740. ErrorLevel := ERROR_READ_MEMORY
  3741. return 0
  3742. }
  3743. dwScore := readMem(hGTA, dwPlayers + SAMP_ILOCALPLAYERSCORE_OFFSET, 4, "Int")
  3744. if(ErrorLevel) {
  3745. ErrorLevel := ERROR_READ_MEMORY
  3746. return 0
  3747. }
  3748. dwTemp := readMem(hGTA, dwPlayers + SAMP_ISTRLEN_LOCALPLAYERNAME_OFFSET, 4, "Int")
  3749. if(ErrorLevel) {
  3750. ErrorLevel := ERROR_READ_MEMORY
  3751. return 0
  3752. }
  3753. sUsername := ""
  3754. if(dwTemp <= 0xf) {
  3755. sUsername := readString(hGTA, dwPlayers + SAMP_SZLOCALPLAYERNAME_OFFSET, 16)
  3756. if(ErrorLevel) {
  3757. ErrorLevel := ERROR_READ_MEMORY
  3758. return 0
  3759. }
  3760. }
  3761. else {
  3762. dwAddress := readDWORD(hGTA, dwPlayers + SAMP_PSZLOCALPLAYERNAME_OFFSET)
  3763. if(ErrorLevel) {
  3764. ErrorLevel := ERROR_READ_MEMORY
  3765. return 0
  3766. }
  3767. sUsername := readString(hGTA, dwAddress, 25)
  3768. if(ErrorLevel) {
  3769. ErrorLevel := ERROR_READ_MEMORY
  3770. return 0
  3771. }
  3772. }
  3773. oScoreboardData[wID] := Object("NAME", sUsername, "ID", wID, "PING", dwPing, "SCORE", dwScore, "ISNPC", 0)
  3774. Loop, % SAMP_PLAYER_MAX
  3775. {
  3776. i := A_Index-1
  3777. dwRemoteplayer := readDWORD(hGTA, dwPlayers+SAMP_PREMOTEPLAYER_OFFSET+i*4)
  3778. if(ErrorLevel) {
  3779. ErrorLevel := ERROR_READ_MEMORY
  3780. return 0
  3781. }
  3782. if(dwRemoteplayer==0)
  3783. continue
  3784. dwPing := readMem(hGTA, dwRemoteplayer + SAMP_IPING_OFFSET, 4, "Int")
  3785. if(ErrorLevel) {
  3786. ErrorLevel := ERROR_READ_MEMORY
  3787. return 0
  3788. }
  3789. dwScore := readMem(hGTA, dwRemoteplayer + SAMP_ISCORE_OFFSET, 4, "Int")
  3790. if(ErrorLevel) {
  3791. ErrorLevel := ERROR_READ_MEMORY
  3792. return 0
  3793. }
  3794. dwIsNPC := readMem(hGTA, dwRemoteplayer + SAMP_ISNPC_OFFSET, 4, "Int")
  3795. if(ErrorLevel) {
  3796. ErrorLevel := ERROR_READ_MEMORY
  3797. return 0
  3798. }
  3799. dwTemp := readMem(hGTA, dwRemoteplayer + SAMP_ISTRLENNAME___OFFSET, 4, "Int")
  3800. if(ErrorLevel) {
  3801. ErrorLevel := ERROR_READ_MEMORY
  3802. return 0
  3803. }
  3804. sUsername := ""
  3805. if(dwTemp <= 0xf)
  3806. {
  3807. sUsername := readString(hGTA, dwRemoteplayer+SAMP_SZPLAYERNAME_OFFSET, 16)
  3808. if(ErrorLevel) {
  3809. ErrorLevel := ERROR_READ_MEMORY
  3810. return 0
  3811. }
  3812. }
  3813. else {
  3814. dwAddress := readDWORD(hGTA, dwRemoteplayer + SAMP_PSZPLAYERNAME_OFFSET)
  3815. if(ErrorLevel || dwAddress==0) {
  3816. ErrorLevel := ERROR_READ_MEMORY
  3817. return 0
  3818. }
  3819. sUsername := readString(hGTA, dwAddress, 25)
  3820. if(ErrorLevel) {
  3821. ErrorLevel := ERROR_READ_MEMORY
  3822. return 0
  3823. }
  3824. }
  3825. o := Object("NAME", sUsername, "ID", i, "PING", dwPing, "SCORE", dwScore, "ISNPC", dwIsNPC)
  3826. oScoreboardData[i] := o
  3827. dwRemoteplayerData := readDWORD(hGTA, dwRemoteplayer + 0x0)
  3828. if(ErrorLevel) {
  3829. ErrorLevel := ERROR_READ_MEMORY
  3830. return 0
  3831. }
  3832. if(dwRemoteplayerData==0)
  3833. continue
  3834. dwAddress := readDWORD(hGTA, dwRemoteplayerData + 489)
  3835. if(ErrorLevel) {
  3836. ErrorLevel := ERROR_READ_MEMORY
  3837. return 0
  3838. }
  3839. if(dwAddress)
  3840. {
  3841. ix := readMem(hGTA, dwRemoteplayerData + 493, 4, "Int")
  3842. if(ErrorLevel) {
  3843. ErrorLevel := ERROR_READ_MEMORY
  3844. return 0
  3845. }
  3846. iy := readMem(hGTA, dwRemoteplayerData + 497, 4, "Int")
  3847. if(ErrorLevel) {
  3848. ErrorLevel := ERROR_READ_MEMORY
  3849. return 0
  3850. }
  3851. iz := readMem(hGTA, dwRemoteplayerData + 501, 4, "Int")
  3852. if(ErrorLevel) {
  3853. ErrorLevel := ERROR_READ_MEMORY
  3854. return 0
  3855. }
  3856. o.MPOS := [ix, iy, iz]
  3857. }
  3858. dwpSAMP_Actor := readDWORD(hGTA, dwRemoteplayerData + 0x0)
  3859. if(ErrorLevel) {
  3860. ErrorLevel := ERROR_READ_MEMORY
  3861. return 0
  3862. }
  3863. if(dwpSAMP_Actor==0)
  3864. continue
  3865. dwPed := readDWORD(hGTA, dwpSAMP_Actor + 676)
  3866. if(ErrorLevel) {
  3867. ErrorLevel := ERROR_READ_MEMORY
  3868. return 0
  3869. }
  3870. if(dwPed==0)
  3871. continue
  3872. o.PED := dwPed
  3873. fHP := readFloat(hGTA, dwRemoteplayerData + 444)
  3874. if(ErrorLevel) {
  3875. ErrorLevel := ERROR_READ_MEMORY
  3876. return 0
  3877. }
  3878. fARMOR := readFloat(hGTA, dwRemoteplayerData + 440)
  3879. if(ErrorLevel) {
  3880. ErrorLevel := ERROR_READ_MEMORY
  3881. return 0
  3882. }
  3883. o.HP := fHP
  3884. o.ARMOR := fARMOR
  3885. }
  3886. ErrorLevel := ERROR_OK
  3887. return 1
  3888. }
  3889. blockDialog() {
  3890. if (!checkHandles()) {
  3891. ErrorLevel := ERROR_INVALID_HANDLE
  3892. return false
  3893. }
  3894. VarSetCapacity(injectBytecode, 7, 0)
  3895. Loop, 7 {
  3896. NumPut(0x90, injectBytecode, A_Index - 1, "UChar")
  3897. }
  3898. return writeRaw(hGTA, dwSAMP + 0x6C014, &injectBytecode, 7)
  3899. }
  3900. unblockDialog() {
  3901. if (!checkHandles()) {
  3902. ErrorLevel := ERROR_INVALID_HANDLE
  3903. return false
  3904. }
  3905. bytecodes := [0xC7, 0x46, 0x28, 0x1, 0x0, 0x0, 0x0]
  3906. VarSetCapacity(injectBytecode, 7, 0)
  3907. for i, o in bytecodes
  3908. NumPut(o, injectBytecode, i - 1, "UChar")
  3909. return writeRaw(hGTA, dwSAMP + 0x6C014, &injectBytecode, 7)
  3910. }
  3911. getDialogStructPtr() {
  3912. if (!checkHandles()) {
  3913. ErrorLevel := ERROR_INVALID_HANDLE
  3914. return false
  3915. }
  3916. dwPointer := readDWORD(hGTA, dwSAMP + SAMP_DIALOG_STRUCT_PTR)
  3917. if (ErrorLevel) {
  3918. ErrorLevel := ERROR_READ_MEMORY
  3919. return false
  3920. }
  3921. ErrorLevel := ERROR_OK
  3922. return dwPointer
  3923. }
  3924. getDialogStyle() {
  3925. dwPointer := getDialogStructPtr()
  3926. if (ErrorLevel || !dwPointer)
  3927. return -1
  3928. style := readMem(hGTA, dwPointer + SAMP_DIALOG_STYLE_OFFSET, 4, "UInt")
  3929. if (ErrorLevel) {
  3930. ErrorLevel := ERROR_READ_MEMORY
  3931. return -1
  3932. }
  3933. ErrorLevel := ERROR_OK
  3934. return style
  3935. }
  3936. getDialogID() {
  3937. dwPointer := getDialogStructPtr()
  3938. if (ErrorLevel || !dwPointer)
  3939. return -1
  3940. id := readMem(hGTA, dwPointer + SAMP_DIALOG_ID_OFFSET, 4, "UInt")
  3941. if (ErrorLevel) {
  3942. ErrorLevel := ERROR_READ_MEMORY
  3943. return -1
  3944. }
  3945. ErrorLevel := ERROR_OK
  3946. return id
  3947. }
  3948. setDialogID(id) {
  3949. dwPointer := getDialogStructPtr()
  3950. if (ErrorLevel || !dwPointer)
  3951. return false
  3952. writeMemory(hGTA, dwPointer + SAMP_DIALOG_ID_OFFSET, id, "UInt", 4)
  3953. if (ErrorLevel) {
  3954. ErrorLevel := ERROR_WRITE_MEMORY
  3955. return false
  3956. }
  3957. ErrorLevel := ERROR_OK
  3958. return true
  3959. }
  3960. getDialogIndex() {
  3961. dwPointer := getDialogStructPtr()
  3962. if (ErrorLevel || !dwPointer)
  3963. return 0
  3964. dwPointer := readDWORD(hGTA, dwPointer + SAMP_DIALOG_PTR1_OFFSET)
  3965. if (ErrorLevel) {
  3966. ErrorLevel := ERROR_READ_MEMORY
  3967. return 0
  3968. }
  3969. index := readMem(hGTA, dwPointer + SAMP_DIALOG_INDEX_OFFSET, 1, "Byte")
  3970. if (ErrorLevel) {
  3971. ErrorLevel := ERROR_READ_MEMORY
  3972. return 0
  3973. }
  3974. ErrorLevel := ERROR_OK
  3975. return index + 1
  3976. }
  3977. getDialogCaption() {
  3978. dwPointer := getDialogStructPtr()
  3979. if (ErrorLevel || !dwPointer)
  3980. return ""
  3981. text := readString(hGTA, dwPointer + SAMP_DIALOG_CAPTION_OFFSET, 64)
  3982. if (ErrorLevel) {
  3983. ErrorLevel := ERROR_READ_MEMORY
  3984. return ""
  3985. }
  3986. ErrorLevel := ERROR_OK
  3987. return text
  3988. }
  3989. getDialogTextSize(dwAddress) {
  3990. i := 0
  3991. Loop, 4096 {
  3992. i := A_Index - 1
  3993. byte := Memory_ReadByte(hGTA, dwAddress + i)
  3994. if (!byte)
  3995. break
  3996. }
  3997. return i
  3998. }
  3999. getDialogText() {
  4000. dwPointer := getDialogStructPtr()
  4001. if (ErrorLevel || !dwPointer)
  4002. return ""
  4003. dwPointer := readDWORD(hGTA, dwPointer + SAMP_DIALOG_TEXT_PTR_OFFSET)
  4004. if (ErrorLevel) {
  4005. ErrorLevel := ERROR_READ_MEMORY
  4006. return ""
  4007. }
  4008. text := readString(hGTA, dwPointer, 4096)
  4009. if (ErrorLevel) {
  4010. text := readString(hGTA, dwPointer, getDialogTextSize(dwPointer))
  4011. if (ErrorLevel) {
  4012. ErrorLevel := ERROR_READ_MEMORY
  4013. return ""
  4014. }
  4015. }
  4016. ErrorLevel := ERROR_OK
  4017. return text
  4018. }
  4019. getDialogLineCount() {
  4020. dwPointer := getDialogStructPtr()
  4021. if (ErrorLevel || !dwPointer)
  4022. return 0
  4023. dwPointer := readDWORD(hGTA, dwPointer + SAMP_DIALOG_PTR2_OFFSET)
  4024. if (ErrorLevel) {
  4025. ErrorLevel := ERROR_READ_MEMORY
  4026. return 0
  4027. }
  4028. count := readMem(hGTA, dwPointer + SAMP_DIALOG_LINECOUNT_OFFSET, 4, "UInt")
  4029. if (ErrorLevel) {
  4030. ErrorLevel := ERROR_READ_MEMORY
  4031. return 0
  4032. }
  4033. ErrorLevel := ERROR_OK
  4034. return count
  4035. }
  4036. getDialogLine__(index) {
  4037. if (getDialogLineCount > index)
  4038. return ""
  4039. dwPointer := getDialogStructPtr()
  4040. if (ErrorLevel || !dwPointer)
  4041. return ""
  4042. dwPointer := readDWORD(hGTA, dwPointer + SAMP_DIALOG_PTR1_OFFSET)
  4043. if (ErrorLevel) {
  4044. ErrorLevel := ERROR_READ_MEMORY
  4045. return ""
  4046. }
  4047. dwPointer := readDWORD(hGTA, dwPointer + SAMP_DIALOG_LINES_OFFSET)
  4048. if (ErrorLevel) {
  4049. ErrorLevel := ERROR_READ_MEMORY
  4050. return ""
  4051. }
  4052. dwLineAddress := readDWORD(hGTA, dwPointer + (index - 1) * 0x4)
  4053. line := readString(hGTA, dwLineAddress, 128)
  4054. ErrorLevel := ERROR_OK
  4055. return line
  4056. }
  4057. getDialogLine(index) {
  4058. lines := getDialogLines()
  4059. if (index > lines.Length())
  4060. return ""
  4061. if (getDialogStyle() == DIALOG_STYLE_TABLIST_HEADERS)
  4062. index++
  4063. return lines[index]
  4064. }
  4065. getDialogLines() {
  4066. text := getDialogText()
  4067. if (text == "")
  4068. return -1
  4069. lines := StrSplit(text, "`n")
  4070. return lines
  4071. }
  4072. isDialogButton1Selected() {
  4073. dwPointer := getDialogStructPtr()
  4074. if (ErrorLevel || !dwPointer)
  4075. return false
  4076. dwPointer := readDWORD(hGTA, dwPointer + SAMP_DIALOG_PTR1_OFFSET)
  4077. if (ErrorLevel) {
  4078. ErrorLevel := ERROR_READ_MEMORY
  4079. return false
  4080. }
  4081. selected := readMem(hGTA, dwPointer + SAMP_DIALOG_BUTTON_HOVERING_OFFSET, 1, "Byte")
  4082. if (ErrorLevel) {
  4083. ErrorLevel := ERROR_READ_MEMORY
  4084. return false
  4085. }
  4086. ErrorLevel := ERROR_OK
  4087. return selected
  4088. }
  4089. getDialogLines__() {
  4090. count := getDialogLineCount()
  4091. dwPointer := getDialogStructPtr()
  4092. if (ErrorLevel || !dwPointer)
  4093. return -1
  4094. dwPointer := readDWORD(hGTA, dwPointer + SAMP_DIALOG_PTR1_OFFSET)
  4095. if (ErrorLevel) {
  4096. ErrorLevel := ERROR_READ_MEMORY
  4097. return -1
  4098. }
  4099. dwPointer := readDWORD(hGTA, dwPointer + SAMP_DIALOG_LINES_OFFSET)
  4100. if (ErrorLevel) {
  4101. ErrorLevel := ERROR_READ_MEMORY
  4102. return -1
  4103. }
  4104. lines := []
  4105. Loop %count% {
  4106. dwLineAddress := readDWORD(hGTA, dwPointer + (A_Index - 1) * 0x4)
  4107. lines[A_Index] := readString(hGTA, dwLineAddress, 128)
  4108. }
  4109. ErrorLevel := ERROR_OK
  4110. return lines
  4111. }
  4112. addChatMessage(wText) {
  4113. wText := "" wText
  4114. if(!checkHandles())
  4115. return false
  4116. dwFunc := dwSAMP + FUNC_SAMP_ADDTOCHATWND
  4117. dwChatInfo := readDWORD(hGTA, dwSAMP + ADDR_SAMP_CHATMSG_PTR)
  4118. if(ErrorLevel) {
  4119. ErrorLevel := ERROR_READ_MEMORY
  4120. return false
  4121. }
  4122. callWithParams(hGTA, dwFunc, [["p", dwChatInfo], ["s", wText]], true)
  4123. ErrorLevel := ERROR_OK
  4124. return true
  4125. }
  4126. getPageSize() {
  4127. if (!checkHandles())
  4128. return false
  4129. dwAddress := readDWORD(hGTA, dwSAMP + ADDR_SAMP_CHATMSG_PTR)
  4130. if (ErrorLevel || !dwAddress)
  4131. return false
  4132. pagesize := readMem(hGTA, dwAddress, 1, "Byte")
  4133. if (ErrorLevel)
  4134. return false
  4135. ErrorLevel := ERROR_OK
  4136. return pagesize
  4137. }
  4138. getGameText() {
  4139. if (!checkHandles())
  4140. return ""
  4141. Loop, 7 {
  4142. dwAddress := 0xBAACC0 + (A_Index - 1) * 0x80
  4143. gameText := readString(hGTA, dwAddress, 128)
  4144. if (ErrorLevel)
  4145. return ""
  4146. if (gameText != "")
  4147. break
  4148. }
  4149. ErrorLevel := ERROR_OK
  4150. return gameText
  4151. }
  4152. getPlayerAnim() {
  4153. if (!checkHandles())
  4154. return -1
  4155. dwAddress := readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET)
  4156. dwAddress := readDWORD(hGTA, dwAddress + SAMP_PPOOLS_OFFSET)
  4157. dwPlayers := readDWORD(hGTA, dwAddress + SAMP_PPOOL_PLAYER_OFFSET)
  4158. dwLocalPlayer := readDWORD(hGTA, dwPlayers + SAMP_LOCALPLAYER_OFFSET)
  4159. if (ErrorLevel)
  4160. return -1
  4161. animId := readMem(hGTA, dwLocalPlayer + 0x4, 2, "Short")
  4162. if (ErrorLevel)
  4163. return -1
  4164. ErrorLevel := ERROR_OK
  4165. return animId
  4166. }
  4167. ServerPatchMotor(bool)
  4168. {
  4169. if(!SAMP())
  4170. return -1
  4171. If(bool){
  4172. writeMemory(hGTA, dwSAMP + 0xB2510, 0xC39090, 3, "UInt")
  4173. }else{
  4174. writeMemory(hGTA, dwSAMP + 0xB2510, 0x55, 1, "UChar")
  4175. writeMemory(hGTA, dwSAMP + 0xB2511, 0xEC8B, 2, "Short")
  4176. }
  4177. }
  4178. setWeatherID(wID) {
  4179. if(!checkHandles())
  4180. return false
  4181. writeMemory(hGTA, 0xC81320, wID, "UInt", 4)
  4182. if (ErrorLevel) {
  4183. ErrorLevel := ERROR_READ_MEMORY
  4184. return false
  4185. }
  4186. ErrorLevel := ERROR_OK
  4187. return true
  4188. }
  4189. patchSAMPFunction(name) {
  4190. if (!checkHandles())
  4191. return false
  4192. for i, o in functionPatches {
  4193. if (name = o.NAME) {
  4194. o.UNPATCH := readMem(hGTA, dwSAMP + o.OFFSET, 2, "Short")
  4195. if (!writeMemory(hGTA, dwSAMP + o.OFFSET, o.PATCH, "Short", 2))
  4196. return false
  4197. return true
  4198. }
  4199. }
  4200. return false
  4201. }
  4202. unpatchSAMPFunction(name) {
  4203. if (!checkHandles())
  4204. return false
  4205. for i, o in functionPatches {
  4206. if (name = o.NAME) {
  4207. if (!o.HasKey("UNPATCH"))
  4208. return false
  4209. if (!writeMemory(hGTA, dwSAMP + o.OFFSET, o.UNPATCH, "Short", 2))
  4210. return false
  4211. return true
  4212. }
  4213. }
  4214. return false
  4215. }
  4216. getServerStatus(INADDR, PORT) {
  4217. DllCall("LoadLibrary", "str", "ws2_32", "ptr")
  4218. VarSetCapacity(wsadata, 408)
  4219. DllCall("ws2_32\WSAStartup", "ushort", 0x0000, "ptr", &wsadata)
  4220. DllCall("ws2_32\WSAStartup", "ushort", NumGet(wsadata, 2, "ushort"), "ptr", &wsadata)
  4221. remoteHost := DllCall("Ws2_32\gethostbyname", "Str", (A_IsUnicode ? __unicodeToAnsi(INADDR) : INADDR), "ptr")
  4222. if(remoteHost)
  4223. {
  4224. if(NumGet(remoteHost + (A_PtrSize==4 ? 8 : 16), "short")==2)
  4225. {
  4226. addrl := NumGet(remoteHost + (A_PtrSize==4 ? 12 : 24), "ptr")
  4227. ha :=  NumGet(addrl+0, "ptr")
  4228. a :=  NumGet(ha+0, "uchar")
  4229. loop, 3
  4230. a .= "." NumGet(ha+A_index, "uchar")
  4231. INADDR := a
  4232. }
  4233. else
  4234. return -1
  4235. }
  4236. else
  4237. return -1
  4238. socket := DllCall("ws2_32\socket", "int", 2, "int", 2, "int", 17, "ptr")
  4239. if(socket==-1)
  4240. {
  4241. return -1
  4242. }
  4243. VarSetCapacity(si, 16, 0)
  4244. NumPut(2, si, 0, "Short")
  4245. NumPut(DllCall("Ws2_32\htons", "UShort", PORT), si, 2, "UShort")
  4246. NumPut(DllCall("Ws2_32\inet_addr", "Str", (A_IsUnicode ? __unicodeToAnsi(INADDR) : INADDR)), si, 4, "ptr")
  4247. VarSetCapacity(message,30)
  4248. StrPut("SAMP", &message, "cp0")
  4249. StrPut("i", &message +10, "cp0")
  4250. if(DllCall("ws2_32\sendto", "ptr", socket, "ptr", &message, "int", 11, "int", 0, "ptr", &si, "int", 16, "int")==-1)
  4251. {
  4252. DllCall("Ws2_32\closesocket", "ptr", socket)
  4253. return -1
  4254. }
  4255. VarSetCapacity(buffer, 2048, 0)
  4256. VarSetCapacity(optval, 8, 0)
  4257. NumPut(1, optval, 0, "long")
  4258. DllCall("ws2_32\setsockopt", "ptr", socket, "int", 0xFFFF, "int", 0x1006, "ptr", &optval, "int", 4)
  4259. VarSetCapacity(silen,4)
  4260. NumPut(16, silen, 0, "int")
  4261. if(DllCall("ws2_32\recvfrom", "ptr", socket, "ptr", &buffer, "int", 2048, "int", 0, "ptr", &si, "ptr", &silen, "int")==-1)
  4262. {
  4263. DllCall("Ws2_32\closesocket", "ptr", socket)
  4264. return -1
  4265. }
  4266. DllCall("Ws2_32\closesocket", "ptr", socket)
  4267. return (NumGet(&buffer + 11, "Uchar") ? 2 : 1)
  4268. }
  4269. printJoinDisconnect() {
  4270. static players := []
  4271. static init := true
  4272. if(init) {
  4273. init := false
  4274. Loop, % SAMP_PLAYER_MAX
  4275. {
  4276. getPlayerNameById(A_Index-1, players[A_Index-1])
  4277. }
  4278. return
  4279. }
  4280. Loop, % SAMP_PLAYER_MAX
  4281. {
  4282. i := A_Index-1
  4283. getPlayerNameById(i, name)
  4284. if(name) {
  4285. if(name != players[i]) {
  4286. if(players[i]) {
  4287. AddChatMessage("{FFFFFF}" players[i] " (ID:" i ") hat den Server {FF0000}verlassen{FFFFFF}.")
  4288. }
  4289. players[i] := name
  4290. AddChatMessage("{FFFFFF}" players[i] " (ID:" i ") hat den Server {00FF00}betreten{FFFFFF}.")
  4291. }
  4292. }
  4293. else {
  4294. if(players[i]) {
  4295. AddChatMessage("{FFFFFF}" players[i] " (ID:" i ") hat den Server {FF0000}verlassen{FFFFFF}.")
  4296. players[i] := ""
  4297. }
  4298. }
  4299. }
  4300. }
  4301. fahrzeugreifen(state)
  4302. {
  4303. If(!SAMP())
  4304. return false
  4305. pointer := readDWORD(hGTA, 0xBA18FC)
  4306. if(pointer)
  4307. {
  4308. writeMemory(hGTA, pointer + 1445, state, 1, "UChar")
  4309. writeMemory(hGTA, pointer + 1446, state, 1, "UChar")
  4310. writeMemory(hGTA, pointer + 1447, state, 1, "UChar")
  4311. writeMemory(hGTA, pointer + 1448, state, 1, "UChar")
  4312. }
  4313. }
  4314. armour(param)
  4315. {
  4316. If(!SAMP())
  4317. return false
  4318. CPed := readDWORD(hGTA, 0xB6F5F0)
  4319. ap := readFloat(hGTA, CPed + 0x548)
  4320. writeMemory(hGTA, CPed + 0x548, param, 4 , "float")
  4321. }
  4322. health(param)
  4323. {
  4324. If(!SAMP())
  4325. return false
  4326. CPed := readDWORD(hGTA, 0xB6F5F0)
  4327. ap := readFloat(hGTA, CPed + 0x540)
  4328. writeMemory(hGTA, CPed + 0x540, param, 4 , "float")
  4329. }
  4330. totalammo(param)
  4331. {
  4332. If(!SAMP())
  4333. return false
  4334. CPed := readDWORD(hGTA, 0xB6F5F0)
  4335. ap := readDWORD(hGTA, CPed + 0x5E0)
  4336. writeMemory(hGTA, CPed + 0x5E0, param, 4, "UInt")
  4337. }
  4338. fixveh()
  4339. {
  4340. If(!SAMP())
  4341. return false
  4342. pointer := readDWORD(hGTA, 0xBA18FC)
  4343. if(pointer)
  4344. {
  4345. writeMemory(hGTA, pointer + 1445, 0, 1, "UChar")
  4346. writeMemory(hGTA, pointer + 1446, 0, 1, "UChar")
  4347. writeMemory(hGTA, pointer + 1447, 0, 1, "UChar")
  4348. writeMemory(hGTA, pointer + 1448, 0, 1, "UChar")
  4349. writeMemory(hGTA, pointer + 1216, 1000, 4, "Float")
  4350. }
  4351. }
  4352. restartGameEx() {
  4353. if(!checkHandles())
  4354. return -1
  4355. dwAddress := readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET)
  4356. if(ErrorLevel || dwAddress==0) {
  4357. ErrorLevel := ERROR_READ_MEMORY
  4358. return -1
  4359. }
  4360. dwFunc := dwSAMP + 0xA060
  4361. VarSetCapacity(injectData, 11, 0)
  4362. NumPut(0xB9, injectData, 0, "UChar")
  4363. NumPut(dwAddress, injectData, 1, "UInt")
  4364. NumPut(0xE8, injectData, 5, "UChar")
  4365. offset := dwFunc - (pInjectFunc + 10)
  4366. NumPut(offset, injectData, 6, "Int")
  4367. NumPut(0xC3, injectData, 10, "UChar")
  4368. writeRaw(hGTA, pInjectFunc, &injectData, 11)
  4369. if(ErrorLevel)
  4370. return false
  4371. hThread := createRemoteThread(hGTA, 0, 0, pInjectFunc, 0, 0, 0)
  4372. if(ErrorLevel)
  4373. return false
  4374. waitForSingleObject(hThread, 0xFFFFFFFF)
  4375. return true
  4376. }
  4377. disconnectEx() {
  4378. if(!checkHandles())
  4379. return 0
  4380. dwAddress := readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET)
  4381. if(ErrorLevel || dwAddress==0) {
  4382. ErrorLevel := ERROR_READ_MEMORY
  4383. return 0
  4384. }
  4385. dwAddress := readDWORD(hGTA, dwAddress + 0x3c9)
  4386. if(ErrorLevel || dwAddress==0) {
  4387. ErrorLevel := ERROR_READ_MEMORY
  4388. return 0
  4389. }
  4390. ecx := dwAddress
  4391. dwAddress := readDWORD(hGTA, dwAddress)
  4392. if(ErrorLevel || dwAddress==0) {
  4393. ErrorLevel := ERROR_READ_MEMORY
  4394. return 0
  4395. }
  4396. VarSetCapacity(injectData, 24, 0)
  4397. NumPut(0xB9, injectData, 0, "UChar")
  4398. NumPut(ecx, injectData, 1, "UInt")
  4399. NumPut(0xB8, injectData, 5, "UChar")
  4400. NumPut(dwAddress, injectData, 6, "UInt")
  4401. NumPut(0x68, injectData, 10, "UChar")
  4402. NumPut(0, injectData, 11, "UInt")
  4403. NumPut(0x68, injectData, 15, "UChar")
  4404. NumPut(500, injectData, 16, "UInt")
  4405. NumPut(0x50FF, injectData, 20, "UShort")
  4406. NumPut(0x08, injectData, 22, "UChar")
  4407. NumPut(0xC3, injectData, 23, "UChar")
  4408. writeRaw(hGTA, pInjectFunc, &injectData, 24)
  4409. if(ErrorLevel)
  4410. return false
  4411. hThread := createRemoteThread(hGTA, 0, 0, pInjectFunc, 0, 0, 0)
  4412. if(ErrorLevel)
  4413. return false
  4414. waitForSingleObject(hThread, 0xFFFFFFFF)
  4415. return true
  4416. }
  4417. setrestart()
  4418. {
  4419. VarSetCapacity(old, 4, 0)
  4420. dwAddress := readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET)
  4421. if(ErrorLevel || dwAddress==0) {
  4422. ErrorLevel := ERROR_READ_MEMORY
  4423. return 0
  4424. }
  4425. NumPut(9,old,0,"Int")
  4426. writeRaw(hGTA, dwAddress + 957, &old, 4)
  4427. }
  4428. restart()
  4429. {
  4430. restartGameEx()
  4431. disconnectEx()
  4432. addChatMessage("Reconnecting...")
  4433. Sleep 15200
  4434. setrestart()
  4435. }
  4436. StopAnim()
  4437. {
  4438. Send, {Enter Down}
  4439. Sleep 100
  4440. Send, {Enter Up}
  4441. }
  4442. amk(o)
  4443. {
  4444. global
  4445. if(!o)
  4446. return
  4447. PlayerID:= o.ID
  4448. PlayerSkin := getTargetPlayerSkinIdById(PlayerID)
  4449. PlayerName := o.Name
  4450. if(Playerskin=228 or Playerskin=186 or Playerskin=203 or Playerskin=204 or Playerskin=123 or Playerskin=122 or Playerskin=169)
  4451. {
  4452. Gegnerfound := 0
  4453. Yakuza_Zeile := 0
  4454. Loop, read, YAKUZA.TXT
  4455. {
  4456. If (Yakuza_Zeile >= A_Index)
  4457. {
  4458. Continue
  4459. }
  4460. else
  4461. {
  4462. if instr(A_Loopreadline,PlayerName)
  4463. {
  4464. Gegnerfound := 1
  4465. }
  4466. Yakuza_Zeile := A_Index
  4467. }
  4468. }
  4469. if(Gegnerfound = 0)
  4470. {
  4471. fileappend, %Playername%`n, YAKUZA.TXT
  4472. addchatmessage("{2E9AFE}* " Playername " wurde als Yakuza eingetragen.")
  4473. }
  4474. }
  4475. if(Playerskin=109 or Playerskin=110 or Playerskin=108 or Playerskin=292 )
  4476. {
  4477. Gegnerfound := 0
  4478. Vagos_Zeile := 0
  4479. Loop, read, VAGOS.TXT
  4480. {
  4481. If (Vagos_Zeile >= A_Index)
  4482. {
  4483. Continue
  4484. }
  4485. else
  4486. {
  4487. if instr(A_Loopreadline,PlayerName)
  4488. {
  4489. Gegnerfound := 1
  4490. }
  4491. Vagos_Zeile := A_Index
  4492. }
  4493. }
  4494. if(Gegnerfound = 0)
  4495. {
  4496. fileappend, %Playername%`n, VAGOS.TXT
  4497. addchatmessage("{2E9AFE}* " Playername " wurde als Vagos eingetragen.")
  4498. }
  4499. }
  4500. if(Playerskin=117 or Playerskin=118 or Playerskin=208 or Playerskin=120)
  4501. {
  4502. Gegnerfound := 0
  4503. Triaden_Zeile := 0
  4504. Loop, read, TRIADEN.TXT
  4505. {
  4506. If (Triaden_Zeile >= A_Index)
  4507. {
  4508. Continue
  4509. }
  4510. else
  4511. {
  4512. if instr(A_Loopreadline,PlayerName)
  4513. {
  4514. Gegnerfound := 1
  4515. }
  4516. Triaden_Zeile := A_Index
  4517. }
  4518. }
  4519. if(Gegnerfound = 0)
  4520. {
  4521. fileappend, %Playername%`n, TRIADEN.TXT
  4522. addchatmessage("{2E9AFE}* " Playername " wurde als Triaden eingetragen.")
  4523. }
  4524. }
  4525. if(Playerskin=225 or Playerskin=123 or Playerskin=125 or Playerskin=126 or Playerskin=223 or Playerskin=113)
  4526. {
  4527. Gegnerfound := 0
  4528. LCN_Zeile := 0
  4529. Loop, read, LCN.TXT
  4530. {
  4531. If (LCN_Zeile >= A_Index)
  4532. {
  4533. Continue
  4534. }
  4535. else
  4536. {
  4537. if instr(A_Loopreadline,PlayerName)
  4538. {
  4539. Gegnerfound := 1
  4540. }
  4541. LCN_Zeile := A_Index
  4542. }
  4543. }
  4544. if(Gegnerfound = 0)
  4545. {
  4546. fileappend, %Playername%`n, LCN.TXT
  4547. addchatmessage("{2E9AFE}* " Playername " wurde als LCN eingetragen.")
  4548. }
  4549. }
  4550. if(Playerskin=114 or Playerskin=115 or Playerskin=116 or Playerskin=173 or Playerskin=174 or Playerskin=175)
  4551. {
  4552. Gegnerfound := 0
  4553. Aztecas_Zeile := 0
  4554. Loop, read, Aztecas.TXT
  4555. {
  4556. If (Aztecas_Zeile >= A_Index)
  4557. {
  4558. Continue
  4559. }
  4560. else
  4561. {
  4562. if instr(A_Loopreadline,PlayerName)
  4563. {
  4564. Gegnerfound := 1
  4565. }
  4566. Aztecas_Zeile := A_Index
  4567. }
  4568. }
  4569. if(Gegnerfound = 0)
  4570. {
  4571. fileappend, %Playername%`n, Aztecas.TXT
  4572. addchatmessage("{2E9AFE}* " Playername " wurde als Aztecas eingetragen.")
  4573. }
  4574. }
  4575. if(Playerskin=102 or Playerskin=103 or Playerskin=104 or Playerskin=13 or Playerskin=195 or Playerskin=293)
  4576. {
  4577. Gegnerfound := 0
  4578. Ballas_Zeile := 0
  4579. Loop, read, Ballas.TXT
  4580. {
  4581. If (Ballas_Zeile >= A_Index)
  4582. {
  4583. Continue
  4584. }
  4585. else
  4586. {
  4587. if instr(A_Loopreadline,PlayerName)
  4588. {
  4589. Gegnerfound := 1
  4590. }
  4591. Ballas_Zeile := A_Index
  4592. }
  4593. }
  4594. if(Gegnerfound = 0)
  4595. {
  4596. fileappend, %Playername%`n, Ballas.TXT
  4597. addchatmessage("{2E9AFE}* " Playername " wurde als Ballas eingetragen.")
  4598. }
  4599. }
  4600. if(Playerskin=265 or Playerskin=266 or Playerskin=267 or Playerskin=280 or Playerskin=284 or Playerskin=285 or Playerskin=300 or Playerskin=301 or Playerskin=306 or Playerskin=303 or Playerskin=304)
  4601. {
  4602. Gegnerfound := 0
  4603. LSPD_Zeile := 0
  4604. Loop, read, LSPD.TXT
  4605. {
  4606. If (LSPD_Zeile >= A_Index)
  4607. {
  4608. Continue
  4609. }
  4610. else
  4611. {
  4612. if instr(A_Loopreadline,PlayerName)
  4613. {
  4614. Gegnerfound := 1
  4615. }
  4616. LSPD_Zeile := A_Index
  4617. }
  4618. }
  4619. if(Gegnerfound = 0)
  4620. {
  4621. fileappend, %Playername%`n, LSPD.TXT
  4622. addchatmessage("{2E9AFE}* " Playername " wurde als LSPD eingetragen.")
  4623. }
  4624. }
  4625. if(Playerskin=100 or Playerskin=247 or Playerskin=248 or Playerskin=254 or Playerskin=291 or Playerskin=261)
  4626. {
  4627. Gegnerfound := 0
  4628. NineDemons_Zeile := 0
  4629. Loop, read, NineDemons.TXT
  4630. {
  4631. If (NineDemons_Zeile >= A_Index)
  4632. {
  4633. Continue
  4634. }
  4635. else
  4636. {
  4637. if instr(A_Loopreadline,PlayerName)
  4638. {
  4639. Gegnerfound := 1
  4640. }
  4641. NineDemons_Zeile := A_Index
  4642. }
  4643. }
  4644. if(Gegnerfound = 0)
  4645. {
  4646. fileappend, %Playername%`n, NineDemons.TXT
  4647. addchatmessage("{2E9AFE}* " Playername " wurde als NineDemons eingetragen.")
  4648. }
  4649. }
  4650. if(Playerskin=105 or Playerskin=106 or Playerskin=107 or Playerskin=269 or Playerskin=270 or Playerskin=271 or Playerskin=65)
  4651. {
  4652. Gegnerfound := 0
  4653. GSF_Zeile := 0
  4654. Loop, read, GSF.TXT
  4655. {
  4656. If (GSF_Zeile >= A_Index)
  4657. {
  4658. Continue
  4659. }
  4660. else
  4661. {
  4662. if instr(A_Loopreadline,PlayerName)
  4663. {
  4664. Gegnerfound := 1
  4665. }
  4666. GSF_Zeile := A_Index
  4667. }
  4668. }
  4669. if(Gegnerfound = 0)
  4670. {
  4671. fileappend, %Playername%`n, GSF.TXT
  4672. addchatmessage("{2E9AFE}* " Playername " wurde als GSF eingetragen.")
  4673. }
  4674. }
  4675. if(Playerskin=217 or Playerskin=211 or Playerskin=206 or Playerskin=202 or Playerskin=230)
  4676. {
  4677. Gegnerfound := 0
  4678. wheelman_Zeile := 0
  4679. Loop, read, WHEELMAN.TXT
  4680. {
  4681. If (wheelman_Zeile >= A_Index)
  4682. {
  4683. Continue
  4684. }
  4685. else
  4686. {
  4687. if instr(A_Loopreadline,PlayerName)
  4688. {
  4689. Gegnerfound := 1
  4690. }
  4691. wheelman_Zeile := A_Index
  4692. }
  4693. }
  4694. if(Gegnerfound = 0)
  4695. {
  4696. fileappend, %Playername%`n, WHEELMAN.TXT
  4697. addchatmessage("{2E9AFE}* " Playername " wurde als Wheelman eingetragen.")
  4698. }
  4699. }
  4700. }
  4701. callFuncForAllStreamedInPlayers(cfunc,dist=0x7fffffff) {
  4702. cfunc := "" cfunc
  4703. dist += 0
  4704. if(!IsFunc(cfunc))
  4705. return false
  4706. p := getStreamedInPlayersInfo()
  4707. if(!p)
  4708. return false
  4709. if(dist<0x7fffffff)
  4710. {
  4711. lpos := getCoordinates()
  4712. if(!lpos)
  4713. return false
  4714. For i, o in p
  4715. {
  4716. if(dist>getDist(lpos,o.POS))
  4717. %cfunc%(o)
  4718. }
  4719. }
  4720. else
  4721. {
  4722. For i, o in p
  4723. %cfunc%(o)
  4724. }
  4725. return true
  4726. }
  4727. getStreamedInPlayersInfo() {
  4728. r:=[]
  4729. if(iRefreshScoreboard+iUpdateTick > A_TickCount)
  4730. {
  4731. For i, o in oScoreboardData
  4732. {
  4733. if(o.HasKey("PED"))
  4734. {
  4735. p := getPedCoordinates(o.PED)
  4736. if(p)
  4737. {
  4738. o.POS := p
  4739. r[i] := o
  4740. }
  4741. }
  4742. }
  4743. return r
  4744. }
  4745. if(!updateOScoreboardData())
  4746. return ""
  4747. For i, o in oScoreboardData
  4748. {
  4749. if(o.HasKey("PED"))
  4750. {
  4751. p := getPedCoordinates(o.PED)
  4752. if(p)
  4753. {
  4754. o.POS := p
  4755. r[i] := o
  4756. }
  4757. }