function Aimbot()
if GUI.aimbot.Enable.v and bool result = isPlayerTargettingAnything(Player player) then
if not GUI.aimbot.IsFire.v or (GUI.aimbot.IsFire.v and isKeyDown(VK_LBUTTON)) then
local playerID = GetNearestPed()
if playerID ~= -1 then
local pedID = sampGetPlayerIdByCharHandle(PLAYER_PED)
if (GUI.aimbot.IgnoreStun.v and not CheckStuned()) then return false end
if (GUI.aimbot.CFilter.v and sampGetPlayerColor(pedID) == sampGetPlayerColor(playerID)) then return false end
local _, handle = sampGetCharHandleBySampPlayerId(playerID)
local myPos = {getActiveCameraCoordinates()}
local enPos = {GetBodyPartCoordinates(GetNearestBone(handle), handle)}
if not GUI.aimbot.VisibleCheck.v or (GUI.aimbot.VisibleCheck.v and isLineOfSightClear(myPos[1], myPos[2], myPos[3], enPos[1], enPos[2], enPos[3], true, true, false, true, true)) then
local pedWeapon = getCurrentCharWeapon(PLAYER_PED)
if (pedWeapon >= 22 and pedWeapon <= 29) or pedWeapon == 32 then
coefficent = 0.04253
elseif pedWeapon == 30 or pedWeapon == 31 then
coefficent = 0.028
elseif pedWeapon == 33 then
сoefficent = 0.01897
end
local vector = {myPos[1] - enPos[1], myPos[2] - enPos[2]}
local angle = math.acos(vector[1] / math.sqrt((math.pow(vector[1], 2) + math.pow(vector[2], 2))))
local view = {fix(representIntAsFloat(readMemory(0xB6F258, 4, false))), fix(representIntAsFloat(readMemory(0xB6F248, 4, false)))}
if (vector[1] <= 0.0 and vector[2] >= 0.0) or (vector[1] >= 0.0 and vector[2] >= 0.0) then
dif = (angle + coefficent) - view[1]
end
if (vector[1] >= 0.0 and vector[2] <= 0.0) or (vector[1] <= 0.0 and vector[2] <= 0.0) then
dif = (-angle + coefficent) - view[1]
end
if GUI.aimbot.DynamicSmooth.v then multiplier = 5 else multiplier = 1 end
local smooth = dif / ((GUI.aimbot.Smooth.v * multiplier) * GUI.aimbot.SuperSmooth.v)
if GUI.aimbot.DynamicSmooth.v then
if smooth > 0.0 then
if smooth < lastsmooth then
smooth = smooth * (lastsmooth / smooth)
end
else
if -smooth < -lastsmooth then
smooth = smooth * (-lastsmooth / -smooth)
end
end
lastsmooth = smooth
end
if smooth > -1.0 and smooth < 0.5 and dif > -2.0 and dif < 2.0 then
view[1] = view[1] + smooth
setCameraPositionUnfixed(view[2], view[1])
end
end
end
end
end
return false
end