feat(vehicle): add lower vehicle stance

This commit is contained in:
maybegreat48 committed 2025-06-17 01:48:13 -04:00
1 parent 52e02c0b84
commit 4a9ef4bd66
4 files changed
+43

No files matched your search

@@ -0,0 +1,30 @@
#include "core/commands/LoopedCommand.hpp"
#include "game/backend/Self.hpp"
namespace YimMenu::Features
{
class LowerVehicleStance : public LoopedCommand
{
using LoopedCommand::LoopedCommand;
virtual void OnTick() override
{
auto veh = Self::GetVehicle();
if (veh)
{
veh.LowerStance(true);
}
}
virtual void OnDisable() override
{
auto veh = Self::GetVehicle();
if (veh)
{
veh.LowerStance(false);
}
}
};
static LowerVehicleStance _LowerVehicleStance{"lowervehiclestance", "Lower Vehicle Stance", "Lowers your current vehicle's stance. Only some vehicles are supported"};
}
+1
View File
@@ -29,6 +29,7 @@ namespace YimMenu::Submenus
misc->AddItem(std::make_shared<BoolCommandItem>("speedometer"_J));
misc->AddItem(std::make_shared<BoolCommandItem>("seatbelt"_J));
misc->AddItem(std::make_shared<BoolCommandItem>("lowervehiclestance"_J, "Lower Stance"));
misc->AddItem(std::make_shared<BoolCommandItem>("allowhatsinvehicles"_J));
misc->AddItem(std::make_shared<BoolCommandItem>("lsccustomsbypass"_J));
misc->AddItem(std::make_shared<BoolCommandItem>("dlcvehicles"_J));
+9
View File
@@ -141,12 +141,21 @@ namespace YimMenu
void Vehicle::SetBoostCharge(int percentage)
{
ENTITY_ASSERT_VALID();
ENTITY_ASSERT_CONTROL();
if (!SupportsBoost())
return;
VEHICLE::SET_ROCKET_BOOST_FILL(GetHandle(), percentage);
}
void Vehicle::LowerStance(bool lower)
{
ENTITY_ASSERT_VALID();
VEHICLE::SET_REDUCED_SUSPENSION_FORCE(GetHandle(), lower);
}
std::string Vehicle::GetFullName()
{
auto model = ENTITY::GET_ENTITY_MODEL(GetHandle());
+3
View File
@@ -32,6 +32,9 @@ namespace YimMenu
bool IsBoostActive();
void SetBoostCharge(int percentage = 100);
// stance
void LowerStance(bool lower);
std::string GetFullName();
};
}