jaxson Posted July 1, 2021 Share Posted July 1, 2021 Hey I'm using hydraware as a base for my cheat and the velocity indicator is off centered and i was wonder how to make it always centered heres the code void speed() { if (!g_Options.Velocity) return; if (!g_LocalPlayer) return; int screenWidth, screenHeight; g_EngineClient->GetScreenSize(screenWidth, screenHeight); auto local_player = g_LocalPlayer; Vector speed = local_player->m_vecVelocity(); int intspeed = round(speed.Length2D()); const float delta = intspeed - lastvel; std::string vel = std::to_string(intspeed); if (local_player->m_fFlags() & FL_ONGROUND) { if (lastvelsaved) { lastvelsaved = false; } drawvel = vel; } else { if (!lastvelsaved) { lastjump = intspeed; lastvelsaved = true; } drawvel = vel + " (" + std::to_string(lastjump) + ")"; } drawvel2 = "(" + std::to_string(lastjump) + ")"; if (local_player->m_nMoveType() == MOVETYPE_NOCLIP) { Render::Get().RenderText(std::to_string(intspeed), screenWidth / 2 - 47, screenHeight - 99, 27.f, Color(0, 0, 0, 255), false, false, g_VeloFont); Render::Get().RenderText(std::to_string(intspeed), screenWidth / 2 - 48, screenHeight - 100, 27.f, g_Options.Velocitycol, false, false, g_VeloFont); if (!(local_player->m_fFlags() & FL_ONGROUND)) { if (lastjump >= 100 && g_Options.lastjump) { Render::Get().RenderText(drawvel2, screenWidth / 2 + 3, screenHeight - 99, 27.f, Color(0, 0, 0), false, false, g_VeloFont); Render::Get().RenderText(drawvel2, screenWidth / 2 + 2, screenHeight - 100, 27.f, g_Options.Velocitycol, false, false, g_VeloFont); } } } else { // if (intspeed >= 280) // g_Render->RenderText(std::to_string(intspeed), screenWidth / 2, screenHeight - 100, 27.f, Color(170, 255, 0), false, false, g_VeloFont); // else Render::Get().RenderText(std::to_string(intspeed), screenWidth / 2 - 47, screenHeight - 99, 27.f, Color(0, 0, 0, 255), false, false, g_VeloFont); Render::Get().RenderText(std::to_string(intspeed), screenWidth / 2 - 48, screenHeight - 100, 27.f, g_Options.Velocitycol, false, false, g_VeloFont); if (!(local_player->m_fFlags() & FL_ONGROUND)) { if (lastjump >= 100 && g_Options.lastjump) { Render::Get().RenderText(drawvel2, screenWidth / 2 + 3, screenHeight - 99, 27.f, Color(0, 0, 0), false, false, g_VeloFont); Render::Get().RenderText(drawvel2, screenWidth / 2 + 2, screenHeight - 100, 27.f, g_Options.Velocitycol, false, false, g_VeloFont); } } } } Quote Link to comment Share on other sites More sharing options...
0 btc Posted July 2, 2021 Share Posted July 2, 2021 https://www.unknowncheats.me/forum/c-and-c-/55700-getting-center-screen.html check examples from here 9 Quote Link to comment Share on other sites More sharing options...
0 jaxson Posted July 3, 2021 Author Share Posted July 3, 2021 On 7/1/2021 at 10:59 PM, btc said: https://www.unknowncheats.me/forum/c-and-c-/55700-getting-center-screen.html check examples from here i got it centered but its not dynamic depending on the speed. like 0 velocity is centered then anything above is just to the right of the center Quote Link to comment Share on other sites More sharing options...
0 btc Posted July 3, 2021 Share Posted July 3, 2021 1 hour ago, jaxson said: i got it centered but its not dynamic depending on the speed. like 0 velocity is centered then anything above is just to the right of the center could you show me a video of it? Quote Link to comment Share on other sites More sharing options...
0 jaxson Posted July 3, 2021 Author Share Posted July 3, 2021 6 minutes ago, btc said: could you show me a video of it? velo.mp4 Quote Link to comment Share on other sites More sharing options...
0 btc Posted July 3, 2021 Share Posted July 3, 2021 20 minutes ago, jaxson said: velo.mp4 35.25 MB · 0 downloads well idk it would look kinda stupid if the text changes the pos when u get velocity Quote Link to comment Share on other sites More sharing options...
0 jaxson Posted July 3, 2021 Author Share Posted July 3, 2021 12 minutes ago, btc said: well idk it would look kinda stupid if the text changes the pos when u get velocity i dont really know how to explain it that well but like i want it to be dynamic i have a video of what i would like it to look like ..mp4 Quote Link to comment Share on other sites More sharing options...
Question
jaxson
Hey I'm using hydraware as a base for my cheat and the velocity indicator is off centered and i was wonder how to make it always centered
heres the code
void speed() { if (!g_Options.Velocity) return; if (!g_LocalPlayer) return; int screenWidth, screenHeight; g_EngineClient->GetScreenSize(screenWidth, screenHeight); auto local_player = g_LocalPlayer; Vector speed = local_player->m_vecVelocity(); int intspeed = round(speed.Length2D()); const float delta = intspeed - lastvel; std::string vel = std::to_string(intspeed); if (local_player->m_fFlags() & FL_ONGROUND) { if (lastvelsaved) { lastvelsaved = false; } drawvel = vel; } else { if (!lastvelsaved) { lastjump = intspeed; lastvelsaved = true; } drawvel = vel + " (" + std::to_string(lastjump) + ")"; } drawvel2 = "(" + std::to_string(lastjump) + ")"; if (local_player->m_nMoveType() == MOVETYPE_NOCLIP) { Render::Get().RenderText(std::to_string(intspeed), screenWidth / 2 - 47, screenHeight - 99, 27.f, Color(0, 0, 0, 255), false, false, g_VeloFont); Render::Get().RenderText(std::to_string(intspeed), screenWidth / 2 - 48, screenHeight - 100, 27.f, g_Options.Velocitycol, false, false, g_VeloFont); if (!(local_player->m_fFlags() & FL_ONGROUND)) { if (lastjump >= 100 && g_Options.lastjump) { Render::Get().RenderText(drawvel2, screenWidth / 2 + 3, screenHeight - 99, 27.f, Color(0, 0, 0), false, false, g_VeloFont); Render::Get().RenderText(drawvel2, screenWidth / 2 + 2, screenHeight - 100, 27.f, g_Options.Velocitycol, false, false, g_VeloFont); } } } else { // if (intspeed >= 280) // g_Render->RenderText(std::to_string(intspeed), screenWidth / 2, screenHeight - 100, 27.f, Color(170, 255, 0), false, false, g_VeloFont); // else Render::Get().RenderText(std::to_string(intspeed), screenWidth / 2 - 47, screenHeight - 99, 27.f, Color(0, 0, 0, 255), false, false, g_VeloFont); Render::Get().RenderText(std::to_string(intspeed), screenWidth / 2 - 48, screenHeight - 100, 27.f, g_Options.Velocitycol, false, false, g_VeloFont); if (!(local_player->m_fFlags() & FL_ONGROUND)) { if (lastjump >= 100 && g_Options.lastjump) { Render::Get().RenderText(drawvel2, screenWidth / 2 + 3, screenHeight - 99, 27.f, Color(0, 0, 0), false, false, g_VeloFont); Render::Get().RenderText(drawvel2, screenWidth / 2 + 2, screenHeight - 100, 27.f, g_Options.Velocitycol, false, false, g_VeloFont); } } } }
Link to comment
Share on other sites
6 answers to this question
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.