Advertisement
Guest User

Untitled

a guest
Dec 8th, 2019
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.88 KB | None | 0 0
  1. float GetMaxDesyncDelta(C_AnimState* animstate)
  2. {
  3.  
  4. float flRunningSpeed = std::clamp(animstate->m_flFeetSpeedForwardsOrSideWays, 0.f, 1.f);
  5. float flYawModifier = ((animstate->m_flStopToFullRunningFraction * -0.3f) - 0.2f) * flRunningSpeed;
  6. float flYawModifier2 = flYawModifier + 1.f;
  7.  
  8.  
  9. if (animstate->m_fDuckAmount > 0.f)
  10. {
  11. float maxVelocity = std::clamp(animstate->m_flFeetSpeedForwardsOrSideWays, 0.f, 1.f);
  12. float duckSpeed = animstate->m_fDuckAmount * maxVelocity;
  13. flYawModifier2 += (duckSpeed * (0.5f - flYawModifier2));
  14. }
  15.  
  16. return *(float*)((uintptr_t)animstate + 0x334) * flYawModifier2;
  17. }
  18. void Indicators() {
  19. if (Globals::LocalPlayer) {
  20. // if (Globals::LocalPlayer->IsAlive()) {
  21.  
  22. if (!Globals::LocalPlayer->AnimState())
  23. return;
  24.  
  25. static int iWidth, iHeight;
  26. g_pEngine->GetScreenSize(iWidth, iHeight);
  27.  
  28. static bool _pressed = true;
  29. if (c_config::get().indicators)
  30. {
  31. // if (Globals::LocalPlayer->IsAlive())
  32. {
  33. auto local_player = Globals::pLocalEntity = g_pEntityList->GetClientEntity(g_pEngine->GetLocalPlayer());
  34. float desyncAmt = GetMaxDesyncDelta(local_player->AnimState());
  35. float diffrence = (Globals::RealAngle.y - Globals::LocalPlayer->GetLowerBodyYaw());
  36. float Velocity = Globals::LocalPlayer->GetVelocity().Length2D();
  37. int offset = 40;
  38. Color fake = desyncAmt <= 29 ? Color(255, 0, 0) : (desyncAmt >= 55 ? Color(132, 195, 16) : Color(255 - (desyncAmt * 2.55), desyncAmt * 2.55, 0));
  39. std::string choke;
  40. auto NetChannel = g_pEngine->GetNetChannel();
  41.  
  42. if (!NetChannel)
  43. return;
  44.  
  45. choke += "CHOKE: " + std::to_string(NetChannel->m_nChokedPackets);
  46. g_pSurface->DrawT(20, (iHeight - offset - 90), Color(255, 255, 255), Globals::IndicatorFont, false, choke.c_str());
  47.  
  48. if (Velocity < 285) // we can make this seperate but im lazy af so no
  49. g_pSurface->DrawT(11, (iHeight - offset - 50), Color(132, 195, 16), Globals::IndicatorFont, false, "");
  50. else
  51. g_pSurface->DrawT(11, (iHeight - offset - 50), Color(132, 195, 16), Globals::IndicatorFont, false, "LC");
  52. g_pSurface->DrawT(11, (iHeight - offset - 25), fake, Globals::IndicatorFont, false, "CHOKE");
  53. if (GetAsyncKeyState(c_config::get().fakeduck_bind))
  54. g_pSurface->DrawT(11, (iHeight - offset - 25), Color(255, 255, 255), Globals::IndicatorFont, false, "DUCK");;
  55.  
  56. if (GetAsyncKeyState(c_config::get().fakeduck_bind))
  57. g_pSurface->DrawT(11, (iHeight - offset - 50), fake, Globals::IndicatorFont, false, "FAKE");
  58. else
  59. //if (desyncAmt < 29) && g_Menu.Config.DesyncAngle)
  60. g_pSurface->DrawT(11, (iHeight - offset - 25), fake, Globals::IndicatorFont, false, "FAKE");
  61.  
  62. if (GetAsyncKeyState(c_config::get().baim_bind))
  63. g_pSurface->DrawT(11, (iHeight - offset - 75), Color(255, 255, 255), Globals::IndicatorFont, false, "BAIM");
  64.  
  65. }
  66. }
  67. //}
  68. }
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement