Skip to content
This repository has been archived by the owner on Nov 5, 2018. It is now read-only.

NoShoot Changes #739

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions src/ATGUI/Tabs/aimbottab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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++)
Expand All @@ -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" };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

capitalize target

static char filterWeapons[32];

if (ImGui::Checkbox("Enabled", &enabled))
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -358,7 +358,13 @@ void Aimbot::RenderTab()
ImGui::PopItemWidth();
}
}


if (ImGui::Checkbox("No Shoot", &noShootEnabled))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct indentation

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");
Expand Down
36 changes: 33 additions & 3 deletions src/Hacks/aimbot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -48,6 +49,8 @@ bool shouldAim;
QAngle AimStepLastAngle;
QAngle RCSLastPunch;

bool noshoot;

std::unordered_map<Hitbox, std::vector<const char*>, Util::IntHash<Hitbox>> hitboxes = {
{ Hitbox::HITBOX_HEAD, { "head_0" } },
{ Hitbox::HITBOX_NECK, { "neck_0" } },
Expand All @@ -58,7 +61,7 @@ std::unordered_map<Hitbox, std::vector<const char*>, Util::IntHash<Hitbox>> hitb
};

std::unordered_map<ItemDefinitionIndex, AimbotWeapon_t, Util::IntHash<ItemDefinitionIndex>> 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" };
Expand Down Expand Up @@ -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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spaces before and after operators

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
Expand Down Expand Up @@ -560,7 +588,8 @@ void Aimbot::CreateMove(CUserCmd* cmd)
}
}
}

if(!player||!(cmd->buttons&IN_ATTACK))
noshoot=false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above

Aimbot::AimStep(player, angle, cmd);
Aimbot::AutoCrouch(player, cmd);
Aimbot::AutoSlow(player, oldForward, oldSideMove, bestDamage, activeWeapon, cmd);
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion src/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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++)
Expand Down Expand Up @@ -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(),
Expand Down
15 changes: 13 additions & 2 deletions src/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
{
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 &&
Expand Down Expand Up @@ -394,6 +404,7 @@ namespace Settings
namespace NoShoot
{
extern bool enabled;
extern NoShootType type;
}

namespace IgnoreJump
Expand Down