doesdismatter Posted June 24, 2021 Share Posted June 24, 2021 Is there any public source for a velocity graph, if not how would someone go about coding something like that? Quote Link to comment Share on other sites More sharing options...
btc Posted June 24, 2021 Share Posted June 24, 2021 void otheresp::draw_velocity() { if (!g_cfg.esp.velocity_graph) return; if (!g_ctx.local()) return; if (!m_engine()->IsInGame() || !g_ctx.local()->is_alive()) return; static std::vector<float> velData(120, 0); Vector vecVelocity = g_ctx.local()->m_vecVelocity(); float currentVelocity = sqrt(vecVelocity.x * vecVelocity.x + vecVelocity.y * vecVelocity.y); velData.erase(velData.begin()); velData.push_back(currentVelocity); int vel = g_ctx.local()->m_vecVelocity().Length2D(); static int width, height; m_engine()->GetScreenSize(width, height); render::get().text(fonts[VELOCITY], width / 2, height / 1.1, Color(0, 255, 100, 255), HFONT_CENTERED_X | HFONT_CENTERED_Y, "(%i)", vel); for (auto i = 0; i < velData.size() - 1; i++) { int cur = velData.at(i); int next = velData.at(i + 1); render::get().line( 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) ); } } 1 Quote Link to comment Share on other sites More sharing options...
mikoquuu Posted August 20, 2021 Share Posted August 20, 2021 On 6/24/2021 at 5:53 PM, btc said: void otheresp::draw_velocity() { if (!g_cfg.esp.velocity_graph) return; if (!g_ctx.local()) return; if (!m_engine()->IsInGame() || !g_ctx.local()->is_alive()) return; static std::vector<float> velData(120, 0); Vector vecVelocity = g_ctx.local()->m_vecVelocity(); float currentVelocity = sqrt(vecVelocity.x * vecVelocity.x + vecVelocity.y * vecVelocity.y); velData.erase(velData.begin()); velData.push_back(currentVelocity); int vel = g_ctx.local()->m_vecVelocity().Length2D(); static int width, height; m_engine()->GetScreenSize(width, height); render::get().text(fonts[VELOCITY], width / 2, height / 1.1, Color(0, 255, 100, 255), HFONT_CENTERED_X | HFONT_CENTERED_Y, "(%i)", vel); for (auto i = 0; i < velData.size() - 1; i++) { int cur = velData.at(i); int next = velData.at(i + 1); render::get().line( 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) ); } } not working Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.