mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-06-17 23:07:26 +08:00
feat(noclip): fix aim nullifying noclip speed. (#1791)
* keep using SET_ENTITY_VELOCITY when not aiming * provide GUI for editing speed of noclip
This commit is contained in:
parent
3eacc0998c
commit
8e7b16ce6d
@ -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 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
|
class noclip : looped_command
|
||||||
{
|
{
|
||||||
@ -39,7 +39,7 @@ namespace big
|
|||||||
m_entity = ent;
|
m_entity = ent;
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector3 vel = {0.f, 0.f, 0.f};
|
Vector3 vel{};
|
||||||
|
|
||||||
// Left Shift
|
// Left Shift
|
||||||
if (PAD::IS_DISABLED_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_SPRINT))
|
if (PAD::IS_DISABLED_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_SPRINT))
|
||||||
@ -76,11 +76,27 @@ namespace big
|
|||||||
|
|
||||||
ENTITY::FREEZE_ENTITY_POSITION(ent, false);
|
ENTITY::FREEZE_ENTITY_POSITION(ent, false);
|
||||||
|
|
||||||
const auto offset = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(ent, vel.x, vel.y, 0.f);
|
const auto is_aiming = PAD::IS_DISABLED_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_AIM);
|
||||||
vel.x = offset.x - location.x;
|
if (is_aiming)
|
||||||
vel.y = offset.y - location.y;
|
{
|
||||||
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -303,43 +303,45 @@ namespace big
|
|||||||
NLOHMANN_DEFINE_TYPE_INTRUSIVE(ipls, select)
|
NLOHMANN_DEFINE_TYPE_INTRUSIVE(ipls, select)
|
||||||
} ipls{};
|
} ipls{};
|
||||||
|
|
||||||
bool clean_player = false;
|
bool clean_player = false;
|
||||||
bool force_wanted_level = false;
|
bool force_wanted_level = false;
|
||||||
bool free_cam = false;
|
bool free_cam = false;
|
||||||
bool invisibility = false;
|
bool invisibility = false;
|
||||||
bool local_visibility = true;
|
bool local_visibility = true;
|
||||||
bool never_wanted = false;
|
bool never_wanted = false;
|
||||||
bool no_ragdoll = false;
|
bool no_ragdoll = false;
|
||||||
bool noclip = false;
|
bool noclip = false;
|
||||||
bool off_radar = false;
|
float noclip_aim_speed_multiplier = 0.25f;
|
||||||
bool ghost_org = false;
|
float noclip_speed_multiplier = 20.f;
|
||||||
bool super_run = false;
|
bool off_radar = false;
|
||||||
bool no_collision = false;
|
bool ghost_org = false;
|
||||||
bool unlimited_oxygen = false;
|
bool super_run = false;
|
||||||
bool no_water_collision = false;
|
bool no_collision = false;
|
||||||
int wanted_level = 0;
|
bool unlimited_oxygen = false;
|
||||||
bool god_mode = false;
|
bool no_water_collision = false;
|
||||||
bool part_water = false;
|
int wanted_level = 0;
|
||||||
bool proof_bullet = false;
|
bool god_mode = false;
|
||||||
bool proof_fire = false;
|
bool part_water = false;
|
||||||
bool proof_collision = false;
|
bool proof_bullet = false;
|
||||||
bool proof_melee = false;
|
bool proof_fire = false;
|
||||||
bool proof_explosion = false;
|
bool proof_collision = false;
|
||||||
bool proof_steam = false;
|
bool proof_melee = false;
|
||||||
bool proof_drown = false;
|
bool proof_explosion = false;
|
||||||
bool proof_water = false;
|
bool proof_steam = false;
|
||||||
uint32_t proof_mask = 0;
|
bool proof_drown = false;
|
||||||
bool mobile_radio = false;
|
bool proof_water = false;
|
||||||
bool fast_respawn = false;
|
uint32_t proof_mask = 0;
|
||||||
bool auto_tp = false;
|
bool mobile_radio = false;
|
||||||
bool super_jump = false;
|
bool fast_respawn = false;
|
||||||
bool beast_jump = false;
|
bool auto_tp = false;
|
||||||
bool healthregen = false;
|
bool super_jump = false;
|
||||||
float healthregenrate = 1.0f;
|
bool beast_jump = false;
|
||||||
bool superman = false;
|
bool healthregen = false;
|
||||||
bool custom_weapon_stop = true;
|
float healthregenrate = 1.0f;
|
||||||
std::string persist_outfit = "";
|
bool superman = false;
|
||||||
bool persist_outfits_mis = false;
|
bool custom_weapon_stop = true;
|
||||||
|
std::string persist_outfit = "";
|
||||||
|
bool persist_outfits_mis = false;
|
||||||
struct hud
|
struct hud
|
||||||
{
|
{
|
||||||
bool color_override = false;
|
bool color_override = false;
|
||||||
@ -359,7 +361,7 @@ namespace big
|
|||||||
// do not save below entries
|
// do not save below entries
|
||||||
bool dance_mode = false;
|
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{};
|
} self{};
|
||||||
|
|
||||||
struct session
|
struct session
|
||||||
|
@ -46,6 +46,17 @@ namespace big
|
|||||||
ImGui::BeginGroup();
|
ImGui::BeginGroup();
|
||||||
|
|
||||||
components::command_checkbox<"noclip">();
|
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<"noragdoll">();
|
||||||
components::command_checkbox<"fastrun">();
|
components::command_checkbox<"fastrun">();
|
||||||
components::command_checkbox<"noidlekick">();
|
components::command_checkbox<"noidlekick">();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user