Jump to content
  • Treść wyszukiwania
    Search In
    • More options...
    Find results that contain...
    Find results in...
  • Sign Up
Password for all archives on our forum: 123
  • 0

question Velocity Indicator


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 post
Share on other sites

6 answers to this question

Recommended Posts


  • 0
On 7/1/2021 at 10:59 PM, btc said:

Hidden Content

    Give reaction to this post to see the hidden content.
 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

Link to post
Share on other sites
  • 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 post
Share on other sites
  • 0
20 minutes ago, jaxson said:

 

well idk it would look kinda stupid if the text changes the pos when u get velocity

Link to post
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 post
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.

Loading...
×
×
  • Create New...