Вопрос Не правильно работает Name esp (internal)

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
29 Мар 2024
Сообщения
6
Реакции
0
Крч, делаю читы 4 дня и порытался сделать отображение имени игрока через стены (пока еще не сделал сому механнику получения никнейма, пока просто отображается статичный текст) и проблема в том что тектс то появляется но он двигаеться когда я двигаюсь или поворачиваюсь в игре

(internal c++)

(и да если можете скажите как получать никнейм игрока)

код функции отображения никнейма:
Expand Collapse Copy
void V::Name()
{
    float(*ViewMatrix)[4][4] = (float(*)[4][4])(client + O::dwViewMatrix);
    if (!ViewMatrix) {
        std::cerr << "ViewMatrix is null." << std::endl;
        return;
    }

    auto localPawn = *(uintptr_t*)(client + O::dwLocalPlayerPawn);
    if (!localPawn) {
        std::cerr << "LocalPawn is null." << std::endl;
        return;
    }

    auto localTeam = *(UINT8*)(server + O::m_iTeamNum);
    auto entityList = *(uintptr_t*)(client + O::dwEntityList);
    if (!entityList) {
        std::cerr << "EntityList is null." << std::endl;
        return;
    }

    for (int i = 1; i < 64; i++) {
        uintptr_t list_entry1 = *(uintptr_t*)(entityList + (8 * (i & 0x7FFF) >> 9) + 16);
        if (!list_entry1) continue;

        uintptr_t playerController = *(uintptr_t*)(list_entry1 + 120 * (i & 0x1FF));
        if (!playerController) continue;

        uint32_t playerPawn = *(uint32_t*)(playerController + O::m_hPlayerPawn);
        if (!playerPawn) continue;

        uintptr_t list_entry2 = *(uintptr_t*)(entityList + 0x8 * ((playerPawn & 0x7FFF) >> 9) + 16);
        if (!list_entry2) continue;

        uintptr_t pCSPlayerPawnPtr = *(uintptr_t*)(list_entry2 + 120 * (playerPawn & 0x1FF));
        if (!pCSPlayerPawnPtr) continue;

        int health = *(INT32*)(pCSPlayerPawnPtr + O::m_iHealth);
        if (health <= 0) continue;

        int team = *(UINT8*)(pCSPlayerPawnPtr + O::m_iTeamNum);
        if (team == localTeam) continue;

        Vec3 feetPos = *(Vec3*)(pCSPlayerPawnPtr + O::m_vOldOrigin);
        Vec3 headPos = { feetPos.x, feetPos.y, feetPos.z + 70.0f };
        

        Vec2 feet, head;
        if (feetPos.WorldToScreen(feet, ViewMatrix) && headPos.WorldToScreen(head, ViewMatrix)) {
            float height = (feet.y - head.y) * 1.5f;
            float width = height / 1.9f;
            float corner_size = height / 4.0f;

            ImVec2 TextPos = { feet.y, head.y};

            float x = feet.x - width / 2;
            float y = head.y;

            ImDrawList* DrawList = ImGui::GetBackgroundDrawList();

            DrawList->AddText(TextPos, ImColor(234, 93, 96), "Bot");

        }
    }

photo_2025-06-21_13-53-17.jpg
 
Крч, делаю читы 4 дня и порытался сделать отображение имени игрока через стены (пока еще не сделал сому механнику получения никнейма, пока просто отображается статичный текст) и проблема в том что тектс то появляется но он двигаеться когда я двигаюсь или поворачиваюсь в игре

(internal c++)

(и да если можете скажите как получать никнейм игрока)

код функции отображения никнейма:
Expand Collapse Copy
void V::Name()
{
    float(*ViewMatrix)[4][4] = (float(*)[4][4])(client + O::dwViewMatrix);
    if (!ViewMatrix) {
        std::cerr << "ViewMatrix is null." << std::endl;
        return;
    }

    auto localPawn = *(uintptr_t*)(client + O::dwLocalPlayerPawn);
    if (!localPawn) {
        std::cerr << "LocalPawn is null." << std::endl;
        return;
    }

    auto localTeam = *(UINT8*)(server + O::m_iTeamNum);
    auto entityList = *(uintptr_t*)(client + O::dwEntityList);
    if (!entityList) {
        std::cerr << "EntityList is null." << std::endl;
        return;
    }

    for (int i = 1; i < 64; i++) {
        uintptr_t list_entry1 = *(uintptr_t*)(entityList + (8 * (i & 0x7FFF) >> 9) + 16);
        if (!list_entry1) continue;

        uintptr_t playerController = *(uintptr_t*)(list_entry1 + 120 * (i & 0x1FF));
        if (!playerController) continue;

        uint32_t playerPawn = *(uint32_t*)(playerController + O::m_hPlayerPawn);
        if (!playerPawn) continue;

        uintptr_t list_entry2 = *(uintptr_t*)(entityList + 0x8 * ((playerPawn & 0x7FFF) >> 9) + 16);
        if (!list_entry2) continue;

        uintptr_t pCSPlayerPawnPtr = *(uintptr_t*)(list_entry2 + 120 * (playerPawn & 0x1FF));
        if (!pCSPlayerPawnPtr) continue;

        int health = *(INT32*)(pCSPlayerPawnPtr + O::m_iHealth);
        if (health <= 0) continue;

        int team = *(UINT8*)(pCSPlayerPawnPtr + O::m_iTeamNum);
        if (team == localTeam) continue;

        Vec3 feetPos = *(Vec3*)(pCSPlayerPawnPtr + O::m_vOldOrigin);
        Vec3 headPos = { feetPos.x, feetPos.y, feetPos.z + 70.0f };
       

        Vec2 feet, head;
        if (feetPos.WorldToScreen(feet, ViewMatrix) && headPos.WorldToScreen(head, ViewMatrix)) {
            float height = (feet.y - head.y) * 1.5f;
            float width = height / 1.9f;
            float corner_size = height / 4.0f;

            ImVec2 TextPos = { feet.y, head.y};

            float x = feet.x - width / 2;
            float y = head.y;

            ImDrawList* DrawList = ImGui::GetBackgroundDrawList();

            DrawList->AddText(TextPos, ImColor(234, 93, 96), "Bot");

        }
    }

Посмотреть вложение 309375
ImVec2 TextPos = { head.x, head.y };
если все еще есть проблема то выведи значения ViewMatrix и убедись в том что WorldToScreen() возвращает корректные координаты
а то как ты можешь получить ник игроков используй CCSPlayerController->m_sSanitizedPlayerName
 
Код:
Expand Collapse Copy
void Texts(std::string Text, Vec2 Pos, ImColor Color, float FontSize, bool KeepCenter)
{
       float TextWidth = ImGui::GetFont()->CalcTextSizeA(FontSize, FLT_MAX, 0.f, Text.c_str()).x;
       ImVec2 Pos_ = { Pos.x - TextWidth / 2,Pos.y };
       ImGui::GetBackgroundDrawList()->AddText(ImGui::GetFont(), FontSize, Pos_, Color, Text.c_str());
  
}
void StrokeText(std::string Text, Vec2 Pos, ImColor Color, float FontSize, bool KeepCenter)
{
    Texts(Text, Vec2(Pos.x - 1, Pos.y + 1), ImColor(0, 0, 0), FontSize, KeepCenter);
    Texts(Text, Vec2(Pos.x - 1, Pos.y - 1), ImColor(0, 0, 0), FontSize, KeepCenter);
    Texts(Text, Vec2(Pos.x + 1, Pos.y + 1), ImColor(0, 0, 0), FontSize, KeepCenter);
    Texts(Text, Vec2(Pos.x + 1, Pos.y - 1), ImColor(0, 0, 0), FontSize, KeepCenter);
    Texts(Text, Pos, Color, FontSize, KeepCenter);
}

StrokeText(PlayerNames, { x + width / 2, head.y - 20 }, ImColor(255, 255, 0, 255), 12, true);


ники можно получить через m_iszplayername,
Код:
Expand Collapse Copy
std::string ReadStringFromMemory(uintptr_t baseAddress, uintptr_t offset, size_t maxLength)
{
    char* ptr = reinterpret_cast<char*>(baseAddress + offset);
    std::string result;
    for (size_t i = 0; i < maxLength - 1; ++i)
    {
        char c = *(ptr + i);
        if (c == '\0') break;
        result += c;
    }
    return result;
}

const size_t length = 128;    

std::string PlayerNames = ReadStringFromMemory(pCSPlayerPawnPtr, m_iszPlayerName, length);
 
Последнее редактирование:
Назад
Сверху Снизу