Message
Message
hpp"
#include "../../utils/overlay/imgui/imgui.h"
#include "../globals/globals.hpp"
#include <Windows.h>
#include <iomanip>
#include <cmath>
if (globals::outline) {
draw->AddLine(ImVec2(X, Y), ImVec2(X, Y + lineH), outlineColor, lineT +
outlineThickness);
draw->AddLine(ImVec2(X, Y), ImVec2(X + lineW, Y), outlineColor, lineT +
outlineThickness);
draw->AddLine(ImVec2(X + W - lineW, Y), ImVec2(X + W, Y), outlineColor,
lineT + outlineThickness);
draw->AddLine(ImVec2(X + W, Y), ImVec2(X + W, Y + lineH), outlineColor,
lineT + outlineThickness);
draw->AddLine(ImVec2(X, Y + H - lineH), ImVec2(X, Y + H), outlineColor,
lineT + outlineThickness);
draw->AddLine(ImVec2(X, Y + H), ImVec2(X + lineW, Y + H), outlineColor,
lineT + outlineThickness);
draw->AddLine(ImVec2(X + W - lineW, Y + H), ImVec2(X + W, Y + H),
outlineColor, lineT + outlineThickness);
draw->AddLine(ImVec2(X + W, Y + H - lineH), ImVec2(X + W, Y + H),
outlineColor, lineT + outlineThickness);
}
draw->AddLine(ImVec2(X, Y), ImVec2(X, Y + lineH),
ImGui::ColorConvertFloat4ToU32(color), lineT);
draw->AddLine(ImVec2(X, Y), ImVec2(X + lineW, Y),
ImGui::ColorConvertFloat4ToU32(color), lineT);
draw->AddLine(ImVec2(X + W - lineW, Y), ImVec2(X + W, Y),
ImGui::ColorConvertFloat4ToU32(color), lineT);
draw->AddLine(ImVec2(X + W, Y), ImVec2(X + W, Y + lineH),
ImGui::ColorConvertFloat4ToU32(color), lineT);
draw->AddLine(ImVec2(X, Y + H - lineH), ImVec2(X, Y + H),
ImGui::ColorConvertFloat4ToU32(color), lineT);
draw->AddLine(ImVec2(X, Y + H), ImVec2(X + lineW, Y + H),
ImGui::ColorConvertFloat4ToU32(color), lineT);
draw->AddLine(ImVec2(X + W - lineW, Y + H), ImVec2(X + W, Y + H),
ImGui::ColorConvertFloat4ToU32(color), lineT);
draw->AddLine(ImVec2(X + W, Y + H - lineH), ImVec2(X + W, Y + H),
ImGui::ColorConvertFloat4ToU32(color), lineT);
}
void vercetti::roblox::hook_esp()
{
auto players = globals::players;
auto draw = ImGui::GetBackgroundDrawList();
POINT cursor_pos;
GetCursorPos(&cursor_pos);
ScreenToClient(FindWindowA(0, "Roblox"), &cursor_pos);
//silence::roblox::vector3_t camerapos =
globals::visualengine.get_camera_pos();
if (globals::fov_on)
{
ImColor fill_color(0, 0, 0, 51);
ImColor black_outline_color(0, 0, 0);
if (globals::show_deadzone)
{
ImColor fill_color(0, 0, 0, 51);
ImColor black_outline_color(0, 0, 0);
if (globals::esp)
{
auto dimensions = globals::visualengine.get_dimensions();
auto viewmatrix = globals::visualengine.get_view_matrix();
auto localplayer = players.get_local_player();
auto localplayerHead =
localplayer.get_model_instance().find_first_child("Head");
// localplayer check
if (player.self == localplayer.self)
continue;
auto head_position =
vercetti::roblox::world_to_screen(vector_sub(head_position_3d, { 0, 2, 0 }),
dimensions, viewmatrix);
auto leg_pos =
vercetti::roblox::world_to_screen(vector_sub(head_position_3d, { 0, 5, 0 }),
dimensions, viewmatrix);
if (leg_pos.x == -1)
continue;
if (globals::distance_esp) {
// Calculate the position on screen for the head position
auto distance_position =
vercetti::roblox::world_to_screen(head_position_3d, dimensions, viewmatrix);
if (globals::name_esp) {
// Calculate the position on screen for the head position
auto name_position =
vercetti::roblox::world_to_screen(vector_sub(head_position_3d, { -0.25, 5.3, 0 }),
dimensions, viewmatrix);
if (globals::healthbar)
{
auto humanoid = character.find_first_child("Humanoid");
draw->AddRectFilledMultiColor(gradientBarPos, gradientBarEndPos,
colorStart, colorStart, colorEnd, colorEnd);
ImVec4 healthColor;
std::string text =
std::to_string(static_cast<int>(health));
if (globals::box)
{
ImVec4 color = ImVec4(globals::box_color[0], globals::box_color[1],
globals::box_color[2], 1.0f);
switch (globals::boxtype)
{
case 0:
if (globals::filledbox) {
draw->AddRectFilled(ImVec2(leg_pos.x - (width / 1.3f) -
outline_offset, leg_pos.y - outline_offset), ImVec2(head_position.x + width +
outline_offset, head_position.y + height + outline_offset),
ImGui::ColorConvertFloat4ToU32(fill_color));
}
draw->AddRect(ImVec2(leg_pos.x - (width / 1.3f), leg_pos.y),
ImVec2(head_position.x + width, head_position.y + height),
ImGui::ColorConvertFloat4ToU32(color));
if (globals::outline) {
draw->AddRect(ImVec2(leg_pos.x - (width / 1.3f) -
outline_offset - 1.5, leg_pos.y - outline_offset - 1.5), ImVec2(head_position.x +
width + outline_offset + 1.5, head_position.y + height + outline_offset + 1.5),
black_outline_color);
draw->AddRect(ImVec2(leg_pos.x - (width / 1.3f) -
outline_offset + 1.5, leg_pos.y - outline_offset + 1.5), ImVec2(head_position.x +
width + outline_offset - 1.5, head_position.y + height + outline_offset - 1.5),
black_outline_color);
}
if (globals::rainbowbox) {
float rainbow_width = (head_position.x + width +
outline_offset) - (leg_pos.x - (width / 1.3f) - outline_offset);
float rainbow_height = (head_position.y + height +
outline_offset) - (leg_pos.y - outline_offset);
draw->AddRectFilledMultiColor(
ImVec2(leg_pos.x - (width / 1.3f) - outline_offset,
leg_pos.y - outline_offset),
ImVec2(leg_pos.x - (width / 1.3f) - outline_offset +
rainbow_width, leg_pos.y - outline_offset + rainbow_height),
col_top_left,
col_top_right,
col_bottom_right,
col_bottom_left
);
}
break;
case 1:
if (globals::filledbox) {
draw->AddRectFilled(ImVec2(leg_pos.x - (width / 1.3f) -
outline_offset, leg_pos.y - outline_offset), ImVec2(head_position.x + width +
outline_offset, head_position.y + height + outline_offset),
ImGui::ColorConvertFloat4ToU32(fill_color));
}
if (globals::rainbowbox) {
float rainbow_width = (head_position.x + width +
outline_offset) - (leg_pos.x - (width / 1.3f) - outline_offset);
float rainbow_height = (head_position.y + height +
outline_offset) - (leg_pos.y - outline_offset);
draw->AddRectFilledMultiColor(
ImVec2(leg_pos.x - (width / 1.3f) - outline_offset,
leg_pos.y - outline_offset),
ImVec2(leg_pos.x - (width / 1.3f) - outline_offset +
rainbow_width, leg_pos.y - outline_offset + rainbow_height),
col_top_left,
col_top_right,
col_bottom_right,
col_bottom_left
);
}
}
}
}
}
}