Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2019
551
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. void DoFakeLag()
  2. {
  3. 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)
  4. return;
  5.  
  6. if (!Globals::LocalPlayer->IsAlive() || Globals::LocalPlayer->IsNade())
  7. return;
  8.  
  9. static bool Hitinit = false;
  10. bool SkipTick = false;
  11. static bool canHit = false;
  12. bool HitCheck = false;
  13.  
  14. if (g_Menu.Config.FakeLagOnPeek)
  15. {
  16. for (int i = 1; i < g_pEngine->GetMaxClients(); ++i)
  17. {
  18. C_BaseEntity* pPlayerEntity = g_pEntityList->GetClientEntity(i);
  19.  
  20. if (!pPlayerEntity
  21. || !pPlayerEntity->IsAlive()
  22. || pPlayerEntity->IsDormant()
  23. || pPlayerEntity == g::pLocalEntity
  24. || pPlayerEntity->GetTeam() == g::pLocalEntity->GetTeam())
  25. continue;
  26. Vector EnemyHead = { pPlayerEntity->GetOrigin().x, pPlayerEntity->GetOrigin().y, (pPlayerEntity->GetHitboxPosition(0, g_LagComp.pMatrix[pPlayerEntity->EntIndex()]).z + 10.f) };
  27.  
  28. Vector Head = { g::pLocalEntity->GetOrigin().x, g::pLocalEntity->GetOrigin().y, (g::pLocalEntity->GetHitboxPosition(0, g_LagComp::getpMatrix[pPlayerEntity->EntIndex()]).z + 10.f) };
  29. Vector HeadExtr = (Head + (g::pLocalEntity->GetVelocity() * TIME_TO_TICKS(14)));
  30. Vector OriginExtr = ((g::pLocalEntity->GetOrigin() + (g::pLocalEntity->GetVelocity() * TIME_TO_TICKS(14))) + Vector(0, 0, 8));
  31.  
  32. if (fabs(g::pLocalEntity->GetVelocity().Length2D()) > .1f && (g_Autowall.CanHitFloatingPoint(HeadExtr, EnemyHead) || g_Autowall.CanHitFloatingPoint(OriginExtr, EnemyHead)))
  33. {
  34. if (!Hitinit)
  35. {
  36. canHit = true;
  37. Hitinit = true;
  38. }
  39. HitCheck = true;
  40. }
  41. }
  42.  
  43. if (!HitCheck)
  44. Hitinit = false;
  45.  
  46. if (canHit)
  47. {
  48. g::bSendPacket = true;
  49. SkipTick = true;
  50. g::LagPeek = true;
  51. canHit = false;
  52. }
  53.  
  54.  
  55. }
  56.  
  57. if (GetAsyncKeyState(c_config::get().fakeduck_bind) && c_config::get().fakeduck_bind > 1)
  58. {
  59. Globals::bSendPacket = (14 <= *(int*)(uintptr_t(g_pClientState) + 0x4D28));
  60. }
  61.  
  62.  
  63.  
  64. }
  65. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement