#NoEnv
#Include samp.ahk
#WinActivateForce GTA:SA:MP
atan2(x, y) {
return DllCall("msvcrt\atan2", "Double", y, "Double", x, "CDECL Double")
}
global CAM_X := 0xB6F258
Loop{
Sleep, 30
while(getTargetPed() > 0 ){
enemy := getPedCoordinates(getTargetPed())
Cam := getCameraCoordinates()
if(GetKeyState("LButton", "P")){
VectorX := Enemy[1] - Cam[1]
VectorY := Enemy[2] - Cam[2]
Angle := atan2(VectorY, -VectorX) - 3.14 / 2
WriteFloat(hGTA, CAM_X, Angle + 0.04)
break
}
}
}