From 8e58dffec475304ced75460d9f6295d870b96e3e Mon Sep 17 00:00:00 2001 From: thomas Date: Mon, 3 Apr 2017 20:46:13 +0200 Subject: [PATCH] Added Noshoot options to 1) not shoot at all 2) shoot when you're directly lokking at the target 3) spray normally after first shot --- src/ATGUI/Tabs/aimbottab.cpp | 16 +++++++++++----- src/Hacks/aimbot.cpp | 36 +++++++++++++++++++++++++++++++++--- src/settings.cpp | 4 +++- src/settings.h | 15 +++++++++++++-- 4 files changed, 60 insertions(+), 11 deletions(-) diff --git a/src/ATGUI/Tabs/aimbottab.cpp b/src/ATGUI/Tabs/aimbottab.cpp index 65c52c993..a615c4439 100644 --- a/src/ATGUI/Tabs/aimbottab.cpp +++ b/src/ATGUI/Tabs/aimbottab.cpp @@ -26,6 +26,7 @@ static bool autoPistolEnabled = false; static bool autoShootEnabled = false; static bool autoScopeEnabled = false; static bool noShootEnabled = false; +static NoShootType noShootType = NoShootType::NOT_AT_ALL; static bool ignoreJumpEnabled = false; static bool smokeCheck = false; static bool flashCheck = false; @@ -68,6 +69,7 @@ void UI::ReloadWeaponSettings() autoShootEnabled = Settings::Aimbot::weapons.at(index).autoShootEnabled; autoScopeEnabled = Settings::Aimbot::weapons.at(index).autoScopeEnabled; noShootEnabled = Settings::Aimbot::weapons.at(index).noShootEnabled; + noShootType = Settings::Aimbot::weapons.at(index).noShootType; ignoreJumpEnabled = Settings::Aimbot::weapons.at(index).ignoreJumpEnabled; smokeCheck = Settings::Aimbot::weapons.at(index).smokeCheck; flashCheck = Settings::Aimbot::weapons.at(index).flashCheck; @@ -94,7 +96,7 @@ void UI::UpdateWeaponSettings() autoAimEnabled, autoAimValue, aimStepEnabled, aimStepValue, rcsEnabled, rcsAlwaysOn, rcsAmountX, rcsAmountY, autoPistolEnabled, autoShootEnabled, autoScopeEnabled, - noShootEnabled, ignoreJumpEnabled, smokeCheck, flashCheck, autoWallEnabled, autoWallValue, autoAimRealDistance, autoSlow, autoSlowMinDamage, predEnabled + noShootEnabled,noShootType, ignoreJumpEnabled, smokeCheck, flashCheck, autoWallEnabled, autoWallValue, autoAimRealDistance, autoSlow, autoSlowMinDamage, predEnabled }; for (int bone = (int) Hitbox::HITBOX_HEAD; bone <= (int) Hitbox::HITBOX_ARMS; bone++) @@ -114,6 +116,7 @@ void Aimbot::RenderTab() { const char* targets[] = { "PELVIS", "", "", "HIP", "LOWER SPINE", "MIDDLE SPINE", "UPPER SPINE", "NECK", "HEAD" }; const char* smoothTypes[] = { "Slow Near End", "Constant Speed", "Fast Near End" }; + const char* noShootTypes[] = { "None", "On target", "Spray" }; static char filterWeapons[32]; if (ImGui::Checkbox("Enabled", &enabled)) @@ -324,9 +327,6 @@ void Aimbot::RenderTab() } ImGui::NextColumn(); { - if (ImGui::Checkbox("No Shoot", &noShootEnabled)) - UI::UpdateWeaponSettings(); - SetTooltip("Stops you shooting when locking to an enemy"); if (ImGui::Checkbox("Auto Scope", &autoScopeEnabled)) UI::UpdateWeaponSettings(); SetTooltip("Automatically scopes weapons that have them"); @@ -358,7 +358,13 @@ void Aimbot::RenderTab() ImGui::PopItemWidth(); } } - + + if (ImGui::Checkbox("No Shoot", &noShootEnabled)) + UI::UpdateWeaponSettings(); + SetTooltip("Stops you shooting when locking to an enemy"); + if (ImGui::Combo("##NOSHOOTTYPE", (int*)& noShootType, noShootTypes, IM_ARRAYSIZE(noShootTypes))) + UI::UpdateWeaponSettings(); + ImGui::Columns(1); ImGui::Separator(); ImGui::Text("AutoWall"); diff --git a/src/Hacks/aimbot.cpp b/src/Hacks/aimbot.cpp index c9df60a83..75ec7ff7e 100644 --- a/src/Hacks/aimbot.cpp +++ b/src/Hacks/aimbot.cpp @@ -32,6 +32,7 @@ float Settings::Aimbot::RCS::valueX = 2.0f; float Settings::Aimbot::RCS::valueY = 2.0f; bool Settings::Aimbot::AutoCrouch::enabled = false; bool Settings::Aimbot::NoShoot::enabled = false; +NoShootType Settings::Aimbot::NoShoot::type = NoShootType::NOT_AT_ALL; bool Settings::Aimbot::IgnoreJump::enabled = false; bool Settings::Aimbot::SmokeCheck::enabled = false; bool Settings::Aimbot::FlashCheck::enabled = false; @@ -48,6 +49,8 @@ bool shouldAim; QAngle AimStepLastAngle; QAngle RCSLastPunch; +bool noshoot; + std::unordered_map, Util::IntHash> hitboxes = { { Hitbox::HITBOX_HEAD, { "head_0" } }, { Hitbox::HITBOX_NECK, { "neck_0" } }, @@ -58,7 +61,7 @@ std::unordered_map, Util::IntHash> hitb }; std::unordered_map> Settings::Aimbot::weapons = { - { ItemDefinitionIndex::INVALID, { false, false, false, Bone::BONE_HEAD, ButtonCode_t::MOUSE_MIDDLE, false, false, 1.0f, SmoothType::SLOW_END, false, 0.0f, false, 0.0f, true, 180.0f, false, 25.0f, false, false, 2.0f, 2.0f, false, false, false, false, false, false, false, false, 10.0f, false, false, false, 5.0f } }, + { ItemDefinitionIndex::INVALID, { false, false, false, Bone::BONE_HEAD, ButtonCode_t::MOUSE_MIDDLE, false, false, 1.0f, SmoothType::SLOW_END, false, 0.0f, false, 0.0f, true, 180.0f, false, 25.0f, false, false, 2.0f, 2.0f, false, false, false, false,NoShootType::NOT_AT_ALL, false, false, false, false, 10.0f, false, false, false, 5.0f } }, }; static const char* targets[] = { "pelvis", "", "", "spine_0", "spine_1", "spine_2", "spine_3", "neck_0", "head_0" }; @@ -479,7 +482,32 @@ void Aimbot::NoShoot(C_BaseCombatWeapon* activeWeapon, C_BasePlayer* player, CUs { if (*activeWeapon->GetItemDefinitionIndex() == ItemDefinitionIndex::WEAPON_C4) return; - + C_BasePlayer* localplayer = (C_BasePlayer*) entityList->GetClientEntity(engine->GetLocalPlayer()); + Vector traceStart, traceEnd; + trace_t tr; + QAngle viewAngles; + engine->GetViewAngles(viewAngles); + QAngle viewAngles_rcs = viewAngles + *localplayer->GetAimPunchAngle() * 2.0f; + Math::AngleVectors(viewAngles_rcs, traceEnd); + traceStart = localplayer->GetEyePosition(); + traceEnd = traceStart + (traceEnd * 8192.0f); + Ray_t ray; + ray.Init(traceStart, traceEnd); + CTraceFilter traceFilter; + traceFilter.pSkip = localplayer; + trace->TraceRay(ray, 0x46004003, &traceFilter, &tr); + C_BasePlayer* target = (C_BasePlayer*) tr.m_pEntityHit; + //if the player your aiming at is the aimbot target you can shoot + if(Settings::Aimbot::NoShoot::type == NoShootType::AFTER_FIRST_SHOT&&(target==player||noshoot)) + { + noshoot=true; + return; + } + else if(Settings::Aimbot::NoShoot::type == NoShootType::IF_ON_TARGET &&target==player) + return; + + + if (*activeWeapon->GetItemDefinitionIndex() == ItemDefinitionIndex::WEAPON_REVOLVER) cmd->buttons &= ~IN_ATTACK2; else @@ -560,7 +588,8 @@ void Aimbot::CreateMove(CUserCmd* cmd) } } } - + if(!player||!(cmd->buttons&IN_ATTACK)) + noshoot=false; Aimbot::AimStep(player, angle, cmd); Aimbot::AutoCrouch(player, cmd); Aimbot::AutoSlow(player, oldForward, oldSideMove, bestDamage, activeWeapon, cmd); @@ -636,6 +665,7 @@ void Aimbot::UpdateValues() Settings::Aimbot::RCS::valueX = currentWeaponSetting.rcsAmountX; Settings::Aimbot::RCS::valueY = currentWeaponSetting.rcsAmountY; Settings::Aimbot::NoShoot::enabled = currentWeaponSetting.noShootEnabled; + Settings::Aimbot::NoShoot::type = currentWeaponSetting.noShootType; Settings::Aimbot::IgnoreJump::enabled = currentWeaponSetting.ignoreJumpEnabled; Settings::Aimbot::Smooth::Salting::enabled = currentWeaponSetting.smoothSaltEnabled; Settings::Aimbot::Smooth::Salting::multiplier = currentWeaponSetting.smoothSaltMultiplier; diff --git a/src/settings.cpp b/src/settings.cpp index 4db598938..4d61ac875 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -170,6 +170,7 @@ void Settings::LoadDefaultsOrSave(std::string path) weaponSetting["AutoShoot"]["Enabled"] = i.second.autoShootEnabled; weaponSetting["AutoScope"]["Enabled"] = i.second.autoScopeEnabled; weaponSetting["NoShoot"]["Enabled"] = i.second.noShootEnabled; + weaponSetting["NoShoot"]["Type"] = (int) i.second.noShootType; weaponSetting["IgnoreJump"]["Enabled"] = i.second.ignoreJumpEnabled; weaponSetting["SmokeCheck"]["Enabled"] = i.second.smokeCheck; weaponSetting["FlashCheck"]["Enabled"] = i.second.flashCheck; @@ -507,7 +508,7 @@ void Settings::LoadConfig(std::string path) Fonts::SetupFonts(); Settings::Aimbot::weapons = { - { ItemDefinitionIndex::INVALID, { false, false, false, Bone::BONE_HEAD, ButtonCode_t::MOUSE_MIDDLE, false, false, 1.0f, SmoothType::SLOW_END, false, 0.0f, false, 0.0f, true, 180.0f, false, 25.0f, false, false, 2.0f, 2.0f, false, false, false, false, false, false, false, false, 10.0f, false, false, false, 5.0f } }, + { ItemDefinitionIndex::INVALID, { false, false, false, Bone::BONE_HEAD, ButtonCode_t::MOUSE_MIDDLE, false, false, 1.0f, SmoothType::SLOW_END, false, 0.0f, false, 0.0f, true, 180.0f, false, 25.0f, false, false, 2.0f, 2.0f, false, false, false, false, NoShootType::NOT_AT_ALL, false, false, false, false, 10.0f, false, false, false, 5.0f } }, }; for (Json::ValueIterator itr = settings["Aimbot"]["weapons"].begin(); itr != settings["Aimbot"]["weapons"].end(); itr++) @@ -556,6 +557,7 @@ void Settings::LoadConfig(std::string path) weaponSetting["AutoShoot"]["Enabled"].asBool(), weaponSetting["AutoScope"]["Enabled"].asBool(), weaponSetting["NoShoot"]["Enabled"].asBool(), + (NoShootType) weaponSetting["NoShoot"]["Type"].asInt(), weaponSetting["IgnoreJump"]["Enabled"].asBool(), weaponSetting["SmokeCheck"]["Enabled"].asBool(), weaponSetting["FlashCheck"]["Enabled"].asBool(), diff --git a/src/settings.h b/src/settings.h index fbc06d98f..a65e5132e 100644 --- a/src/settings.h +++ b/src/settings.h @@ -142,11 +142,19 @@ enum class SpammerType : int SPAMMER_POSITIONS, }; +enum class NoShootType : int +{ + NOT_AT_ALL, + IF_ON_TARGET, + AFTER_FIRST_SHOT, +}; + struct AimbotWeapon_t { bool enabled, silent, friendly; Bone bone; SmoothType smoothType; + NoShootType noShootType; ButtonCode_t aimkey; bool aimkeyOnly, smoothEnabled, smoothSaltEnabled, errorMarginEnabled, autoAimEnabled, aimStepEnabled, rcsEnabled, rcsAlwaysOn; float smoothAmount, smoothSaltMultiplier, errorMarginValue, autoAimFov, aimStepValue, rcsAmountX, rcsAmountY, autoWallValue, autoSlowMinDamage; @@ -158,7 +166,7 @@ struct AimbotWeapon_t bool autoAimEnabled, float autoAimValue, bool aimStepEnabled, float aimStepValue, bool rcsEnabled, bool rcsAlwaysOn, float rcsAmountX, float rcsAmountY, bool autoPistolEnabled, bool autoShootEnabled, bool autoScopeEnabled, - bool noShootEnabled, bool ignoreJumpEnabled, bool smokeCheck, bool flashCheck, + bool noShootEnabled,NoShootType noShootType, bool ignoreJumpEnabled, bool smokeCheck, bool flashCheck, bool autoWallEnabled, float autoWallValue, bool autoAimRealDistance, bool autoSlow, float autoSlowMinDamage, bool predEnabled, bool autoWallBones[6] = nullptr) { @@ -187,6 +195,7 @@ struct AimbotWeapon_t this->autoShootEnabled = autoShootEnabled; this->autoScopeEnabled = autoScopeEnabled; this->noShootEnabled = noShootEnabled; + this->noShootType = noShootType; this->ignoreJumpEnabled = ignoreJumpEnabled; this->smokeCheck = smokeCheck; this->flashCheck = flashCheck; @@ -237,7 +246,8 @@ struct AimbotWeapon_t this->autoShootEnabled == another.autoShootEnabled && this->autoScopeEnabled == another.autoScopeEnabled && this->noShootEnabled == another.noShootEnabled && - this->ignoreJumpEnabled == another.ignoreJumpEnabled && + this->noShootType == another.noShootType && + this->ignoreJumpEnabled == another.ignoreJumpEnabled && this->smokeCheck == another.smokeCheck && this->flashCheck == another.flashCheck && this->autoWallEnabled == another.autoWallEnabled && @@ -394,6 +404,7 @@ namespace Settings namespace NoShoot { extern bool enabled; + extern NoShootType type; } namespace IgnoreJump