-
Автор темы
- #1
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Помогите фиксануть
Код:
int m_iMaxProcessTicks; //sv_maxusrcmdprocessticks
int m_iDummyCommandsToProcess;
int m_iTicksAllowedForProcessing;
int m_iTotalCommandsToSend;
int m_iNumFakeCommandsToSend;
bool m_bReadyToShiftTickbase;
bool m_bIncrementTicksAllowedForProcessing;
bool m_bEnableShiftPrinting;
bool m_bShiftedLastSendPacket;
int m_iBackupTickbase;
bool m_bForceNextTickToIncrementTicksAllowedForProcessing;
int m_iNumInvalidTicksSent;
int m_iBackupTickbaseFirstCmd;
float m_flDelayTickbaseShiftUntilThisTime;
double m_flLastServerPacketReceiveTime;
int m_iLastServerPacketReceiveTickcount;
int m_nServerTick;
__int32 m_nDeltaTick;
bool m_bForceSend = false;
bool m_bShouldChoke = false;
bool ApplyTickbaseShift = false;
int m_iCustomTickbase[150][2]; //if not set to 0, prediction will set tickbase to this on that command number
int m_iCalculatedTickbase[150];
int lastoutgoingcommand;
CLC_Move moveMsg;
int m_TicksAllowedForProcessing;
void SetForceSend(bool send) { m_bForceSend = send; };
void SetShouldChoke(bool choke) { m_bShouldChoke = choke; };
void InitDoubleTap()
{
static bool did_shift_before = false;
static int double_tapped = 0;
int i_ticks_to_wait = 15;
static int prev_shift_ticks = 0;
static bool reset = false;
bool ApplyTickbaseShift = false;
static int shot_tick = 0;
int networked_tickbase = g_csgo->local->GetTickBase();
int current_tickbase = g_csgo->local->GetTickBase();
bool m_bShiftedLastSendPacket = false;
int num_used_commands = g_csgo->client_state->iChokedCommands + 1;
int clockcorrect = TIME_TO_TICKS(0.03f);
static int process_ticks = 0;
int latencyticks = max(0, TIME_TO_TICKS(interfaces.engine->GetNetChannelInfo()->GetAvgLatency(FLOW_OUTGOING)));
static int limit = 14;
bool CanShiftShot = false;
bool PredictionStateIsShifted = false;
bool WaitForTickbaseBeforeFiring = false;
int tickb = m_nServerTick + latencyticks + 1;
int nIdealFinalTick = tickb + clockcorrect;
int simulation_ticks = m_iTotalCommandsToSend;
int _ShiftedTickbase = nIdealFinalTick - simulation_ticks + 1;
int new_tickbase = current_tickbase;
int too_fast_limit = nIdealFinalTick + clockcorrect;
int too_slow_limit = nIdealFinalTick - clockcorrect;
float desiredrealtime = interfaces.global_vars->realtime + TICKS_TO_TIME(abs(networked_tickbase) + g_csgo->client_state->iChokedCommands + 1);
int nEstimatedFinalTick = current_tickbase + simulation_ticks;
bool _CanFireAfterShifting = (g_csgo->cmd->buttons & IN_ATTACK);
int nextslot = (g_csgo->cmd->command_number + 1) % 150;
int slot = g_csgo->cmd->command_number % 150;
int maxprocessable = TIME_TO_TICKS(0.03f);
CMAntiAim::Get().shot_dt = false;
bool _CanFireWithoutShifting = (g_csgo->cmd->buttons & IN_ATTACK);
int _FirstCommandSlot = (g_csgo->cmd->command_number - g_csgo->client_state->iChokedCommands) % 150;
int nCorrectedTick = nIdealFinalTick - simulation_ticks + 1;
int servertick = m_nServerTick;
int nFinalTickbase = nCorrectedTick + moveMsg.m_nNewCommands;
int old_tickbase = m_iCalculatedTickbase[lastoutgoingcommand % 150];
if (CanDT() && !g_csgo->game_rules->IsFreezeTime())
{
if (vars.ragebot.double_tap->active)
{
prev_shift_ticks = 0;
auto can_shift_shot = CMAntiAim::Get().can_exploit(16);
auto can_shot = CMAntiAim::Get().can_exploit(abs(-1 - prev_shift_ticks));
if (m_iNumInvalidTicksSent != 1 || can_shift_shot || !can_shot && !did_shift_before)
{
prev_shift_ticks = 16;
double_tapped = 0;
}
else {
double_tapped++;
m_iNumInvalidTicksSent++;
prev_shift_ticks = 0;
}
if (m_nDeltaTick == -1)
{
for (int i = 0; i < 150; ++i)
{
m_iCustomTickbase[i][0] = 0;
m_iCustomTickbase[i][1] = 0;
m_iCalculatedTickbase[i] = 0;
}
}
if (g_csgo->send_packet && g_csgo->local->GetTickBase())
{
if (prev_shift_ticks > 0)
{
if (CMAntiAim::Get().can_exploit(_CanFireAfterShifting && prev_shift_ticks + clockcorrect))
{
CMAntiAim::Get().shot_dt = true;
if (g_csgo->cmd->buttons & IN_ATTACK)
{
m_bEnableShiftPrinting = false;
m_iBackupTickbase = g_csgo->local->GetTickBase();
g_csgo->m_nTickbaseShift = prev_shift_ticks;
CMAntiAim::Get().did_shot = true;
PredictionStateIsShifted = true;
CMAntiAim::Get().cmd_tick = g_csgo->cmd->command_number;
reset = false;
interfaces.global_vars->curtime = TICKS_TO_TIME(g_csgo->local->GetTickBase());
m_bEnableShiftPrinting = true;
if (m_bShiftedLastSendPacket)
{
g_csgo->local->GetTickBase();
return;
}
m_iBackupTickbase = g_csgo->local->GetTickBase(); //store the current tickbase in case we need to restore prediction later if we did not decide to shift
m_iBackupTickbaseFirstCmd = m_iCustomTickbase[_FirstCommandSlot][0]; //save the first cmd tickbase in case we dont decide to shift
{
m_bShiftedLastSendPacket = TICKS_TO_TIME(nCorrectedTick),
m_bShiftedLastSendPacket = TICKS_TO_TIME(nFinalTickbase),
m_bShiftedLastSendPacket = TIME_TO_TICKS(TICKS_TO_TIME(old_tickbase) - TICKS_TO_TIME(nCorrectedTick)),
m_bShiftedLastSendPacket = TICKS_TO_TIME(old_tickbase);
TICKS_TO_TIME(servertick);
moveMsg.m_nNewCommands = 1 + g_csgo->client_state->iChokedCommands;
}
m_iCustomTickbase[_FirstCommandSlot][0] = _ShiftedTickbase;
nIdealFinalTick - simulation_ticks + desiredrealtime + 1;
interfaces.global_vars->curtime = TICKS_TO_TIME(servertick + prev_shift_ticks);
CMAntiAim::Get().cmd_tick = (g_csgo->cmd->command_number + 1) % 150;
if (nEstimatedFinalTick > too_fast_limit || nEstimatedFinalTick < too_slow_limit)
new_tickbase = nIdealFinalTick - simulation_ticks + 1;
m_iCustomTickbase[nextslot][0] = nIdealFinalTick;
m_iCustomTickbase[nextslot][1] = 1;
_CanFireWithoutShifting += _ShiftedTickbase;
if (m_TicksAllowedForProcessing == -999)
m_TicksAllowedForProcessing = (m_iTicksAllowedForProcessing);
CMAntiAim::Get().base_tick = g_csgo->local->GetTickBase();
if (m_iNumInvalidTicksSent != 1)
{
m_bIncrementTicksAllowedForProcessing = true;
m_iNumInvalidTicksSent++;
m_bForceNextTickToIncrementTicksAllowedForProcessing = false;
}
else
{
m_iNumInvalidTicksSent = 0;
if (m_bReadyToShiftTickbase && m_iTicksAllowedForProcessing)
{
m_bForceNextTickToIncrementTicksAllowedForProcessing = true;
}
}
if (m_iCustomTickbase[slot][0] != 0)
{
m_iCustomTickbase[slot][0] = 0;
m_iCustomTickbase[slot][1] = 0;
}
interfaces.global_vars->curtime = TICKS_TO_TIME(m_iBackupTickbase);
interfaces.global_vars->curtime = TICKS_TO_TIME(m_iBackupTickbase + maxprocessable);
interfaces.global_vars->curtime = TICKS_TO_TIME(_ShiftedTickbase);
m_bEnableShiftPrinting = true;
}
else
{
if ((!(g_csgo->cmd->buttons & IN_ATTACK) || !Ragebot::Get().shot) && CMAntiAim::Get().did_shot) {
g_csgo->dt_charged = false;
g_csgo->skip_ticks = vars.ragebot.dt_instant ? 16 : 8;
CMAntiAim::Get().did_shot = false;
PredictionStateIsShifted = false;
CMAntiAim::Get().base_tick = g_csgo->local->GetTickBase();
}
}
if (m_bIncrementTicksAllowedForProcessing)
{
SetForceSend(true);
SetShouldChoke(false);
WaitForTickbaseBeforeFiring = true;
}
}
else
{
CMAntiAim::Get().shot_dt = false;
process_ticks = 0;
reset = true;
m_iMaxProcessTicks = 16;
m_iTicksAllowedForProcessing = 0;
m_iNumFakeCommandsToSend = 0;
m_bReadyToShiftTickbase = false;
m_bIncrementTicksAllowedForProcessing = false;
m_iNumInvalidTicksSent = 0;
m_bEnableShiftPrinting = true;
m_bForceNextTickToIncrementTicksAllowedForProcessing = false;
for (int i = 0; i < 150; ++i)
{
m_iCustomTickbase[i][0] = 0;
m_iCustomTickbase[i][1] = 0;
m_iCalculatedTickbase[i] = 0;
}
}
}
did_shift_before = prev_shift_ticks != 0;
}
}
else {
g_csgo->bShootedFirstBullet = false;
g_csgo->TickShifted = false;
g_csgo->nSinceUse = 0;
}
}
new_tickbase;
return;
}