-
Автор темы
- #1
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
паста но лучше чем деф и всякие люди просто углы брута меняли
Код:
std::string ResolverMode[65];
int last_ticks[65];
int IBasePlayer::get_choked_packets() {
auto ticks = TIME_TO_TICKS(get_simtime() - GetOldSimulationTime());
if (ticks == 0 && last_ticks[get_index()] > 0) {
return last_ticks[get_index()] - 1;
}
else {
last_ticks[get_index()] = ticks;
return ticks;
}
}
float c_resolver::GetAngle(IBasePlayer* player) {
return Math::normalize_yaw(player->get_eye_angles().y);
}
float c_resolver::GetForwardYaw(IBasePlayer* player) {
return Math::normalize_yaw(GetBackwardYaw(player) - 180.f);
}
float c_resolver::GetBackwardYaw(IBasePlayer* player) {
return Math::CalculateAngle(csgo->local->GetOrigin(), player->GetOrigin()).y;
}
float c_resolver::GetLeftYaw(IBasePlayer* player) {
return Math::normalize_yaw(Math::CalculateAngle(csgo->local->GetOrigin(), player->GetOrigin()).y - 90.f);
}
float c_resolver::GetRightYaw(IBasePlayer* player) {
return Math::normalize_yaw(Math::CalculateAngle(csgo->local->GetOrigin(), player->GetOrigin()).y + 90.f);
}
bool c_resolver::TargetJitter(IBasePlayer* player, bool v2) {
float yaw = v2 ? GetRightYaw(player) : GetLeftYaw(player);
return fabsf(GetAngle(player) - Math::normalize_yaw(yaw + 90.f))
>= fabsf(GetAngle(player) - Math::normalize_yaw(yaw - 90.f));
}
bool c_resolver::TargetSide(IBasePlayer* player) {
float yaw = Math::normalize_yaw(GetBackwardYaw(player));
float angle = GetAngle(player);
return fabsf(angle - Math::normalize_yaw(yaw + 90.f))
>= fabsf(angle - Math::normalize_yaw(yaw - 90.f));
}
void c_resolver::DetectSide(IBasePlayer* player, int* side)
{
Vector src3D, dst3D, forward, right, up, src, dst;
float back_two, right_two, left_two;
trace_t tr;
Ray_t ray, ray2, ray3, ray4, ray5;
CTraceFilter filter;
Math::AngleVectors(Vector(0, GetBackwardYaw(player), 0), &forward, &right, &up);
filter.pSkip = player;
src3D = player->GetEyePosition();
dst3D = src3D + (forward * 384); //Might want to experiment with other numbers, incase you don't know what the number does, its how far the trace will go. Lower = shorter.
ray.Init(src3D, dst3D);
interfaces.trace->TraceRay(ray, MASK_SHOT, &filter, &tr);
back_two = (tr.endpos - tr.startpos).Length();
ray2.Init(src3D + right * 35, dst3D + right * 35);
interfaces.trace->TraceRay(ray2, MASK_SHOT, &filter, &tr);
right_two = (tr.endpos - tr.startpos).Length();
ray3.Init(src3D - right * 35, dst3D - right * 35);
interfaces.trace->TraceRay(ray3, MASK_SHOT, &filter, &tr);
left_two = (tr.endpos - tr.startpos).Length();
if (left_two > right_two) {
*side = -1;
}
else if (right_two > left_two) {
*side = 1;
}
else
*side = 0;
}
bool c_resolver::DoesHaveJitter(IBasePlayer* player, int* new_side) {
static float LastAngle[64];
static int LastBrute[64];
static bool Switch[64];
static float LastUpdateTime[64];
int i = player->get_index();
float CurrentAngle = player->get_eye_angles().y;
if (!Math::IsNearEqual(CurrentAngle, LastAngle, 50.f)) {
Switch = !Switch;
LastAngle = CurrentAngle;
*new_side = Switch ? 1 : -1;
LastBrute = *new_side;
LastUpdateTime = interfaces.global_vars->curtime;
return true;
}
else {
if (fabsf(LastUpdateTime - interfaces.global_vars->curtime >= TICKS_TO_TIME(17))
|| player->get_simtime() != player->GetOldSimulationTime()) {
LastAngle = CurrentAngle;
}
*new_side = LastBrute;
}
return false;
}
void c_resolver::StoreAntifreestand()
{
if (!csgo->local->is_alive())
return;
if (!csgo->weapon->IsGun())
return;
for (int i = 1; i < interfaces.engine->GetMaxClients(); ++i)
{
auto player = interfaces.ent_list->GetClientEntity(i);
if (!player || !player->is_alive() || player->is_dormant() || player->GetTeam() == csgo->local->GetTeam())
continue;
bool Autowalled = false, HitSide1 = false, HitSide2 = false;
auto idx =
player->get_index();
float angToLocal = Math::CalculateAngle(csgo->local->GetOrigin(),
player->GetOrigin()).y;
Vector ViewPoint = csgo->local->GetOrigin() + Vector(0, 0, 90);
Vector2D Side1 = { (45 * sin(DEG2RAD(angToLocal))),(45 * cos(DEG2RAD(angToLocal))) };
Vector2D Side2 = { (45 * sin(DEG2RAD(angToLocal + 180))) ,(45 * cos(DEG2RAD(angToLocal + 180))) };
Vector2D Side3 = { (58 * sin(DEG2RAD(angToLocal))),(58 * cos(DEG2RAD(angToLocal))) };
Vector2D Side4 = { (58 * sin(DEG2RAD(angToLocal + 360))) ,(58 * cos(DEG2RAD(angToLocal + 360))) };
Vector Origin = player->GetOrigin();
Vector2D OriginLeftRight[] = { Vector2D(Side1.x, Side1.y), Vector2D(Side2.x, Side2.y) };
Vector2D OriginLeftRightLocal[] = { Vector2D(Side3.x, Side3.y), Vector2D(Side4.x, Side4.y) };
for (int side = 0; side < 2; side++)
{
Vector OriginAutowall = { Origin.x + OriginLeftRight[side].x, Origin.y - OriginLeftRight[side].y , Origin.z + 90 };
Vector ViewPointAutowall = { ViewPoint.x + OriginLeftRightLocal[side].x, ViewPoint.y - OriginLeftRightLocal[side].y , ViewPoint.z };
if (g_AutoWall.CanHitFloatingPoint(OriginAutowall, ViewPoint))
{
if (side == 0)
{
HitSide1 = true;
FreestandSide[idx] = -1;
}
else if (side == 1)
{
HitSide2 = true;
FreestandSide[idx] = 1;
}
Autowalled = true;
}
else
{
for (int sidealternative = 0; sidealternative < 2; sidealternative++)
{
Vector ViewPointAutowallalternative = { Origin.x + OriginLeftRight[sidealternative].x, Origin.y - OriginLeftRight[sidealternative].y , Origin.z + 90 };
if (g_AutoWall.CanHitFloatingPoint(ViewPointAutowallalternative, ViewPointAutowall))
{
if (sidealternative == 0)
{
HitSide1 = true;
FreestandSide[idx] = -1;
//FreestandAngle[pPlayerEntity->EntIndex()] = -39;
}
else if (sidealternative == 1)
{
HitSide2 = true;
FreestandSide[idx] = 1;
//FreestandAngle[pPlayerEntity->EntIndex()] = 39;
}
Autowalled = true;
}
}
}
}
}
}
void c_resolver::Do(IBasePlayer* player) {
if (!csgo->local->is_alive())
return;
if (!vars.ragebot.resolver)
return;
if (player->get_choked_packets() <= 0)
return;
if (player->get_player_info().fakeplayer)
return;
if (!(player->get_flags() & FL_ONGROUND))
return;
auto animstate = player->get_anim_state();
animstate->m_goal_feet_yaw = GetAngle(player);
float angle = GetAngle(player);
int idx = player->get_index();
int new_side = 0;
float desync_delta = 60.f;
if (!animstate)
return;
auto record = g_Animfix->get_latest_firing_animation(player);
if (record.has_value() && record.value()->player != csgo->local)
return;
if (DoesHaveJitter(player, &new_side))
{
ResolverMode[idx] = "jitter";
switch (csgo->missedshots[idx] % 2) {
case 0:
animstate->m_goal_feet_yaw = Math::normalize_yaw(angle + desync_delta * new_side);
break;
case 1:
animstate->m_goal_feet_yaw = Math::normalize_yaw(angle - desync_delta * new_side);
break;
}
}
else
{
if (csgo->missedshots[idx] == 0)
{
ResolverMode[idx] = "freestand";
animstate->m_goal_feet_yaw = Math::normalize_yaw(angle + (-desync_delta) * FreestandSide[idx]);
}
else
{
switch (csgo->missedshots[idx] % 2)
{
case 0:
animstate->m_goal_feet_yaw = Math::normalize_yaw(angle + desync_delta * FreestandSide[idx]);
break;
case 1:
animstate->m_goal_feet_yaw = Math::normalize_yaw(angle + desync_delta * -FreestandSide[idx]);
break;
}
ResolverMode[idx] = "bruteforce";
}
}
animstate->m_goal_feet_yaw = Math::normalize_yaw(animstate->m_goal_feet_yaw);
}
вот и вейви ресик подьехал
Последнее редактирование: