Пользователь
-
Автор темы
- #1
Onetap v2 normal autostrafe
Возможно вронг.
Возможно вронг.
C++:
void OneTap::Features::Misc::AutoStrafe::Normal()
{
// [COLLAPSED LOCAL DECLARATIONS. PRESS KEYPAD CTRL-"+" TO EXPAND]
if (g_pGlobals.UserCmd->m_buttons & IN_JUMP)
{
float m_flVelocitySquare = g_pLocalPlayer->m_vecVelocity().y * g_pLocalPlayer->m_vecVelocity().y;
float m_flVelocityAtan = C_SDK::Math::Atan(g_pLocalPlayer->m_vecVelocity().x);
float m_flVelocityRad2Deg = m_flVelocityAtan * 57.29578;
if (((g_pLocalPlayer->m_vecVelocity().x * g_pLocalPlayer->m_vecVelocity().x) + (g_pLocalPlayer->m_vecVelocity().y * g_pLocalPlayer->m_vecVelocity().y)) >= 30.0)
{
float m_flYaw = g_pGlobals.UserCmd->m_viewAngles.yaw;
float m_flRetrackValue = g_pConfigs.Misc.StrafeStrength * 0.44999999;
if (g_pGlobals.UserCmd->m_buttons & IN_MOVE_LEFT)
{
if (!g_pGlobals.UserCmd)
return;
m_flYaw = C_SDK::Math::NormalizeAngle(m_flYaw + m_flRetrackValue);
g_pGlobals.UserCmd->m_viewAngles.yaw = m_flVelocityRad2Deg;
}
if (g_pGlobals.UserCmd->m_buttons & IN_MOVE_RIGHT)
{
if (!g_pGlobals.UserCmd)
return;
m_flYaw = C_SDK::Math::NormalizeAngle(m_flYaw - m_flRetrackValue);
g_pGlobals.UserCmd->m_viewAngles.yaw = m_flVelocityRad2Deg;
}
C_SDK::Math::NormalizeAngle(m_flVelocityRad2Deg);
C_SDK::Math::NormalizeAngle(m_flYaw);
bool m_bPositive = g_pGlobals.UserCmd->m_commandNumber & 1;
float m_flSpeed = (g_pLocalPlayer->m_vecVelocity().x * g_pLocalPlayer->m_vecVelocity().x) + m_flVelocitySquare;
float m_flCalculatedSpeed = 0.0;
float m_flFinalSpeed = 0.0;
float m_flSpeedDelta = 0.0;
float m_flSideMove = 0.0;
if (m_bPositive)
{
m_flSideMove = 450.0;
m_flCalculatedSpeed = (30.0 / m_flSpeed) * -57.29578;
}
else
{
m_flSideMove = -450.0;
m_flCalculatedSpeed = (30.0 / m_flSpeed) * 57.29578;
}
m_flFinalSpeed = m_flCalculatedSpeed * 0.5;
g_pGlobals.UserCmd->m_wishMove.x = 0.0;
g_pGlobals.UserCmd->m_wishMove.y = m_flSideMove;
m_flSpeedDelta = m_flFinalSpeed * 0.017453292;
g_pGlobals.UserCmd->m_wishMove.x = (g_pGlobals.UserCmd->m_wishMove.x * (m_flFinalSpeed * 0.017453292)) - (g_pGlobals.UserCmd->m_wishMove.y * m_flSpeedDelta);
g_pGlobals.UserCmd->m_wishMove.y = (g_pGlobals.UserCmd->m_wishMove.x * m_flSpeedDelta) - (g_pGlobals.UserCmd->m_wishMove.y * (m_flFinalSpeed * 0.017453292));
}
}
}