diff --git a/memory-external/hacks/hack.hpp b/memory-external/hacks/hack.hpp index 2567fc2..7a02b9d 100644 --- a/memory-external/hacks/hack.hpp +++ b/memory-external/hacks/hack.hpp @@ -38,6 +38,33 @@ namespace hack { * (This could have been done by getting a entity list count from the engine, but I'm too lazy to do that) **/ while (true) { + bool c4IsPlanted = process->read(base_client.base + updater::offsets::dwPlantedC4 - 0x8); + if (c4IsPlanted) + { + const uintptr_t planted_c4 = process->read(process->read(base_client.base + updater::offsets::dwPlantedC4)); + + const uintptr_t c4Node = process->read(planted_c4 + updater::offsets::m_pGameSceneNode); + + const Vector3 c4Origin = process->read(c4Node + updater::offsets::m_vecAbsOrigin); + + const Vector3 c4ScreenPos = c4Origin.world_to_screen(view_matrix); + + float distance = localOrigin.calculate_distance(c4Origin); + float roundedDistance = std::round(distance / 500.f); + + float height = 10 - roundedDistance; + float width = height * 1.2f; + + render::DrawBorderBox( + g::hdcBuffer, + c4ScreenPos.x - (width / 2), + c4ScreenPos.y - (height / 2), + width, + height, + RGB(0, 185, 255) + ); + } + playerIndex++; list_entry = process->read(entity_list + (8 * (playerIndex & 0x7FFF) >> 9) + 16); if (!list_entry)