From 939f0c3fc5cb38c96d356e94116429f0c0a2472b Mon Sep 17 00:00:00 2001 From: TheRouletteBoi Date: Sat, 29 Apr 2023 21:01:26 -0700 Subject: [PATCH] Fix code for spawning Adder on 1.12 GTAV --- src/Core/Menu/Submenus.cpp | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/src/Core/Menu/Submenus.cpp b/src/Core/Menu/Submenus.cpp index bbd89faa..9bcdf09a 100644 --- a/src/Core/Menu/Submenus.cpp +++ b/src/Core/Menu/Submenus.cpp @@ -88,21 +88,34 @@ void GtavSubmenu() LoadMenuThatSupportsAllSyscalls(FindActiveGame::PatchedMenu::GTAVDebugPayload, "Debug Payload", "GTAV"); }); - g_Menu.Option(L"Load Offsets For 1.12").Action([] + g_Menu.Option(L"[Step 1] Load Offsets For 1.12").Action([] { - LoadMenuThatSupportsAllSyscalls(FindActiveGame::PatchedMenu::GTAVFindExternalOffsetsFor112, "Load Offsets For 1.12", "GTAV"); + if (vsh::GetCooperationMode() == vsh::CooperationMode::Game) + { + GTAV::CHEATS::FindExternalOffsets(); + } + else + vsh::ShowNotificationWithIcon(L"You must be in game", vsh::NotifyIcon::Error, vsh::NotifySound::None); }); - g_Menu.Option(L"Spawn Adder For 1.12").Action([] + g_Menu.Option(L"[Step 2] Spawn Adder For 1.12").Description(L"Spawned in last death location").Action([] { - GTAV::CHEATS::SetGlobal(2394760 + 1657, 1); // ??? - GTAV::CHEATS::SetGlobal(2394760 + 1656, 1); // ??? - GTAV::CHEATS::SetGlobal(2394760 + 1660, 3); // ??? - int vehicleNetId = GamePatching::GetMem(2394760 + 1665); // vehicleNetId - GTAV::CHEATS::SetGlobal(2394760 + 1603 + 42, 0xB779A091); // vehicle hash - GTAV::CHEATS::Vector3 selfCoordinates = GTAV::CHEATS::GetGlobal(2382711 + 279); - GTAV::CHEATS::SetGlobal(2394760 + 1661, selfCoordinates); // coordinates - GTAV::CHEATS::SetGlobal(2394760 + 1664, 0); // heading + if (vsh::GetCooperationMode() == vsh::CooperationMode::Game) + { + int selfPlayerId = GTAV::CHEATS::GetGlobal(2385027 + 1); // PlayerId + int totalNumPlayers = GTAV::CHEATS::GetGlobal(2390805); // totalNumPlayers + + GTAV::CHEATS::SetGlobal(2394760 + 1657, 1); // required for spawning + GTAV::CHEATS::SetGlobal(2394760 + 1656, 1); // required for spawning + GTAV::CHEATS::SetGlobal(2394760 + 1660, 3); // required for spawning + int vehicleNetId = GTAV::CHEATS::GetGlobal(2394760 + 1665); // vehicleNetId + GTAV::CHEATS::SetGlobal(2394760 + 1603 + 42, 0xB779A091); // vehicle hash + GTAV::CHEATS::Vector3 deathCoordinates = GTAV::CHEATS::GetGlobal(2382711 + 279); // last death coordinates + GTAV::CHEATS::SetGlobal(2394760 + 1661, deathCoordinates); // coordinates + GTAV::CHEATS::SetGlobal(2394760 + 1664, 0); // heading + } + else + vsh::ShowNotificationWithIcon(L"You must be in game", vsh::NotifyIcon::Error, vsh::NotifySound::None); }); }