Jump to content
  • 0

question Velocity Indicator


jaxson
 Share

Question

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

  • 0
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?

Link to comment
Share on other sites

  • 0
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

 

Link to comment
Share on other sites

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.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...