Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.72 KB | None | 0 0
  1. void AIM() {
  2. float LimDist = 1000.0f;
  3. float GetHyp;
  4. IActor* MePlayer = NULL;
  5. IActor* Nearest = 0;
  6. IGameFramework* pFrameWork = IGameFramework::GetGameFramework();
  7. IEntitySystem* pEntSys = SSystemGlobalEnvironment::Singleton()->pEntitySystem;
  8. IEntityIt* pEntIt = pEntSys->GetEntityIterator();
  9. Vec3 ScreenPos{ 0,0,0 };
  10. if (pFrameWork->GetClientActor(&MePlayer))
  11. {
  12. auto Iitem = MePlayer->GetCurrentItem();
  13. if (Iitem) {
  14. auto Weapon = Iitem->GetIWeapon();
  15. if (Weapon) {
  16. if (Fun.aimtype == 1) {
  17. Iitem->SetFiringPos({ 0,0,0 });
  18. }
  19. if (MePlayer && pEntIt)
  20. for (; IEntity * pEnt = pEntIt->Next(); )
  21. {
  22. if (IActor * LocPlayer = pFrameWork->GetIActorSystem()->GetActor(pEnt->GetID()))
  23. {
  24. auto WeaponName = Weapon->GetCurrentWeapon();
  25. Vec3 EnemyPos = GetPlayerPos(pEnt);
  26. Vec3 Out;
  27. Vec3 bone = { 0,0,0 };
  28. Vec3 MyBone = GetBonePositionByID(MePlayer->getIEntity(), 13);
  29. if (MePlayer != LocPlayer) {
  30. if (MyTeam(MePlayer, LocPlayer) && (!GetDeadPlayer(LocPlayer))) {
  31. switch (Fun.bonetype) {
  32. case 0: bone = GetBonePositionByID(pEnt, 13); break;
  33. case 1: bone = GetBonePositionByID(pEnt, 1); break;
  34. }
  35. if (Fun.aim360 ? true : WorldToScreen({bone.x, bone.y, bone.z }, &Out)) {
  36. if (Fun.AimAkt) {
  37. if (strstr(pEnt->GetName(), _xor("Iron"))) bone = GetBonePositionByID(pEnt, 9);
  38. if (strstr(pEnt->GetName(), _xor("Drone"))) bone = GetBonePositionByID(pEnt, 12);
  39. if (strstr(pEnt->GetName(), _xor("TurretWall"))) bone = GetBonePositionByID(pEnt, 47);
  40. if (strstr(pEnt->GetName(), _xor("TurretCeil"))) bone = GetBonePositionByID(pEnt, 78);
  41. if (strstr(pEnt->GetName(), _xor("TurretFloor_ASR")) || strstr(pEnt->GetName(), _xor("Turret_ASR_Target"))) bone = GetBonePositionByID(pEnt, 62);
  42. if (strstr(pEnt->GetName(), _xor("CQBHeavy"))) bone = GetBonePositionByID(pEnt, 13);
  43. if (strstr(pEnt->GetName(), _xor("SMGHeavy"))) bone = GetBonePositionByID(pEnt, 13);
  44. if (strstr(pEnt->GetName(), _xor("TurretFloor_cqb")) || strstr(pEnt->GetName(), _xor("TurretFloor_CQB")) || strstr(pEnt->GetName(), _xor("TurretHunt_CQB"))) bone = GetBonePositionByID(pEnt, 58);
  45. if (strstr(pEnt->GetName(), _xor("TurretFloor_mg")) || strstr(pEnt->GetName(), _xor("TurretFloor_MG")) || strstr(pEnt->GetName(), _xor("TurretHunt_MG")) || strstr(pEnt->GetName(), _xor("TurretRail_mg")) || strstr(pEnt->GetName(), _xor("Turret_MG"))) bone = GetBonePositionByID(pEnt, 68);
  46. if (strstr(pEnt->GetName(), _xor("HeavyTurretRail"))) bone = GetBonePositionByID(pEnt, 52);
  47. if (strstr(pEnt->GetName(), _xor("SEDAssault"))) bone = GetBonePositionByID(pEnt, 60);
  48. if (strstr(pEnt->GetName(), _xor("SEDSoldier"))) bone = GetBonePositionByID(pEnt, 58);
  49. bone.z += 0.085f;
  50. if (strstr(WeaponName, _xor("arl")) || strstr(WeaponName, _xor("kn")) || strstr(WeaponName, _xor("fg")) || strstr(WeaponName, _xor("sg")) || strstr(WeaponName, _xor("ap")) || strstr(WeaponName, _xor("mk")) || strstr(WeaponName, _xor("df")) || strstr(WeaponName, _xor("cm")) || strstr(WeaponName, _xor("ak")))
  51. {
  52. continue;
  53. }
  54. if (Fun.Shields) {
  55. if (strstr(pEnt->GetName(), _xor("Shield")))continue;
  56. }
  57. if (Fun.sed) {
  58. if (strstr(pEnt->GetName(), _xor("SED")))continue;
  59. }
  60. if (Fun.turret) {
  61. if (strstr(pEnt->GetName(), _xor("Turret")))continue;
  62. }
  63. if (Fun.bosses) {
  64. if ((strstr(pEnt->GetName(), _xor("mech2300")) ||
  65. strstr(pEnt->GetName(), _xor("_Flagship_MainArtillery")) ||
  66. strstr(pEnt->GetName(), _xor("_Flagship_Artillery")) ||
  67. strstr(pEnt->GetName(), _xor("Black_Wolf")) ||
  68. strstr(pEnt->GetName(), _xor("Mantis")) ||
  69. strstr(pEnt->GetName(), _xor("Iron")) ||
  70. strstr(pEnt->GetName(), _xor("Mech2300")) ||
  71. strstr(pEnt->GetName(), _xor("Tank_Turret")) ||
  72. strstr(pEnt->GetName(), _xor("_TurretAPC")) ||
  73. strstr(pEnt->GetName(), _xor("_Turret_MG_OneShot")) ||
  74. strstr(pEnt->GetName(), _xor("JP_Flamethrower")) ||
  75. strstr(pEnt->GetName(), _xor("Helicopter"))))
  76. continue;
  77. }
  78. if ((Fun.CounterAmmo == 0) || isVisible(bone, MyBone)) {
  79. if (strstr(WeaponName, _xor("ar")) || strstr(WeaponName, _xor("mg")) || strstr(WeaponName, _xor("smg")) || (strstr(WeaponName, _xor("sr"))) || strstr(WeaponName, _xor("rg")) || strstr(WeaponName, _xor("pt")))
  80. {
  81. if (Fun.priority == 0) {
  82. auto CrossLim = GetHypotenuse({ bone.x, bone.y, bone.z });
  83. if (CrossLim < LimDist) {
  84. switch (Fun.aimtype) {
  85. case 0: AimType2(MePlayer, MyBone, { bone.x, bone.y, bone.z });
  86. break;
  87. case 1: Iitem->SetFiringPos({ bone.x, bone.y, bone.z });
  88. break;
  89. }
  90. CrossLim = LimDist;
  91. }
  92. }
  93. if (Fun.priority == 1) {
  94. auto dist = Distance(MyBone, bone);
  95. if (dist < LimDist) {
  96. switch (Fun.aimtype) {
  97. case 0: AimType2(MePlayer, MyBone, { bone.x, bone.y, bone.z });
  98. break;
  99. case 1: Iitem->SetFiringPos({ bone.x, bone.y, bone.z });
  100. break;
  101. }
  102. Nearest = LocPlayer;
  103. dist = LimDist;
  104. }
  105. }
  106. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement