diff --git a/src/backend/looped/self/noclip.cpp b/src/backend/looped/self/noclip.cpp index c5a7db0b..f9f59438 100644 --- a/src/backend/looped/self/noclip.cpp +++ b/src/backend/looped/self/noclip.cpp @@ -10,7 +10,7 @@ namespace big { static constexpr ControllerInputs controls[] = {ControllerInputs::INPUT_SPRINT, ControllerInputs::INPUT_MOVE_UP_ONLY, ControllerInputs::INPUT_MOVE_DOWN_ONLY, ControllerInputs::INPUT_MOVE_LEFT_ONLY, ControllerInputs::INPUT_MOVE_RIGHT_ONLY, ControllerInputs::INPUT_DUCK}; - static constexpr float speed = 20.f; + static constexpr float speed = 1.0f; class noclip : looped_command { @@ -39,7 +39,7 @@ namespace big m_entity = ent; } - Vector3 vel = {0.f, 0.f, 0.f}; + Vector3 vel{}; // Left Shift if (PAD::IS_DISABLED_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_SPRINT)) @@ -76,11 +76,27 @@ namespace big ENTITY::FREEZE_ENTITY_POSITION(ent, false); - const auto offset = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(ent, vel.x, vel.y, 0.f); - vel.x = offset.x - location.x; - vel.y = offset.y - location.y; + const auto is_aiming = PAD::IS_DISABLED_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_AIM); + if (is_aiming) + { + vel = vel * g.self.noclip_aim_speed_multiplier; - ENTITY::SET_ENTITY_VELOCITY(ent, vel.x * m_speed_multiplier, vel.y * m_speed_multiplier, vel.z * m_speed_multiplier); + const auto offset = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(ent, vel.x * m_speed_multiplier, vel.y * m_speed_multiplier, vel.z * m_speed_multiplier); + + ENTITY::SET_ENTITY_VELOCITY(ent, 0, 0, 0); + ENTITY::SET_ENTITY_COORDS_NO_OFFSET(ent, offset.x, offset.y, offset.z, true, true, true); + } + else + { + vel = vel * g.self.noclip_speed_multiplier; + + const auto offset = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(ent, vel.x, vel.y, 0.f); + vel.x = offset.x - location.x; + vel.y = offset.y - location.y; + + ENTITY::SET_ENTITY_MAX_SPEED(ent, 999999999999); + ENTITY::SET_ENTITY_VELOCITY(ent, vel.x * m_speed_multiplier, vel.y * m_speed_multiplier, vel.z * m_speed_multiplier); + } } } diff --git a/src/core/settings.hpp b/src/core/settings.hpp index 501ec340..60ecb570 100644 --- a/src/core/settings.hpp +++ b/src/core/settings.hpp @@ -303,43 +303,45 @@ namespace big NLOHMANN_DEFINE_TYPE_INTRUSIVE(ipls, select) } ipls{}; - bool clean_player = false; - bool force_wanted_level = false; - bool free_cam = false; - bool invisibility = false; - bool local_visibility = true; - bool never_wanted = false; - bool no_ragdoll = false; - bool noclip = false; - bool off_radar = false; - bool ghost_org = false; - bool super_run = false; - bool no_collision = false; - bool unlimited_oxygen = false; - bool no_water_collision = false; - int wanted_level = 0; - bool god_mode = false; - bool part_water = false; - bool proof_bullet = false; - bool proof_fire = false; - bool proof_collision = false; - bool proof_melee = false; - bool proof_explosion = false; - bool proof_steam = false; - bool proof_drown = false; - bool proof_water = false; - uint32_t proof_mask = 0; - bool mobile_radio = false; - bool fast_respawn = false; - bool auto_tp = false; - bool super_jump = false; - bool beast_jump = false; - bool healthregen = false; - float healthregenrate = 1.0f; - bool superman = false; - bool custom_weapon_stop = true; - std::string persist_outfit = ""; - bool persist_outfits_mis = false; + bool clean_player = false; + bool force_wanted_level = false; + bool free_cam = false; + bool invisibility = false; + bool local_visibility = true; + bool never_wanted = false; + bool no_ragdoll = false; + bool noclip = false; + float noclip_aim_speed_multiplier = 0.25f; + float noclip_speed_multiplier = 20.f; + bool off_radar = false; + bool ghost_org = false; + bool super_run = false; + bool no_collision = false; + bool unlimited_oxygen = false; + bool no_water_collision = false; + int wanted_level = 0; + bool god_mode = false; + bool part_water = false; + bool proof_bullet = false; + bool proof_fire = false; + bool proof_collision = false; + bool proof_melee = false; + bool proof_explosion = false; + bool proof_steam = false; + bool proof_drown = false; + bool proof_water = false; + uint32_t proof_mask = 0; + bool mobile_radio = false; + bool fast_respawn = false; + bool auto_tp = false; + bool super_jump = false; + bool beast_jump = false; + bool healthregen = false; + float healthregenrate = 1.0f; + bool superman = false; + bool custom_weapon_stop = true; + std::string persist_outfit = ""; + bool persist_outfits_mis = false; struct hud { bool color_override = false; @@ -359,7 +361,7 @@ namespace big // do not save below entries bool dance_mode = false; - NLOHMANN_DEFINE_TYPE_INTRUSIVE(self, ipls, 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, persist_outfit, persist_outfits_mis) + NLOHMANN_DEFINE_TYPE_INTRUSIVE(self, ipls, ptfx_effects, clean_player, force_wanted_level, free_cam, invisibility, local_visibility, never_wanted, no_ragdoll, noclip, noclip_aim_speed_multiplier, noclip_speed_multiplier, 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, persist_outfit, persist_outfits_mis) } self{}; struct session diff --git a/src/views/self/view_self.cpp b/src/views/self/view_self.cpp index d82178f2..98ceac1f 100644 --- a/src/views/self/view_self.cpp +++ b/src/views/self/view_self.cpp @@ -46,6 +46,17 @@ namespace big ImGui::BeginGroup(); components::command_checkbox<"noclip">(); + components::options_modal("Noclip", [] { + ImGui::Separator(); + + ImGui::BeginGroup(); + ImGui::Text("NOCLIP_AIM_SPEED_MULTIPLIER"_T.data()); + ImGui::SliderFloat("##noclipaimspeedmult", &g.self.noclip_aim_speed_multiplier, 0.1f, 1.0f); + ImGui::Text("NOCLIP_SPEED_MULTIPLIER"_T.data()); + ImGui::SliderFloat("##noclipspeedmult", &g.self.noclip_speed_multiplier, 1.f, 100.f); + ImGui::EndGroup(); + }); + components::command_checkbox<"noragdoll">(); components::command_checkbox<"fastrun">(); components::command_checkbox<"noidlekick">();