Guest User

Untitled

a guest
Jul 11th, 2021
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.85 KB | None | 0 0
  1. void aimbot(c_ent* g_ent, c_weapon* g_weapon, c_actor* pactor, c_actor* actor, c_item* g_item, c_game_rules* g_game_rules, Vec3 vPos, c_ent_id g_projectitle_id) {
  2.     if (!g_vars.aimbot.enabled)
  3.         return;
  4.  
  5.     Vec3 bone_postion = bone_pos(g_ent);
  6.  
  7.     SClientGameHitInfo info;
  8.     memset(&info, 0, sizeof(SClientGameHitInfo));
  9.     info.source.itemId = g_item->get_item_id();
  10.     info.source.projectileId = g_projectitle_id;
  11.     info.source.ammoClassId = 65535;
  12.     info.shared.shooterId = actor->get_entity_id();
  13.     info.shared.targetId = g_ent->get_entity_id();
  14.     info.shared.material = get_material_object(g_game_rules, g_ent);
  15.     info.shared.partId = 0;
  16.     info.shared.pos = vPos;
  17.     info.shared.typeId = 1;
  18.     info.shared.shootPos = c_system_global::singleton()->get_irenderer()->get_view_camera();
  19.     info.shared.dir = info.shared.pos - info.shared.shootPos;
  20.     info.travelDistance = info.shared.dir.length();
  21.     info.shared.dir = info.shared.dir / info.travelDistance;
  22.     info.source.normal = info.shared.dir * -1.f;
  23.  
  24.     info.bFromRemote = false;
  25.     info.canBeReported = true;
  26.     info.bRequest = true;
  27.  
  28.     const char* WeaponName = g_item->get_weapon_ent()->get_name();
  29.     bool IsWeaponWork =
  30.         strstr(WeaponName, "ar") ||
  31.         strstr(WeaponName, "shg") ||
  32.         strstr(WeaponName, "mg") ||
  33.         strstr(WeaponName, "smg") ||
  34.         strstr(WeaponName, "sr") ||
  35.         strstr(WeaponName, "pt") ||
  36.         strstr(WeaponName, "rg") ||
  37.         strstr(WeaponName, "hmg");
  38.  
  39.     bool IsWeaponNotWork =
  40.         strstr(WeaponName, "arl") ||
  41.         strstr(WeaponName, "ft") ||
  42.         strstr(WeaponName, "fg") ||
  43.         strstr(WeaponName, "sg") ||
  44.         strstr(WeaponName, "ap") ||
  45.         strstr(WeaponName, "mk") ||
  46.         strstr(WeaponName, "df") ||
  47.         strstr(WeaponName, "cm") ||
  48.         strstr(WeaponName, "ak");
  49.  
  50.     if (!IsWeaponNotWork && IsWeaponWork) {
  51.         switch (g_vars.aimbot.type)
  52.         {
  53.         case 1:
  54.             if (c_system_global::singleton()->get_physical_world()->is_visible_bone(bone_postion, 0.f))
  55.             {
  56.                 if (g_vars.aimbot.shot_type == 1) {
  57.                     if (GetAsyncKeyState(VK_LBUTTON) & 1)
  58.                         VectorAIM(pactor, bone_postion);
  59.                 }
  60.                 else if (g_vars.aimbot.shot_type == 2)
  61.                     VectorAIM(pactor, bone_postion);
  62.             }
  63.             break;
  64.         case 2:
  65.             if (c_system_global::singleton()->get_physical_world()->is_visible_bone(bone_postion, 0.f))
  66.             {
  67.                 if (g_vars.aimbot.shot_type == 1)
  68.                     g_weapon->set_firing_pos(bone_postion);
  69.                 else if (g_vars.aimbot.shot_type == 2) {
  70.                     g_weapon->set_firing_pos(bone_postion);
  71.                     g_weapon->start_fire();
  72.                     g_weapon->stop_fire();
  73.                 }
  74.             }
  75.             break;
  76.         case 3:
  77.             if (c_system_global::singleton()->get_physical_world()->is_visible(info.shared.shootPos, info.shared.pos))
  78.             {
  79.                 if (g_vars.aimbot.shot_type == 1) {
  80.                     if (GetAsyncKeyState(VK_LBUTTON) & 1)
  81.                         g_game_rules->client_hit(&info);
  82.                 }
  83.                 else if (g_vars.aimbot.shot_type == 2)
  84.                     g_game_rules->client_hit(&info);
  85.             }
  86.             break;
  87.         }
  88.     }
  89. }
Advertisement
Add Comment
Please, Sign In to add comment