diff --git a/src/backend/looped/weapons/cage_gun.cpp b/src/backend/looped/weapons/cage_gun.cpp index c4fe0605..0f34e156 100644 --- a/src/backend/looped/weapons/cage_gun.cpp +++ b/src/backend/looped/weapons/cage_gun.cpp @@ -7,7 +7,7 @@ namespace big { void looped::weapons_cage_gun() { - if (const bool bCageGun = g.weapons.custom_weapon == CustomWeapon::CAGE_GUN; bCageGun) + if (const bool bCageGun = g.weapons.custom_weapon == CustomWeapon::CAGE_GUN; bCageGun && (!g.self.custom_weapon_stop || WEAPON::IS_PED_ARMED(self::ped, 4 | 2))) { if (PAD::IS_DISABLED_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_AIM)) { @@ -28,4 +28,5 @@ namespace big } } } + } diff --git a/src/backend/looped/weapons/delete_gun.cpp b/src/backend/looped/weapons/delete_gun.cpp index 16f047d3..4487f393 100644 --- a/src/backend/looped/weapons/delete_gun.cpp +++ b/src/backend/looped/weapons/delete_gun.cpp @@ -8,7 +8,7 @@ namespace big { void looped::weapons_delete_gun() { - if (const bool bDeleteGun = g.weapons.custom_weapon == CustomWeapon::DELETE_GUN; bDeleteGun) + if (const bool bDeleteGun = g.weapons.custom_weapon == CustomWeapon::DELETE_GUN; bDeleteGun && (!g.self.custom_weapon_stop || WEAPON::IS_PED_ARMED(self::ped, 4 | 2))) { if (PAD::IS_DISABLED_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_AIM)) { diff --git a/src/backend/looped/weapons/gravity_gun.cpp b/src/backend/looped/weapons/gravity_gun.cpp index 69489358..792f3505 100644 --- a/src/backend/looped/weapons/gravity_gun.cpp +++ b/src/backend/looped/weapons/gravity_gun.cpp @@ -24,16 +24,16 @@ namespace big dist += 5; if (!entity::take_control_of(e)) - return;// TODO: remove from vector + return; // TODO: remove from vector ENTITY::SET_ENTITY_COLLISION(e, false, false); other = ENTITY::GET_ENTITY_COORDS(e, true); Vector3 rot = CAM::GET_GAMEPLAY_CAM_ROT(2); - float pitch = math::deg_to_rad(rot.x);// vertical + float pitch = math::deg_to_rad(rot.x); // vertical // float roll = rot.y; - float yaw = math::deg_to_rad(rot.z + 90);// horizontal + float yaw = math::deg_to_rad(rot.z + 90); // horizontal Vector3 velocity; @@ -51,7 +51,7 @@ namespace big bool is_gravity_gun_selected = g.weapons.custom_weapon == CustomWeapon::GRAVITY_GUN; auto is_zoomed_in = is_gravity_gun_selected && PAD::IS_DISABLED_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_AIM); - if (is_zoomed_in) + if (is_zoomed_in && (!g.self.custom_weapon_stop || WEAPON::IS_PED_ARMED(self::ped, 4 | 2))) { location = self::pos; diff --git a/src/backend/looped/weapons/repair_gun.cpp b/src/backend/looped/weapons/repair_gun.cpp index d685e424..0080851c 100644 --- a/src/backend/looped/weapons/repair_gun.cpp +++ b/src/backend/looped/weapons/repair_gun.cpp @@ -8,7 +8,7 @@ namespace big { void looped::weapons_repair_gun() { - if (const bool bRepairGun = g.weapons.custom_weapon == CustomWeapon::REPAIR_GUN; bRepairGun) + if (const bool bRepairGun = g.weapons.custom_weapon == CustomWeapon::REPAIR_GUN; bRepairGun && (!g.self.custom_weapon_stop || WEAPON::IS_PED_ARMED(self::ped, 4 | 2))) { if (PAD::IS_DISABLED_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_AIM)) { @@ -33,4 +33,4 @@ namespace big } } } -} +} \ No newline at end of file diff --git a/src/backend/looped/weapons/steal_vehicle_gun.cpp b/src/backend/looped/weapons/steal_vehicle_gun.cpp index 64a28eaa..f1e152b4 100644 --- a/src/backend/looped/weapons/steal_vehicle_gun.cpp +++ b/src/backend/looped/weapons/steal_vehicle_gun.cpp @@ -9,7 +9,8 @@ namespace big void looped::weapons_steal_vehicle_gun() { - if (const bool bStealVehicleGun = g.weapons.custom_weapon == CustomWeapon::STEAL_VEHICLE_GUN; bStealVehicleGun) + if (const bool bStealVehicleGun = g.weapons.custom_weapon == CustomWeapon::STEAL_VEHICLE_GUN; + bStealVehicleGun && (!g.self.custom_weapon_stop || WEAPON::IS_PED_ARMED(self::ped, 4 | 2))) { if (PAD::IS_DISABLED_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_AIM)) { @@ -38,4 +39,6 @@ namespace big } } } + + } diff --git a/src/backend/looped/weapons/vehicle_gun.cpp b/src/backend/looped/weapons/vehicle_gun.cpp index b3bbc819..732adbaa 100644 --- a/src/backend/looped/weapons/vehicle_gun.cpp +++ b/src/backend/looped/weapons/vehicle_gun.cpp @@ -17,16 +17,17 @@ namespace big const auto elapsed_time_in_ms = std::chrono::duration_cast(time_now - last_time).count(); - if (is_vehicle_gun_selected && !g_gui->is_open() && elapsed_time_in_ms >= 100 && PAD::IS_DISABLED_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_ATTACK)) + if (is_vehicle_gun_selected && !g_gui->is_open() && elapsed_time_in_ms >= 100 && PAD::IS_DISABLED_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_ATTACK) + && (!g.self.custom_weapon_stop || WEAPON::IS_PED_ARMED(self::ped, 4 | 2))) { Vector3 location = self::pos; constexpr int rotation_order = 2; Vector3 rot = CAM::GET_GAMEPLAY_CAM_ROT(rotation_order); - float pitch = math::deg_to_rad(rot.x);// vertical + float pitch = math::deg_to_rad(rot.x); // vertical //float roll = rot.y; - float yaw = math::deg_to_rad(rot.z + 90);// horizontal + float yaw = math::deg_to_rad(rot.z + 90); // horizontal float dist = 10.f; location.x += dist * cos(pitch) * cos(yaw); @@ -48,4 +49,5 @@ namespace big last_time = time_now; } } + } diff --git a/src/core/globals.hpp b/src/core/globals.hpp index 8085ff35..897823f2 100644 --- a/src/core/globals.hpp +++ b/src/core/globals.hpp @@ -286,6 +286,7 @@ namespace big bool healthregen = false; float healthregenrate = 1.0f; bool superman = false; + bool custom_weapon_stop = true; struct hud { bool hudcolor = false; @@ -307,7 +308,7 @@ namespace big // do not save below entries bool dance_mode = false; - NLOHMANN_DEFINE_TYPE_INTRUSIVE(self, ptfx_effects, clean_player, force_wanted_level, free_cam, invisibility, local_visibility, never_wanted, no_ragdoll, noclip, off_radar, super_run, no_collision, unlimited_oxygen, no_water_collision, wanted_level, god_mode, part_water, proof_bullet, proof_fire, proof_collision, proof_melee, proof_explosion, proof_steam, proof_drown, proof_water, proof_mask, mobile_radio, fast_respawn, auto_tp, super_jump, beast_jump, healthregen, healthregenrate, hud, superman) + NLOHMANN_DEFINE_TYPE_INTRUSIVE(self, ptfx_effects, clean_player, force_wanted_level, free_cam, invisibility, local_visibility, never_wanted, no_ragdoll, noclip, off_radar, super_run, no_collision, unlimited_oxygen, no_water_collision, wanted_level, god_mode, part_water, proof_bullet, proof_fire, proof_collision, proof_melee, proof_explosion, proof_steam, proof_drown, proof_water, proof_mask, mobile_radio, fast_respawn, auto_tp, super_jump, beast_jump, healthregen, healthregenrate, hud, superman, custom_weapon_stop) } self{}; struct session diff --git a/src/views/self/view_weapons.cpp b/src/views/self/view_weapons.cpp index 901a2ff5..011ab47e 100644 --- a/src/views/self/view_weapons.cpp +++ b/src/views/self/view_weapons.cpp @@ -111,6 +111,7 @@ namespace big components::sub_title("CUSTOM_WEAPONS"_T); + ImGui::Checkbox("Custom Gun only fires when weapon is out", &g.self.custom_weapon_stop); CustomWeapon selected = g.weapons.custom_weapon; if (ImGui::BeginCombo("WEAPON"_T.data(), custom_weapons[(int)selected].name))