diff --git a/src/Hacks/aimbot.cpp b/src/Hacks/aimbot.cpp index c9df60a83..41a9f5e7f 100644 --- a/src/Hacks/aimbot.cpp +++ b/src/Hacks/aimbot.cpp @@ -483,7 +483,27 @@ void Aimbot::NoShoot(C_BaseCombatWeapon* activeWeapon, C_BasePlayer* player, CUs if (*activeWeapon->GetItemDefinitionIndex() == ItemDefinitionIndex::WEAPON_REVOLVER) cmd->buttons &= ~IN_ATTACK2; else + { + //Assuming all important checks have already been done. + 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(target==player)return; cmd->buttons &= ~IN_ATTACK; + } } } diff --git a/src/Hacks/autostrafe.cpp b/src/Hacks/autostrafe.cpp index f4e9ee3a3..4b89fa517 100644 --- a/src/Hacks/autostrafe.cpp +++ b/src/Hacks/autostrafe.cpp @@ -9,24 +9,25 @@ void LegitStrafe(C_BasePlayer* localplayer, CUserCmd* cmd) if (localplayer->GetFlags() & FL_ONGROUND) return; - if (cmd->buttons & IN_FORWARD || cmd->buttons & IN_BACK || cmd->buttons & IN_MOVELEFT || cmd->buttons & IN_MOVERIGHT) - return; - if (cmd->mousedx <= 1 && cmd->mousedx >= -1) return; switch (Settings::AutoStrafe::type) { case AutostrafeType::AS_FORWARDS: - cmd->sidemove = cmd->mousedx < 0.f ? -450.f : 450.f; + cmd->forwardmove=0.f; + cmd->sidemove = cmd->mousedx < 0.f ? -450.f :cmd->mousedx==0?0.f: 450.f; break; case AutostrafeType::AS_BACKWARDS: + cmd->forwardmove=0.f; cmd->sidemove = cmd->mousedx < 0.f ? 450.f : -450.f; break; case AutostrafeType::AS_LEFTSIDEWAYS: + cmd->sidemove=0.f; cmd->forwardmove = cmd->mousedx < 0.f ? -450.f : 450.f; break; case AutostrafeType::AS_RIGHTSIDEWAYS: + cmd->sidemove=0.f; cmd->forwardmove = cmd->mousedx < 0.f ? 450.f : -450.f; break; default: