|
CSGO: Backtrack Triggerbot
Hello. Here is a simple backtrack triggerbot. It shoots not only when your crosshair is at enemy, but also when it’s on one of the enemy’s previous records. It should be pretty obvious how it looks so I didn’t bothered making video. Call in CreateMove.
auto q = center - start; if (d < FLT_EPSILON)
return {};
return start + direction * (v - std::sqrt(d));
};
auto delta = (maxs - mins).Normalize();
for (size_t i{}; i < std::floor(mins.Dist(maxs)); ++i)
{
if (auto intersection = sphereRayIntersection(mins + delta * float(i)); intersection)
return intersection;
}
if (auto intersection = sphereRayIntersection(maxs); intersection)
return intersection;
return {};
}
static std::optional auto set = hdr->GetHitboxSet(0); for (auto& record : LagCompensation.GetRecordsForEntity(entity)) Vector mins, maxs; if (auto intersection = GetIntersectionPoint(start, end, mins, maxs, hitbox->radius); intersection) filter.pSkip = CEntity::GetLocalPlayer(); Interfaces::Trace->TraceRay(ray, MASK_SHOT | CONTENTS_GRATE, &filter, &trace); return {}; void BacktrackTrigger(CUserCmd* cmd) Vector viewangles; Interfaces::Engine->GetViewAngles(viewangles); AngleVectors(viewangles + local->GetAimPunch(), &end); for (size_t i{}; i <= Interfaces::GlobalVars->maxClients; ++i) if (auto record = GetTargetRecord(entity, start, end); record) //backtrack your target entity break; Credits: @superdoc1234 for ray capsule intersection algorithm. EDIT: C++17 compiler is required due to usage of optional and if with initializers. |
|