-
Автор темы
- #1
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Код:
local function VectorLerp(vecSource, vecDestination, flPercentage)
return vecSource + (vecDestination - vecSource) * flPercentage
end
local function NormalizeYaw(flYaw)
while flYaw > 180 do flYaw = flYaw - 360 end
while flYaw < -180 do flYaw = flYaw + 360 end
return flYaw
end
local refEnabled = Menu.Switch('Anti Aim Improvements', 'Edge Yaw', false)
local vecTraceStart = Vector.new()
Cheat.RegisterCallback('pre_prediction', function(UserCmd)
if not refEnabled:GetBool() then
return
end
local iLocalPlayerEntIndex = EngineClient.GetLocalPlayer()
if not iLocalPlayerEntIndex then
return
end
local pLocalPlayerEntity = EntityList.GetClientEntity(iLocalPlayerEntIndex)
local pLocalPlayer = pLocalPlayerEntity:GetPlayer()
local flVelocityZ = pLocalPlayer:GetProp('m_vecVelocity[2]')
local bInJump = bit.band(UserCmd.buttons, 2) == 2
if flVelocityZ ~= 0 or bInJump then
return
end
if ClientState.m_choked_commands == 0 then vecTraceStart = pLocalPlayer:GetEyePosition() end
local aTraceEnd = {}
local angViewAngles = EngineClient.GetViewAngles()
for flYaw = 18, 360, 18 do
flYaw = NormalizeYaw(flYaw)
local angEdge = QAngle.new(0, flYaw, 0)
local vecTraceEnd = vecTraceStart + Cheat.AngleToForward(angEdge) * 0x60
local traceInfo = EngineTrace.TraceRay(vecTraceStart, vecTraceEnd, pLocalPlayerEntity, 0x200400B)
local flFraction = traceInfo.fraction
local pEntity = traceInfo.hit_entity
if pEntity and pEntity:GetClassName() == 'CWorld' and flFraction < 0.3 then
aTraceEnd[#aTraceEnd+1] = {
vecTraceEnd = traceInfo.endpos,
flYaw = flYaw
}
end
end
table.sort(aTraceEnd, function(a, b)
return a.flYaw < b.flYaw
end)
local angEdge
if #aTraceEnd >= 2 then
local vecTraceCenter = VectorLerp(aTraceEnd[1].vecTraceEnd, aTraceEnd[#aTraceEnd].vecTraceEnd, 0.5)
angEdge = Cheat.VectorToAngle(vecTraceStart - vecTraceCenter)
end
if angEdge then
local flYaw = angViewAngles.yaw
local flEdgeYaw = angEdge.yaw
local flDiff = NormalizeYaw(flEdgeYaw - flYaw)
if math.abs(flDiff) < 90 then
flDiff = 0
flYaw = NormalizeYaw(flEdgeYaw + 180)
end
-- Static yaw
local flNewYaw = -flYaw
-- Apply edge yaw
flNewYaw = NormalizeYaw(flNewYaw + flEdgeYaw + 180)
flNewYaw = NormalizeYaw(flNewYaw + flDiff)
AntiAim.OverrideYawOffset(flNewYaw)
end
end)