Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. void FakeSideLBY(CUserCmd *pCmd, bool &bSendPacket)
  2. {
  3. int i = 0; i < Interfaces::EntList->GetHighestEntityIndex(); ++i;
  4. IClientEntity *pEntity = Interfaces::EntList->GetClientEntity(i);
  5. IClientEntity *pLocal = Interfaces::EntList->GetClientEntity(Interfaces::Engine->GetLocalPlayer());
  6.  
  7. static bool isMoving;
  8. float PlayerIsMoving = abs(pLocal->GetVelocity().Length());
  9. if (PlayerIsMoving > 0.1) isMoving = true;
  10. else if (PlayerIsMoving <= 0.1) isMoving = false;
  11.  
  12. int flip = (int)floorf(Interfaces::Globals->curtime / 1.1) % 2;
  13. static bool bFlipYaw;
  14. float flInterval = Interfaces::Globals->interval_per_tick;
  15. float flTickcount = pCmd->tick_count;
  16. float flTime = flInterval * flTickcount;
  17. if (std::fmod(flTime, 1) == 0.f)
  18. bFlipYaw = !bFlipYaw;
  19.  
  20. if (PlayerIsMoving <= 0.1)
  21. {
  22. if (bSendPacket)
  23. {
  24. pCmd->viewangles.y += 180.f;
  25. }
  26. else
  27. {
  28. if (flip)
  29. {
  30. pCmd->viewangles.y += bFlipYaw ? 90.f : -90.f;
  31.  
  32. }
  33. else
  34. {
  35. pCmd->viewangles.y -= hackManager.pLocal()->GetLowerBodyYaw() + bFlipYaw ? 90.f : -90.f;
  36. }
  37. }
  38. }
  39. else if (PlayerIsMoving > 0.1)
  40. {
  41. if (bSendPacket)
  42. {
  43. pCmd->viewangles.y += 180.f;
  44. }
  45. else
  46. {
  47. pCmd->viewangles.y += 90.f;
  48. }
  49. }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement