Skip to content

Commit

Permalink
TP to camp and Speed up moonshine production (#182)
Browse files Browse the repository at this point in the history
* Tp to camp

* Speed Up Moonshine Production
  • Loading branch information
tuyilmaz authored Jul 28, 2024
1 parent 02efdf2 commit 28520d9
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/game/features/self/SpeedUpMoonshine.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#include "core/commands/LoopedCommand.hpp"
#include "game/backend/Self.hpp"
#include "game/rdr/Natives.hpp"
#include "game/rdr/ScriptGlobal.hpp"
#include "game/rdr/ScriptFunction.hpp"

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

virtual void OnTick() override
{
static int LastCheck = 0;
auto MoonshineGlobal = ScriptGlobal(1297600).At(Self::GetPlayer().GetId(), 87).At(19);

if (!MoonshineGlobal.CanAccess() || MISC::GET_SYSTEM_TIME() - LastCheck < 1000)
return;

LastCheck = MISC::GET_SYSTEM_TIME();

auto BottleProgression = MoonshineGlobal.At(16);

if (*BottleProgression.As<int*>() < 20)
{
ScriptFunctions::TriggerMoonshineProduction();
}
}
};

static FastMoonshine _FastMoonshine{"fastmoonshine", "Fast Moonshine", "Speeds up moonshine production"};
}
45 changes: 45 additions & 0 deletions src/game/features/self/TpToCamp.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#include "core/commands/Command.hpp"
#include "core/frontend/Notifications.hpp"
#include "game/backend/Self.hpp"
#include "game/rdr/ScriptGlobal.hpp"
#include "util/teleport.hpp"

namespace YimMenu::Features
{

class TpToCamp : public Command
{
using Command::Command;
static constexpr auto PlayerList = ScriptGlobal(1141332);

virtual void OnCall() override
{
if (!PlayerList.CanAccess())
return;

for (int i = 0; i < 32; i++)
{
if (*PlayerList.At(i, 27).At(9).As<int*>() == Self::GetPlayer().GetId() && *PlayerList.At(i, 27).As<int*>() != 3)
{
auto Camp = ScriptGlobal(1141332).At(i, 27).At(20);

if (!Camp.CanAccess())
return;

Vector3 CampCoords = *Camp.As<Vector3*>();
if (CampCoords != Vector3(0.f, 0.f, 0.f))
{
YimMenu::Teleport::TeleportEntity(Self::GetPed().GetHandle(), CampCoords + Vector3(1, 0, 0), true);
}
else
{
Notifications::Show("Camp", "Unable to find camp", NotificationType::Error);
}
break;
}
}
}
};

static TpToCamp _TpToCamp{"tptocamp", "Teleport To Camp", "Teleport to your camp"};
}
1 change: 1 addition & 0 deletions src/game/frontend/submenus/Recovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ namespace YimMenu::Submenus
}
}));
recoveryOptions->AddItem(std::make_shared<BoolCommandItem>("unlimiteditems"_J));
recoveryOptions->AddItem(std::make_shared<BoolCommandItem>("fastmoonshine"_J));
recovery->AddItem(spawnCollectiblesGroup);
recovery->AddItem(recoveryOptions);

Expand Down
1 change: 1 addition & 0 deletions src/game/frontend/submenus/Teleport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ namespace YimMenu::Submenus
miscGroup->AddItem(std::make_shared<CommandItem>("tptowaypoint"_J));
miscGroup->AddItem(std::make_shared<CommandItem>("tptomount"_J));
miscGroup->AddItem(std::make_shared<CommandItem>("tptotraintrack"_J));
miscGroup->AddItem(std::make_shared<CommandItem>("tptocamp"_J));
miscGroup->AddItem(std::make_shared<CommandItem>("tptomoonshineshack"_J));
miscGroup->AddItem(std::make_shared<CommandItem>("tptonazar"_J));

Expand Down
1 change: 1 addition & 0 deletions src/game/rdr/ScriptFunction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,6 @@ namespace YimMenu
{
static inline ScriptFunction GiveItemDatabaseAward("interactive_campfire"_J, "22 05 24");
static inline ScriptFunction GiveLootTableAward("interactive_campfire"_J, "22 02 14 00 00 2F");
static inline ScriptFunction TriggerMoonshineProduction("net_moonshine_manager"_J, "22 00 15");
}
}

0 comments on commit 28520d9

Please sign in to comment.