aimbot smooth
This commit is contained in:
parent
e8b1d227cc
commit
4d216b662b
@ -49,4 +49,5 @@ namespace Config {
|
||||
bool rcs = 0;
|
||||
bool fov_circle = 0;
|
||||
ImVec4 fovCircleColor = ImVec4(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
float aimbot_smooth = 0.f;
|
||||
}
|
||||
|
||||
@ -48,4 +48,5 @@ namespace Config {
|
||||
extern bool rcs;
|
||||
extern bool fov_circle;
|
||||
extern ImVec4 fovCircleColor;
|
||||
extern float aimbot_smooth;
|
||||
}
|
||||
|
||||
@ -119,6 +119,7 @@ namespace internal_config
|
||||
j["antiflash"] = Config::antiflash;
|
||||
j["rcs"] = Config::rcs;
|
||||
j["fov_circle"] = Config::fov_circle;
|
||||
j["aimbot_smooth"] = Config::aimbot_smooth;
|
||||
|
||||
j["enemyChamsInvisible"] = Config::enemyChamsInvisible;
|
||||
j["enemyChams"] = Config::enemyChams;
|
||||
@ -217,6 +218,7 @@ namespace internal_config
|
||||
Config::aimbot = j.value("aimbot", false);
|
||||
Config::rcs = j.value("rcs", false);
|
||||
Config::aimbot_fov = j.value("aimbot_fov", 0.f);
|
||||
Config::aimbot_smooth = j.value("aimbot_smooth", 0.f);
|
||||
|
||||
Config::antiflash = j.value("antiflash", false);
|
||||
|
||||
|
||||
@ -12,114 +12,125 @@
|
||||
// Please dont ever make me do this again
|
||||
|
||||
Vector_t GetEntityEyePos(const C_CSPlayerPawn* Entity) {
|
||||
if (!Entity)
|
||||
return {};
|
||||
if (!Entity)
|
||||
return {};
|
||||
|
||||
uintptr_t game_scene_node = *reinterpret_cast<uintptr_t*>((uintptr_t)Entity + SchemaFinder::Get(hash_32_fnv1a_const("C_BaseEntity->m_pGameSceneNode")));
|
||||
uintptr_t game_scene_node = *reinterpret_cast<uintptr_t*>((uintptr_t)Entity + SchemaFinder::Get(hash_32_fnv1a_const("C_BaseEntity->m_pGameSceneNode")));
|
||||
|
||||
auto Origin = *reinterpret_cast<Vector_t*>(game_scene_node + SchemaFinder::Get(hash_32_fnv1a_const("CGameSceneNode->m_vecAbsOrigin")));
|
||||
auto ViewOffset = *reinterpret_cast<Vector_t*>((uintptr_t)Entity + SchemaFinder::Get(hash_32_fnv1a_const("C_BaseModelEntity->m_vecViewOffset")));
|
||||
auto Origin = *reinterpret_cast<Vector_t*>(game_scene_node + SchemaFinder::Get(hash_32_fnv1a_const("CGameSceneNode->m_vecAbsOrigin")));
|
||||
auto ViewOffset = *reinterpret_cast<Vector_t*>((uintptr_t)Entity + SchemaFinder::Get(hash_32_fnv1a_const("C_BaseModelEntity->m_vecViewOffset")));
|
||||
|
||||
Vector_t Result = Origin + ViewOffset;
|
||||
if (!std::isfinite(Result.x) || !std::isfinite(Result.y) || !std::isfinite(Result.z))
|
||||
return {};
|
||||
Vector_t Result = Origin + ViewOffset;
|
||||
if (!std::isfinite(Result.x) || !std::isfinite(Result.y) || !std::isfinite(Result.z))
|
||||
return {};
|
||||
|
||||
return Result;
|
||||
return Result;
|
||||
}
|
||||
|
||||
inline QAngle_t CalcAngles(Vector_t viewPos, Vector_t aimPos)
|
||||
{
|
||||
QAngle_t angle = { 0, 0, 0 };
|
||||
QAngle_t angle = { 0, 0, 0 };
|
||||
|
||||
Vector_t delta = aimPos - viewPos;
|
||||
Vector_t delta = aimPos - viewPos;
|
||||
|
||||
angle.x = -asin(delta.z / delta.Length()) * (180.0f / 3.141592654f);
|
||||
angle.y = atan2(delta.y, delta.x) * (180.0f / 3.141592654f);
|
||||
angle.x = -asin(delta.z / delta.Length()) * (180.0f / 3.141592654f);
|
||||
angle.y = atan2(delta.y, delta.x) * (180.0f / 3.141592654f);
|
||||
|
||||
return angle;
|
||||
return angle;
|
||||
}
|
||||
|
||||
inline float GetFov(const QAngle_t& viewAngle, const QAngle_t& aimAngle)
|
||||
{
|
||||
QAngle_t delta = (aimAngle - viewAngle).Normalize();
|
||||
QAngle_t delta = (aimAngle - viewAngle).Normalize();
|
||||
|
||||
return sqrtf(powf(delta.x, 2.0f) + powf(delta.y, 2.0f));
|
||||
return sqrtf(powf(delta.x, 2.0f) + powf(delta.y, 2.0f));
|
||||
}
|
||||
|
||||
void Aimbot() {
|
||||
static C_CSPlayerPawn* lockedTarget = nullptr;
|
||||
static bool prevAimbotState = false;
|
||||
static C_CSPlayerPawn* lockedTarget = nullptr;
|
||||
static bool prevAimbotState = false;
|
||||
|
||||
bool aimbotActive = Config::aimbot;
|
||||
bool aimbotActive = Config::aimbot;
|
||||
|
||||
// Получаем локального игрока и viewangles всегда, чтобы не дублировать код
|
||||
C_CSPlayerPawn* lp = H::oGetLocalPlayer(0);
|
||||
Vector_t lep = GetEntityEyePos(lp);
|
||||
QAngle_t* viewangles = (QAngle_t*)(modules.getModule("client") + 0x1A78650);
|
||||
// Получаем локального игрока и viewangles всегда, чтобы не дублировать код
|
||||
C_CSPlayerPawn* lp = H::oGetLocalPlayer(0);
|
||||
Vector_t lep = GetEntityEyePos(lp);
|
||||
QAngle_t* viewangles = (QAngle_t*)(modules.getModule("client") + 0x1A78650);
|
||||
|
||||
// Если кнопка только что нажата (переход с false на true) — ищем новую цель
|
||||
if (aimbotActive && !prevAimbotState) {
|
||||
int nMaxHighestEntity = I::GameEntity->Instance->GetHighestEntityIndex();
|
||||
float bestFov = Config::aimbot_fov;
|
||||
C_CSPlayerPawn* bestTarget = nullptr;
|
||||
QAngle_t bestAngle = {0, 0, 0};
|
||||
// Если кнопка только что нажата (переход с false на true) — ищем новую цель
|
||||
if (aimbotActive && !prevAimbotState) {
|
||||
int nMaxHighestEntity = I::GameEntity->Instance->GetHighestEntityIndex();
|
||||
float bestFov = Config::aimbot_fov;
|
||||
C_CSPlayerPawn* bestTarget = nullptr;
|
||||
QAngle_t bestAngle = { 0, 0, 0 };
|
||||
|
||||
for (int i = 1; i <= nMaxHighestEntity; i++) {
|
||||
auto Entity = I::GameEntity->Instance->Get(i);
|
||||
if (!Entity)
|
||||
continue;
|
||||
if (!Entity->handle().valid())
|
||||
continue;
|
||||
SchemaClassInfoData_t* _class = nullptr;
|
||||
Entity->dump_class_info(&_class);
|
||||
if (!_class)
|
||||
continue;
|
||||
const uint32_t hash = HASH(_class->szName);
|
||||
if (hash == HASH("C_CSPlayerPawn")) {
|
||||
C_CSPlayerPawn* pawn = (C_CSPlayerPawn*)Entity;
|
||||
if (pawn->get_entity_by_handle() == lp->get_entity_by_handle())
|
||||
continue;
|
||||
if (pawn->getHealth() <= 0)
|
||||
continue;
|
||||
/* if (!Config::team_check && pawn->getTeam() == lp->getTeam())
|
||||
continue;*/
|
||||
Vector_t eye_pos = GetEntityEyePos(pawn);
|
||||
QAngle_t angle = CalcAngles(eye_pos, lep);
|
||||
angle.x *= -1.f;
|
||||
angle.y += 180.f;
|
||||
const float fov = GetFov(*viewangles, angle);
|
||||
if (!std::isfinite(fov) || fov > bestFov)
|
||||
continue;
|
||||
bestFov = fov;
|
||||
bestTarget = pawn;
|
||||
bestAngle = angle;
|
||||
}
|
||||
}
|
||||
lockedTarget = bestTarget;
|
||||
}
|
||||
for (int i = 1; i <= nMaxHighestEntity; i++) {
|
||||
auto Entity = I::GameEntity->Instance->Get(i);
|
||||
if (!Entity)
|
||||
continue;
|
||||
if (!Entity->handle().valid())
|
||||
continue;
|
||||
SchemaClassInfoData_t* _class = nullptr;
|
||||
Entity->dump_class_info(&_class);
|
||||
if (!_class)
|
||||
continue;
|
||||
const uint32_t hash = HASH(_class->szName);
|
||||
if (hash == HASH("C_CSPlayerPawn")) {
|
||||
C_CSPlayerPawn* pawn = (C_CSPlayerPawn*)Entity;
|
||||
if (pawn->get_entity_by_handle() == lp->get_entity_by_handle())
|
||||
continue;
|
||||
if (pawn->getHealth() <= 0)
|
||||
continue;
|
||||
if (!Config::team_check && pawn->getTeam() == lp->getTeam())
|
||||
continue;
|
||||
Vector_t eye_pos = GetEntityEyePos(pawn);
|
||||
QAngle_t angle = CalcAngles(eye_pos, lep);
|
||||
angle.x *= -1.f;
|
||||
angle.y += 180.f;
|
||||
const float fov = GetFov(*viewangles, angle);
|
||||
if (!std::isfinite(fov) || fov > bestFov)
|
||||
continue;
|
||||
bestFov = fov;
|
||||
bestTarget = pawn;
|
||||
bestAngle = angle;
|
||||
}
|
||||
}
|
||||
lockedTarget = bestTarget;
|
||||
}
|
||||
|
||||
// Если кнопка отпущена — сбрасываем захват
|
||||
if (!aimbotActive)
|
||||
lockedTarget = nullptr;
|
||||
// Если кнопка отпущена — сбрасываем захват
|
||||
if (!aimbotActive)
|
||||
lockedTarget = nullptr;
|
||||
|
||||
// Если есть захваченная цель и кнопка удерживается
|
||||
if (aimbotActive && lockedTarget) {
|
||||
// Проверяем, что цель всё ещё валидна
|
||||
if (!lockedTarget->handle().valid() || lockedTarget->getHealth() <= 0) {
|
||||
lockedTarget = nullptr;
|
||||
} else {
|
||||
Vector_t eye_pos = GetEntityEyePos(lockedTarget);
|
||||
QAngle_t angle = CalcAngles(eye_pos, lep);
|
||||
angle.x *= -1.f;
|
||||
angle.y += 180.f;
|
||||
QAngle_t ang_punch_angle = *(QAngle_t*)((uintptr_t)lp + SchemaFinder::Get(hash_32_fnv1a_const("C_CSPlayerPawn->m_aimPunchAngle")));
|
||||
if (Config::rcs)
|
||||
angle -= ang_punch_angle * 2.f;
|
||||
angle.z = 0.f;
|
||||
angle = angle.Normalize();
|
||||
*viewangles = angle;
|
||||
}
|
||||
}
|
||||
// Если есть захваченная цель и кнопка удерживается
|
||||
if (aimbotActive && lockedTarget) {
|
||||
// Проверяем, что цель всё ещё валидна
|
||||
if (!lockedTarget->handle().valid() || lockedTarget->getHealth() <= 0) {
|
||||
lockedTarget = nullptr;
|
||||
}
|
||||
else {
|
||||
Vector_t eye_pos = GetEntityEyePos(lockedTarget);
|
||||
QAngle_t angle = CalcAngles(eye_pos, lep);
|
||||
angle.x *= -1.f;
|
||||
angle.y += 180.f;
|
||||
QAngle_t ang_punch_angle = *(QAngle_t*)((uintptr_t)lp + SchemaFinder::Get(hash_32_fnv1a_const("C_CSPlayerPawn->m_aimPunchAngle")));
|
||||
if (Config::rcs)
|
||||
angle -= ang_punch_angle * 2.f;
|
||||
angle.z = 0.f;
|
||||
angle = angle.Normalize();
|
||||
if (Config::aimbot_smooth > 0.f) {
|
||||
QAngle_t cur = *viewangles;
|
||||
QAngle_t delta = (angle - cur).Normalize();
|
||||
float smooth = Config::aimbot_smooth;
|
||||
angle = cur + delta * (1.f / smooth);
|
||||
angle = angle.Normalize();
|
||||
*viewangles = angle;
|
||||
}
|
||||
else {
|
||||
*viewangles = angle;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
prevAimbotState = aimbotActive;
|
||||
prevAimbotState = aimbotActive;
|
||||
}
|
||||
|
||||
@ -146,6 +146,7 @@ void Menu::render() {
|
||||
|
||||
ImGui::Checkbox("Team Check", &Config::team_check);
|
||||
ImGui::SliderFloat("FOV", &Config::aimbot_fov, 0.f, 90.f);
|
||||
ImGui::SliderFloat("Smooth", &Config::aimbot_smooth, 0.f, 10.f, "%.2f");
|
||||
ImGui::Checkbox("Draw FOV Circle", &Config::fov_circle);
|
||||
if (Config::fov_circle) {
|
||||
ImGui::ColorEdit4("Circle Color##FovColor", (float*)&Config::fovCircleColor);
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user