Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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) {
- if (!g_vars.aimbot.enabled)
- return;
- Vec3 bone_postion = bone_pos(g_ent);
- SClientGameHitInfo info;
- memset(&info, 0, sizeof(SClientGameHitInfo));
- info.source.itemId = g_item->get_item_id();
- info.source.projectileId = g_projectitle_id;
- info.source.ammoClassId = 65535;
- info.shared.shooterId = actor->get_entity_id();
- info.shared.targetId = g_ent->get_entity_id();
- info.shared.material = get_material_object(g_game_rules, g_ent);
- info.shared.partId = 0;
- info.shared.pos = vPos;
- info.shared.typeId = 1;
- info.shared.shootPos = c_system_global::singleton()->get_irenderer()->get_view_camera();
- info.shared.dir = info.shared.pos - info.shared.shootPos;
- info.travelDistance = info.shared.dir.length();
- info.shared.dir = info.shared.dir / info.travelDistance;
- info.source.normal = info.shared.dir * -1.f;
- info.bFromRemote = false;
- info.canBeReported = true;
- info.bRequest = true;
- const char* WeaponName = g_item->get_weapon_ent()->get_name();
- bool IsWeaponWork =
- strstr(WeaponName, "ar") ||
- strstr(WeaponName, "shg") ||
- strstr(WeaponName, "mg") ||
- strstr(WeaponName, "smg") ||
- strstr(WeaponName, "sr") ||
- strstr(WeaponName, "pt") ||
- strstr(WeaponName, "rg") ||
- strstr(WeaponName, "hmg");
- bool IsWeaponNotWork =
- strstr(WeaponName, "arl") ||
- strstr(WeaponName, "ft") ||
- strstr(WeaponName, "fg") ||
- strstr(WeaponName, "sg") ||
- strstr(WeaponName, "ap") ||
- strstr(WeaponName, "mk") ||
- strstr(WeaponName, "df") ||
- strstr(WeaponName, "cm") ||
- strstr(WeaponName, "ak");
- if (!IsWeaponNotWork && IsWeaponWork) {
- switch (g_vars.aimbot.type)
- {
- case 1:
- if (c_system_global::singleton()->get_physical_world()->is_visible_bone(bone_postion, 0.f))
- {
- if (g_vars.aimbot.shot_type == 1) {
- if (GetAsyncKeyState(VK_LBUTTON) & 1)
- VectorAIM(pactor, bone_postion);
- }
- else if (g_vars.aimbot.shot_type == 2)
- VectorAIM(pactor, bone_postion);
- }
- break;
- case 2:
- if (c_system_global::singleton()->get_physical_world()->is_visible_bone(bone_postion, 0.f))
- {
- if (g_vars.aimbot.shot_type == 1)
- g_weapon->set_firing_pos(bone_postion);
- else if (g_vars.aimbot.shot_type == 2) {
- g_weapon->set_firing_pos(bone_postion);
- g_weapon->start_fire();
- g_weapon->stop_fire();
- }
- }
- break;
- case 3:
- if (c_system_global::singleton()->get_physical_world()->is_visible(info.shared.shootPos, info.shared.pos))
- {
- if (g_vars.aimbot.shot_type == 1) {
- if (GetAsyncKeyState(VK_LBUTTON) & 1)
- g_game_rules->client_hit(&info);
- }
- else if (g_vars.aimbot.shot_type == 2)
- g_game_rules->client_hit(&info);
- }
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment