Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void DoFakeLag()
- {
- if (!Globals::LocalPlayer || !g_pEngine->IsConnected() || !g_pEngine->IsInGame() || (c_config::get().fakelag == 0 && !(GetAsyncKeyState(c_config::get().fakeduck_bind) && c_config::get().fakeduck_bind > 1)) || g_Menu.Config.FakeLagShouldLag || g_Menu.Config.LegitBacktrack)
- return;
- if (!Globals::LocalPlayer->IsAlive() || Globals::LocalPlayer->IsNade())
- return;
- static bool Hitinit = false;
- bool SkipTick = false;
- static bool canHit = false;
- bool HitCheck = false;
- if (g_Menu.Config.FakeLagOnPeek)
- {
- for (int i = 1; i < g_pEngine->GetMaxClients(); ++i)
- {
- C_BaseEntity* pPlayerEntity = g_pEntityList->GetClientEntity(i);
- if (!pPlayerEntity
- || !pPlayerEntity->IsAlive()
- || pPlayerEntity->IsDormant()
- || pPlayerEntity == g::pLocalEntity
- || pPlayerEntity->GetTeam() == g::pLocalEntity->GetTeam())
- continue;
- Vector EnemyHead = { pPlayerEntity->GetOrigin().x, pPlayerEntity->GetOrigin().y, (pPlayerEntity->GetHitboxPosition(0, g_LagComp.pMatrix[pPlayerEntity->EntIndex()]).z + 10.f) };
- Vector Head = { g::pLocalEntity->GetOrigin().x, g::pLocalEntity->GetOrigin().y, (g::pLocalEntity->GetHitboxPosition(0, g_LagComp::getpMatrix[pPlayerEntity->EntIndex()]).z + 10.f) };
- Vector HeadExtr = (Head + (g::pLocalEntity->GetVelocity() * TIME_TO_TICKS(14)));
- Vector OriginExtr = ((g::pLocalEntity->GetOrigin() + (g::pLocalEntity->GetVelocity() * TIME_TO_TICKS(14))) + Vector(0, 0, 8));
- if (fabs(g::pLocalEntity->GetVelocity().Length2D()) > .1f && (g_Autowall.CanHitFloatingPoint(HeadExtr, EnemyHead) || g_Autowall.CanHitFloatingPoint(OriginExtr, EnemyHead)))
- {
- if (!Hitinit)
- {
- canHit = true;
- Hitinit = true;
- }
- HitCheck = true;
- }
- }
- if (!HitCheck)
- Hitinit = false;
- if (canHit)
- {
- g::bSendPacket = true;
- SkipTick = true;
- g::LagPeek = true;
- canHit = false;
- }
- }
- if (GetAsyncKeyState(c_config::get().fakeduck_bind) && c_config::get().fakeduck_bind > 1)
- {
- Globals::bSendPacket = (14 <= *(int*)(uintptr_t(g_pClientState) + 0x4D28));
- }
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement