Merge pull request #497 from TotallyNotElite/master
WIP: Add lightesp, a leightweight alternative to ESP
This commit is contained in:
commit
93ffb12e37
@ -28,6 +28,7 @@ target_sources(cathook PRIVATE
|
|||||||
"${CMAKE_CURRENT_LIST_DIR}/KillSay.hpp"
|
"${CMAKE_CURRENT_LIST_DIR}/KillSay.hpp"
|
||||||
"${CMAKE_CURRENT_LIST_DIR}/Killstreak.hpp"
|
"${CMAKE_CURRENT_LIST_DIR}/Killstreak.hpp"
|
||||||
"${CMAKE_CURRENT_LIST_DIR}/LagExploit.hpp"
|
"${CMAKE_CURRENT_LIST_DIR}/LagExploit.hpp"
|
||||||
|
"${CMAKE_CURRENT_LIST_DIR}/LightESP.hpp"
|
||||||
"${CMAKE_CURRENT_LIST_DIR}/Misc.hpp"
|
"${CMAKE_CURRENT_LIST_DIR}/Misc.hpp"
|
||||||
"${CMAKE_CURRENT_LIST_DIR}/Noisemaker.hpp"
|
"${CMAKE_CURRENT_LIST_DIR}/Noisemaker.hpp"
|
||||||
"${CMAKE_CURRENT_LIST_DIR}/Spam.hpp"
|
"${CMAKE_CURRENT_LIST_DIR}/Spam.hpp"
|
||||||
|
12
include/hacks/LightESP.hpp
Normal file
12
include/hacks/LightESP.hpp
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#include "common.hpp"
|
||||||
|
#include <hacks/Aimbot.hpp>
|
||||||
|
namespace hacks
|
||||||
|
{
|
||||||
|
namespace shared
|
||||||
|
{
|
||||||
|
namespace lightesp
|
||||||
|
{
|
||||||
|
void run();
|
||||||
|
void draw();
|
||||||
|
rgba_t LightESPColor(CachedEntity *ent);
|
||||||
|
}}}
|
@ -12,6 +12,7 @@
|
|||||||
#if ENABLE_VISUALS
|
#if ENABLE_VISUALS
|
||||||
|
|
||||||
#include "ESP.hpp"
|
#include "ESP.hpp"
|
||||||
|
#include "LightESP.hpp"
|
||||||
#include "SkinChanger.hpp"
|
#include "SkinChanger.hpp"
|
||||||
#include "Radar.hpp"
|
#include "Radar.hpp"
|
||||||
#include "SpyAlert.hpp"
|
#include "SpyAlert.hpp"
|
||||||
|
@ -26,6 +26,7 @@ if(NOT LagbotMode)
|
|||||||
"${CMAKE_CURRENT_LIST_DIR}/KillSay.cpp"
|
"${CMAKE_CURRENT_LIST_DIR}/KillSay.cpp"
|
||||||
"${CMAKE_CURRENT_LIST_DIR}/Killstreak.cpp"
|
"${CMAKE_CURRENT_LIST_DIR}/Killstreak.cpp"
|
||||||
"${CMAKE_CURRENT_LIST_DIR}/LagExploit.cpp"
|
"${CMAKE_CURRENT_LIST_DIR}/LagExploit.cpp"
|
||||||
|
"${CMAKE_CURRENT_LIST_DIR}/LightESP.cpp"
|
||||||
"${CMAKE_CURRENT_LIST_DIR}/Misc.cpp"
|
"${CMAKE_CURRENT_LIST_DIR}/Misc.cpp"
|
||||||
"${CMAKE_CURRENT_LIST_DIR}/Noisemaker.cpp"
|
"${CMAKE_CURRENT_LIST_DIR}/Noisemaker.cpp"
|
||||||
"${CMAKE_CURRENT_LIST_DIR}/Trigger.cpp"
|
"${CMAKE_CURRENT_LIST_DIR}/Trigger.cpp"
|
||||||
|
84
src/hacks/LightESP.cpp
Normal file
84
src/hacks/LightESP.cpp
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
#include "LightESP.hpp"
|
||||||
|
|
||||||
|
namespace hacks
|
||||||
|
{
|
||||||
|
namespace shared
|
||||||
|
{
|
||||||
|
namespace lightesp
|
||||||
|
{
|
||||||
|
|
||||||
|
CatVar enable(CV_SWITCH, "lightesp_enabled", "0", "Enable LightESP",
|
||||||
|
"Lightweight ESP. Only shows head.");
|
||||||
|
Vector hitp[32];
|
||||||
|
Vector minp[32];
|
||||||
|
Vector maxp[32];
|
||||||
|
bool drawEsp[32];
|
||||||
|
|
||||||
|
void run()
|
||||||
|
{
|
||||||
|
#if ENABLE_VISUALS
|
||||||
|
if (!enable)
|
||||||
|
return;
|
||||||
|
for (int i = 1; i < g_IEngine->GetMaxClients(); i++)
|
||||||
|
{
|
||||||
|
CachedEntity *pEntity = ENTITY(i);
|
||||||
|
if (CE_BAD(pEntity) || !pEntity->m_bAlivePlayer())
|
||||||
|
{
|
||||||
|
drawEsp[i] = false;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (pEntity->m_iTeam() == LOCAL_E->m_iTeam() &&
|
||||||
|
playerlist::IsDefault(pEntity))
|
||||||
|
{
|
||||||
|
drawEsp[i] = false;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!pEntity->hitboxes.GetHitbox(0))
|
||||||
|
continue;
|
||||||
|
hitp[i] = pEntity->hitboxes.GetHitbox(0)->center;
|
||||||
|
minp[i] = pEntity->hitboxes.GetHitbox(0)->min;
|
||||||
|
maxp[i] = pEntity->hitboxes.GetHitbox(0)->max;
|
||||||
|
drawEsp[i] = true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
void draw()
|
||||||
|
{
|
||||||
|
#if ENABLE_VISUALS
|
||||||
|
if (!enable)
|
||||||
|
return;
|
||||||
|
for (int i = 1; i < g_IEngine->GetMaxClients(); i++)
|
||||||
|
{
|
||||||
|
if (!drawEsp[i])
|
||||||
|
continue;
|
||||||
|
CachedEntity *pEntity = ENTITY(i);
|
||||||
|
if (CE_BAD(pEntity) || !pEntity->m_bAlivePlayer())
|
||||||
|
continue;
|
||||||
|
Vector out;
|
||||||
|
if (draw::WorldToScreen(hitp[i], out))
|
||||||
|
{
|
||||||
|
float size;
|
||||||
|
if (abs(maxp[i].x - minp[i].x) > abs(maxp[i].y - minp[i].y))
|
||||||
|
size = abs(maxp[i].x - minp[i].x);
|
||||||
|
else
|
||||||
|
size = abs(maxp[i].y - minp[i].y);
|
||||||
|
|
||||||
|
draw_api::draw_rect(
|
||||||
|
out.x, out.y, size / 4, size / 4,
|
||||||
|
hacks::shared::lightesp::LightESPColor(pEntity));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
rgba_t LightESPColor(CachedEntity *ent)
|
||||||
|
{
|
||||||
|
if (!playerlist::IsDefault(ent))
|
||||||
|
{
|
||||||
|
return playerlist::Color(ent);
|
||||||
|
}
|
||||||
|
return colors::green;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -8,7 +8,6 @@
|
|||||||
#include "common.hpp"
|
#include "common.hpp"
|
||||||
#include "hack.hpp"
|
#include "hack.hpp"
|
||||||
#include "MiscTemporary.hpp"
|
#include "MiscTemporary.hpp"
|
||||||
|
|
||||||
#include <link.h>
|
#include <link.h>
|
||||||
#include <hacks/hacklist.hpp>
|
#include <hacks/hacklist.hpp>
|
||||||
|
|
||||||
@ -337,6 +336,10 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
|
|||||||
PROF_SECTION(CM_backtracc);
|
PROF_SECTION(CM_backtracc);
|
||||||
hacks::shared::backtrack::Run();
|
hacks::shared::backtrack::Run();
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
PROF_SECTION(CM_lightesp);
|
||||||
|
hacks::shared::lightesp::run();
|
||||||
|
}
|
||||||
{
|
{
|
||||||
PROF_SECTION(CM_aimbot);
|
PROF_SECTION(CM_aimbot);
|
||||||
hacks::shared::aimbot::CreateMove();
|
hacks::shared::aimbot::CreateMove();
|
||||||
|
@ -144,6 +144,11 @@ void DrawCheatVisuals()
|
|||||||
hacks::shared::backtrack::Draw();
|
hacks::shared::backtrack::Draw();
|
||||||
}
|
}
|
||||||
IF_GAME(IsTF2())
|
IF_GAME(IsTF2())
|
||||||
|
{
|
||||||
|
PROF_SECTION(DRAW_lightesp);
|
||||||
|
hacks::shared::lightesp::draw();
|
||||||
|
}
|
||||||
|
IF_GAME(IsTF2())
|
||||||
{
|
{
|
||||||
PROF_SECTION(DRAW_healarrows);
|
PROF_SECTION(DRAW_healarrows);
|
||||||
hacks::tf2::healarrow::Draw();
|
hacks::tf2::healarrow::Draw();
|
||||||
|
@ -567,6 +567,10 @@ static const std::string list_tf2 = R"(
|
|||||||
"glow_self_b"
|
"glow_self_b"
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
"LightESP" [
|
||||||
|
"LightESP Menu"
|
||||||
|
"lightesp_enabled"
|
||||||
|
]
|
||||||
"Colors" [
|
"Colors" [
|
||||||
"Colors Menu"
|
"Colors Menu"
|
||||||
"gui_rainbow"
|
"gui_rainbow"
|
||||||
|
Reference in New Issue
Block a user