diff --git a/src/game/features/system/LSCCustomsBypass.cpp b/src/game/features/system/LSCCustomsBypass.cpp new file mode 100644 index 0000000..ffac782 --- /dev/null +++ b/src/game/features/system/LSCCustomsBypass.cpp @@ -0,0 +1,44 @@ +#include "core/commands/BoolCommand.hpp" +#include "game/backend/ScriptPatches.hpp" + +namespace YimMenu::Features +{ +//from https://github.com/TCRoid/YimMenu-Lua-RS-Missions/ + class LSCCustomsBypass : public BoolCommand + { + using BoolCommand::BoolCommand; + + ScriptPatch m_CanUseVehiclePatch{}; + ScriptPatch m_BlockMenuOptionPatch{}; + + virtual void OnEnable() override + { + if (!m_CanUseVehiclePatch) + { + m_CanUseVehiclePatch = ScriptPatches::AddPatch("carmod_shop"_J, "2D ? ? ? ? 38 ? 5D ? ? ? 56 ? ? 71 2E ? ? 5D", 5, {0x72, 0x2E, 0x03, 0x01}); + } + m_CanUseVehiclePatch->Enable(); + + if (!m_BlockMenuOptionPatch) + { + m_BlockMenuOptionPatch = ScriptPatches::AddPatch("carmod_shop"_J, "2D ? ? ? ? 38 ? 5D ? ? ? 5D ? ? ? 56", 5, {0x71, 0x2E, 0x01, 0x01}); + } + m_BlockMenuOptionPatch->Enable(); + } + + virtual void OnDisable() override + { + if (m_CanUseVehiclePatch) + { + m_CanUseVehiclePatch->Disable(); + } + + if (m_BlockMenuOptionPatch) + { + m_BlockMenuOptionPatch->Disable(); + } + } + }; + + static LSCCustomsBypass _LSCCustomsBypass{"lsccustomsbypass", "Remove LSC Restrictions", "Removes Los Santos Customs vehicle modification restrictions", false}; +} \ No newline at end of file diff --git a/src/game/frontend/submenus/World.cpp b/src/game/frontend/submenus/World.cpp index 21be140..432ec69 100644 --- a/src/game/frontend/submenus/World.cpp +++ b/src/game/frontend/submenus/World.cpp @@ -8,6 +8,7 @@ namespace YimMenu::Submenus { auto mainGroup = std::make_shared("Spawners"); auto spawnGroup = std::make_shared("Vehicle"); + auto modsGroup = std::make_shared("Modifications"); spawnGroup->AddItem(std::make_shared("vehmodelname"_J)); spawnGroup->AddItem(std::make_shared("spawninvehicle"_J)); @@ -16,7 +17,10 @@ namespace YimMenu::Submenus spawnGroup->AddItem(std::make_shared("usecustomlicenseplate"_J, std::make_shared("customlicenseplate"_J))); spawnGroup->AddItem(std::make_shared("spawnvehicle"_J)); + modsGroup->AddItem(std::make_shared("lsccustomsbypass"_J)); + mainGroup->AddItem(spawnGroup); + mainGroup->AddItem(modsGroup); AddCategory(std::move(mainGroup)); }