Ghetto adaptive cstrafer

Начинающий
Статус
Оффлайн
Регистрация
13 Июн 2017
Сообщения
2
Реакции[?]
0
Поинты[?]
0
This aint mine, just found it in my downloads from somewhere, hf
//Might be posted here before but im not sure so

Код:
void Strafe(SDK::CUserCmd* pCmd)
{
auto pLocal = g_pTools->GetLocalPlayer();
SDK::Vector Velocity = pLocal->GetVelocity();
Velocity.z = 0;
float Speed = Velocity.Length();
if (Speed < 45) Speed = 45;
if (Speed > 750) Speed = 750;
float FinalPath = GetTraceFractionWorldProps(pLocal->GetAbsOrigin() + SDK::Vector(0, 0, 10), pLocal->GetAbsOrigin() + SDK::Vector(0, 0, 10) + Velocity / 2.0f);
float DeltaAngle = RightMovement * fmax((275.0f / Speed) * (2.0f / FinalPath) * (128.0f / (1.7f / g_pGlobalVarsBase->interval_per_tick)) * ClientVars::m_iMisc_CircleStrafeRetrackSpeed, 2.0f);
StrafeAngle += DeltaAngle;
if (fabs(StrafeAngle) >= 360.0f)
{
StrafeAngle = 0.0f;
IsActive = false;
//RightMovement = 0;
}
else
{
pCmd->forwardmove = cos((StrafeAngle + 90 * RightMovement) * (M_PI / 180.0f)) * 450.f;
pCmd->sidemove = sin((StrafeAngle + 90 * RightMovement) * (M_PI / 180.0f)) * 450.f;
}
}
void Start(SDK::CUserCmd* pCmd)
{
auto pLocal = g_pTools->GetLocalPlayer();
StrafeAngle = 0;
IsActive = true;
SDK::QAngle CurrentAngles;
CurrentAngles.y = 0;
CurrentAngles.x = 0;
SDK::Vector Forward = CurrentAngles.Direction();
SDK::Vector Right = Forward.Cross(SDK::Vector(0, 0, 1));
SDK::Vector Left = SDK::Vector(-Right.x, -Right.y, Right.z);
float LeftPath = GetTraceFractionWorldProps(pLocal->GetAbsOrigin() + SDK::Vector(0, 0, 10), pLocal->GetAbsOrigin() + Left * 450.f + SDK::Vector(0, 0, 10));
float RightPath = GetTraceFractionWorldProps(pLocal->GetAbsOrigin() + SDK::Vector(0, 0, 10), pLocal->GetAbsOrigin() + Right * 450.f + SDK::Vector(0, 0, 10));
//if (LeftPath > RightPath)
// RightMovement = -1;
//else
//RightMovement = 1;
//if (RightMovement == 1)
// RightMovement = -1;
//else if (RightMovement == -1)
// RightMovement = 1;
//else
RightMovement = 1;
}
 
Сверху Снизу