Advertisement
Guest User

Untitled

a guest
Nov 19th, 2018
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 39.99 KB | None | 0 0
  1. global sizeofDataType := { "UChar": 1, "Char": 1
  2. , "UShort": 2, "Short": 2
  3. , "UInt": 4, "Int": 4
  4. , "UFloat": 4, "Float": 4
  5. , "Int64": 8, "Double": 8}
  6. global b := [22, 32, 42, 52, 21, 31]
  7. global bmode := ["[HEAD]", "[TORSO]", "[KNEE]", "[RANDOM]"]
  8. global SAMP_AC_PATCHES := [0x99250, 0xB2F70, 0xB30F0, 0x99247]
  9. global SAMP_AC_BYTES := ["C3", "B845000000C21C00", "B801000000C3", "9090"]
  10. global oAirplaneModels := [417, 425, 447, 460, 469, 476, 487, 488, 497, 511, 512, 513, 519, 520, 548, 553, 563, 577, 592, 593]
  11. global oBikeModels := [481,509,510]
  12. 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"]
  13. global ADDR_CPED_PTR := 0xB6F5F0
  14. global ADDR_CVEHICLE_PTR := 0xB6F980
  15. global ADDR_VEHICLE_PTR := 0xBA18FC
  16. global ADDR_FPS_PTR := 0xB729A0
  17. global OFFSET_MATRIX := 0x14
  18. global OFFSET_POSX := 0x30
  19. global OFFSET_POSY := 0x34
  20. global OFFSET_POSZ := 0x38
  21. global OFFSET_ROTATION_X := 0x10
  22. global OFFSET_ROTATION_Y := 0x14
  23. global OFFSET_GTA_ENTITY := 0x40
  24. global ADDR_POSITION_X := 0xB6F2E4
  25. global ADDR_POSITION_Y := 0xB6F2E8
  26. global ADDR_POSITION_Z := 0xB6F2EC
  27. global ADDR_REDMARKER_POSX := 0xC7DEC8
  28. global ADDR_REDMARKER_POSY := 0xC7DECC
  29. global ADDR_REDMARKER_POSZ := 0xC7DED0
  30. global OFFSET_CPED_HP := 0x540
  31. global OFFSET_CPED_ARMOR := 0x548
  32. global OFFSET_CPED_SKINID := 0x22
  33. global OFFSET_CPED_OTARGET := 0x79C
  34. global OFFSET_CPED_FLAGS := 0x42
  35. global OFFSET_CPED_ROTATION := 0x558
  36. global OFFSET_CPED_TROTATION := 0x55C
  37. global OFFSET_CPED_FLAGS := 0x42
  38. global OFFSET_CPED_STATE := 0x46C
  39. global OFFSET_CPED_STATE2 := 0x530
  40. global OFFSET_VEH_SPEED_X := 0x44
  41. global OFFSET_VEH_SPEED_Y := 0x48
  42. global OFFSET_VEH_SPEED_Z := 0x4C
  43. global OFFSET_VEH_SPIN_X := 0x50
  44. global OFFSET_VEH_SPIN_Y := 0x54
  45. global OFFSET_VEH_SPIN_Z := 0x58
  46. global OFFSET_VEH_HPOFF := 0x4C0
  47. global OFFSET_VEH_DOORSTATE := 0x4F8
  48. global OFFSET_VEH_ENGINESTATE := 0x428
  49. global OFFSET_VEH_LIGHTSTATE := 0x584
  50. global OFFSET_VEH_MODEL := 0x22
  51. global OFFSET_VEH_TYPE := 0x590
  52. global OFFSET_VEH_DRIVER := 0x460
  53. global OFFSET_VEH_LASTVEH := 0x58C
  54. global ADDR_WEAPON_TARGET := 0xB6F3B8
  55. global ADDR_WEAPON_DATA := 0xC8AAB8
  56. global OFFSET_WEAPON_MAX := 100
  57. global OFFSET_WEAPON_STACK := 0x70
  58. global OFFSET_WEAPON_TRANGE := 0x4
  59. global OFFSET_WEAPON_ID := 0x740
  60. global OFFSET_WEAPON_SLOT := 0x718
  61. global OFFSET_WEAPON_DMG := 0x760
  62. global ADDR_WORLD_GRAVITY := 0x863984
  63. global ADDR_WORLD_MAPX := 0xBA67B8
  64. global ADDR_WORLD_MAPY := 0xBA67BC
  65. global FUNC_GETBONEPOS := 0x5E4280
  66. global SAMPFUNCS_FUNC_DBGCHECK := 0x65098
  67. global SAMPFUNCS_FUNC_SETSKIN := 0x65090
  68. global pData_iAFKState := 0x1D1
  69. global pData_iGlobalMarkers := 0x1E9
  70. global pData_iMapX := 0x1ED
  71. global pData_iMapY := 0x1F1
  72. global pData_iMapZ := 0x1F5
  73. global pData_iGTAPed := 0x2A4
  74. global pData_iHP := 0x1BC
  75. global pData_iArmor := 0x1B8
  76. global ADDR_SAMP_CRASHREPORT := 0x5CF2C
  77. global ADDR_SAMP_INCHAT_PTR := 0x21a10c
  78. global ADDR_SAMP_INCHAT_PTR_OFF := 0x55
  79. global ADDR_SAMP_USERNAME := 0x219A6F
  80. global ADDR_SAMP_CHATMSG_PTR := 0x21A0E4
  81. global ADDR_SAMP_SHOWDLG_PTR := 0x21A0B8
  82. global FUNC_SAMP_SENDCMD := 0x65c60
  83. global FUNC_SAMP_SENDSAY := 0x57f0
  84. global FUNC_SAMP_ADDTOCHATWND := 0x64520
  85. global FUNC_SAMP_SHOWGAMETEXT := 0x9C2C0
  86. global FUNC_SAMP_PLAYAUDIOSTR := 0x62dA0
  87. global FUNC_SAMP_STOPAUDIOSTR := 0x629A0
  88. global FUNC_SAMP_SHOWDIALOG := 0x6B9C0
  89. global FUNC_UPDATESCOREBOARD := 0x8A10
  90. global SAMP_INFO_OFFSET := 0x21A0F8
  91. global SAMP_COLOR_OFFSET := 0x216378
  92. global SAMP_SCOREBOARD_INFO := 0x21A0B4
  93. global SAMP_DRAWING_DISTANCE := 0xD3DCC
  94. global SAMP_SETTINGS_OFFSET := 0x3C5
  95. global SAMP_PPOOLS_OFFSET := 0x3CD
  96. global SAMP_PPOOL_PLAYER_OFFSET := 0x18
  97. global SAMP_PPOOL_VEHICLE_OFFSET := 0x1C
  98. global SAMP_PPOOL_PICKUP_OFFSET := 0x20
  99. global SAMP_PPOOL_OBJECT_OFFSET := 0x4
  100. global SAMP_PPOOL_TEXTDRAW_OFFSET := 0x10
  101. global SAMP_PPOOL_GANGZONE_OFFSET := 0x8
  102. global SAMP_SLOCALPLAYERID_OFFSET := 0x4
  103. global SAMP_LOCALPLAYER_OFFSET := 0x22
  104. global SAMP_ISTRLEN_LOCALPLAYERNAME_OFFSET := 0x1A
  105. global SAMP_SZLOCALPLAYERNAME_OFFSET := 0xA
  106. global SAMP_PSZLOCALPLAYERNAME_OFFSET := 0xA
  107. global SAMP_ISTRLENNAME___OFFSET := 0x1C
  108. global SAMP_SZPLAYERNAME_OFFSET := 0xC
  109. global SAMP_PSZPLAYERNAME_OFFSET := 0xC
  110. global SAMP_ILOCALPLAYERPING_OFFSET := 0x26
  111. global SAMP_ILOCALPLAYERSCORE_OFFSET := 0x2A
  112. global SAMP_PLAYER_MAX := 1000
  113. global SAMP_MAX_PLAYERS := 1004
  114. global SIZE_SAMP_CHATMSG := 0xFC
  115. getPID(szWindow)
  116. { local dwPID := 0
  117. WinGet, dwPID, PID, %szWindow%
  118. return dwPID
  119. }
  120. openProcess(dwPID, dwRights = 0x1F0FFF)
  121. { return DllCall("OpenProcess", "UInt", dwRights, "int", 0, "UInt", dwPID, "Uint")
  122. }
  123. closeProcess(hProcess)
  124. { DllCall("CloseHandle", "UInt", hProcess, "UInt")
  125. }
  126. getModuleBaseAddress(sModule, hProcess)
  127. { dwSize = 1024*4
  128. VarSetCapacity(hMods, dwSize)
  129. VarSetCapacity(cbNeeded, 4)
  130. dwRet := DllCall("Psapi.dll\EnumProcessModules", "UInt", hProcess, "UInt", &hMods, "UInt", dwSize, "UInt*", cbNeeded, "UInt")
  131. dwMods := cbNeeded / 4
  132. i := 0
  133. VarSetCapacity(hModule, 4)
  134. VarSetCapacity(sCurModule, A_IsUnicode ? 2*260 : 260)
  135. while(i < dwMods) {
  136. hModule := NumGet(hMods, i*4)
  137. DllCall("Psapi.dll\GetModuleFileNameEx", "UInt", hProcess, "UInt", hModule, "Str", sCurModule, "UInt", A_IsUnicode ? 2*260 : 260)
  138. SplitPath, sCurModule, sFilename
  139. if(sModule == sFilename)
  140. return hModule
  141. i := i + 1
  142. }
  143. return 0
  144. }
  145. callWithParams(dwFunc, aParams, bCleanupStack = true, thiscall = false) {
  146. validParams := 0
  147. i := aParams.MaxIndex()
  148. dwLen := i * 5 + 5 + 1
  149. if(bCleanupStack)
  150. dwLen += 3
  151. VarSetCapacity(injectData, i * 5 + 5 + 3 + 1, 0)
  152. i_ := 1
  153. while(i > 0) {
  154. if(aParams[i][1] != "") {
  155. dwMemAddress := 0x0
  156. if(aParams[i][1] == "p") {
  157. dwMemAddress := aParams[i][2]
  158. } else if(aParams[i][1] == "s") {
  159. if(i_>3)
  160. return false
  161. dwMemAddress := pParam%i_%
  162. __WSTRING(dwMemAddress, aParams[i][2])
  163. if(ErrorLevel)
  164. return false
  165. i_ += 1
  166. } else if(aParams[i][1] == "i") {
  167. dwMemAddress := aParams[i][2]
  168. } else {
  169. return false
  170. }
  171. NumPut((thiscall && i == 1 ? 0xB9 : 0x68), injectData, validParams * 5, "UChar")
  172. NumPut(dwMemAddress, injectData, validParams * 5 + 1, "UInt")
  173. validParams += 1
  174. }
  175. i -= 1
  176. }
  177. offset := dwFunc - ( pInjectFunc + validParams * 5 + 5 )
  178. NumPut(0xE8, injectData, validParams * 5, "UChar")
  179. NumPut(offset, injectData, validParams * 5 + 1, "Int")
  180. if(bCleanupStack) {
  181. NumPut(0xC483, injectData, validParams * 5 + 5, "UShort")
  182. NumPut(validParams*4, injectData, validParams * 5 + 7, "UChar")
  183. NumPut(0xC3, injectData, validParams * 5 + 8, "UChar")
  184. } else {
  185. NumPut(0xC3, injectData, validParams * 5 + 5, "UChar")
  186. }
  187. __RAW(pInjectFunc, &injectData, dwLen)
  188. if(ErrorLevel)
  189. return false
  190. hThread := createRemoteThread(0, 0, pInjectFunc, 0, 0, 0)
  191. if(ErrorLevel)
  192. return false
  193. waitForSingleObject(hThread, 0xFFFFFFFF)
  194. closeProcess(hThread)
  195. return true
  196. }
  197. virtualAllocEx(hProcess, dwSize, flAllocationType, flProtect)
  198. { return DllCall("VirtualAllocEx", "UInt", hProcess, "UInt", 0, "UInt", dwSize, "UInt", flAllocationType, "UInt", flProtect, "UInt")
  199. }
  200. virtualFreeEx(hProcess, lpAddress, dwSize, dwFreeType)
  201. { return DllCall("VirtualFreeEx", "UInt", hProcess, "UInt", lpAddress, "UInt", dwSize, "UInt", dwFreeType, "UInt")
  202. }
  203. createRemoteThread(lpThreadAttributes, dwStackSize, lpStartAddress, lpParameter, dwCreationFlags, lpThreadId)
  204. { return DllCall("CreateRemoteThread", "UInt", hGTA, "UInt", lpThreadAttributes, "UInt", dwStackSize, "UInt", lpStartAddress, "UInt", lpParameter, "UInt", dwCreationFlags, "UInt", lpThreadId, "UInt")
  205. }
  206. waitForSingleObject(hThread, dwMilliseconds) {
  207. return DllCall("WaitForSingleObject", "UInt", hThread, "UInt", dwMilliseconds, "UInt")
  208. }
  209. __unicodeToAnsi(wString, nLen = 0)
  210. { pString := wString + 1 > 65536 ? wString : &wString
  211. If !nLen
  212. nLen := DllCall("WideCharToMultiByte", "Uint", 0, "Uint", 0, "Uint", pString, "int", -1, "Uint", 0, "int", 0, "Uint", 0, "Uint", 0)
  213. VarSetCapacity(sString, nLen)
  214. DllCall("WideCharToMultiByte", "Uint", 0, "Uint", 0, "Uint", pString, "int", -1, "str", sString, "int", nLen, "Uint", 0, "Uint", 0)
  215. return sString
  216. }
  217. __READ(dwAddress, dwLen, type, ByRef dwRead=0)
  218. { VarSetCapacity(dwRead, dwLen)
  219. DllCall("ReadProcessMemory", "UInt", hGTA, "UInt", dwAddress, "Str", dwRead, "UInt", dwLen, "UInt", 0, "UInt*", 0)
  220. dwRead := NumGet(dwRead, 0, type)
  221. return dwRead
  222. }
  223. __FLOAT(dwAddress, ByRef dwRead=0)
  224. { VarSetCapacity(dwRead, 4)
  225. DllCall("ReadProcessMemory", "UInt", hGTA, "UInt", dwAddress, "Str", dwRead, "UInt", 4, "UInt*", 0, "UInt", 0)
  226. dwRead := NumGet(dwRead, 0, "Float")
  227. return dwRead
  228. }
  229. __DWORD(dwAddress, ByRef dwRead=0)
  230. { VarSetCapacity(dwRead, 4)
  231. DllCall("ReadProcessMemory", "UInt", hGTA, "UInt", dwAddress, "Str", dwRead, "UInt", 4, "UInt", 0, "UInt*", 0)
  232. dwRead := NumGet(dwRead, 0, "UInt")
  233. return dwRead
  234. }
  235. __WRITE(dwAddress, writevalue, size=4, type="Int")
  236. { VarSetCapacity(finalvalue,size, 0)
  237. NumPut(writevalue,finalvalue,0,type)
  238. DllCall("WriteProcessMemory","Uint",hGTA,"Uint",dwAddress,"Uint",&finalvalue,"Uint",size,"Uint",0)
  239. }
  240. __WSTRING(dwAddress, wString)
  241. { sString := wString
  242. if A_IsUnicode
  243. sString := __unicodeToAnsi(wString)
  244. DllCall("WriteProcessMemory", "UInt", hGTA, "UInt", dwAddress, "Str", sString, "UInt", StrLen(wString) + 1, "UInt", 0, "UInt")
  245. }
  246. __RAW(dwAddress, pBuffer, dwLen)
  247. { DllCall("WriteProcessMemory", "UInt", hGTA, "UInt", dwAddress, "UInt", pBuffer, "UInt", dwLen, "UInt", 0, "UInt")
  248. }
  249. CPed(matrix)
  250. { If(!matrix)
  251. return __DWORD(ADDR_CPED_PTR)
  252. else return Matrix(__DWORD(ADDR_CPED_PTR))
  253. }
  254. Matrix(dwAddress)
  255. { return __DWORD(dwAddress + OFFSET_MATRIX)
  256. }
  257. Vehicle(matrix)
  258. { If(!matrix)
  259. return __DWORD(ADDR_VEHICLE_PTR)
  260. else return Matrix(__DWORD(ADDR_VEHICLE_PTR))
  261. }
  262. InfoOffset(settings)
  263. { If(!settings)
  264. return __DWORD(g_dwSAMP_Addr + SAMP_INFO_OFFSET)
  265. else return __DWORD(__DWORD(g_dwSAMP_Addr + SAMP_INFO_OFFSET) + SAMP_SETTINGS_OFFSET)
  266. }
  267. SAMP_pPool(pool){
  268. return __DWORD(__DWORD(InfoOffset + SAMP_PPOOLS_OFFSET) + SAMP_PPOOL_PLAYER_OFFSET)
  269. }
  270. _sub5L920(pointer, matrix=0)
  271. { If(matrix)
  272. pointer := Matrix(pointer)
  273. return [__FLOAT(pointer + OFFSET_POSX), __FLOAT(pointer + OFFSET_POSY), __FLOAT(pointer + OFFSET_POSZ)]
  274. }
  275. IsPlayerInAnyVehicle()
  276. { return (Vehicle(0) > 0)
  277. }
  278. GetTargetPed()
  279. { return __DWORD(__DWORD(ADDR_WEAPON_TARGET) + OFFSET_CPED_OTARGET)
  280. }
  281. _sub5L92M(){
  282. return (__READ(m + 1856, 2, "Short") == 358 ? 1 : 0)
  283. }
  284. AddChatMessage(text,color=0xffffffff)
  285. { dwFunc := g_dwSAMP_Addr + 0x64010
  286. __DWORD(g_dwSAMP_Addr + 0x21A0E4, dwAddress)
  287. callWithParams(dwFunc, [["i", dwAddress],["i", 8],["s", text],["i", 0],["i", color],["i", 0]], false, true)
  288. }
  289. IsChatOpen()
  290. { return (__DWORD(__DWORD(g_dwSAMP_Addr + ADDR_SAMP_INCHAT_PTR) + ADDR_SAMP_INCHAT_PTR_OFF) > 0)
  291. }
  292. _sub5L9367()
  293. {
  294. sub5L9 := []
  295. if(!updateScoreboardDataEx())
  296. return 0
  297. Loop, % SAMP_PLAYER_MAX
  298. {
  299. i := A_Index-1
  300. dwRemoteplayer := __DWORD(stPlayerPool+46+i*4)
  301. if(dwRemoteplayer==0)
  302. continue
  303. __DWORD(dwRemoteplayer, dwRemoteplayerData)
  304. if(dwRemoteplayerData==0)
  305. continue
  306. __DWORD(dwRemoteplayerData, dwpSAMP_Actor)
  307. if(dwpSAMP_Actor==0)
  308. continue
  309. __DWORD(dwpSAMP_Actor + 676, dwPed)
  310. if(dwPed==0)
  311. continue
  312. o := Object("sub", dwPed)
  313. sub5L9[i] := o
  314. }
  315. return 1
  316. }
  317. updateScoreboardDataEx(){
  318. callWithParams(g_dwSAMP_Addr + FUNC_UPDATESCOREBOARD, [["i", InfoOffset]], false, true)
  319. return true
  320. }
  321. AntiCrash(){
  322. cReport := ADDR_SAMP_CRASHREPORT
  323. __WRITE(g_dwSAMP_Addr + cReport, 0x90909090, 4)
  324. cReport += 0x4
  325. __WRITE(g_dwSAMP_Addr + cReport, 0x90, 1)
  326. cReport += 0x9
  327. __WRITE(g_dwSAMP_Addr + cReport, 0x90909090, 4)
  328. cReport += 0x4
  329. __WRITE(g_dwSAMP_Addr + cReport, 0x90, 1)
  330. }
  331. SampPatchDisableAnticheat(){
  332. for i, patch in SAMP_AC_PATCHES
  333. {
  334. tobin(d, SAMP_AC_BYTES[i])
  335. __RAW(g_dwSAMP_Addr + patch, &d, StrLen(SAMP_AC_BYTES[i]) / 2)
  336. }
  337. }
  338. tobin(byref addr, str="")
  339. {
  340. if(!RegExMatch(str,"^([a-fA-F0-9][a-fA-F0-9])*$"))
  341. {
  342. msgbox % "fail tobin"
  343. return
  344. }
  345. i:=Strlen(str)/2
  346. VarSetCapacity(addr, i)
  347. dataddr := &addr
  348. x:=""
  349. loop,parse,str
  350. {
  351. if(A_Index & 1)
  352. x := A_Loopfield
  353. else
  354. {
  355. DllCall("RtlFillMemory"
  356. , "UInt", dataddr
  357. , "UInt", 1
  358. , "UChar", "0x" x A_Loopfield)
  359. dataddr++
  360. }
  361. }
  362. }
  363. _subr()
  364. {
  365. If(GetKeyState("RButton", "P"))
  366. {
  367. _sub5L9367()
  368. for i, k in sub5L9
  369. {
  370. If(k)
  371. {
  372. If(_sub5L2411b(k.sub))
  373. {
  374. If(__FLOAT(k.sub + 1344))
  375. {
  376. sub5L9299 := _sub5L920(k.sub, 1)
  377. sub5B588A := _sub5L920(mainMatrix, 0)
  378. If(_sub5L9211(sub5L9299[1], sub5L9299[2], sub5L9299[3] - 1.0, subMO89, subMO90) && _sub5L9211(sub5L9299[1], sub5L9299[2], sub5L9299[3] + 0.9, subMO91, subMO92))
  379. {
  380. If(subMO89)
  381. {
  382. submH := subMO90 - subMO92
  383. subMW23 := submH / 2.5
  384. subNT89L := chairX
  385. subNT98L := chairY
  386. subT89LN := _sub5L92M()
  387. if(subT89LN){
  388. subNT89L := s_chairX
  389. subNT98L := s_chairY
  390. }
  391. If(aim || pSilent)
  392. {
  393. if((subNT89L > subMO91 - (subMW23 * usedFOV) && subNT89L < subMO91 + (subMW23 * usedFOV)) && (subNT98L > subMO92 && subNT98L < subMO92 + submH))
  394. {
  395. __FLOAT(11989592, sub5L9212)
  396. sub5L9300 := __FLOAT(11991500, sub5L9221) - sub5L9299[1]
  397. sub5L9301 := __FLOAT(11991504, sub5L9295) - sub5L9299[2]
  398. subI9301 := sqrt((sub5L9300 * sub5L9300) + (sub5L9301 * sub5L9301))
  399. subI9987 := acos(sub5L9300 / subI9301)
  400. If(subI9301 > 3.5)
  401. {
  402. if(sub5L9300 <= 0 && sub5L9301 >= 0 || sub5L9300 >= 0 && sub5L9301 >= 0)
  403. {
  404. If(subT89LN)
  405. subM167L := (subI9987)- sub5L9212
  406. else
  407. subM167L := (subI9987 + 0.0389) - sub5L9212
  408. subMI78 := sub5L9212 - subI9987
  409. }
  410. if(sub5L9300 >= 0 && sub5L9301 <= 0 || sub5L9300 <= 0 && sub5L9301 <= 0)
  411. {
  412. If(subT89LN)
  413. subM167L := (-subI9987) - sub5L9212
  414. else
  415. subM167L := (-subI9987 + 0.0389) - sub5L9212
  416. subMI78 := sub5L9212 - (-subI9987)
  417. }
  418. subSM894 := subM167L / smooth
  419. If(aim)
  420. {
  421. If(subSM894 > -1.0 && subSM894 < 0.5 && subM167L > -2.0 && subM167L < 2.0 && subMI78 < 0.1800 && subMI78 > -0.1800){
  422. VarSetCapacity(d, 4, 0)
  423. NumPut(sub5L9212 += subSM894, d, 0, "float")
  424. SEC(11989592, &d, 4)
  425. }
  426. }
  427. If(pSilent){
  428. If(subMI78 < 0.1800 && subMI78 > -0.1800){
  429. sub5L9897 := _sub5L920(mainMatrix, 0)
  430. __DWORD(12231696, w)
  431. If(boneMode == 1)
  432. cbone := 8
  433. else if(boneMode == 2)
  434. cbone := 4
  435. else if(boneMode == 3)
  436. cbone := 42
  437. else if(boneMode == 4){
  438. d := b.MaxIndex()
  439. a := b.minIndex()
  440. Random, cbone, %a%, %d%
  441. }
  442. bonepos := GetBonePosition(k.sub, (cbone == 4 ? b[cbone] : cbone))
  443. SendBulletSync(1,i,w,sub5L9897[1],sub5L9897[2],sub5L9897[3],bonepos[1],bonepos[2],bonepos[3], bonepos[1]-sub5L9299[1], bonepos[2]-sub5L9299[2], bonepos[3]-sub5L9299[3])
  444. if(!subI9288){
  445. subI9288 := 1
  446. _subK78L77()
  447. }
  448. }
  449. }
  450. }
  451. }else if(subI9288 && pSilent){
  452. subI9288 := 0
  453. _subK78L74()
  454. }
  455. }
  456. }
  457. }
  458. }
  459. }
  460. }
  461. }
  462. }else{
  463. if(subI9288){
  464. subI9288 := 0
  465. _subK78L74()
  466. }
  467. }
  468. }
  469. _sub5L9211(posX, posY, posZ, byref sX, byref sY) {
  470. VarSetCapacity(params, 12)
  471. NumPut(posX, params, 0, "Float")
  472. NumPut(posY, params, 4, "Float")
  473. NumPut(posZ, params, 8, "Float")
  474. __RAW(pParam1, &params, 12)
  475. if(ErrorLevel)
  476. return false
  477. VarSetCapacity(injectData, 25, 0)
  478. NumPut(0x68, injectData, 0, "UChar")
  479. NumPut(pParam2, injectData, 1, "UInt")
  480. NumPut(0x68, injectData, 5, "UChar")
  481. NumPut(pParam1, injectData, 6, "UInt")
  482. NumPut(0xE8, injectData, 10, "UChar")
  483. offset := 0x71DAB0 - (pInjectFunc + 15)
  484. NumPut(offset, injectData, 11, "Int")
  485. NumPut(0xC483, injectData, 15, "UShort")
  486. NumPut(8, injectData, 17, "UChar")
  487. NumPut(0x0589, injectData, 18, "UShort")
  488. NumPut(pParam2 +8, injectData, 20, "UInt")
  489. NumPut(0xC3, injectData, 24, "UChar")
  490. __RAW(pInjectFunc, &injectData, 25)
  491. if(ErrorLevel)
  492. return false
  493. hThread := createRemoteThread(0, 0, pInjectFunc, 0, 0, 0)
  494. if(ErrorLevel)
  495. return false
  496. waitForSingleObject(hThread, 0xFFFFFFFF)
  497. closeProcess(hThread)
  498. __FLOAT(pParam2, sX)
  499. __FLOAT(pParam2 + 4, sY)
  500. return true
  501. }
  502. GetBonePosition(ped,boneId){
  503. callWithParams(0x5E4280, [["i", ped],["i", pParam1],["i", boneId],["i", 1]], false, true)
  504. return [__FLOAT(pParam1), __FLOAT(pParam1 + 4), __FLOAT(pParam1 + 8)]
  505. }
  506. _sub5L2411b(ped)
  507. {
  508. VarSetCapacity(injectData, 16, 0)
  509. NumPut(0xB9, injectData, 0, "UChar")
  510. NumPut(ped, injectData, 1, "UInt")
  511. NumPut(0xE8, injectData, 5, "UChar")
  512. offset := 0x536BC0 - (pInjectFunc + 10)
  513. NumPut(offset, injectData, 6, "Int")
  514. NumPut(0xA2, injectData, 10, "UChar")
  515. NumPut(pParam1, injectData, 11, "Int")
  516. NumPut(0xC3, injectData, 15, "UChar")
  517. __RAW(pInjectFunc, &injectData, 16)
  518. hThread := createRemoteThread(0, 0, pInjectFunc, 0, 0, 0)
  519. waitForSingleObject(hThread, 0xFFFFFFFF)
  520. closeProcess(hThread)
  521. return __READ(pParam1, 1, "UChar")
  522. }
  523.  
  524.  
  525. SEC(dwAddress, pBuffer, dwLen)
  526. ; by paul
  527. {
  528. bufAddr := pInjectFunc+200
  529. __RAW(bufAddr, pBuffer, dwLen)
  530. if(ErrorLevel)
  531. return false
  532. str := "5589E583EC108B45088B008945FC8B45088B40048945F88B45088B40088945F4C745F0000000008B45F03B45F4731A8B45FC8B55F001C28B45F80345F00FB60088028D45F0FF00EBDEB800000000C9C20400"
  533. tobin(injectData, str)
  534. VarSetCapacity(params, 12)
  535. NumPut(dwAddress, params, 0, "UInt")
  536. NumPut(bufAddr, params, 4, "UInt")
  537. NumPut(dwLen, params, 8, "UInt")
  538. __RAW(pInjectFunc+180, &params, 12)
  539. if(ErrorLevel)
  540. return false
  541. __RAW(pInjectFunc, &injectData, strlen(str)/2)
  542. hThread := createRemoteThread(0, 0, pInjectFunc, pInjectFunc+180, 0, 0)
  543. if(ErrorLevel)
  544. return false
  545. waitForSingleObject(hThread, 0xFFFFFFFF)
  546. return true
  547. }
  548.  
  549.  
  550. _subK78L77()
  551. ; by paul
  552. { codeaddr := pInjectFunc+357
  553. valaddr := pInjectFunc+951
  554. VarSetCapacity(injectData1, 118)
  555. NumPut(0x5824448D, injectData1, 0, "UInt")
  556. NumPut(0x408B, injectData1, 4, "UShort")
  557. NumPut(0x0C, injectData1, 6, "UChar")
  558. NumPut(0x158B, injectData1, 7, "UShort")
  559. NumPut(valaddr, injectData1, 9, "UInt")
  560. NumPut(0x1089, injectData1, 13, "UShort")
  561. NumPut(0x158B, injectData1, 15, "UShort")
  562. NumPut(valaddr+4, injectData1, 17, "UInt")
  563. NumPut(0x5089, injectData1, 21, "UShort")
  564. NumPut(0x04, injectData1, 23, "UChar")
  565. NumPut(0x158B, injectData1, 24, "UShort")
  566. NumPut(valaddr+8, injectData1, 26, "UInt")
  567. NumPut(0x5089, injectData1, 30, "UShort")
  568. NumPut(0x08, injectData1, 32, "UChar")
  569. NumPut(0x158B, injectData1, 33, "UShort")
  570. NumPut(valaddr+12, injectData1, 35, "UInt")
  571. NumPut(0x5089, injectData1, 39, "UShort")
  572. NumPut(0x0C, injectData1, 41, "UChar")
  573. NumPut(0x158B, injectData1, 42, "UShort")
  574. NumPut(valaddr+16, injectData1, 44, "UInt")
  575. NumPut(0x5089, injectData1, 48, "UShort")
  576. NumPut(0x10, injectData1, 50, "UChar")
  577. NumPut(0x158B, injectData1, 51, "UShort")
  578. NumPut(valaddr+20, injectData1, 53, "UInt")
  579. NumPut(0x5089, injectData1, 57, "UShort")
  580. NumPut(0x14, injectData1, 59, "UChar")
  581. NumPut(0x158B, injectData1, 60, "UShort")
  582. NumPut(valaddr+24, injectData1, 62, "UInt")
  583. NumPut(0x5089, injectData1, 66, "UShort")
  584. NumPut(0x18, injectData1, 68, "UChar")
  585. NumPut(0x158B, injectData1, 69, "UShort")
  586. NumPut(valaddr+28, injectData1, 71, "UInt")
  587. NumPut(0x5089, injectData1, 75, "UShort")
  588. NumPut(0x1C, injectData1, 77, "UChar")
  589. NumPut(0x158B, injectData1, 78, "UShort")
  590. NumPut(valaddr+32, injectData1, 80, "UInt")
  591. NumPut(0x5089, injectData1, 84, "UShort")
  592. NumPut(0x20, injectData1, 86, "UChar")
  593. NumPut(0x158B, injectData1, 87, "UShort")
  594. NumPut(valaddr+36, injectData1, 89, "UInt")
  595. NumPut(0x5089, injectData1, 93, "UShort")
  596. NumPut(0x24, injectData1, 95, "UChar")
  597. NumPut(0x158B, injectData1, 96, "UShort")
  598. NumPut(valaddr+40, injectData1, 98, "UInt")
  599. NumPut(0x90285088, injectData1, 102, "UInt")
  600. NumPut(0x118B, injectData1, 106, "UShort")
  601. NumPut(0x5824448D, injectData1, 108, "UInt")
  602. NumPut(0x50, injectData1, 112, "UChar")
  603. NumPut(0xE9, injectData1, 113, "UChar")
  604. offset := (g_dwSAMP_Addr + 0x6B83) - (codeaddr+118)
  605. NumPut(offset, injectData1, 114, "UInt")
  606. VarSetCapacity(injectData2, 5)
  607. NumPut(0xE9, injectData2, 0, "UChar")
  608. offset := codeaddr - (g_dwSAMP_Addr + 0x6B83)
  609. NumPut(offset, injectData2, 1, "UInt")
  610. __RAW(codeaddr, &injectData1, 118)
  611. if(ErrorLevel)
  612. return
  613. __RAW(g_dwSAMP_Addr + 0x6B7E, &injectData2, 5)
  614. ErrorLevel := ERROR_OK
  615. }
  616.  
  617. _subK78L74()
  618. ; by paul
  619. { VarSetCapacity(injectData, 5)
  620. NumPut(0x5824448D, injectData, 0, "UInt")
  621. NumPut(0x50, injectData, 4, "UChar")
  622. __RAW(g_dwSAMP_Addr + 0x6B7E, &injectData, 5)
  623. }
  624. SendBulletSync(hittype,hitid,weaponid, fOrigX,fOrigY,fOrigZ,fTargetX,fTargetY,fTargetZ,fCenterX,fCenterY,fCenterZ)
  625. ; by paul
  626. { valaddr := pInjectFunc+951
  627. VarSetCapacity(val, 41)
  628. NumPut(0xCE, val, 0, "UChar")
  629. NumPut(hittype, val, 1, "UChar")
  630. NumPut(hitid, val, 2, "UShort")
  631. NumPut(fOrigX, val, 4, "Float")
  632. NumPut(fOrigY, val, 8, "Float")
  633. NumPut(fOrigZ, val, 12, "Float")
  634. NumPut(fTargetX, val, 16, "Float")
  635. NumPut(fTargetY, val, 20, "Float")
  636. NumPut(fTargetZ, val, 24, "Float")
  637. NumPut(fCenterX, val, 28, "Float")
  638. NumPut(fCenterY, val, 32, "Float")
  639. NumPut(fCenterZ, val, 36, "Float")
  640. NumPut(weaponid, val, 40, "UChar")
  641. __RAW(valaddr, &val, 41)
  642. }
  643.  
  644. PATH_OVERLAY := RelToAbs(A_ScriptDir, "DX39.dll")
  645. hModule := DllCall("LoadLibrary", Str, PATH_OVERLAY)
  646. if(hModule == -1 || hModule == 0)
  647. {
  648. MsgBox, 48, Error, The dll-file couldn't be found!
  649. ExitApp
  650. }
  651. Init_func := DllCall("GetProcAddress", UInt, hModule, Str, "Init")
  652. SetParam_func := DllCall("GetProcAddress", UInt, hModule, Str, "SetParam")
  653. TextCreate_func := DllCall("GetProcAddress", UInt, hModule, Str, "TextCreate")
  654. TextDestroy_func := DllCall("GetProcAddress", UInt, hModule, Str, "TextDestroy")
  655. TextSetShadow_func := DllCall("GetProcAddress", UInt, hModule, Str, "TextSetShadow")
  656. TextSetShown_func := DllCall("GetProcAddress", UInt, hModule, Str, "TextSetShown")
  657. TextSetColor_func := DllCall("GetProcAddress", UInt, hModule, Str, "TextSetColor")
  658. TextSetPos_func := DllCall("GetProcAddress", UInt, hModule, Str, "TextSetPos")
  659. TextSetString_func := DllCall("GetProcAddress", UInt, hModule, Str, "TextSetString")
  660. TextUpdate_func := DllCall("GetProcAddress", UInt, hModule, Str, "TextUpdate")
  661. BoxCreate_func := DllCall("GetProcAddress", UInt, hModule, Str, "BoxCreate")
  662. BoxDestroy_func := DllCall("GetProcAddress", UInt, hModule, Str, "BoxDestroy")
  663. BoxSetShown_func := DllCall("GetProcAddress", UInt, hModule, Str, "BoxSetShown")
  664. BoxSetBorder_func := DllCall("GetProcAddress", UInt, hModule, Str, "BoxSetBorder")
  665. BoxSetBorderColor_func := DllCall("GetProcAddress", UInt, hModule, Str, "BoxSetBorderColor")
  666. BoxSetColor_func := DllCall("GetProcAddress", UInt, hModule, Str, "BoxSetColor")
  667. BoxSetHeight_func := DllCall("GetProcAddress", UInt, hModule, Str, "BoxSetHeight")
  668. BoxSetPos_func := DllCall("GetProcAddress", UInt, hModule, Str, "BoxSetPos")
  669. BoxSetWidth_func := DllCall("GetProcAddress", UInt, hModule, Str, "BoxSetWidth")
  670. LineCreate_func := DllCall("GetProcAddress", UInt, hModule, Str, "LineCreate")
  671. LineDestroy_func := DllCall("GetProcAddress", UInt, hModule, Str, "LineDestroy")
  672. LineSetShown_func := DllCall("GetProcAddress", UInt, hModule, Str, "LineSetShown")
  673. LineSetColor_func := DllCall("GetProcAddress", UInt, hModule, Str, "LineSetColor")
  674. LineSetWidth_func := DllCall("GetProcAddress", UInt, hModule, Str, "LineSetWidth")
  675. LineSetPos_func := DllCall("GetProcAddress", UInt, hModule, Str, "LineSetPos")
  676. ImageCreate_func := DllCall("GetProcAddress", UInt, hModule, Str, "ImageCreate")
  677. ImageDestroy_func := DllCall("GetProcAddress", UInt, hModule, Str, "ImageDestroy")
  678. ImageSetShown_func := DllCall("GetProcAddress", UInt, hModule, Str, "ImageSetShown")
  679. ImageSetAlign_func := DllCall("GetProcAddress", UInt, hModule, Str, "ImageSetAlign")
  680. ImageSetPos_func := DllCall("GetProcAddress", UInt, hModule, Str, "ImageSetPos")
  681. ImageSetRotation_func := DllCall("GetProcAddress", UInt, hModule, Str, "ImageSetRotation")
  682. DestroyAllVisual_func := DllCall("GetProcAddress", UInt, hModule, Str, "DestroyAllVisual")
  683. ShowAllVisual_func := DllCall("GetProcAddress", UInt, hModule, Str, "ShowAllVisual")
  684. HideAllVisual_func := DllCall("GetProcAddress", UInt, hModule, Str, "HideAllVisual")
  685. GetFrameRate_func := DllCall("GetProcAddress", UInt, hModule, Str, "GetFrameRate")
  686. GetScreenSpecs_func := DllCall("GetProcAddress", UInt, hModule, Str, "GetScreenSpecs")
  687. SetCalculationRatio_func:= DllCall("GetProcAddress", UInt, hModule, Str, "SetCalculationRatio")
  688. SetOverlayPriority_func := DllCall("GetProcAddress", UInt, hModule, Str, "SetOverlayPriority")
  689. Init()
  690. {
  691. global Init_func
  692. res := DllCall(Init_func)
  693. return res
  694. }
  695. SetParam(str_Name, str_Value)
  696. {
  697. global SetParam_func
  698. res := DllCall(SetParam_func, Str, str_Name, Str, str_Value)
  699. return res
  700. }
  701. TextCreate(Font, fontsize, bold, italic, x, y, color, text, shadow, show)
  702. {
  703. global TextCreate_func
  704. res := DllCall(TextCreate_func,Str,Font,Int,fontsize,UChar,bold,UChar,italic,Int,x,Int,y,UInt,color,Str,text,UChar,shadow,UChar,show)
  705. return res
  706. }
  707. TextDestroy(id)
  708. {
  709. global TextDestroy_func
  710. res := DllCall(TextDestroy_func,Int,id)
  711. return res
  712. }
  713. TextSetShadow(id, shadow)
  714. {
  715. global TextSetShadow_func
  716. res := DllCall(TextSetShadow_func,Int,id,UChar,shadow)
  717. return res
  718. }
  719. TextSetShown(id, show)
  720. {
  721. global TextSetShown_func
  722. res := DllCall(TextSetShown_func,Int,id,UChar,show)
  723. return res
  724. }
  725. TextSetColor(id,color)
  726. {
  727. global TextSetColor_func
  728. res := DllCall(TextSetColor_func,Int,id,UInt,color)
  729. return res
  730. }
  731. TextSetPos(id,x,y)
  732. {
  733. global TextSetPos_func
  734. res := DllCall(TextSetPos_func,Int,id,Int,x,Int,y)
  735. return res
  736. }
  737. TextSetString(id,Text)
  738. {
  739. global TextSetString_func
  740. res := DllCall(TextSetString_func,Int,id,Str,Text)
  741. return res
  742. }
  743. TextUpdate(id,Font,Fontsize,bold,italic)
  744. {
  745. global TextUpdate_func
  746. res := DllCall(TextUpdate_func,Int,id,Str,Font,int,Fontsize,UChar,bold,UChar,italic)
  747. return res
  748. }
  749. BoxCreate(x,y,width,height,Color,show)
  750. {
  751. global BoxCreate_func
  752. res := DllCall(BoxCreate_func,Int,x,Int,y,Int,width,Int,height,UInt,Color,UChar,show)
  753. return res
  754. }
  755. BoxDestroy(id)
  756. {
  757. global BoxDestroy_func
  758. res := DllCall(BoxDestroy_func,Int,id)
  759. return res
  760. }
  761. BoxSetShown(id,Show)
  762. {
  763. global BoxSetShown_func
  764. res := DllCall(BoxSetShown_func,Int,id,UChar,Show)
  765. return res
  766. }
  767. BoxSetBorder(id,height,Show)
  768. {
  769. global BoxSetBorder_func
  770. res := DllCall(BoxSetBorder_func,Int,id,Int,height,Int,Show)
  771. return res
  772. }
  773. BoxSetBorderColor(id,Color)
  774. {
  775. global BoxSetBorderColor_func
  776. res := DllCall(BoxSetBorderColor_func,Int,id,UInt,Color)
  777. return res
  778. }
  779. BoxSetColor(id,Color)
  780. {
  781. global BoxSetColor_func
  782. res := DllCall(BoxSetColor_func,Int,id,UInt,Color)
  783. return res
  784. }
  785. BoxSetHeight(id,height)
  786. {
  787. global BoxSetHeight_func
  788. res := DllCall(BoxSetHeight_func,Int,id,Int,height)
  789. return res
  790. }
  791. BoxSetPos(id,x,y)
  792. {
  793. global BoxSetPos_func
  794. res := DllCall(BoxSetPos_func,Int,id,Int,x,Int,y)
  795. return res
  796. }
  797. BoxSetWidth(id,width)
  798. {
  799. global BoxSetWidth_func
  800. res := DllCall(BoxSetWidth_func,Int,id,Int,width)
  801. return res
  802. }
  803. LineCreate(x1,y1,x2,y2,width,color,show)
  804. {
  805. global LineCreate_func
  806. res := DllCall(LineCreate_func,Int,x1,Int,y1,Int,x2,Int,y2,Int,Width,UInt,color,UChar,show)
  807. return res
  808. }
  809. LineDestroy(id)
  810. {
  811. global LineDestroy_func
  812. res := DllCall(LineDestroy_func,Int,id)
  813. return res
  814. }
  815. LineSetShown(id,show)
  816. {
  817. global LineSetShown_func
  818. res := DllCall(LineSetShown_func,Int,id,UChar,show)
  819. return res
  820. }
  821. LineSetColor(id,color)
  822. {
  823. global LineSetColor_func
  824. res := DllCall(LineSetColor_func,Int,id,UInt,color)
  825. return res
  826. }
  827. LineSetWidth(id, width)
  828. {
  829. global LineSetWidth_func
  830. res := DllCall(LineSetWidth_func,Int,id,Int,width)
  831. return res
  832. }
  833. LineSetPos(id,x1,y1,x2,y2)
  834. {
  835. global LineSetPos_func
  836. res := DllCall(LineSetPos_func,Int,id,Int,x1,Int,y1,Int,x2,Int,y2)
  837. return res
  838. }
  839. ImageCreate(path, x, y, rotation, align, show)
  840. {
  841. global ImageCreate_func
  842. res := DllCall(ImageCreate_func, Str, path, Int, x, Int, y, Int, rotation, Int, align, UChar, show)
  843. return res
  844. }
  845. ImageDestroy(id)
  846. {
  847. global ImageDestroy_func
  848. res := DllCall(ImageDestroy_func,Int,id)
  849. return res
  850. }
  851. ImageSetShown(id,show)
  852. {
  853. global ImageSetShown_func
  854. res := DllCall(ImageSetShown_func,Int,id,UChar,show)
  855. return res
  856. }
  857. ImageSetAlign(id,align)
  858. {
  859. global ImageSetAlign_func
  860. res := DllCall(ImageSetAlign_func,Int,id,Int,align)
  861. return res
  862. }
  863. ImageSetPos(id, x, y)
  864. {
  865. global ImageSetPos_func
  866. res := DllCall(ImageSetPos_func,Int,id,Int,x, Int, y)
  867. return res
  868. }
  869. ImageSetRotation(id, rotation)
  870. {
  871. global ImageSetRotation_func
  872. res := DllCall(ImageSetRotation_func,Int,id,Int, rotation)
  873. return res
  874. }
  875. DestroyAllVisual()
  876. {
  877. global DestroyAllVisual_func
  878. res := DllCall(DestroyAllVisual_func)
  879. return res
  880. }
  881. ShowAllVisual()
  882. {
  883. global ShowAllVisual_func
  884. res := DllCall(ShowAllVisual_func)
  885. return res
  886. }
  887. HideAllVisual()
  888. {
  889. global HideAllVisual_func
  890. res := DllCall(HideAllVisual_func )
  891. return res
  892. }
  893. GetFrameRate()
  894. {
  895. global GetFrameRate_func
  896. res := DllCall(GetFrameRate_func )
  897. return res
  898. }
  899. GetScreenSpecs(ByRef width, ByRef height)
  900. {
  901. global GetScreenSpecs_func
  902. res := DllCall(GetScreenSpecs_func, IntP, width, IntP, height)
  903. return res
  904. }
  905. SetCalculationRatio(width, height)
  906. {
  907. global SetCalculationRatio_func
  908. res := DllCall(SetCalculationRatio_func, Int, width, Int, height)
  909. return res
  910. }
  911. SetOverlayPriority(id, priority)
  912. {
  913. global SetOverlayPriority_func
  914. res := DllCall(SetOverlayPriority_func, Int, id, Int, priority)
  915. return res
  916. }
  917. RelToAbs(root, dir, s := "\") {
  918. pr := SubStr(root, 1, len := InStr(root, s, "", InStr(root, s . s) + 2) - 1)
  919. , root := SubStr(root, len + 1), sk := 0
  920. If InStr(root, s, "", 0) = StrLen(root)
  921. StringTrimRight, root, root, 1
  922. If InStr(dir, s, "", 0) = StrLen(dir)
  923. StringTrimRight, dir, dir, 1
  924. Loop, Parse, dir, %s%
  925. {
  926. If A_LoopField := ..
  927. StringLeft, root, root, InStr(root, s, "", 0) - 1
  928. Else If A_LoopField :=
  929. root =
  930. Else If A_LoopField != .
  931. Continue
  932. StringReplace, dir, dir, %A_LoopField%%s%
  933. }
  934. Return, pr . root . s . dir
  935. }
  936. cheatItem(d)
  937. {
  938. global
  939. If(d){
  940. TextSetColor(rectangle%output%, 0xFF00FF00)
  941. TextSetString(rectangle%output%, "1")
  942. }else{
  943. TextSetColor(rectangle%output%, 0xFF545454)
  944. TextSetString(rectangle%output%, "0")
  945. }
  946. }
  947. Inputwindow(info="Please enter the value") {
  948. global
  949. TextSetString(Ov_Inputwindow_Input, "")
  950. TextSetString(Ov_Inputwindow_Info, info)
  951. BoxSetShown(Ov_Inputwindow_Box, true)
  952. BoxSetShown(Ov_Inputwindow_Box_Info, true)
  953. BoxSetShown(Ov_Inputwindow_Text_Box, true)
  954. TextSetShown(Ov_Inputwindow_Info, true)
  955. TextSetShown(Ov_Inputwindow_Input, true)
  956. BlockInput, On
  957. Inputwindow_Input := ""
  958. Loop, {
  959. Input, Inputwindow_nchar, L1 I, {Backspace}{Enter}{Escape}
  960. StringTrimLeft, Inputwindow_Endkey, Errorlevel, 7
  961. If ( Inputwindow_Endkey = "Escape" )
  962. {
  963. CloseInputwindow()
  964. return ""
  965. }
  966. else If ( Inputwindow_Endkey = "Enter" )
  967. {
  968. CloseInputwindow()
  969. return Inputwindow_Input
  970. }
  971. else If ( Inputwindow_Endkey = "Backspace" )
  972. StringTrimRight, Inputwindow_Input, Inputwindow_Input, 1
  973. Inputwindow_Input := Inputwindow_Input Inputwindow_nchar
  974. TextSetString(Ov_Inputwindow_Input, Inputwindow_Input)
  975. }
  976. }
  977. CloseInputwindow() {
  978. global
  979. BlockInput, Off
  980. BoxSetShown(Ov_Inputwindow_Box, false)
  981. BoxSetShown(Ov_Inputwindow_Box_Info, false)
  982. BoxSetShown(Ov_Inputwindow_Text_Box, false)
  983. TextSetShown(Ov_Inputwindow_Info, false)
  984. TextSetShown(Ov_Inputwindow_Input, false)
  985. }
  986. MenuUpdate(){
  987. global
  988. If(!WinActive("GTA:SA:MP"))
  989. return
  990. text := Color_Primary_Text
  991. onoff := Color_Primary_Text
  992. for i, in Menu%Menu_Menu%
  993. {
  994. If(!txtcr)
  995. text .= Menu%Menu_Menu%[i] "`n"
  996. If ( Menu%Menu_Menu%_%i%_State )
  997. {
  998. onoff .= "1.00`n"
  999. }else if(i == 3){
  1000. onOff .= "" Round(smooth, 1) "`n"
  1001. }else if(i == 4){
  1002. onOff .= "" Round(fov, 1) "`n"
  1003. }else if(i == 7){
  1004. onOff .= "" Round(silentFOV, 1) "`n"
  1005. }else if(i == 8){
  1006. onOff .= "" bmode[boneMode] "`n"
  1007. }else if(i == 1 || i == 5 || i == 9){
  1008. onoff .= "`n"
  1009. }else{
  1010. onoff .= "-`n"
  1011. }
  1012. }
  1013. If(!txtcr)
  1014. txtcr := 1
  1015. BoxSetPos(Ov_Menu_Box_Cursor, Menu_X +1, Menu_Y + TEXT_SPACE_Y+ 1+ (Menu_Position - 1) * Menu_Factor)
  1016. BoxSetPos(Ov_Menu_Box_Lighter, Menu_X +1, Menu_Y + TEXT_SPACE_Y+1+ (Menu_Position - 1) * Menu_Factor)
  1017. Menu_Height := Menu%Menu_Menu%.MaxIndex() * Menu_Factor + 5
  1018. BoxSetHeight(Ov_Menu_Box_Text, Menu_Height)
  1019. if(!set){
  1020. TextSetString(Ov_Menu_Text_Text, text)
  1021. set := 1
  1022. }
  1023. TextSetString(Ov_Menu_Text_State, onoff)
  1024. }
  1025. MenuCreate() {
  1026. global
  1027. Ov_Menu_Titlebar := BoxCreate(menu_X, menu_Y - 10, menuwidth + 2, 12, 0xFF262626, 0)
  1028. Ov_Menu_Box_Text := BoxCreate(Menu_X, Menu_Y, menuwidth + 2, 0, menubackground, false)
  1029. Ov_Menu_Title := TextCreate("Calibri", 5, 0, 0, menu_X +5, menu_Y -9, 0xFFF57384, "~gsf aimbot 2k18", 1, 0)
  1030. Ov_Menu_Box_Cursor := BoxCreate(Menu_X, Menu_Y -20, menuwidth, 10, swcolor, false)
  1031. Ov_Menu_Box_Lighter := BoxCreate(Menu_X, Menu_Y -20, 1, 10, 0xFFFF5E6E, false)
  1032. Ov_Menu_Text_Text := TextCreate("Calibri", 7, 0, 0, Menu_X + 5, Menu_Y+ TEXT_SPACE_Y, textcolor_default, "...", 1, 0)
  1033. Ov_Menu_Text_State := TextCreate("Calibri", 7, 0, 1, Menu_X + menuwidth -30, Menu_Y + TEXT_SPACE_Y, 0xFFBABABA ,eerrur, 1, 0)
  1034. BoxSetBorder(Ov_Menu_Box_Text, 1, 1)
  1035. BoxSetBorderColor(Ov_Menu_Box_Text, 0xFF000000)
  1036. }
  1037. ListLines, Off
  1038. SetBatchLines, -1
  1039. If(!A_IsAdmin){
  1040. Run *RunAs "%A_ScriptFullPath%" %FullArgsQuoted%,, UseErrorLevel
  1041. If(ErrorLevel){
  1042. MsgBox, 53, WICHTIG: Als Admin starten.
  1043. IfMsgBox, Retry
  1044. Reload
  1045. Else
  1046. ExitApp
  1047. }
  1048. ExitApp
  1049. return
  1050. }
  1051. #NoEnv
  1052. #HotkeyInterval 1
  1053. #KeyHistory 0
  1054. #IfWinActive, GTA:SA:MP
  1055. #SingleInstance, force
  1056. #Persistent
  1057. #HotString EndChars `n
  1058. #HotString ?
  1059. OnExit, freeMemory
  1060. gosub getProcessAndModules
  1061. gosub vars
  1062. gosub arrays
  1063. SetParam("use_window", "1")
  1064. SetParam("window", "GTA:SA:MP")
  1065. gosub mainmenu
  1066. Hotkey, Insert, Menu_Toggle, on
  1067. return
  1068. getProcessAndModules:
  1069. global newPID := getPID("GTA:SA:MP")
  1070. if(newPID)
  1071. global hGTA := openProcess(newPID)
  1072. else{
  1073. MsgBox,GTA wurde nicht gefunden
  1074. ExitApp
  1075. }
  1076. global g_dwSAMP_Addr := getModuleBaseAddress("samp.dll", hGTA)
  1077. global g_dwProcess := 0x400000
  1078. global pMemory := virtualAllocEx(hGTA, 6144, 0x1000 | 0x2000, 0x40)
  1079. global pParam1 := pMemory
  1080. global pParam2 := pMemory + 1024
  1081. global pParam3 := pMemory + 2048
  1082. global pParam4 := pMemory + 3072
  1083. global pParam5 := pMemory + 4096
  1084. global pInjectFunc := pMemory + 5120
  1085. global m := CPed(0)
  1086. global mainMatrix := CPed(1)
  1087. global InfoOffset := InfoOffset(0)
  1088. global SAMPSettings := InfoOffset(1)
  1089. global stPlayerPool := SAMP_pPool("Player")
  1090. __DWORD(12677188, l1)
  1091. __DWORD(12677192, l2)
  1092. global chairX := l1 / 1.885
  1093. global chairY := l2 / 2.50
  1094. global s_chairX := l1 / 2.0
  1095. global s_chairY := l2 / 2.0
  1096. global divX := l1 / 800
  1097. global sub5L9 := ""
  1098. global locked_ped := 0
  1099. AntiCrash()
  1100. SampPatchDisableAnticheat()
  1101. return
  1102. freeMemory:
  1103. virtualFreeEx(hGTA, pMemory, 0, 0x8000)
  1104. closeProcess(hGTA)
  1105. DestroyAllvIsual()
  1106. _subK78L74()
  1107. ExitApp
  1108. return
  1109. vars:
  1110. IniRead, Menu_X, siixmod.ini, d3d9, Menu_X
  1111. IniRead, Menu_Y, siixmod.ini, d3d9, Menu_Y
  1112. IniRead, Smooth, siixmod.ini, d3d9, Smooth, 1.0
  1113. IniRead, fov, siixmod.ini, d3d9, fov, 2.0
  1114. IniRead, silentFOV, siixmod.ini, d3d9, silentFOV, 1.5
  1115. IniRead, boneMode, siixmod.ini, d3d9, boneMode, 4
  1116. global started
  1117. global Smooth
  1118. global FOV
  1119. global silentFOV
  1120. global usedFOV
  1121. global boneMode
  1122. global aim
  1123.  
  1124. global pSilent
  1125. global subI9288 := 0
  1126. global menuwidth := 105
  1127. global titlecolor := 0xFF919191
  1128. global textcolor_default := 0xFFFFFFFF
  1129. global lightercolor := 0xff42B7FF
  1130. global swcolor := 0xAA000000
  1131. global menubackground := 0xff404040
  1132. global Menu_Menu := "Main"
  1133. global Menu_Position := 1
  1134. global Menu_Level := 1
  1135. global Menu_History1 := "Main"
  1136. global Menu_Factor := 10.52
  1137. global TEXT_SPACE_Y := 3
  1138. return
  1139. arrays:
  1140. MenuMain := ["{4286f4}[Smooth Aimbot]{FFFFFF}"
  1141. , " - Smooth Aimbot"
  1142. , " - Smooth +/-"
  1143. , " - FOV +/-"
  1144. , "{8642f4}[Silent Aimbot]{FFFFFF}"
  1145. , " - pSilent"
  1146. , " - FOV +/-"
  1147. , " - Bone"]
  1148. return
  1149. mainmenu:
  1150. MenuCreate()
  1151. return
  1152. Menu_Toggle:
  1153. Menu_State := !Menu_State
  1154. If ( Menu_State )
  1155. {
  1156. Hotkey, Up, Menu_Up, On
  1157. Hotkey, Down, Menu_Down, On
  1158. Hotkey, Enter, Menu_Enter, On
  1159. Hotkey, NumpadAdd, DefineVars, On
  1160. Hotkey, NumpadSub, DefineVars, On
  1161. If ( ! Menu_FT )
  1162. {
  1163. Menu_FT := 1
  1164. MenuUpdate()
  1165. }
  1166. }Else{
  1167. Hotkey, Up, Menu_Up, Off
  1168. Hotkey, Down, Menu_Down, Off
  1169. Hotkey, Enter, Menu_Enter, Off
  1170. Hotkey, NumpadAdd, DefineVars, Off
  1171. Hotkey, NumpadSub, DefineVars, Off
  1172. }
  1173. BoxSetShown(Ov_Menu_Titlebar, Menu_State)
  1174. BoxSetShown(Ov_Menu_Box_Cursor, Menu_State)
  1175. BoxSetShown(Ov_Menu_Box_Lighter, Menu_State)
  1176. BoxSetShown(Ov_Menu_Box_Text, Menu_State)
  1177. TextSetShown(Ov_Menu_Text_Text, Menu_State)
  1178. TextSetShown(Ov_Menu_Title, Menu_State)
  1179. TextSetShown(Ov_Menu_Text_State, Menu_State)
  1180. return
  1181. Menu_Up:
  1182. If (Menu_Position = 1)
  1183. Menu_Position := Menu%Menu_Menu%.MaxIndex()
  1184. else
  1185. Menu_Position--
  1186. MenuUpdate()
  1187. return
  1188. Menu_Down:
  1189. If ( Menu_Position = Menu%Menu_Menu%.MaxIndex())
  1190. Menu_Position := 1
  1191. else Menu_Position++
  1192. MenuUpdate()
  1193. return
  1194. Menu_Enter:
  1195. Goto, Menu%Menu_Menu%_%Menu_Position%
  1196. return
  1197. MenuMain_3:
  1198. MenuMain_4:
  1199. MenuMain_9:
  1200. return
  1201. DefineVars:
  1202. If(A_ThisHotkey == "NumpadAdd"){
  1203. If(Menu_Position == 3){
  1204. If(Smooth < 30.0)
  1205. smooth++
  1206. }else if(Menu_Position == 4){
  1207. If(FOV < 3.5)
  1208. fov += 0.1
  1209. }else if(Menu_Position == 7){
  1210. if(silentFOV < 3.5)
  1211. silentFOV += 0.1
  1212. }else if(Menu_Position == 8){
  1213. If(boneMode < 4)
  1214. boneMode++
  1215. else boneMode := 1
  1216. }
  1217. }else If(A_ThisHotkey == "NumpadSub"){
  1218. If(Menu_Position == 3)
  1219. {
  1220. If(Smooth >1.0)
  1221. smooth--
  1222. }else if(Menu_Position == 4){
  1223. If(FOV > 0.4)
  1224. fov -= 0.1
  1225. }else if(Menu_Position == 7){
  1226. if(silentFOV > 0.4)
  1227. silentFOV -= 0.1
  1228. }else if(Menu_Position == 8){
  1229. If(boneMode >1)
  1230. boneMode--
  1231. else boneMode := 4
  1232. }
  1233. }
  1234. If(aim)
  1235. usedFOV := FOV
  1236. else If(pSilent)
  1237. usedFOV := silentFOV
  1238. IniWrite, %smooth%, siixmod.ini, d3d9, Smooth
  1239. IniWrite, %fov%, siixmod.ini, d3d9, fov
  1240. IniWrite, %silentFOV%, siixmod.ini, d3d9, silentFOV
  1241. IniWrite, %boneMode%, siixmod.ini, d3d9, boneMode
  1242. MenuUpdate()
  1243. return
  1244. MenuMain_1:
  1245. return
  1246. MenuMain_2:
  1247. If(pSilent)
  1248. return
  1249. if(!aim)
  1250. {
  1251. usedFOV := FOV
  1252. If(!started){
  1253. SetTimer, aimer, 30
  1254. started := 1
  1255. }
  1256. }else{
  1257. if(started){
  1258. SetTimer, aimer, off
  1259. started := 0
  1260. }
  1261. }
  1262. aim := !aim, MenuMain_%Menu_Position%_State := aim
  1263. MenuUpdate()
  1264. return
  1265. MenuMain_5:
  1266. return
  1267. MenuMain_6:
  1268. If(aim)
  1269. return
  1270. if(!pSilent)
  1271. {
  1272. usedFOV := silentFOV
  1273. If(!started){
  1274. SetTimer, aimer, 10
  1275. started := 1
  1276. }
  1277. }else{
  1278. if(started){
  1279. SetTimer, aimer, off
  1280. started := 0
  1281. }
  1282. subI9288 := 0
  1283. _subK78L74()
  1284. }
  1285. pSilent := !pSilent, MenuMain_%Menu_Position%_State := pSilent
  1286. MenuUpdate()
  1287. return
  1288.  
  1289. MenuMain_7:
  1290. return
  1291. MenuMain_8:
  1292. return
  1293.  
  1294. aimer:
  1295. If(!WinActive("GTA:SA:MP") || IsChatOpen() || Vehicle(0))
  1296. return
  1297. _subr()
  1298. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement