Code:
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#SingleInstance Force
#NoEnv
#include GDI+.ahk
SetBatchLines -1
NoSpread = 0
NoRecoil = 0
Overlay = 0
Breath = 0
Spotting = 0
YawInverse = 6
PlayerRadar = 1
PosCX1 = 1920
PosCY1 = 540
;Type---------------
PROGRAM = Battlefield 4
Settimer,Loop,10
Settimer,pData,10
Settimer, WindowXY,100
Settimer, Spread,100
Settimer, Recoil,100
Settimer, Debug, 10
Settimer, OverlayUpdate3,10
If !pToken := Gdip_Startup()
{
MsgBox, 48, gdiplus error!, Gdiplus failed to start. Please ensure you have gdiplus on your system
ExitApp
}
Offset(kl="")
{
CLIENTGAMECONTEXT = 0x24a0c00 ;0 + Base
ANGLES := 0x21e3400 ;+ base
;---------gamecontext----------
ClientPlayerManager := 0x60 ;GameContext
idToPlayerMapOffset := 0x548 ;ClientPlayerManager
;------------------ReadLocalPlayer --------------------
ClientPlayer = 0x540 ;ClientPlayerManager
ClientSoldier = 0x14d0 ;ClientPlayer
ClientReplication = 0x490 ;ClientSoldier
soldierWeaponsComponent = 0x570 ;ClientSoldier
breathControlHandler = 0x588 ;clientSoldier
pHealthComponent = 0x140 ;ClientSoldier
ActiveSlot = 0x0a98 ;SoldierWeaponCompenent
CurrentAnimatedWeaponHandler = 0x0890 ;soldierWeaponComponent
ClientSoldierWeapon := * 0x8 ;currentAnimantedWeaponHandler + ActiveSlot
CorrectedFiring := 0x49c0 ;Angles
WeaponSway := 0x78 ;CorrectedFiring
WeaponSwayData := 0x08 ;WeaponSway
;---------------------PlayerData-------------------
InVehicle := 0x14c0 ;clientPlayer
TeamID := 0x13cc ;Clientplayer
Health := 0x20 ;pHealthComponent
projectilesLoaded := 0x01a0 ;CorrectedFiring
ProjectilesInMagazines := 0x01a4 ;CorrectedFiring
PositionX := 0x30 ;clientReplication
PositionY := 0x34 ;ClientReplication
PositionZ := 0x38 ;clientReplication
flYaw := 0x4D8 ;clientSoldier
Return %kl%
}
MainGui():
Try{
WinWaitActive,Battlefield 4,,120
if WinExist("Battlefield 4")
{
WinGetPos,Xpos, YPos,WidthW,HeightH,Battlefield 4
PosX := XPos+10, PosY := YPos +20
Gui +AlwaysOnTop -Caption +ToolWindow
Gui, Color, FA0000
gui, font,cFF0000 S12 Bold, Arial
Gui, Add, Text, x10 y10 w100 h20 vNSpread ,Spread %NoSpread%
Gui, Add, Slider,x120 y10 W50 h20 Center NoTicks Range0-100 vNoSpread gSpread,100
;Gui,Add, CheckBox,x120 y10 Checked%NoSpread% vNoSpread gSpread
Gui, Add, text, x10 y30 w100 h30, NoRecoil
Gui, Add, CheckBox,x120 y30 Checked%NoRecoil% vNoRecoil gRecoil
Gui,Add,Text, x10 y50 W100 H40,Overlay
Gui, Add, CheckBox, x120 y50 Checked%Overlay% vOverlay gOverlay
gui, Add, Text, x10 y70 w120 h30, NoBreath
Gui, Add, CheckBox, X120 y70 Checked%Breath% vBreath gBreath
Gui, Add, Text,x10 y90 w120 h30, Radar Spotting
Gui, Add, CheckBox,x120 y90 Checked%Spotting% vSpotting gpData
Gui, Add, Text,x10 y110 w120 h30,EnemyRadar
Gui, Add, Checkbox,x120 y110 Checked%PlayerRadar% vPlayerRadar gOverlayUpdate3
Gui, Add, Text,x10 y130 W120 H30,HorzPos
Gui, Add, Slider,x120 y130 w50 h20 Center NoTicks range0-%A_ScreenWidth% vPosCX1 gOverlayUpdate3,1920
Gui, Add, Text,x10 y150 W120 H30,VertPos
Gui, Add, Slider,x120 y150 w50 h20 Center NoTicks range0-%A_ScreenHeight% vPosCY1 gOverlayUpdate3,540
Gui, Show,NA x%PosX% y%PosY%,Gui77
WinSet, TransColor,FA0000, Gui77
}
}Catch{}
return
~Numpad0::
If WinExist("Gui77")
WinActivate,Gui77
return
WindowXY:
IfWinActive,Battlefield 4
{
WinGetPos,Xpos, YPos,WidthW,HeightH,Battlefield 4
PosX := XPos, PosY := YPos
WinMove,Gui77,,PosX,PosY
}
ifWinnotexist, Battlefield 4
ExitApp
return
Spread:
Gui, Submit, Nohide
NoSpread := Round(NoSpread/100,3)
VarHex := FloatToHex(NoSpread)
StringTrimRight,NoSpread,NoSpread,1
GuiControl,,NSpread,Spread %NoSpread%
WriteMemory(VarHex,WeaponSwayData+0x0430,PROGRAM) ;VisualSpreadADS
WriteMemory(VarHex,WeaponSwayData+0x0434,PROGRAM) ;ProjectileSpreadADS
WriteMemory(VarHex,WeaponSwayData+0x0438,PROGRAM) ;VisualSpread
WriteMemory(VarHex,WeaponSwayData+0x043C,PROGRAM) ;ProjectileSpread
return
Recoil:
Gui, Submit, Nohide
if NoRecoil = 1
{
iniRead,WeaponNameLoad,Backup.dfd,%CurrentWeaponName3%,Weapon
if WeaponNameLoad != %CurrentWeaponName3%
{
IniWrite,%CurrentWeaponName3%,Backup.dfd,%CurrentWeaponName3%,Weapon
IniWrite,%Recoil1%,Backup.dfd,%CurrentWeaponName3%,Recoil1B
IniWrite,%Recoil2%,Backup.dfd,%CurrentWeaponName3%,Recoil2B
}
WriteMemory(0x00,WeaponSwayData+0x0444,PROGRAM)
WriteMemory(FloatToHex(100),WeaponSwayData+0x0440,PROGRAM)
}
if NoRecoil = 0
{
iniRead,WeaponNameLoad,Backup.dfd,%CurrentWeaponName3%,Weapon
if WeaponNameLoad != ERROR
{
IniRead,Recoil1Ret,Backup.dfd,%CurrentWeaponName3%,Recoil1B
IniRead,Recoil2Ret,Backup.dfd,%CurrentWeaponName3%,Recoil2B
WriteMemory(Recoil1Ret,WeaponSwayData+0x0444,PROGRAM)
WriteMemory(Recoil2Ret,WeaponSwayData+0x0440,PROGRAM)
}
}
return
Overlay:
Gui, Submit, Nohide
if Overlay = 1
{
Settimer, OverlayUpdate,1
}
if Overlay = 0
{
Settimer, OverlayUpdate, Off
Gui,2: Destroy
}
return
OverlayUpdate:
SendText := Round(ClientHealth,1) " / 100 `n" projectilesLoaded " / " ProjectilesInMagazines
Width := 120, Height := 50
Gui, 2: -Caption +E0x80000 +LastFound +OwnDialogs +Owner +AlwaysOnTop
Gui, 2: Show, NA
hwnd1 := WinExist()
hbm := CreateDIBSection(Width, Height)
hdc := CreateCompatibleDC()
obm := SelectObject(hdc, hbm)
G := Gdip_GraphicsFromHDC(hdc)
Gdip_SetSmoothingMode(G, 4)
pBrush := Gdip_BrushCreateSolid(0x00000000)
Gdip_FillRoundedRectangle(G, pBrush, 0, 0, Width, Height, 20)
Gdip_DeleteBrush(pBrush)
Font = Arial
If !hFamily := Gdip_FontFamilyCreate(Font)
{
MsgBox, 48, Font error!, The font you have specified does not exist on the system
ExitApp
}
Options = x10p y30p w80p Left cFF00ff00 r4 s15 BoldItalic
Gdip_TextToGraphics(G, SendText, Options, Font, Width, Height)
UpdateLayeredWindow(hwnd1, hdc, PosX, PosY+180, Width, Height)
Gdip_DeleteFontFamily(hFamily)
SelectObject(hdc, obm)
DeleteObject(hbm)
DeleteDC(hdc)
Gdip_DeleteGraphics(G)
return
OverlayUpdate3:
Gui, Submit, Nohide
if PlayerRadar = 1
{
Straal := (2*150)
PosCX := PosCX1 - Straal
PosCY := PosCY1 - Straal
Width3 := WidthW, Height3 := HeightH
Gui, 4: -Caption +E0x80000 +LastFound +OwnDialogs +Owner +AlwaysOnTop +0x20
Gui, 4: Show, NA
hwnd3 := WinExist()
hbm3 := CreateDIBSection(Width3, Height3)
hdc3 := CreateCompatibleDC()
obm3 := SelectObject(hdc3, hbm3)
G3 := Gdip_GraphicsFromHDC(hdc3)
Gdip_SetSmoothingMode(G3, 4)
pBrush4 := Gdip_BrushCreateSolid(0x11000000)
pBrush5 := Gdip_BrushCreateSolid(0xFF00FF00)
Gdip_FillRoundedRectangle(G3, pBrush4, PosCX, PosCY, Straal, Straal, Straal/2)
Gdip_FillRoundedRectangle(G3, pBrush5, (PosCX+(Straal/2)), (PosCY+(Straal/2)) , 5, 5, 2.5)
Gdip_DeleteBrush(pBrush4)
Gdip_DeleteBrush(pBrush5)
;pBrush6 := Gdip_BrushCreateSolid(0xFFFF0000)
Loop, 32
{
pBrush6 := Gdip_BrushCreateSolid(RC%A_Index%)
Gdip_FillRoundedRectangle(G3, pBrush6, xR%A_Index%, yR%A_Index% , 5, 5, 2.5)
}
Gdip_DeleteBrush(pBrush6)
UpdateLayeredWindow(hwnd3, hdc3, 0, 0, Width3, Height3)
Gdip_DeleteFontFamily(hFamily2)
SelectObject(hdc3, obm3)
DeleteObject(hbm3)
DeleteDC(hdc3)
Gdip_DeleteGraphics(G3)
}
else if PlayerRadar = 0
{
Gui, 4: Destroy
}
return
Breath:
if InVehicle = 1
return
if (ActiveSlot Contains 0,9 && Breath = 1)
{
WriteMemory(0x00,BreathControlHandler+0x38,PROGRAM)
WriteMemory(0x00,BreathControlHandler+0x3C,PROGRAM)
WriteMemory(0x00,BreathControlHandler+0x40,PROGRAM)
WriteMemory(0x00,BreathControlHandler+0x44,PROGRAM)
WriteMemory(0x00,BreathControlHandler+0x48,PROGRAM)
WriteMemory(0x00,BreathControlHandler+0x4C,PROGRAM)
WriteMemory(0x00,BreathControlHandler+0x58,PROGRAM)
}
else
return
return
;--------------------------ESP--------------------------------------------------------------
pData:
Critical
Gui, Submit, Nohide
While (ide < 64)
{
if ClientHealth < 1
ide = 63
ide ++
pPlayer := Convert(ReadMemory(IdToPlayerMapOffset+(ide * 0x8),PROGRAM),"H")
pSoldier := Convert(ReadMemory(pPlayer+0x14D0,PROGRAM),"H")
pPlayerTeamID := ReadMemory(pPlayer+0x13cc,PROGRAM)
if Spotting = 1
{
if pPlayerTeamID != ClientPlayerTeamID
{
SpottingTargetComponentData := Convert(ReadMemory(pSoldier+0xBF0,PROGRAM),"H")
SpotType := ReadMemory(SpottingTargetComponentData+0x50,PROGRAM)
{
if (SpotType = 0 && ClientHealth > 0)
WriteMemory(0x1,SpottingTargetComponentData+0x50,PROGRAM)
}
}
}
IfNotEqual, pPlayerTeamID, %ClientPlayerTeamID% ; if other team
{
RColor = 0xFFFF0000
}
else
{
RColor = 0xFF0000FF
}
pHealthComponent := Convert(ReadMemory(pSoldier+0x140,PROGRAM),"H")
pHealth := Round(HexToFloat(Convert(ReadMemory(pHealthComponent+0x20,PROGRAM),"H")))
if pHealth <= 1
{
RColor = 0x00000000
}
pSoldierName := ReadMemoryStr(pPlayer+0x40,PROGRAM)
If pSoldierName = %PlayerName%
{
RColor = 0xFF00FF00
}
pIsOcluded := ReadMemory(pSoldier+591,PROGRAM)
pReplication := Convert(ReadMemory(pSoldier+0x490,PROGRAM),"H")
pPositionX := HexToFloat(Convert(ReadMemory(pReplication+0x30,PROGRAM),"H"))
pPositionY := HexToFloat(Convert(ReadMemory(pReplication+0x34,PROGRAM),"H"))
pPositionZ := HexToFloat(Convert(ReadMemory(pReplication+0x38,PROGRAM),"H"))
pVelocityX := HexToFLoat(Convert(ReadMemory(pReplication+0x50,PROGRAM),"H"))
pVelocityY := HexToFloat(Convert(ReadMemory(pReplication+0x54,PROGRAM),"H"))
pVelocityZ := HexToFloat(Convert(ReadMemory(pReplication+0x58,PROGRAM),"H"))
Distance:
xD := round(PositionX - pPositionX)
yD := Round(PositionY - pPositionY)
zD := Round(PositionZ - pPositionZ)
pDistance := Round(sqrt((xD * xD) + (yD * yD) + (zD * zD)))
ArrayCount++
xD%ArrayCount% := pPositionX
yD%ArrayCount% := pPositionY
zD%ArrayCount% := pPositionZ
A%ArrayCount% := pDistance
B%ArrayCount% := pSoldierName . " " pHealth
C .= A%ArrayCount% ","
Ry := positionZ - zD%ArrayCount%
Rx := PositionX - xD%ArrayCount%
Rz := PositionZ - zD%ArrayCount%
angleY := -Yaw
angleP := -Pitch
if pDistance < 150
{
RC%ArrayCount% := RColor
D%ArrayCount% := pDistance
xR%ArrayCount% := (Rx*Cos(angleY)-Ry*Sin(angleY))+(PosCX+(Straal/2))
yR%ArrayCount% := (Rx*Sin(angleY)+Ry*Cos(angleY))+(PosCY+(Straal/2))
}
}
Gosub,OverlayUpdate3
ArrayCount = 0
ide = 0
return
InsertionSort(var) { ; SORT COMMA SEPARATED LIST
StringSplit a, var, `, ; make array, size = a0
Loop % a0-1 {
i := A_Index+1, v := a%i%, j := i-1
While j>0 and a%j%>v
u := j+1, a%u% := a%j%, j--
u := j+1, a%u% := v
}
Loop % a0 ; construct string from sorted array
sorted .= "," . a%A_Index%
Return SubStr(sorted,2) ; drop leading comma
}
Debug:
;Gosub,AngleCalc
;Tooltip % xD1 " " yD1 " " zD1 " X " PositionX " Y " PositionY " Z " PositionZ " flYaw " flYaw " flPitch " flPitch ,0,0
;tooltip % " yaw " Yaw " pitch " Pitch " x " x " y " y " z " z " NX " newx " NY " newy " NZ " newz " XF " xFinal " YF " yFinal " ZF " zFinal " SX " screenx1 " SY " screeny1 " W " WidthW " H " HeightH ,0,0
;Tooltip % pSoldierName " X " screenx1 " Y " screeny1 " " pIsOcluded,0,0
;Tooltip % "Length R " R "`n Angle T " Yaw " `n Circle CentreXY " H " " K " `n X " xR1 " `n Y " yR1 ,0,0
;Tooltip % Rx " " Ry " " Rz " " xR21 " " yR21,0,0
return
CalcHorzFOV(FOV) ;RECOIL
{
Pie = 3.14159
heightFOV = %A_ScreenHeight%
widthFOV = %A_ScreenWidth%
vfovDeg := FOV ;Vertical FOV From PROFSAVE_profile
Deg2Rad := Round(vfovDeg*(Pie/180),3) ;Converts Deg to Radians
hfovRad := Round(2*atan(tan(Deg2Rad/2)*widthFOV/heightFOV),3) ;Calc hFOV with vFOV in rad
Rad2Deg := Round(hfovRad*(180/Pie)) ;Converts Radians back to Deg
return Rad2Deg
}
return
D2R(Deg) ;Deg2Rad
{
Pie = 3.1415926535897932384626433832795
Rad := (Deg*(Pie/180)) ;Converts Deg to Radians
return Rad
}
R2D(Rad) ;Rad2Deg
{
Pie = 3.1415926535897932384626433832795
Deg := (Rad*(180/Pie)) ;Converts Radians back to Deg
Return Deg
}
WriteMemory(WVALUE,MADDRESS,PROGRAM)
{
winget, pid, PID, %PROGRAM%
ProcessHandle := DllCall("OpenProcess", "int", 2035711, "char", 0, "UInt", PID, "UInt")
DllCall("WriteProcessMemory", "UInt", ProcessHandle, "UInt", MADDRESS, "Uint*", WVALUE, "Uint", 4, "Uint *", 0)
DllCall("CloseHandle", "int", ProcessHandle)
return
}
HexToFloat(x) {
Return (1-2*(x>>31)) * (2**((x>>23 & 255)-150)) * (0x800000 | x & 0x7FFFFF)
}
HexToDouble(x) { ; may be wrong at extreme values
Return (2*(x>0)-1) * (2**((x>>52 & 0x7FF)-1075)) * (0x10000000000000 | x & 0xFFFFFFFFFFFFF)
}
FloatToHex(f) {
form := A_FormatInteger
SetFormat Integer, HEX
v := DllCall("MulDiv", Float,f, Int,1, Int,1, UInt)
SetFormat Integer, %form%
Return v
}
DoubleToHex(d) {
form := A_FormatInteger
SetFormat Integer, HEX
v := DllCall("ntdll.dll\RtlLargeIntegerShiftLeft",Double,d, UChar,0, Int64)
SetFormat Integer, %form%
Return v
}
ReadMemory(MADDRESS=0,PROGRAM="",MVALUE="",BYTE=4)
{
Static OLDPROC, ProcessHandle
if MVALUE := " "
VarSetCapacity(MVALUE,4,0)
If PROGRAM != %OLDPROC%
{
WinGet, pid, pid, % OLDPROC := PROGRAM
ProcessHandle := ( ProcessHandle ? 0*(closed:=DllCall("CloseHandle"
,"UInt",ProcessHandle)) : 0 )+(pid ? DllCall("OpenProcess"
,"Int",16,"Int",0,"UInt",pid) : 0)
}
If (ProcessHandle) && DllCall("ReadProcessMemory","UInt",ProcessHandle,"UInt",MADDRESS,"str",MVALUE,"UInt",BYTE,"UInt *",0)
return *(&MVALUE+3)<<24 | *(&MVALUE+2)<<16 | *(&MVALUE+1)<<8 | *(&MVALUE)
return !ProcessHandle ? "Handle Closed: " closed : "Fail"
}
getProcessBaseAddress(WindowTitle, windowMatchMode := "3") ;WindowTitle can be anything ahk_exe ahk_class etc
{
if (windowMatchMode && A_TitleMatchMode != windowMatchMode)
{
mode := A_TitleMatchMode ; This is a string and will not contain the 0x prefix
StringReplace, windowMatchMode, windowMatchMode, 0x ; remove hex prefix as SetTitleMatchMode will throw a run time error. This will occur if integer mode is set to hex and matchmode param is passed as an number not a string.
SetTitleMatchMode, %windowMatchMode% ;mode 3 is an exact match
}
WinGet, hWnd, ID, %WindowTitle%
if mode
SetTitleMatchMode, %mode% ; In case executed in autoexec
if !hWnd
return ; return blank failed to find window
return DllCall(A_PtrSize = 4 ; If DLL call fails, returned value will = 0
? "GetWindowLong"
: "GetWindowLongPtr"
, "Ptr", hWnd, "Int", -6, A_Is64bitOS ? "Int64" : "UInt")
; For the returned value when the OS is 64 bit use Int64 to prevent negative overflow when AHK is 32 bit and target process is 64bit
; however if the OS is 32 bit, must use UInt, otherwise the number will be huge (however it will still work as the lower 4 bytes are correct)
; Note - it's the OS bitness which matters here, not the scripts/AHKs
}
ReadMemoryStr(MADDRESS=0, PROGRAM = "", length = 0 , terminator = "") ; "" = Null
{
Static OLDPROC, ProcessHandle
If (PROGRAM != OLDPROC || !ProcessHandle)
{
WinGet, pid, pid, % OLDPROC := PROGRAM
ProcessHandle := ( ProcessHandle ? 0*(closed:=DllCall("CloseHandle"
,"UInt",ProcessHandle)) : 0 )+(pid ? DllCall("OpenProcess"
,"Int",16,"Int",0,"UInt",pid) : 0) ;PID is stored in value pid
}
; length depends on the encoding too
VarSetCapacity(Output, length ? length : 1, 0)
If !length ; read until terminator found or something goes wrong/error
{
Loop
{
success := DllCall("ReadProcessMemory", "UInt", ProcessHandle, "UInt", MADDRESS++, "str", Output, "Uint", 1, "Uint *", 0)
if (ErrorLevel || !success || Output = terminator)
break
teststr .= Output
}
}
Else ; will read X length
{
DllCall("ReadProcessMemory", "UInt", ProcessHandle, "UInt", MADDRESS, "str", Output, "Uint", length, "Uint *", 0)
; Loop % length
; teststr .= chr(NumGet(Output, A_Index-1, "Char"))
teststr := StrGet(&Output, length, "UTF-8")
}
return teststr
}
;H for Hex D for Dec
Convert(Number=0, ConvertTo="") {
TmpNum := Number
Ok := False
If TmpNum Is Integer
Ok := True
Else If TmpNum Is Xdigit
{
Ok := True
TmpNum := "0x" TmpNum
} Else If (InStr(TmpNum, "0x"))
Ok := True
Else
Return -1
If (Ok)
If (ConvertTo = "D" ) {
SetFormat Integer, D
TmpNum += 0
SetFormat Integer, H
Return TmpNum
} Else If (ConvertTo = "H") {
SetFormat Integer, H
TmpNum += 0
SetFormat Integer, D
Return TmpNum
} Else
Return -2
Else
Return -3
}
Loop:
{
Base := Convert(getProcessBaseAddress(PROGRAM),"H")
GameContext := Convert(ReadMemory(Base+0x24a0c00,PROGRAM),"H")
ClientPlayerManager := Convert(ReadMemory(GameContext+0x60,PROGRAM),"H")
idToPlayerMapOffset := Convert(ReadMemory(ClientPlayerManager+0x548,PROGRAM),"H")
Angles := Convert(ReadMemory(Base+0x21e3400,PROGRAM),"H")
;----------------LocelPlayer--------------------
ClientPlayer := Convert(ReadMemory(ClientPlayerManager+0x540,PROGRAM),"H")
ClientSoldier := Convert(ReadMemory(ClientPlayer+0x14d0,PROGRAM),"H")
ClientReplication := Convert(ReadMemory(ClientSoldier+0x490,PROGRAM),"H")
SoldierWeaponsComponent := Convert(ReadMemory(ClientSoldier+0x570,PROGRAM),"H")
breathControlHandler := Convert(ReadMemory(ClientSoldier+0x588,PROGRAM),"H")
HealthComponent := Convert(ReadMemory(ClientSoldier+0x140,PROGRAM),"H")
ClientHealth := HexToFloat(Convert(ReadMemory(HealthComponent+0x20,PROGRAM),"H"))
if ClientHealth < 1
return
ActiveSlot := Convert(ReadMemory(SoldierWeaponsComponent+0x0a98,PROGRAM),"D")
CurrentAnimatedWeaponHandler := Convert(ReadMemory(SoldierWeaponsComponent+0x0890,PROGRAM),"H")
ClientSoldierWeapon := ReadMemoryStr(CurrentAnimatedWeaponHandler +(ActiveSlot * 0x8),PROGRAM)
CorrectedFiring := Convert(ReadMemory(Angles+0x49c0,PROGRAM),"H")
WeaponSway := Convert(ReadMemory(CorrectedFiring+0x78,PROGRAM),"H")
WeaponSwayData := Convert(ReadMemory(WeaponSway+0x08,PROGRAM),"H")
Vrads := Convert(ReadMemory(WeaponSwayData+0x0430,PROGRAM),"H")
Prads := HexToFloat(Convert(ReadMemory(WeaponSwayData+0x0434,PROGRAM),"H"))
Vr := HexToFloat(Convert(ReadMemory(WeaponSwayData+0x0438,PROGRAM),"H"))
Pr := HexToFloat(Convert(ReadMemory(WeaponSwayData+0x043C,PROGRAM),"H"))
;------------PlayerData----------------
InVehicle := Convert(ReadMemory(ClientPlayer+0x14c0,PROGRAM),"H")
ClientPlayerTeamID := ReadMemory(ClientPlayer+0x13cc,PROGRAM)
PlayerName := ReadMemoryStr(ClientPlayer+0x40,PROGRAM)
projectilesLoaded := Convert(ReadMemory(CorrectedFiring+0x01a0,PROGRAM),"D")
projectilesInMagazines := Convert(ReadMemory(CorrectedFiring+0x01a4,PROGRAM),"D")
PositionX := HexToFloat(Convert(ReadMemory(ClientReplication+0x30,PROGRAM),"H"))
PositionY := HexToFloat(Convert(ReadMemory(ClientReplication+0x34,PROGRAM),"H")) ;Heigth in map
PositionZ := HexToFloat(Convert(ReadMemory(ClientReplication+0x38,PROGRAM),"H"))
VelocityX := HexToFloat(Convert(ReadMemory(ClientReplication+0x50,PROGRAM),"H"))
VelocityY := HexToFloat(Convert(ReadMemory(ClientReplication+0x54,PROGRAM),"H"))
VelocityZ := HexToFloat(Convert(ReadMemory(ClientReplication+0x58,PROGRAM),"H"))
Yaw := HexToFloat(Convert(ReadMemory(ClientSoldier+0x4D8,PROGRAM),"H"))
Pitch := HexToFloat(Convert(ReadMemory(ClientSoldier+0x4DC,PROGRAM),"H"))
CurrentWeaponName := Convert(ReadMemory(CorrectedFiring+0x01c8,PROGRAM),"H")
CurrentWeaponName2 := Convert(ReadMemory(CurrentWeaponName+0x0130,PROGRAM),"H")
CurrentWeaponName3 := ReadMemoryStr(CurrentWeaponName2+0x0,PROGRAM)
Recoil1 := Convert(ReadMemory(WeaponSwayData+0x0440,PROGRAM),"H")
Recoil2 := Convert(ReadMemory(WeaponSwayData+0x0444,PROGRAM),"H")
;ToolTip % ClientSoldierWeapon
}
return