Модератор форума
-
Автор темы
- #1
C++:
while (&vars.ragebot.enable && vars.ragebot.resolver)
{
static float LBY[65];
static float OldLBY[65];
static float Delta[65];
static float OldDelta[65];
for (int ID = 0; ID < I::ClientEntList->GetHighestEntityIndex(); ID++)
{
CBaseEntity* Player = I::ClientEntList->GetClientEntity(ID);
if (!Player || Player == G::LocalPlayer || !Player->GetAlive() || Player->GetDormant() || (!Player->GetClientClass() || Player->GetClientClass()->m_ClassID != 35) || (Player->GetTeam() == G::LocalPlayer->GetTeam() && !Cvar.RageFriendly))
continue;
auto *Yaw = reinterpret_cast<float*>(reinterpret_cast<DWORD>(Player) + offsets.m_angEyeAnglesY);
auto Speed = Player->GetVelocity().Length();
if (LBY[ID] != Player->GetLBY())
{
*Yaw = Player->GetLBY();
OldDelta[ID] = Delta[ID];
Delta[ID] = (Player->GetLBY() - LBY[ID]);
OldLBY[ID] = LBY[ID];
LBY[ID] = Player->GetLBY();
}
else if (Speed > 0.1f && Player->GetFlags() & FL_ONGROUND)
{
*Yaw = Player->GetLBY();
}
else if (fabsf(Delta[ID]) > 35.f)
{
if (Delta[ID] == OldDelta[ID])
{
*Yaw = Player->GetLBY() + Delta[ID];
}
else
{
float MinDelta = Delta[ID] < OldDelta[ID] ? Delta[ID] : OldDelta[ID];
float MaxDelta = Delta[ID] > OldDelta[ID] ? Delta[ID] : OldDelta[ID];
*Yaw = Player->GetLBY() + (Delta[ID] + RandomFloat(MinDelta, MaxDelta));
}
}
}
break;
}