feat(kortz): add auto-enter PC access code button (#1044)

* feat(kortz): add auto-enter PC access code button

Adds Auto-Enter PC Access Code in-heist shortcut that loops 3
iterations zeroing ScriptLocal(32820).At(i,2), yielding 100ms,
and pressing Enter (INPUT_CELLPHONE_SELECT).

* fix(kortz): apply imaginothing's ScriptLocal struct correction

ScriptLocal(thread, 32818).At(1).At(i, 2).At(1) instead of flat 32820 offset — accurately reflects header skip, array stride, and field offset per native layout.
This commit is contained in:
Ali
2026-07-29 14:05:51 +02:00
committed by GitHub
parent 0581661c8b
commit b6543e61c4
2 changed files with 22 additions and 0 deletions
@@ -5,6 +5,8 @@
#include "game/gta/ScriptGlobal.hpp"
#include "game/gta/ScriptLocal.hpp"
#include "game/gta/Scripts.hpp"
#include "core/backend/ScriptMgr.hpp"
#include "game/gta/Natives.hpp"
#include "game/backend/Self.hpp"
namespace YimMenu::Features
@@ -159,6 +161,24 @@ namespace YimMenu::Features
}
};
class AutoEnterPcAccessCode : public Command
{
using Command::Command;
virtual void OnCall() override
{
if (auto thread = Scripts::FindScriptThread("fm_mission_controller_v3"_J))
{
for (int i = 0; i <= 2; i++)
{
*ScriptLocal(thread, 32818).At(1).At(i, 2).At(1).As<int*>() = 0;
ScriptMgr::Yield(100ms);
PAD::SET_CONTROL_VALUE_NEXT_FRAME(0, 237, 1.0);
}
}
}
};
// --- Setup ---
class Setup : public Command
{
@@ -214,5 +234,6 @@ namespace YimMenu::Features
static TakePrimaryTarget _KortzCenterTakePrimary{"kortzcenterheisttakeprimary", "Take Primary Target", "Takes primary target painting (stand near it)"};
static TakeSecondaryTarget _KortzCenterTakeSecondary{"kortzcenterheisttakesecondary", "Take Secondary Target", "Takes secondary loot (stand near it)"};
static Setup _KortzCenterSetup{"kortzcenterheistsetup", "Setup", "Sets up Kortz Center heist"};
static AutoEnterPcAccessCode _KortzCenterAutoEnterPcAccessCode{"kortzcenterheistautoenterpcaccesscode", "Auto-Enter PC Access Code", "Automatically enters the PC access code"};
}
}
@@ -52,6 +52,7 @@ namespace YimMenu::Submenus
inHeist->AddItem(std::make_shared<CommandItem>("kortzcenterheistskipfingerprint"_J));
inHeist->AddItem(std::make_shared<CommandItem>("kortzcenterheistskipsignalnodes"_J));
inHeist->AddItem(std::make_shared<CommandItem>("kortzcenterheistskipdatacrack"_J));
inHeist->AddItem(std::make_shared<CommandItem>("kortzcenterheistautoenterpcaccesscode"_J));
inHeist->AddItem(std::make_shared<CommandItem>("kortzcenterheistcutglass"_J));
inHeist->AddItem(std::make_shared<CommandItem>("kortzcenterheistdisablelaser"_J));
inHeist->AddItem(std::make_shared<CommandItem>("kortzcenterheisttakeprimary"_J));