MitilcC / CS2-Internal-Cheat

Free and open-source internal cheat for CS2, written in C++, working on Windows
MIT License
47 stars 8 forks source link

better healthbar #2

Open weedptr opened 5 months ago

weedptr commented 5 months ago

code:

`void DrawHealthBar2(DWORD EntityAddress, float MaxHealth, float CurrentHealth, ImVec2 Pos, ImVec2 Size, bool Horizontal = true) { ImDrawList* DrawList = ImGui::GetBackgroundDrawList();

float Proportion = CurrentHealth / MaxHealth;

ImColor FirstStageColor = ImColor(96, 246, 113, 220);
ImColor SecondStageColor = ImColor(247, 214, 103, 220);
ImColor ThirdStageColor = ImColor(255, 95, 95, 220);
ImColor BackGroundColor = ImColor(90, 90, 90, 220);
ImColor Color;
if (Proportion > 0.5)
    Color = FirstStageColor;
else if (Proportion > 0.25)
    Color = SecondStageColor;
else
    Color = ThirdStageColor;

DrawList->AddRectFilled(Pos, { Pos.x + Size.x, Pos.y + Size.y }, BackGroundColor);

if (Horizontal)
{
    DrawList->AddRectFilled(Pos, { Pos.x + Size.x * Proportion, Pos.y + Size.y }, Color);
}
else
{
    float healthHeight = Size.y * Proportion;
    DrawList->AddRectFilled({ Pos.x, Pos.y + Size.y - healthHeight }, { Pos.x + Size.x, Pos.y + Size.y }, Color);
}

ImColor BorderColor = ImColor(45, 45, 45, 220);
DrawList->AddRect(Pos, { Pos.x + Size.x, Pos.y + Size.y }, BorderColor);

}

    if (Menu::ESP::ShowHealthBar)
    {
        ImVec2 healthBarPos = ImVec2(x - 10, y); // Adjust position as needed
        ImVec2 healthBarSize = ImVec2(5, height); // Adjust size as needed

        DrawHealthBar2(Entity.control, 100.0f, static_cast<float>(Entity.health), healthBarPos, healthBarSize, false);
    }

`

enjoy

MitilcC commented 5 months ago

Thanks for your suggestion, I see some mistakes in health bar, I will perfect it next time

weedptr commented 5 months ago

Thanks for your suggestion, I see some mistakes in health bar, I will perfect it next time

when will u add more features? aswell do you have a discord server?

MitilcC commented 5 months ago

Features are being added gradually. Due to the lack of knowledge about Hook Createmove, this type of functionality needs to be explored more. A related server will be opened for this project in the future for discord server

weedptr commented 5 months ago

Features are being added gradually. Due to the lack of knowledge about Hook Createmove, this type of functionality needs to be explored more. A related server will be opened for this project in the future for discord server

added any features yet?