mirror of
https://github.com/YimMenu/YimMenuV2.git
synced 2026-10-11 01:38:13 +08:00
Some Fixes & Improvements (#571)
This commit is contained in:
1 parent
26bb283c46
commit
e8e03e3ccd
12 files changed
+98
-24
No files matched your search
@@ -0,0 +1,32 @@
|
||||
#include "game/commands/PlayerCommand.hpp"
|
||||
#include "core/backend/ScriptMgr.hpp"
|
||||
#include "game/gta/Scripts.hpp"
|
||||
#include "types/script/ScriptEvent.hpp"
|
||||
#include "types/script/globals/GSBD_RandomEvents.hpp"
|
||||
|
||||
namespace YimMenu::Features
|
||||
{
|
||||
class SendGooch : public PlayerCommand
|
||||
{
|
||||
using PlayerCommand::PlayerCommand;
|
||||
|
||||
virtual void OnCall(Player player) override
|
||||
{
|
||||
Scripts::ForceScriptHost(Scripts::FindScriptThread("freemode"_J));
|
||||
|
||||
if (auto GSBDRandomEvents = GSBD_RandomEvents::Get())
|
||||
{
|
||||
SCRIPT_EVENT_REQUEST_RANDOM_EVENT data;
|
||||
data.FMMCType = 310;
|
||||
data.PlayersToSend = 1;
|
||||
data.Send();
|
||||
|
||||
ScriptMgr::Yield();
|
||||
|
||||
GSBDRandomEvents->TargetData.XMASMuggerTarget = player.GetId();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
static SendGooch _SendGooch{"sendgooch", "Send Gooch", "Sends the Gooch to the specified player."};
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
#include "game/commands/PlayerCommand.hpp"
|
||||
#include "core/backend/ScriptMgr.hpp"
|
||||
#include "game/gta/Scripts.hpp"
|
||||
#include "types/script/ScriptEvent.hpp"
|
||||
#include "types/script/globals/GSBD_RandomEvents.hpp"
|
||||
|
||||
namespace YimMenu::Features
|
||||
{
|
||||
class SendPhantomCar : public PlayerCommand
|
||||
{
|
||||
using PlayerCommand::PlayerCommand;
|
||||
|
||||
virtual void OnCall(Player player) override
|
||||
{
|
||||
Scripts::ForceScriptHost(Scripts::FindScriptThread("freemode"_J));
|
||||
|
||||
if (auto GSBDRandomEvents = GSBD_RandomEvents::Get())
|
||||
{
|
||||
SCRIPT_EVENT_REQUEST_RANDOM_EVENT data;
|
||||
data.FMMCType = 269;
|
||||
data.PlayersToSend = 1;
|
||||
data.Send();
|
||||
|
||||
ScriptMgr::Yield();
|
||||
|
||||
GSBDRandomEvents->TargetData.PhantomCarTarget = player.GetId();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
static SendPhantomCar _SendPhantomCar{"sendphantomcar", "Send Phantom Car", "Sends the Phantom Car to the specified player."};
|
||||
}
|
||||
@@ -35,7 +35,7 @@ namespace YimMenu
|
||||
if (ImGui::IsItemHovered())
|
||||
{
|
||||
ImGui::SetTooltip("%s", m_Command->GetDescription().data());
|
||||
if (GetAsyncKeyState(VK_SHIFT) & 0x8000)
|
||||
if (GetAsyncKeyState(VK_CAPITAL) & 0x8000)
|
||||
ImGui::OpenPopup(std::format("{} Hotkey", m_Command->GetLabel()).data());
|
||||
}
|
||||
|
||||
|
||||
@@ -245,6 +245,7 @@ namespace YimMenu::Submenus
|
||||
if (ImGui::TreeNode("Bytecode"))
|
||||
{
|
||||
RenderBytecode(curProgram);
|
||||
ImGui::TreePop();
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
@@ -11,6 +11,8 @@ namespace YimMenu::Submenus
|
||||
auto vehicle = std::make_shared<Group>("Vehicle");
|
||||
|
||||
general->AddItem(std::make_shared<PlayerCommandItem>("sendsext"_J));
|
||||
general->AddItem(std::make_shared<PlayerCommandItem>("sendphantomcar"_J));
|
||||
general->AddItem(std::make_shared<PlayerCommandItem>("sendgooch"_J));
|
||||
|
||||
bounty->AddItem(std::make_shared<IntCommandItem>("bountyamount"_J, "Amount"));
|
||||
bounty->AddItem(std::make_shared<BoolCommandItem>("anonymousbounty"_J, "Anonymous"));
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace YimMenu::Submenus
|
||||
#define ICON_FA_SACK_DOLLAR "\xef\x93\x80"
|
||||
Submenu::Submenu("Recovery", ICON_FA_SACK_DOLLAR)
|
||||
{
|
||||
auto missions = std::make_shared<Category>("Missions");
|
||||
auto main = std::make_shared<Category>("Main");
|
||||
auto businesses = std::make_shared<Category>("Businesses");
|
||||
auto casino = std::make_shared<Category>("Casino");
|
||||
|
||||
@@ -36,11 +36,11 @@ namespace YimMenu::Submenus
|
||||
casinoSlots->AddItem(std::make_shared<BoolCommandItem>("casinomanipulaterigslotmachines"_J));
|
||||
|
||||
|
||||
missions->AddItem(generalGroup);
|
||||
main->AddItem(generalGroup);
|
||||
businesses->AddItem(businessGroup);
|
||||
casino->AddItem(casinoSlots);
|
||||
|
||||
AddCategory(std::move(missions));
|
||||
AddCategory(std::move(main));
|
||||
AddCategory(std::move(businesses));
|
||||
AddCategory(std::move(casino));
|
||||
AddCategory(BuildStatEditorMenu());
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace YimMenu::Submenus
|
||||
|
||||
globalsGroup->AddItem(std::make_shared<BoolCommandItem>("godmode"_J));
|
||||
globalsGroup->AddItem(std::make_shared<BoolCommandItem>("invis"_J));
|
||||
movementGroup->AddItem(std::make_shared<ConditionalItem>("invis"_J, std::make_shared<BoolCommandItem>("localvis"_J)));
|
||||
globalsGroup->AddItem(std::make_shared<ConditionalItem>("invis"_J, std::make_shared<BoolCommandItem>("localvis"_J)));
|
||||
globalsGroup->AddItem(std::make_shared<BoolCommandItem>("otr"_J));
|
||||
globalsGroup->AddItem(std::make_shared<BoolCommandItem>("noragdoll"_J));
|
||||
globalsGroup->AddItem(std::make_shared<BoolCommandItem>("noidlekick"_J));
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace YimMenu::Submenus
|
||||
|
||||
menu->AddItem(std::make_unique<ImGuiItem>([] {
|
||||
const float height = 15 * ImGui::GetTextLineHeightWithSpacing();
|
||||
if (ImGui::BeginListBox("##vehicles", {300.f, height}))
|
||||
if (ImGui::BeginListBox("##luascripts", {300.f, height}))
|
||||
{
|
||||
static std::optional<std::string> loadingScript;
|
||||
|
||||
|
||||
@@ -174,10 +174,6 @@ namespace YimMenu::Submenus
|
||||
|
||||
miscGroup->AddItem(std::make_shared<ConditionalItem>("autotptowaypoint"_J, std::make_shared<CommandItem>("tptowaypoint"_J), true));
|
||||
miscGroup->AddItem(std::make_shared<BoolCommandItem>("autotptowaypoint"_J));
|
||||
// miscGroup->AddItem(std::make_shared<CommandItem>("tptomount"_J));
|
||||
// miscGroup->AddItem(std::make_shared<CommandItem>("tptotraintrack"_J));
|
||||
// miscGroup->AddItem(std::make_shared<CommandItem>("tptomoonshineshack"_J));
|
||||
// miscGroup->AddItem(std::make_shared<CommandItem>("tptonazar"_J));
|
||||
miscGroup->AddItem(std::make_shared<CommandItem>("tptoobjective"_J));
|
||||
|
||||
main->AddItem(miscGroup);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "SpawnVehicle.hpp"
|
||||
#include "core/commands/BoolCommand.hpp"
|
||||
#include "core/backend/ScriptMgr.hpp"
|
||||
#include "core/backend/FiberPool.hpp"
|
||||
#include "game/backend/Self.hpp"
|
||||
@@ -8,6 +9,9 @@
|
||||
|
||||
namespace YimMenu::Submenus
|
||||
{
|
||||
static BoolCommand spawnInsideVehicle{"spawninsideveh", "Spawn Inside", "Spawn inside the vehicle."};
|
||||
static BoolCommand spawnVehicleMaxed{"spawnvehmaxed", "Spawn Maxed", "Spawn the vehicle maxed."};
|
||||
|
||||
static Vector3 GetVehicleSpawnLoc(joaat_t hash, bool spawnInside)
|
||||
{
|
||||
float y_offset = 0;
|
||||
@@ -34,8 +38,6 @@ namespace YimMenu::Submenus
|
||||
static std::vector<std::string> vehicleNames{};
|
||||
static std::vector<int> vehicleClasses{};
|
||||
static int selectedClass{-1};
|
||||
static bool spawnInside{};
|
||||
static bool spawnMaxed{};
|
||||
|
||||
menu->AddItem(std::make_unique<ImGuiItem>([] {
|
||||
static bool init = [] {
|
||||
@@ -118,12 +120,12 @@ namespace YimMenu::Submenus
|
||||
if (ImGui::Selectable(name.c_str()))
|
||||
{
|
||||
FiberPool::Push([hash] {
|
||||
auto handle = Vehicle::Create(hash, GetVehicleSpawnLoc(hash, spawnInside), Self::GetPed().GetHeading());
|
||||
auto handle = Vehicle::Create(hash, GetVehicleSpawnLoc(hash, spawnInsideVehicle.GetState()), Self::GetPed().GetHeading());
|
||||
|
||||
if (spawnInside)
|
||||
if (spawnInsideVehicle.GetState())
|
||||
Self::GetPed().SetInVehicle(handle);
|
||||
|
||||
if (spawnMaxed)
|
||||
if (spawnVehicleMaxed.GetState())
|
||||
handle.Upgrade();
|
||||
});
|
||||
}
|
||||
@@ -133,12 +135,10 @@ namespace YimMenu::Submenus
|
||||
|
||||
ImGui::EndListBox();
|
||||
}
|
||||
|
||||
ImGui::Checkbox("Spawn Inside", &spawnInside);
|
||||
ImGui::SameLine();
|
||||
ImGui::Checkbox("Spawn Maxed", &spawnMaxed);
|
||||
}));
|
||||
|
||||
menu->AddItem(std::make_shared<BoolCommandItem>("spawninsideveh"_J));
|
||||
menu->AddItem(std::make_shared<BoolCommandItem>("spawnvehmaxed"_J));
|
||||
return menu;
|
||||
}
|
||||
}
|
||||
@@ -33,7 +33,7 @@ namespace YimMenu::Submenus
|
||||
|
||||
const int visible = std::min(20, static_cast<int>(g_PedModels.size()));
|
||||
const float height = visible * ImGui::GetTextLineHeightWithSpacing();
|
||||
if (ImGui::BeginListBox("##vehicles", {300.f, height}))
|
||||
if (ImGui::BeginListBox("##peds", {300.f, height}))
|
||||
{
|
||||
std::string lower = search;
|
||||
std::transform(lower.begin(), lower.end(), lower.begin(), ::tolower);
|
||||
|
||||
@@ -58,11 +58,22 @@ namespace YimMenu
|
||||
ENTITY_ASSERT_CONTROL();
|
||||
ENTITY_ASSERT_SCRIPT_CONTEXT();
|
||||
|
||||
if (VEHICLE::GET_DOES_VEHICLE_HAVE_DAMAGE_DECALS(GetHandle()))
|
||||
if (!VEHICLE::GET_DOES_VEHICLE_HAVE_DAMAGE_DECALS(GetHandle()))
|
||||
return;
|
||||
|
||||
// this is what carmod_shop does to repair your vehicle
|
||||
VEHICLE::SET_VEHICLE_FIXED(GetHandle());
|
||||
ENTITY::SET_ENTITY_HEALTH(GetHandle(), 1000, 0, 0);
|
||||
VEHICLE::SET_VEHICLE_ENGINE_HEALTH(GetHandle(), 1000.f);
|
||||
VEHICLE::SET_VEHICLE_PETROL_TANK_HEALTH(GetHandle(), 1000.f);
|
||||
VEHICLE::SET_VEHICLE_DIRT_LEVEL(GetHandle(), 0.f);
|
||||
GRAPHICS::REMOVE_DECALS_FROM_VEHICLE(GetHandle());
|
||||
ENTITY::FORCE_ENTITY_AI_AND_ANIMATION_UPDATE(GetHandle());
|
||||
/*if (ENTITY::GET_ENTITY_MODEL(GetHandle()) == "brawler"_J)
|
||||
{
|
||||
VEHICLE::SET_VEHICLE_FIXED(GetHandle());
|
||||
VEHICLE::SET_VEHICLE_DIRT_LEVEL(GetHandle(), 0);
|
||||
}
|
||||
VEHICLE::SET_VEHICLE_ON_GROUND_PROPERLY(GetHandle(), 1084227584);
|
||||
PHYSICS::ACTIVATE_PHYSICS(GetHandle());
|
||||
}*/
|
||||
}
|
||||
|
||||
int Vehicle::GetGear()
|
||||
|
||||
Reference in new issue
Block a user