Skip to content

Commit

Permalink
Auto TP to Waypoint and Superjump (#94)
Browse files Browse the repository at this point in the history
* main

* use native and remove function changes
  • Loading branch information
Rxann authored Mar 23, 2024
1 parent 58f2df5 commit c1120d9
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/core/byte_patch_manager/byte_patch_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace YimMenu
// put patches here
// example usage:
//
//BytePatch::Make(Pointers.GetLocalPed,0).get()
//BytePatch::Make(Pointers.GetLocalPed,0)->apply();

LOG(INFO) << "Byte patch manager initialized";
}
Expand Down
5 changes: 5 additions & 0 deletions src/core/byte_patch_manager/byte_patch_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ namespace YimMenu

static void Init();

//store created patches here for dynamic enabling/disabling
struct Patches
{
};

private:
static Byte_Patch_Manager& GetInstance()
{
Expand Down
25 changes: 25 additions & 0 deletions src/game/features/self/AutoTP.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#include "core/commands/LoopedCommand.hpp"
#include "game/features/Features.hpp"
#include "util/teleport.hpp"

namespace YimMenu::Features
{
class AutoTP : public LoopedCommand
{
using LoopedCommand::LoopedCommand;

virtual void OnTick() override
{
if (MAP::IS_WAYPOINT_ACTIVE())
{
Vector3 coords = Teleport::GetWaypointCoords();
if (coords != Vector3{0, 0, 0})
{
Teleport::TeleportEntity(YimMenu::Self::PlayerPed, rage::fvector3{coords.x, coords.y, coords.z}, true);
}
}
}
};

static AutoTP _AutoTP{"autotp", "Auto TP to Waypoint", "Automatically teleports you when you place a waypoint"};
}
18 changes: 18 additions & 0 deletions src/game/features/self/Superjump.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include "core/commands/LoopedCommand.hpp"
#include "game/features/Features.hpp"
#include "game/rdr/Natives.hpp"

namespace YimMenu::Features
{
class Superjump : public LoopedCommand
{
using LoopedCommand::LoopedCommand;

virtual void OnTick() override
{
MISC::SET_SUPER_JUMP_THIS_FRAME(Self::Id);
}
};

static Superjump _Superjump{"superjump", "Superjump", "Jump higher than normal"};
}
10 changes: 8 additions & 2 deletions src/game/frontend/submenus/Network.cpp
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
#include "Network.hpp"

#include "core/commands/Commands.hpp"
#include "core/commands/HotkeySystem.hpp"
#include "core/commands/LoopedCommand.hpp"
#include "core/frontend/Notifications.hpp"
#include "game/backend/FiberPool.hpp"
#include "game/features/Features.hpp"
#include "game/frontend/items/Items.hpp"
#include "game/pointers/Pointers.hpp"


namespace YimMenu::Submenus
{
Network::Network() :
Submenu::Submenu("Network")
{
auto session = std::make_shared<Category>("Session");
auto spoofing = std::make_shared<Category>("Spoofing");
auto session = std::make_shared<Category>("Session");
auto spoofing = std::make_shared<Category>("Spoofing");
session->AddItem(std::make_shared<CommandItem>("explodeall"_J));
session->AddItem(std::make_shared<CommandItem>("maxhonorall"_J));
session->AddItem(std::make_shared<CommandItem>("minhonorall"_J));
spoofing->AddItem(std::make_shared<BoolCommandItem>("hidegod"_J));
spoofing->AddItem(std::make_shared<BoolCommandItem>("voicechatoverride"_J));
AddCategory(std::move(session));
AddCategory(std::move(spoofing));
}
Expand Down
3 changes: 2 additions & 1 deletion src/game/frontend/submenus/Self.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ namespace YimMenu::Submenus
globalsGroup->AddItem(std::make_shared<BoolCommandItem>("keepclean"_J));
globalsGroup->AddItem(std::make_shared<BoolCommandItem>("antilasso"_J));
globalsGroup->AddItem(std::make_shared<BoolCommandItem>("antihogtie"_J));
globalsGroup->AddItem(std::make_shared<BoolCommandItem>("voicechatoverride"_J)); // TODO: move this to spoofing or network
globalsGroup->AddItem(std::make_shared<BoolCommandItem>("autotp"_J));
globalsGroup->AddItem(std::make_shared<BoolCommandItem>("superjump"_J));

toolsGroup->AddItem(std::make_shared<CommandItem>("suicide"_J));
toolsGroup->AddItem(std::make_shared<CommandItem>("clearcrimes"_J));
Expand Down
5 changes: 2 additions & 3 deletions src/util/teleport.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
#include "common.hpp"
#include "core/frontend/Notifications.hpp"
#include "game/backend/ScriptMgr.hpp"
#include "game/rdr/Natives.hpp"
#include "game/rdr/Entity.hpp"
#include "game/rdr/Natives.hpp"


// TODO: remove this file

Expand Down Expand Up @@ -88,8 +89,6 @@ namespace YimMenu::Teleport
if (MAP::IS_WAYPOINT_ACTIVE())
return MAP::_GET_WAYPOINT_COORDS();

Notifications::Show("Waypoint", "You don't have a waypoint set", NotificationType::Error);

return Vector3{0, 0, 0};
}

Expand Down

0 comments on commit c1120d9

Please sign in to comment.