From 3fd450c3961bf8639940b7c23910abfdc1586fa8 Mon Sep 17 00:00:00 2001 From: latiao-1337 <146958060+latiao-1337@users.noreply.github.com> Date: Mon, 5 May 2025 09:43:21 +0800 Subject: [PATCH] add peds ignore and CopsDispatch and PedRiotMode and ExplosiveAmmo (#279) * add peds ignore * CopsDispatch * PedRiotMode * ExplosiveAmmo * improve --- src/game/features/self/ExplosiveAmmo.cpp | 21 +++++++++++++++++ src/game/features/world/CopsDispatch.cpp | 25 ++++++++++++++++++++ src/game/features/world/Pedsignore.cpp | 30 ++++++++++++++++++++++++ src/game/features/world/RiotMode.cpp | 25 ++++++++++++++++++++ src/game/frontend/submenus/Self.cpp | 1 + src/game/frontend/submenus/World.cpp | 9 +++++++ 6 files changed, 111 insertions(+) create mode 100644 src/game/features/self/ExplosiveAmmo.cpp create mode 100644 src/game/features/world/CopsDispatch.cpp create mode 100644 src/game/features/world/Pedsignore.cpp create mode 100644 src/game/features/world/RiotMode.cpp diff --git a/src/game/features/self/ExplosiveAmmo.cpp b/src/game/features/self/ExplosiveAmmo.cpp new file mode 100644 index 0000000..a9f7280 --- /dev/null +++ b/src/game/features/self/ExplosiveAmmo.cpp @@ -0,0 +1,21 @@ +#include "core/commands/LoopedCommand.hpp" +#include "game/backend/Self.hpp" +#include "game/gta/Pools.hpp" + +#include + +namespace YimMenu::Features +{ + class ExplosiveAmmo : public LoopedCommand + { + using LoopedCommand::LoopedCommand; + virtual void OnTick() override + { + MISC::SET_EXPLOSIVE_AMMO_THIS_FRAME(Self::GetPlayer().GetId()); + + } + }; + + static ExplosiveAmmo _ExplosiveAmmo{"ExplosiveAmmo", "Explosive Ammo", "Every bullet you shoot explodes."}; + +} \ No newline at end of file diff --git a/src/game/features/world/CopsDispatch.cpp b/src/game/features/world/CopsDispatch.cpp new file mode 100644 index 0000000..0551408 --- /dev/null +++ b/src/game/features/world/CopsDispatch.cpp @@ -0,0 +1,25 @@ +#include "core/commands/LoopedCommand.hpp" +#include "game/backend/Self.hpp" +#include "game/gta/Pools.hpp" + +#include + +namespace YimMenu::Features +{ + class CopsDispatch : public LoopedCommand + { + using LoopedCommand::LoopedCommand; + virtual void OnTick() override + { + PLAYER::SET_DISPATCH_COPS_FOR_PLAYER(Self::GetPlayer().GetId(), FALSE); + } + + virtual void OnDisable() override + { + PLAYER::SET_DISPATCH_COPS_FOR_PLAYER(Self::GetPlayer().GetId(), TRUE); + } + }; + + static CopsDispatch _CopsDispatch{"CopsDispatch", "Cops Dispatch", "When you are wanted, no police will be spawned."}; + +} \ No newline at end of file diff --git a/src/game/features/world/Pedsignore.cpp b/src/game/features/world/Pedsignore.cpp new file mode 100644 index 0000000..24130b5 --- /dev/null +++ b/src/game/features/world/Pedsignore.cpp @@ -0,0 +1,30 @@ +#include "core/commands/LoopedCommand.hpp" +#include "game/gta/Pools.hpp" +#include "game/backend/Self.hpp" +#include + +namespace YimMenu::Features +{ + class PedIgnore : public LoopedCommand + { + using LoopedCommand::LoopedCommand; + virtual void OnTick() override + { + PLAYER::SET_EVERYONE_IGNORE_PLAYER(Self::GetPlayer().GetId(), TRUE); + PLAYER::SET_POLICE_IGNORE_PLAYER(Self::GetPlayer().GetId(), TRUE); + PED::SET_BLOCKING_OF_NON_TEMPORARY_EVENTS_FOR_AMBIENT_PEDS_THIS_FRAME(TRUE); + PED::SET_PED_RESET_FLAG(Self::GetPed().GetHandle(), 124, true); + + } + + virtual void OnDisable() override + { + PLAYER::SET_EVERYONE_IGNORE_PLAYER(Self::GetPlayer().GetId(), FALSE); + PLAYER::SET_POLICE_IGNORE_PLAYER(Self::GetPlayer().GetId(), FALSE); + + } + }; + + static PedIgnore _PedIgnore{"pedsignore", "Peds Ignore", "Nearby peds will ignore you and become oblivious to your actions."}; + +} \ No newline at end of file diff --git a/src/game/features/world/RiotMode.cpp b/src/game/features/world/RiotMode.cpp new file mode 100644 index 0000000..66fb40f --- /dev/null +++ b/src/game/features/world/RiotMode.cpp @@ -0,0 +1,25 @@ +#include "core/commands/LoopedCommand.hpp" +#include "game/backend/Self.hpp" +#include "game/gta/Pools.hpp" + +#include + +namespace YimMenu::Features +{ + class PedRiotMode : public LoopedCommand + { + using LoopedCommand::LoopedCommand; + virtual void OnTick() override + { + MISC::SET_RIOT_MODE_ENABLED(TRUE); + } + + virtual void OnDisable() override + { + MISC::SET_RIOT_MODE_ENABLED(FALSE); + } + }; + + static PedRiotMode _PedRiotMode{"PedRiotMode", "Riot Mode", "All PEDs attack each other."}; + +} \ No newline at end of file diff --git a/src/game/frontend/submenus/Self.cpp b/src/game/frontend/submenus/Self.cpp index 9d752da..129b688 100644 --- a/src/game/frontend/submenus/Self.cpp +++ b/src/game/frontend/submenus/Self.cpp @@ -66,6 +66,7 @@ namespace YimMenu::Submenus weaponsGlobalsGroup->AddItem(std::make_shared("rapidfire"_J)); weaponsGlobalsGroup->AddItem(std::make_shared("aimbot"_J)); weaponsGlobalsGroup->AddItem(std::make_shared("infiniteparachutes"_J)); + weaponsGlobalsGroup->AddItem(std::make_shared("ExplosiveAmmo"_J)); weaponsGlobalsGroup->AddItem(std::make_shared("giveallweapons"_J)); weapons->AddItem(weaponsGlobalsGroup); diff --git a/src/game/frontend/submenus/World.cpp b/src/game/frontend/submenus/World.cpp index 7a23e5f..fd8d64f 100644 --- a/src/game/frontend/submenus/World.cpp +++ b/src/game/frontend/submenus/World.cpp @@ -27,10 +27,16 @@ namespace YimMenu::Submenus weatherOpts->AddItem(std::make_shared("forceweather"_J, std::make_shared("setweather"_J), true)); weatherOpts->AddItem(std::make_shared("forceweather"_J)); + auto otherOpts = std::make_shared("Other", 1); + otherOpts->AddItem(std::make_shared("pedsignore"_J)); + otherOpts->AddItem(std::make_shared("PedRiotMode"_J)); + otherOpts->AddItem(std::make_shared("CopsDispatch"_J)); + main->AddItem(std::move(killPeds)); main->AddItem(std::move(deleteOpts)); main->AddItem(std::move(bringOpts)); main->AddItem(std::move(weatherOpts)); + main->AddItem(std::move(otherOpts)); auto spawnGroup = std::make_shared("Vehicle"); auto modsGroup = std::make_shared("Modifications"); @@ -52,6 +58,9 @@ namespace YimMenu::Submenus iplsGroup->AddItem(std::make_shared("unloadipl"_J)); iplsGroup->AddItem(std::make_shared("ipltp"_J)); + + + AddCategory(std::move(main)); AddCategory(std::move(spawnersGroup)); AddCategory(std::move(iplsGroup));