Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function AngleToTarget(pX,pY,pZ, tX,tY,tZ)
- local deltaX = pX - tX
- local deltaY = pY - tY
- local deltaZ = pZ - tZ
- local hyp = math.sqrt((deltaX*deltaX) + (deltaY*deltaY))
- local angP = math.deg(math.asin(deltaZ / hyp))
- local angY = math.deg(math.atan(deltaY / deltaX))
- local angR = 0
- if (deltaX >= 0) then angY = angY + 180 end
- return angP,angY,angR
- end
- local function WithinPitchYaw(pX,pY,pZ, tX,tY,tZ)
- local p, y, r = AngleToTarget(pX,pY,pZ, tX,tY,tZ)
- local currP = ReadFloat(procHandle, o_EyeP)
- local currY = ReadFloat(procHandle, o_EyeY)
- p = math.NormalizeAngle(p)
- y = math.NormalizeAngle(y)
- currP = math.NormalizeAngle(currP)
- currY = math.NormalizeAngle(currY)
- local diffP = math.abs(math.abs(currP) - math.abs(p))
- local diffY = math.abs(math.abs(currY) - math.abs(y))
- if (diffP > config.aimbot.FOV) or (diffY > config.aimbot.FOV) then return false end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement