Вопрос Как сделать вх на имгуи для интернал чита (c++)

Начинающий
Статус
Оффлайн
Регистрация
20 Сен 2020
Сообщения
7
Реакции[?]
0
Поинты[?]
0
я новичёк, сделал (спастил, будет правильнее сказать) интернал менюшку на имгуи (kierahook), как мне теперь вх там сделать?
 
Начинающий
Статус
Оффлайн
Регистрация
4 Сен 2023
Сообщения
4
Реакции[?]
0
Поинты[?]
0
Начинающий
Статус
Оффлайн
Регистрация
29 Апр 2024
Сообщения
113
Реакции[?]
9
Поинты[?]
9K
Начинающий
Статус
Оффлайн
Регистрация
1 Янв 2020
Сообщения
74
Реакции[?]
3
Поинты[?]
3K
esp.cpp:
#include "globals.h"
#include "offsets.h"
#include "config.h"
#include "includes.h"
#include "math.h"
#include "imgui/imgui_internal.h"


ImColor GetBarColor(float percent) {
    ImVec4 red(1, 0, 0, 1);
    ImVec4 yellow(1, 1, 0, 1);
    ImVec4 green(0, 1, 0, 1);

    ImColor color;
    if (percent <= 0.5)
    {
        color = ImLerp(red, yellow, percent * 2);
    }
    else
    {
        color = ImLerp(yellow, green, (percent - 0.5f) * 2);
    }
    return color;
}


void RenderESP() {
    if (config.box2d || config.espLines) {
        ImDrawList* drawList = ImGui::GetBackgroundDrawList();
        uintptr_t localPlayerPawn = [I](uintptr_t[/I])(ClientBase + dwLocalPlayerPawn);
        if (localPlayerPawn) {
            uintptr_t entityList = [I](uintptr_t[/I])(ClientBase + dwEntityList);
            ViewMatrix vm = [I](ViewMatrix[/I])(ClientBase + dwViewMatrix);
            int localTeam = [I](int[/I])(localPlayerPawn + m_iTeamNum);

            std::cout << localTeam << std::endl;

            for (int playerIndex = 1; playerIndex < 64; playerIndex++) {
                uintptr_t listEntry = [I](uintptr_t[/I])(entityList + (8 * (playerIndex & 0x7FFF) >> 9) + 16);

                if (!listEntry)
                {
                    continue;
                }


                uintptr_t player = [I](uintptr_t[/I])(listEntry + 120 * (playerIndex & 0x1FF));

                if (!player)
                {
                    continue;
                }

                int playerTeam = [I](int[/I])(player + m_iTeamNum);

                if (!config.showTeamate) {
                    if (playerTeam == localTeam) {
                        continue;
                    }
                }

                uint32_t playerPawn = [I](uint32_t[/I])(player + m_hPawn);

                char playerName = [I](char[/I])(player + 0x640); //m_iszPlayerName = 0x640;

                uintptr_t listEntry2 = [I](uintptr_t[/I])(entityList + 0x8 * ((playerPawn & 0x7FFF) >> 9) + 16);

                if (!listEntry2) {
                    continue;
                }
                uintptr_t pCSPlayerPawn = [I](uintptr_t[/I])(listEntry2 + 120 * (playerPawn & 0x1FF));

                if (!pCSPlayerPawn) {
                    continue;
                }


                int health = [I](int[/I])(pCSPlayerPawn + m_iHealth);

                std::cout << health << std::endl;

                if (health <= 0 || health > 100) {
                    continue;
                }

                if (pCSPlayerPawn == localPlayerPawn)
                    continue;


                Vector3 origin = [I](Vector3[/I])(pCSPlayerPawn + m_vOldOrigin);
                Vector3 eyePos = origin + [I](Vector3[/I])(pCSPlayerPawn + m_vecViewOffset);
                eyePos.z += 12;

                Vector2 head, feet;


                /*if (worldToScreenPoint(origin, vm, head)) {
                    drawList->AddCircle(ImVec2(head.x, head.y), 20.0f, IM_COL32(255, 0, 0, 255));
                    //feet.x += width;
                    //feet.y -= width;
                }*/
                if (world_to_screen(vm.vm, origin, feet) && world_to_screen(vm.vm, eyePos, head)) {
                    if (config.textinfo) {
                        drawList->AddText(ImVec2(head.x, head.y), IM_COL32(255, 0, 0, 255), std::to_string(health).c_str());
                    }
                    if (config.espLines && playerTeam != localTeam) {
                        drawList->AddLine(ImVec2(960, 540), ImVec2(feet.x, feet.y), IM_COL32(255, 0, 0, 180));
                    }
                    if (config.box2d) {
                        float width = (head.y - feet.y) / 4;
                        feet.x -= width;
                        head.x += width;
                        ImU32 fillColor;
                        if (playerTeam == localTeam) {
                            fillColor = IM_COL32(0, 0, 255, config.fillAlpha);
                        }
                        else {
                            fillColor = IM_COL32(255, 0, 0, config.fillAlpha);
                        }
                        if (config.boxfiled) {
                            drawList->AddRectFilled(ImVec2(head.x, head.y), ImVec2(feet.x, feet.y), fillColor, 7.0f);
                        }
                        drawList->AddRect(ImVec2(head.x, head.y), ImVec2(feet.x, feet.y), IM_COL32(255, 255, 255, 255), 7.0f);
   
                        std::cout << "head.x" << " " << head.x << " head.y" << " " << head.y << std::endl;
                    }
                    if (config.healthbar) {
                        float maxHealth = 100;
                        float percent = health / maxHealth;
                        float horizontalOffset = 10;
                        Vector2 bottomPoint = Vector2(feet.x + (head.y - feet.y) / 4, feet.y);
                        Vector2 topPoint = Vector2(head.x - (head.y - feet.y) / 4, head.y);
                        float boxWidth = (bottomPoint.y - topPoint.y) / 5;
                        float lineHeight = (bottomPoint.y - topPoint.y) * percent;
                        float lineWidth = (bottomPoint.x - topPoint.x) * percent;
                        //drawList->AddCircle(bottomPoint + Vector3(-boxWidth, 0, 0), 5, IM_COL32(255, 0, 0, 255), 10, 3);
                        //drawList->AddCircle(topPoint + Vector3(-boxWidth, 0, 0), 5, IM_COL32(255, 0, 0, 255), 10, 3);
                        //drawList->AddCircle(bottomPoint + Vector3(-boxWidth - lineWidth, -lineHeight, 0), 5, IM_COL32(255, 0, 0, 255), 10, 3);
                        drawList->AddLine(
                            bottomPoint + Vector3(-boxWidth - horizontalOffset, 1, 0),
                            topPoint + Vector3(-boxWidth - horizontalOffset, -1, 0),
                            IM_COL32(0, 0, 0, 255), 6);
                        drawList->AddLine(
                            bottomPoint + Vector3(-boxWidth - horizontalOffset, 0, 0),
                            bottomPoint + Vector3(-boxWidth - lineWidth - horizontalOffset, -lineHeight, 0),
                            GetBarColor(percent), 4);
                    }

                }
               
            }
        }
    }
}
оффсеты сам думаю найдешь
SS:
1724226321180.png
 
Последнее редактирование:
Read Only
Статус
Оффлайн
Регистрация
11 Авг 2023
Сообщения
120
Реакции[?]
7
Поинты[?]
8K
esp.cpp:
#include "globals.h"
#include "offsets.h"
#include "config.h"
#include "includes.h"
#include "math.h"
#include "imgui/imgui_internal.h"


ImColor GetBarColor(float percent) {
    ImVec4 red(1, 0, 0, 1);
    ImVec4 yellow(1, 1, 0, 1);
    ImVec4 green(0, 1, 0, 1);

    ImColor color;
    if (percent <= 0.5)
    {
        color = ImLerp(red, yellow, percent * 2);
    }
    else
    {
        color = ImLerp(yellow, green, (percent - 0.5f) * 2);
    }
    return color;
}


void RenderESP() {
    if (config.box2d || config.espLines) {
        ImDrawList* drawList = ImGui::GetBackgroundDrawList();
        uintptr_t localPlayerPawn = [I](uintptr_t[/I])(ClientBase + dwLocalPlayerPawn);
        if (localPlayerPawn) {
            uintptr_t entityList = [I](uintptr_t[/I])(ClientBase + dwEntityList);
            ViewMatrix vm = [I](ViewMatrix[/I])(ClientBase + dwViewMatrix);
            int localTeam = [I](int[/I])(localPlayerPawn + m_iTeamNum);

            std::cout << localTeam << std::endl;

            for (int playerIndex = 1; playerIndex < 64; playerIndex++) {
                uintptr_t listEntry = [I](uintptr_t[/I])(entityList + (8 * (playerIndex & 0x7FFF) >> 9) + 16);

                if (!listEntry)
                {
                    continue;
                }


                uintptr_t player = [I](uintptr_t[/I])(listEntry + 120 * (playerIndex & 0x1FF));

                if (!player)
                {
                    continue;
                }

                int playerTeam = [I](int[/I])(player + m_iTeamNum);

                if (!config.showTeamate) {
                    if (playerTeam == localTeam) {
                        continue;
                    }
                }

                uint32_t playerPawn = [I](uint32_t[/I])(player + m_hPawn);

                char playerName = [I](char[/I])(player + 0x640); //m_iszPlayerName = 0x640;

                uintptr_t listEntry2 = [I](uintptr_t[/I])(entityList + 0x8 * ((playerPawn & 0x7FFF) >> 9) + 16);

                if (!listEntry2) {
                    continue;
                }
                uintptr_t pCSPlayerPawn = [I](uintptr_t[/I])(listEntry2 + 120 * (playerPawn & 0x1FF));

                if (!pCSPlayerPawn) {
                    continue;
                }


                int health = [I](int[/I])(pCSPlayerPawn + m_iHealth);

                std::cout << health << std::endl;

                if (health <= 0 || health > 100) {
                    continue;
                }

                if (pCSPlayerPawn == localPlayerPawn)
                    continue;


                Vector3 origin = [I](Vector3[/I])(pCSPlayerPawn + m_vOldOrigin);
                Vector3 eyePos = origin + [I](Vector3[/I])(pCSPlayerPawn + m_vecViewOffset);
                eyePos.z += 12;

                Vector2 head, feet;


                /*if (worldToScreenPoint(origin, vm, head)) {
                    drawList->AddCircle(ImVec2(head.x, head.y), 20.0f, IM_COL32(255, 0, 0, 255));
                    //feet.x += width;
                    //feet.y -= width;
                }*/
                if (world_to_screen(vm.vm, origin, feet) && world_to_screen(vm.vm, eyePos, head)) {
                    if (config.textinfo) {
                        drawList->AddText(ImVec2(head.x, head.y), IM_COL32(255, 0, 0, 255), std::to_string(health).c_str());
                    }
                    if (config.espLines && playerTeam != localTeam) {
                        drawList->AddLine(ImVec2(960, 540), ImVec2(feet.x, feet.y), IM_COL32(255, 0, 0, 180));
                    }
                    if (config.box2d) {
                        float width = (head.y - feet.y) / 4;
                        feet.x -= width;
                        head.x += width;
                        ImU32 fillColor;
                        if (playerTeam == localTeam) {
                            fillColor = IM_COL32(0, 0, 255, config.fillAlpha);
                        }
                        else {
                            fillColor = IM_COL32(255, 0, 0, config.fillAlpha);
                        }
                        if (config.boxfiled) {
                            drawList->AddRectFilled(ImVec2(head.x, head.y), ImVec2(feet.x, feet.y), fillColor, 7.0f);
                        }
                        drawList->AddRect(ImVec2(head.x, head.y), ImVec2(feet.x, feet.y), IM_COL32(255, 255, 255, 255), 7.0f);
  
                        std::cout << "head.x" << " " << head.x << " head.y" << " " << head.y << std::endl;
                    }
                    if (config.healthbar) {
                        float maxHealth = 100;
                        float percent = health / maxHealth;
                        float horizontalOffset = 10;
                        Vector2 bottomPoint = Vector2(feet.x + (head.y - feet.y) / 4, feet.y);
                        Vector2 topPoint = Vector2(head.x - (head.y - feet.y) / 4, head.y);
                        float boxWidth = (bottomPoint.y - topPoint.y) / 5;
                        float lineHeight = (bottomPoint.y - topPoint.y) * percent;
                        float lineWidth = (bottomPoint.x - topPoint.x) * percent;
                        //drawList->AddCircle(bottomPoint + Vector3(-boxWidth, 0, 0), 5, IM_COL32(255, 0, 0, 255), 10, 3);
                        //drawList->AddCircle(topPoint + Vector3(-boxWidth, 0, 0), 5, IM_COL32(255, 0, 0, 255), 10, 3);
                        //drawList->AddCircle(bottomPoint + Vector3(-boxWidth - lineWidth, -lineHeight, 0), 5, IM_COL32(255, 0, 0, 255), 10, 3);
                        drawList->AddLine(
                            bottomPoint + Vector3(-boxWidth - horizontalOffset, 1, 0),
                            topPoint + Vector3(-boxWidth - horizontalOffset, -1, 0),
                            IM_COL32(0, 0, 0, 255), 6);
                        drawList->AddLine(
                            bottomPoint + Vector3(-boxWidth - horizontalOffset, 0, 0),
                            bottomPoint + Vector3(-boxWidth - lineWidth - horizontalOffset, -lineHeight, 0),
                            GetBarColor(percent), 4);
                    }

                }
              
            }
        }
    }
}
оффсеты сам думаю найдешь
SS:
Посмотреть вложение 283826
он писал ИНТЕРНАЛ
 
Пользователь
Статус
Оффлайн
Регистрация
8 Июн 2020
Сообщения
196
Реакции[?]
63
Поинты[?]
28K
esp.cpp:
#include "globals.h"
#include "offsets.h"
#include "config.h"
#include "includes.h"
#include "math.h"
#include "imgui/imgui_internal.h"


ImColor GetBarColor(float percent) {
    ImVec4 red(1, 0, 0, 1);
    ImVec4 yellow(1, 1, 0, 1);
    ImVec4 green(0, 1, 0, 1);

    ImColor color;
    if (percent <= 0.5)
    {
        color = ImLerp(red, yellow, percent * 2);
    }
    else
    {
        color = ImLerp(yellow, green, (percent - 0.5f) * 2);
    }
    return color;
}


void RenderESP() {
    if (config.box2d || config.espLines) {
        ImDrawList* drawList = ImGui::GetBackgroundDrawList();
        uintptr_t localPlayerPawn = [I](uintptr_t[/I])(ClientBase + dwLocalPlayerPawn);
        if (localPlayerPawn) {
            uintptr_t entityList = [I](uintptr_t[/I])(ClientBase + dwEntityList);
            ViewMatrix vm = [I](ViewMatrix[/I])(ClientBase + dwViewMatrix);
            int localTeam = [I](int[/I])(localPlayerPawn + m_iTeamNum);

            std::cout << localTeam << std::endl;

            for (int playerIndex = 1; playerIndex < 64; playerIndex++) {
                uintptr_t listEntry = [I](uintptr_t[/I])(entityList + (8 * (playerIndex & 0x7FFF) >> 9) + 16);

                if (!listEntry)
                {
                    continue;
                }


                uintptr_t player = [I](uintptr_t[/I])(listEntry + 120 * (playerIndex & 0x1FF));

                if (!player)
                {
                    continue;
                }

                int playerTeam = [I](int[/I])(player + m_iTeamNum);

                if (!config.showTeamate) {
                    if (playerTeam == localTeam) {
                        continue;
                    }
                }

                uint32_t playerPawn = [I](uint32_t[/I])(player + m_hPawn);

                char playerName = [I](char[/I])(player + 0x640); //m_iszPlayerName = 0x640;

                uintptr_t listEntry2 = [I](uintptr_t[/I])(entityList + 0x8 * ((playerPawn & 0x7FFF) >> 9) + 16);

                if (!listEntry2) {
                    continue;
                }
                uintptr_t pCSPlayerPawn = [I](uintptr_t[/I])(listEntry2 + 120 * (playerPawn & 0x1FF));

                if (!pCSPlayerPawn) {
                    continue;
                }


                int health = [I](int[/I])(pCSPlayerPawn + m_iHealth);

                std::cout << health << std::endl;

                if (health <= 0 || health > 100) {
                    continue;
                }

                if (pCSPlayerPawn == localPlayerPawn)
                    continue;


                Vector3 origin = [I](Vector3[/I])(pCSPlayerPawn + m_vOldOrigin);
                Vector3 eyePos = origin + [I](Vector3[/I])(pCSPlayerPawn + m_vecViewOffset);
                eyePos.z += 12;

                Vector2 head, feet;


                /*if (worldToScreenPoint(origin, vm, head)) {
                    drawList->AddCircle(ImVec2(head.x, head.y), 20.0f, IM_COL32(255, 0, 0, 255));
                    //feet.x += width;
                    //feet.y -= width;
                }*/
                if (world_to_screen(vm.vm, origin, feet) && world_to_screen(vm.vm, eyePos, head)) {
                    if (config.textinfo) {
                        drawList->AddText(ImVec2(head.x, head.y), IM_COL32(255, 0, 0, 255), std::to_string(health).c_str());
                    }
                    if (config.espLines && playerTeam != localTeam) {
                        drawList->AddLine(ImVec2(960, 540), ImVec2(feet.x, feet.y), IM_COL32(255, 0, 0, 180));
                    }
                    if (config.box2d) {
                        float width = (head.y - feet.y) / 4;
                        feet.x -= width;
                        head.x += width;
                        ImU32 fillColor;
                        if (playerTeam == localTeam) {
                            fillColor = IM_COL32(0, 0, 255, config.fillAlpha);
                        }
                        else {
                            fillColor = IM_COL32(255, 0, 0, config.fillAlpha);
                        }
                        if (config.boxfiled) {
                            drawList->AddRectFilled(ImVec2(head.x, head.y), ImVec2(feet.x, feet.y), fillColor, 7.0f);
                        }
                        drawList->AddRect(ImVec2(head.x, head.y), ImVec2(feet.x, feet.y), IM_COL32(255, 255, 255, 255), 7.0f);
 
                        std::cout << "head.x" << " " << head.x << " head.y" << " " << head.y << std::endl;
                    }
                    if (config.healthbar) {
                        float maxHealth = 100;
                        float percent = health / maxHealth;
                        float horizontalOffset = 10;
                        Vector2 bottomPoint = Vector2(feet.x + (head.y - feet.y) / 4, feet.y);
                        Vector2 topPoint = Vector2(head.x - (head.y - feet.y) / 4, head.y);
                        float boxWidth = (bottomPoint.y - topPoint.y) / 5;
                        float lineHeight = (bottomPoint.y - topPoint.y) * percent;
                        float lineWidth = (bottomPoint.x - topPoint.x) * percent;
                        //drawList->AddCircle(bottomPoint + Vector3(-boxWidth, 0, 0), 5, IM_COL32(255, 0, 0, 255), 10, 3);
                        //drawList->AddCircle(topPoint + Vector3(-boxWidth, 0, 0), 5, IM_COL32(255, 0, 0, 255), 10, 3);
                        //drawList->AddCircle(bottomPoint + Vector3(-boxWidth - lineWidth, -lineHeight, 0), 5, IM_COL32(255, 0, 0, 255), 10, 3);
                        drawList->AddLine(
                            bottomPoint + Vector3(-boxWidth - horizontalOffset, 1, 0),
                            topPoint + Vector3(-boxWidth - horizontalOffset, -1, 0),
                            IM_COL32(0, 0, 0, 255), 6);
                        drawList->AddLine(
                            bottomPoint + Vector3(-boxWidth - horizontalOffset, 0, 0),
                            bottomPoint + Vector3(-boxWidth - lineWidth - horizontalOffset, -lineHeight, 0),
                            GetBarColor(percent), 4);
                    }

                }
             
            }
        }
    }
}
оффсеты сам думаю найдешь
SS:
Посмотреть вложение 283826
Прикольно выглядит, не против если возьму несколько приколов себе ?
 
Участник
Статус
Оффлайн
Регистрация
19 Апр 2020
Сообщения
1,176
Реакции[?]
314
Поинты[?]
152K
Начинающий
Статус
Оффлайн
Регистрация
1 Янв 2020
Сообщения
74
Реакции[?]
3
Поинты[?]
3K
Прикольно выглядит, не против если возьму несколько приколов себе ?
конечно, ток учти, что там хп бар, в некоторых случаях поворота, может криво отображаться, я еще не пофиксил
 
Пользователь
Статус
Оффлайн
Регистрация
8 Июн 2020
Сообщения
196
Реакции[?]
63
Поинты[?]
28K
Начинающий
Статус
Оффлайн
Регистрация
25 Мар 2022
Сообщения
2
Реакции[?]
0
Поинты[?]
0
я новичёк, сделал (спастил, будет правильнее сказать) интернал менюшку на имгуи (kierahook), как мне теперь вх там сделать?
В инете щас миллион пасты лежит во фри доступе,просто оттуда возьми
 
Начинающий
Статус
Оффлайн
Регистрация
29 Апр 2024
Сообщения
113
Реакции[?]
9
Поинты[?]
9K
esp.cpp:
#include "globals.h"
#include "offsets.h"
#include "config.h"
#include "includes.h"
#include "math.h"
#include "imgui/imgui_internal.h"


ImColor GetBarColor(float percent) {
    ImVec4 red(1, 0, 0, 1);
    ImVec4 yellow(1, 1, 0, 1);
    ImVec4 green(0, 1, 0, 1);

    ImColor color;
    if (percent <= 0.5)
    {
        color = ImLerp(red, yellow, percent * 2);
    }
    else
    {
        color = ImLerp(yellow, green, (percent - 0.5f) * 2);
    }
    return color;
}


void RenderESP() {
    if (config.box2d || config.espLines) {
        ImDrawList* drawList = ImGui::GetBackgroundDrawList();
        uintptr_t localPlayerPawn = [I](uintptr_t[/I])(ClientBase + dwLocalPlayerPawn);
        if (localPlayerPawn) {
            uintptr_t entityList = [I](uintptr_t[/I])(ClientBase + dwEntityList);
            ViewMatrix vm = [I](ViewMatrix[/I])(ClientBase + dwViewMatrix);
            int localTeam = [I](int[/I])(localPlayerPawn + m_iTeamNum);

            std::cout << localTeam << std::endl;

            for (int playerIndex = 1; playerIndex < 64; playerIndex++) {
                uintptr_t listEntry = [I](uintptr_t[/I])(entityList + (8 * (playerIndex & 0x7FFF) >> 9) + 16);

                if (!listEntry)
                {
                    continue;
                }


                uintptr_t player = [I](uintptr_t[/I])(listEntry + 120 * (playerIndex & 0x1FF));

                if (!player)
                {
                    continue;
                }

                int playerTeam = [I](int[/I])(player + m_iTeamNum);

                if (!config.showTeamate) {
                    if (playerTeam == localTeam) {
                        continue;
                    }
                }

                uint32_t playerPawn = [I](uint32_t[/I])(player + m_hPawn);

                char playerName = [I](char[/I])(player + 0x640); //m_iszPlayerName = 0x640;

                uintptr_t listEntry2 = [I](uintptr_t[/I])(entityList + 0x8 * ((playerPawn & 0x7FFF) >> 9) + 16);

                if (!listEntry2) {
                    continue;
                }
                uintptr_t pCSPlayerPawn = [I](uintptr_t[/I])(listEntry2 + 120 * (playerPawn & 0x1FF));

                if (!pCSPlayerPawn) {
                    continue;
                }


                int health = [I](int[/I])(pCSPlayerPawn + m_iHealth);

                std::cout << health << std::endl;

                if (health <= 0 || health > 100) {
                    continue;
                }

                if (pCSPlayerPawn == localPlayerPawn)
                    continue;


                Vector3 origin = [I](Vector3[/I])(pCSPlayerPawn + m_vOldOrigin);
                Vector3 eyePos = origin + [I](Vector3[/I])(pCSPlayerPawn + m_vecViewOffset);
                eyePos.z += 12;

                Vector2 head, feet;


                /*if (worldToScreenPoint(origin, vm, head)) {
                    drawList->AddCircle(ImVec2(head.x, head.y), 20.0f, IM_COL32(255, 0, 0, 255));
                    //feet.x += width;
                    //feet.y -= width;
                }*/
                if (world_to_screen(vm.vm, origin, feet) && world_to_screen(vm.vm, eyePos, head)) {
                    if (config.textinfo) {
                        drawList->AddText(ImVec2(head.x, head.y), IM_COL32(255, 0, 0, 255), std::to_string(health).c_str());
                    }
                    if (config.espLines && playerTeam != localTeam) {
                        drawList->AddLine(ImVec2(960, 540), ImVec2(feet.x, feet.y), IM_COL32(255, 0, 0, 180));
                    }
                    if (config.box2d) {
                        float width = (head.y - feet.y) / 4;
                        feet.x -= width;
                        head.x += width;
                        ImU32 fillColor;
                        if (playerTeam == localTeam) {
                            fillColor = IM_COL32(0, 0, 255, config.fillAlpha);
                        }
                        else {
                            fillColor = IM_COL32(255, 0, 0, config.fillAlpha);
                        }
                        if (config.boxfiled) {
                            drawList->AddRectFilled(ImVec2(head.x, head.y), ImVec2(feet.x, feet.y), fillColor, 7.0f);
                        }
                        drawList->AddRect(ImVec2(head.x, head.y), ImVec2(feet.x, feet.y), IM_COL32(255, 255, 255, 255), 7.0f);
  
                        std::cout << "head.x" << " " << head.x << " head.y" << " " << head.y << std::endl;
                    }
                    if (config.healthbar) {
                        float maxHealth = 100;
                        float percent = health / maxHealth;
                        float horizontalOffset = 10;
                        Vector2 bottomPoint = Vector2(feet.x + (head.y - feet.y) / 4, feet.y);
                        Vector2 topPoint = Vector2(head.x - (head.y - feet.y) / 4, head.y);
                        float boxWidth = (bottomPoint.y - topPoint.y) / 5;
                        float lineHeight = (bottomPoint.y - topPoint.y) * percent;
                        float lineWidth = (bottomPoint.x - topPoint.x) * percent;
                        //drawList->AddCircle(bottomPoint + Vector3(-boxWidth, 0, 0), 5, IM_COL32(255, 0, 0, 255), 10, 3);
                        //drawList->AddCircle(topPoint + Vector3(-boxWidth, 0, 0), 5, IM_COL32(255, 0, 0, 255), 10, 3);
                        //drawList->AddCircle(bottomPoint + Vector3(-boxWidth - lineWidth, -lineHeight, 0), 5, IM_COL32(255, 0, 0, 255), 10, 3);
                        drawList->AddLine(
                            bottomPoint + Vector3(-boxWidth - horizontalOffset, 1, 0),
                            topPoint + Vector3(-boxWidth - horizontalOffset, -1, 0),
                            IM_COL32(0, 0, 0, 255), 6);
                        drawList->AddLine(
                            bottomPoint + Vector3(-boxWidth - horizontalOffset, 0, 0),
                            bottomPoint + Vector3(-boxWidth - lineWidth - horizontalOffset, -lineHeight, 0),
                            GetBarColor(percent), 4);
                    }

                }
              
            }
        }
    }
}
Пожалуйста, авторизуйтесь для просмотра ссылки.
(noad)
 
Сверху Снизу