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