Advertisement
Guest User

Untitled

a guest
Jan 21st, 2020
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.60 KB | None | 0 0
  1. #include "..\Features.h"
  2.  
  3. bool Swtich = false;
  4. static float SentYaw;
  5. static bool FreestandingSide = false;
  6.  
  7. void FreeStanding() // should have rewritten
  8. {
  9. static float FinalAngle;
  10. bool bside1 = false;
  11. bool bside2 = false;
  12. bool autowalld = false;
  13.  
  14. float tempdis = 999999999.f;
  15. Vector2D LocalOrg = Vector2D(g::pLocalEntity->GetOrigin().x, g::pLocalEntity->GetOrigin().y);
  16.  
  17. float closeYaw = 999.f;
  18.  
  19. for (int i = 1; i <= g_pEngine->GetMaxClients(); ++i)
  20. {
  21. C_BaseEntity* pPlayerEntity = g_pEntityList->GetClientEntity(i);
  22.  
  23. if (!pPlayerEntity
  24. || !pPlayerEntity->IsAlive()
  25. || pPlayerEntity->IsDormant()
  26. || pPlayerEntity == g::pLocalEntity
  27. || pPlayerEntity->GetTeam() == g::pLocalEntity->GetTeam())
  28. continue;
  29.  
  30. Vector2D EnemyOrg = Vector2D(pPlayerEntity->GetOrigin().x, pPlayerEntity->GetOrigin().y);
  31.  
  32.  
  33. if (tempdis > fabs(g_Math.Distance(EnemyOrg, LocalOrg)))
  34. {
  35. closeYaw = g_Math.NormalizeYaw(g_Math.CalcAngle(g::pLocalEntity->GetOrigin(), pPlayerEntity->GetOrigin()).y);
  36. tempdis = fabs(g_Math.Distance(EnemyOrg, LocalOrg));
  37. }
  38.  
  39. if (g_Menu.Config.Freestanding)
  40. {
  41. float angToLocal = g_Math.CalcAngle(g::pLocalEntity->GetOrigin(), pPlayerEntity->GetOrigin()).y;
  42. Vector ViewPoint = pPlayerEntity->GetOrigin() + Vector(0, 0, 90);
  43.  
  44. Vector2D Side1 = { (45 * sin(g_Math.GRD_TO_BOG(angToLocal))),(45 * cos(g_Math.GRD_TO_BOG(angToLocal))) };
  45. Vector2D Side2 = { (45 * sin(g_Math.GRD_TO_BOG(angToLocal + 180))) ,(45 * cos(g_Math.GRD_TO_BOG(angToLocal + 180))) };
  46.  
  47. Vector2D Side3 = { (50 * sin(g_Math.GRD_TO_BOG(angToLocal))),(50 * cos(g_Math.GRD_TO_BOG(angToLocal))) };
  48. Vector2D Side4 = { (50 * sin(g_Math.GRD_TO_BOG(angToLocal + 180))) ,(50 * cos(g_Math.GRD_TO_BOG(angToLocal + 180))) };
  49.  
  50. Vector Origin = g::pLocalEntity->GetOrigin();
  51.  
  52. Vector2D OriginLeftRight[] = { Vector2D(Side1.x, Side1.y), Vector2D(Side2.x, Side2.y) };
  53.  
  54. Vector2D OriginLeftRightLocal[] = { Vector2D(Side3.x, Side3.y), Vector2D(Side4.x, Side4.y) };
  55.  
  56. for (int side = 0; side < 2; side++)
  57. {
  58. Vector OriginAutowall = { Origin.x + OriginLeftRight[side].x, Origin.y - OriginLeftRight[side].y , Origin.z + 80 };
  59. Vector OriginAutowall2 = { ViewPoint.x + OriginLeftRightLocal[side].x, ViewPoint.y - OriginLeftRightLocal[side].y , ViewPoint.z };
  60.  
  61. if (Autowall::get().CanHitFloatingPoint(OriginAutowall, ViewPoint, pPlayerEntity))
  62. {
  63. if (side == 0)
  64. {
  65. FreestandingSide = true;
  66. bside1 = true;
  67. FinalAngle = angToLocal + 90;
  68. }
  69. else if (side == 1)
  70. {
  71. FreestandingSide = false;
  72. bside2 = true;
  73. FinalAngle = angToLocal - 90;
  74. }
  75. autowalld = true;
  76. }
  77. else
  78. {
  79. for (int side222 = 0; side222 < 2; side222++)
  80. {
  81. Vector OriginAutowall222 = { Origin.x + OriginLeftRight[side222].x, Origin.y - OriginLeftRight[side222].y , Origin.z + 80 };
  82.  
  83. if (Autowall::get().CanHitFloatingPoint(OriginAutowall222, OriginAutowall2, pPlayerEntity))
  84. {
  85. if (side222 == 0)
  86. {
  87. FreestandingSide = true;
  88. bside1 = true;
  89. FinalAngle = angToLocal + 90;
  90. }
  91. else if (side222 == 1)
  92. {
  93. FreestandingSide = false;
  94. bside2 = true;
  95. FinalAngle = angToLocal - 90;
  96. }
  97. autowalld = true;
  98. }
  99. }
  100. }
  101. }
  102. }
  103. }
  104.  
  105. if (!autowalld || (bside1 && bside2))
  106. {
  107. if (closeYaw != 999.f && g_Menu.Config.AtTarget)
  108. g::pCmd->viewangles.y = g_Math.NormalizeYaw(closeYaw + SentYaw);
  109. else
  110. g::pCmd->viewangles.y += SentYaw;
  111. }
  112. else
  113. g::pCmd->viewangles.y = FinalAngle;
  114. }
  115.  
  116. bool LBYUpdate()
  117. {
  118. static float NextUpdate = 0;
  119. float Curtime = g_pGlobalVars->curtime;
  120. auto* AnimState = g::pLocalEntity->AnimState();
  121.  
  122. if (!AnimState || !(g::pLocalEntity->GetFlags() & FL_ONGROUND))
  123. return false;
  124.  
  125. if (AnimState->speed_2d > 0.1f)
  126. NextUpdate = Curtime + 0.22f;
  127.  
  128. if (NextUpdate < Curtime)
  129. {
  130. NextUpdate = Curtime + 1.1f;
  131. return true;
  132. }
  133.  
  134. return false;
  135. }
  136. bool yawleft;
  137. bool yawright;
  138.  
  139. void Real()
  140. {
  141. if (GetAsyncKeyState(g_Menu.Config.yaw_left))
  142. {
  143. yawleft = true;
  144.  
  145. }
  146. else if (GetAsyncKeyState(g_Menu.Config.yaw_left && yawleft == false))
  147. {
  148. yawright = true;
  149. yawleft = false;
  150. }
  151.  
  152. float Yaw = 0.f;
  153. if (g::bSendPacket)
  154. {
  155. switch (g_Menu.Config.Yaw)
  156. {
  157. case 0: {
  158. bool LBYUpdateb = LBYUpdate();
  159. if (GetKeyState(g_Menu.Config.desyncswitch))
  160. {
  161. Yaw += 180.f;
  162.  
  163. if (LBYUpdateb)
  164. g::pCmd->viewangles.y -= 95.f;//was 120
  165.  
  166. }
  167. else )
  168. { Yaw += 180.f;
  169.  
  170. if (LBYUpdateb)
  171. g::pCmd->viewangles.y += 95.f;//was 120
  172.  
  173. }
  174.  
  175. {
  176. break;
  177. case 1:
  178. Yaw += 0.f;//lol
  179. break;
  180. case 2:
  181. Yaw += Swtich ? -90.f : 90.f;
  182. break;
  183. case 3:
  184. Yaw = g_Math.NormalizeYaw(g_pGlobalVars->curtime * 360.f);
  185. break;
  186. case 4:
  187. g_Menu.Config.AtTarget = false;
  188. if (yawleft)
  189. {
  190. Yaw += 90;
  191. }
  192. else if (yawright)
  193. {
  194. Yaw -= 90;
  195. }
  196. break;
  197.  
  198. }
  199.  
  200. SentYaw = Yaw;
  201.  
  202. FreeStanding();
  203.  
  204. if (g_Menu.Config.JitterRange != 0)
  205. {
  206. float Offset = g_Menu.Config.JitterRange / 2.f;
  207.  
  208. if (!g_Menu.Config.RandJitterInRange)
  209. {
  210. Swtich ? g::pCmd->viewangles.y -= Offset : g::pCmd->viewangles.y += Offset;
  211. }
  212. else
  213. {
  214. static bool oldSwtich = Swtich;
  215.  
  216. g::pCmd->viewangles.y -= Offset;
  217.  
  218. static int Add = 0;
  219.  
  220. if (oldSwtich != Swtich)
  221. {
  222. Add = rand() % g_Menu.Config.JitterRange;
  223. oldSwtich = Swtich;
  224. }
  225.  
  226. g::pCmd->viewangles.y += Add;
  227. }
  228. }
  229.  
  230. SentYaw = g::pCmd->viewangles.y;
  231. }
  232.  
  233.  
  234.  
  235. if (!g::bSendPacket) // yea i have absolutly no clue on how todo desync just pasted in someting stacker gave me
  236. {
  237. // auto NetChannel = g_pEngine->GetNetChannel();
  238. // float Delta = g::pLocalEntity->GetMaxDesyncDelta();
  239.  
  240.  
  241.  
  242. if (GetKeyState(g_Menu.Config.desyncswitch))
  243. {
  244. g::pCmd->viewangles.y += 120.f;
  245.  
  246. }
  247. else )
  248. { g::pCmd->viewangles.y -= 120.f;
  249.  
  250. }
  251.  
  252.  
  253.  
  254. }
  255. else
  256. g::pCmd->viewangles.y = SentYaw;
  257. }
  258.  
  259. void Pitch()
  260. {
  261.  
  262.  
  263.  
  264. switch (g_Menu.Config.Pitch)
  265. {
  266. case 0:
  267. g::pCmd->viewangles.x = 89.9f;
  268. break;
  269. case 1:
  270. g::pCmd->viewangles.x = Swtich ? 991.f : 1080.f;
  271. break;
  272. case 2:
  273. g::pCmd->viewangles.x = 1080.f;
  274. break;
  275. case 3:
  276. {
  277. static bool chjang = false;
  278. static float spin = 0;
  279. if (chjang != Swtich)
  280. {
  281. spin += 10.f;
  282. chjang = Swtich;
  283. }
  284.  
  285. if (spin > 80.f)
  286. spin = 0.f;
  287.  
  288. g::pCmd->viewangles.x = 1080.f - spin;
  289. }
  290.  
  291. break;
  292.  
  293. case 4: g::pCmd->viewangles.x = -89.9f; break;
  294. case 5: g::pCmd->viewangles.x = 991.f; break;
  295. case 6:
  296.  
  297. //g::pLocalEntity->GetActiveWeapon()->GetAmmo()
  298. g::pCmd->viewangles.x = 90 - (g::pLocalEntity->GetActiveWeapon()->GetAmmo() * 2);
  299. break;
  300. case 7: g::pCmd->viewangles.x = -991.f; break;
  301. }
  302.  
  303. }
  304.  
  305. void AntiAim::OnCreateMove()
  306. {
  307. if (!g_pEngine->IsInGame() || !g_Menu.Config.Antiaim || g_Menu.Config.LegitBacktrack)
  308. return;
  309.  
  310. if (g::CheatType != 1)
  311. return;
  312.  
  313. if (!g::pLocalEntity->IsAlive())
  314. return;
  315.  
  316. if (!g::pLocalEntity->GetActiveWeapon() || g::pLocalEntity->IsKnifeorNade())
  317. return;
  318.  
  319. float flServerTime = g::pLocalEntity->GetTickBase() * g_pGlobalVars->intervalPerTick;
  320. bool canShoot = (g::pLocalEntity->GetActiveWeapon()->GetNextPrimaryAttack() <= flServerTime);
  321.  
  322. if (canShoot && (g::pCmd->buttons & IN_ATTACK))
  323. return;
  324.  
  325. if (g::pCmd->buttons & IN_USE)
  326. {
  327. g::bSendPacket = true;
  328. return;
  329. }
  330.  
  331. if (g::bSendPacket)
  332. Swtich = !Swtich;
  333.  
  334. Pitch();
  335. Real();
  336. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement