-
Автор темы
- #1
C++:
void Visuals::velocity_info()
{
if (!g_Options.velocity_info)
return;
if (!g_LocalPlayer || !g_LocalPlayer->IsAlive())
return;
static std::vector<float> velData(120, 0);
Vector vecVelocity = g_LocalPlayer->m_vecVelocity();
float currentVelocity = sqrt(vecVelocity.x * vecVelocity.x + vecVelocity.y * vecVelocity.y);
velData.erase(velData.begin());
velData.push_back(currentVelocity);
int vel = g_LocalPlayer->m_vecVelocity().Length2D();
static int width, height;
g_EngineClient->GetScreenSize(width, height);
for (auto i = 0; i < velData.size() - 1; i++)
{
int cur = velData.at(i);
int next = velData.at(i + 1);
Render::Get().RenderLine<int>(
width / 2 + (velData.size() * 5 / 2) - (i - 1) * 5.f,
height / 1.15 - (std::clamp(cur, 0, 450) + .2f),
width / 2 + (velData.size() * 5 / 2) - i * 5.f,
height / 1.15 - (std::clamp(next, 0, 450) * .2f), Color(255, 255, 255, 255)
);
}
}