Advertisement
Guest User

Untitled

a guest
Dec 7th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.86 KB | None | 0 0
  1. #pragma once
  2. #include "HookIncludes.h"
  3.  
  4.  
  5. int GetEstimatedServerTickCount(float latency)
  6. {
  7. return (int)floorf(float((float)((float)(latency) / (float)((uintptr_t)&g_Globals->interval_per_tick)) + 0.5) + 1 + (int)((uintptr_t)&g_Globals->tickcount));
  8. }
  9.  
  10. float NormalizeYaw(float value)
  11. {
  12. while (value > 180)
  13. value -= 360.f;
  14.  
  15. while (value < -180)
  16. value += 360.f;
  17. return value;
  18. }
  19.  
  20. namespace Globals
  21. {
  22. int Shots;
  23. int missedshots;
  24. float RealAngle;
  25. float FakeAngle;
  26. Vector AimPoint;
  27. bool shouldflip;
  28. bool ySwitch;
  29. float NextTime;
  30. int resolvemode = 1;
  31. int LBYState;
  32. float fakeAngle;
  33. float OldSimulationTime[65];
  34. bool error;
  35. }
  36.  
  37. /*void Resolver3()
  38. {
  39. C_BaseEntity *pLocal = g_EntityList->GetClientEntity(g_Engine->GetLocalPlayer());
  40.  
  41. for (auto i = 0; i < g_EntityList->GetHighestEntityIndex(); i++)
  42. {
  43. C_BaseEntity* pEnt = g_EntityList->GetClientEntity(i);
  44. if (!pEnt) continue;
  45.  
  46. if ((pEnt == pLocal)) continue;
  47.  
  48. if (pEnt->IsDormant()) continue;
  49.  
  50. player_info_t pTemp;
  51.  
  52. if (!g_Engine->GetPlayerInfo(i, &pTemp))
  53. continue;
  54. auto FYaw = pEnt->GetLowerBodyYaw();
  55. auto pitch = pEnt->GetEyeAngles()->x;
  56. if (menu.Ragebot.Resolver)
  57. {
  58. pEnt->GetEyeAngles()->y = FYaw;
  59. float PlayerIsMoving = abs(pEnt->GetVelocity().Length2D());
  60. bool bLowerBodyUpdated = false;
  61. bool IsUsingFakeAngles = false;
  62.  
  63. if (oldlowerbodyyaw != FYaw)
  64. {
  65. bLowerBodyUpdated = true;
  66. }
  67. float bodyeyedelta = fabs(pEnt->GetEyeAngles()->y - pEnt->GetLowerBodyYaw());
  68. if (PlayerIsMoving || bLowerBodyUpdated)// || LastUpdatedNetVars->eyeangles.x != CurrentNetVars->eyeangles.x || LastUpdatedNetVars->eyeyaw != CurrentNetVars->eyeangles.y)
  69. {
  70. pEnt->GetEyeAngles()->y = FYaw;
  71. oldlowerbodyyaw = pEnt->GetEyeAngles()->y;
  72.  
  73. IsUsingFakeAngles = false;
  74. }
  75. else
  76. {
  77. if (bodyeyedelta > 35.0f)
  78. {
  79. pEnt->GetEyeAngles()->y = oldlowerbodyyaw;
  80. IsUsingFakeAngles = true;
  81. }
  82. else
  83. {
  84. IsUsingFakeAngles = false;
  85. }
  86. }
  87. if (IsUsingFakeAngles)
  88. {
  89.  
  90. pEnt->GetEyeAngles()->y += 45;
  91.  
  92.  
  93. }
  94. }
  95. }
  96.  
  97. }*/
  98. inline float ClampYaw(float yaw) {
  99. while (yaw > 180.f)
  100. yaw -= 360.f;
  101. while (yaw < -180.f)
  102. yaw += 360.f;
  103. return yaw;
  104. }
  105.  
  106. void Resolver3()
  107. {
  108.  
  109.  
  110.  
  111. if (g_Options.Ragebot.Resolver)
  112. {
  113. C_BaseEntity *pLocal = g_EntityList->GetClientEntity(g_Engine->GetLocalPlayer());
  114. {
  115. for (auto i = 0; i < g_EntityList->GetHighestEntityIndex(); i++)
  116. {
  117. C_BaseEntity* pEnt = g_EntityList->GetClientEntity(i);
  118.  
  119. if (!pEnt) continue;
  120.  
  121. if (pEnt == pLocal) continue;
  122.  
  123. if (pEnt->IsDormant()) continue;
  124.  
  125. player_info_t pTemp;
  126.  
  127. if (!g_Engine->GetPlayerInfo(i, &pTemp))
  128. continue;
  129.  
  130. if (pEnt->GetTeamNum() == pLocal->GetTeamNum()) continue;
  131.  
  132. auto FYaw = pEnt->GetLowerBodyYaw();
  133. auto pitch = pEnt->GetEyeAngles()->x;
  134.  
  135. pEnt->GetEyeAngles()->y = FYaw;
  136. float PlayerIsMoving = abs(pEnt->GetVelocity().Length2D());
  137. bool bLowerBodyUpdated = false;
  138. bool IsBreakingLBY = false;
  139.  
  140. bool isFakeHeading = false;
  141.  
  142. float oldLBY = pEnt->GetLowerBodyYaw();
  143.  
  144.  
  145. if (oldLBY != pEnt->GetLowerBodyYaw())
  146. {
  147. bLowerBodyUpdated = true;
  148. }
  149. else
  150. {
  151. bLowerBodyUpdated = false;
  152. }
  153.  
  154. if (pEnt->GetEyeAngles()->y - pEnt->GetLowerBodyYaw() > 35)
  155. {
  156. isFakeHeading = true;
  157. }
  158. else
  159. {
  160. isFakeHeading = false;
  161. }
  162.  
  163. float bodyeyedelta = fabs(pEnt->GetEyeAngles()->y - pEnt->GetLowerBodyYaw());
  164.  
  165. // Resolver starts here
  166.  
  167. if (PlayerIsMoving || bLowerBodyUpdated) // Activates when enemy is moving or their lower body updates
  168. {
  169. Globals::resolvemode = 3;
  170.  
  171. pEnt->GetEyeAngles()->y = FYaw; // sets their angle to lower body
  172. oldLBY = pEnt->GetEyeAngles()->y;
  173.  
  174. IsBreakingLBY = false; // enemy is not breaking lower body because he is moving or his lower body just updated
  175. }
  176. else
  177. {
  178. Globals::resolvemode = 1;
  179.  
  180. if (bodyeyedelta == 0.f && pEnt->GetVelocity().Length2D() >= 0 && pEnt->GetVelocity().Length2D() < 36) // I dont know
  181. {
  182. pEnt->GetEyeAngles()->y = oldLBY;
  183. IsBreakingLBY = true;
  184. }
  185. else
  186. {
  187. IsBreakingLBY = false;
  188. }
  189. }
  190.  
  191. if (IsBreakingLBY) // Activates when enemy is using lower body breaker
  192. {
  193. Globals::resolvemode = 2;
  194.  
  195. pEnt->GetEyeAngles()->y = oldLBY; // sets their angle to lower body on first shot
  196.  
  197. switch (Globals::Shots % 3)
  198. {
  199. case 1: pEnt->GetEyeAngles()->y = 180; break;
  200. case 2: pEnt->GetEyeAngles()->y = pEnt->GetLowerBodyYaw() + rand() % 180;
  201. case 3: pEnt->GetEyeAngles()->y = pEnt->GetLowerBodyYaw() + pEnt->GetEyeAngles()->y + rand() % 35;
  202. }
  203. }
  204.  
  205. else
  206.  
  207. {
  208. // Resolver when nothing above is met as example when the enemy is standing and is not breaking lower body
  209.  
  210. Globals::resolvemode = 1;
  211.  
  212. pEnt->GetEyeAngles()->y = pEnt->GetLowerBodyYaw() + rand() % 180;
  213.  
  214. switch (Globals::Shots % 13)
  215. {
  216. case 1: pEnt->GetEyeAngles()->y = 180; break;
  217. case 2: pEnt->GetEyeAngles()->y = pEnt->GetLowerBodyYaw() + rand() % 180;
  218. case 3: pEnt->GetEyeAngles()->y = pEnt->GetLowerBodyYaw() + pEnt->GetEyeAngles()->y + rand() % 35;
  219. case 4: pEnt->GetEyeAngles()->y = 45 + rand() % 180;
  220. case 5: pEnt->GetEyeAngles()->y = oldLBY + rand() % 90;
  221. case 6: pEnt->GetEyeAngles()->y = 180 + rand() % 90;
  222. case 7: pEnt->GetEyeAngles()->y = oldLBY + pEnt->GetEyeAngles()->y + rand() % 45;
  223. case 8: pEnt->GetEyeAngles()->y = pEnt->GetLowerBodyYaw(); break;
  224. case 9: pEnt->GetEyeAngles()->y = pEnt->GetLowerBodyYaw() + rand() % 90; break;
  225. case 10: pEnt->GetEyeAngles()->y = pEnt->GetLowerBodyYaw() + rand() % 180; break;
  226. case 11: pEnt->GetEyeAngles()->y = oldLBY + rand() % 45; break;
  227. case 12: pEnt->GetEyeAngles()->y = pEnt->GetLowerBodyYaw() + rand() % 90; break;
  228. case 13: pEnt->GetEyeAngles()->y = pEnt->GetEyeAngles()->y + rand() % 360; break;
  229. }
  230. }
  231. }
  232. }
  233. }
  234. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement