niggerhackero

lby breaker

Dec 7th, 2019
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. static float next_lby_update_time = 0;
  2. float get_curtime(CUserCmd* ucmd) {
  3. auto local_player = Globals::LocalPlayer;
  4.  
  5. if (!local_player)
  6. return 0;
  7.  
  8. int g_tick = 0;
  9. CUserCmd* g_pLastCmd = nullptr;
  10. if (!g_pLastCmd || g_pLastCmd->hasbeenpredicted) {
  11. g_tick = (float)local_player->GetTickBase();
  12. }
  13. else {
  14. ++g_tick;
  15. }
  16. g_pLastCmd = ucmd;
  17. float curtime = g_tick * g_pGlobalVars->intervalPerTick;
  18. return curtime;
  19. }
  20.  
  21. bool next_lby_update(const float yaw_to_break, CUserCmd* cmd)
  22. {
  23. auto local_player = Globals::LocalPlayer;
  24.  
  25. if (!local_player)
  26. return false;
  27.  
  28. static float next_lby_update_time = 0;
  29. float curtime = get_curtime(cmd);
  30.  
  31. auto animstate = local_player->AnimState();
  32. if (!animstate)
  33. return false;
  34.  
  35. if (!(local_player->GetFlags() & FL_ONGROUND))
  36. return false;
  37.  
  38. if (animstate->speed_2d > 0.1)
  39. next_lby_update_time = curtime + 0.22f;
  40.  
  41. if (next_lby_update_time < curtime)
  42. {
  43. next_lby_update_time = curtime + 1.1f;
  44. return true;
  45. }
  46.  
  47. return false;
  48. }
  49. bool m_bAutomaticDir = false;
  50. int m_iAutoDirection = 0;
  51.  
  52. int m_iJitter = 0;
  53. int m_iJitterIteration = 0;
  54.  
  55. float m_flCurrentFeetYaw = 0.0f;
  56. float m_flPreviousFeetYaw = 0.0f;
Add Comment
Please, Sign In to add comment