diff --git a/src/core/globals.hpp b/src/core/globals.hpp index c21d5963..a03d5051 100644 --- a/src/core/globals.hpp +++ b/src/core/globals.hpp @@ -233,8 +233,9 @@ namespace big bool desync_kick = false; bool rid_join = false; bool lessen_breakups = false; // disabled by default due to anticheat concerns + bool receive_pickup = false; - NLOHMANN_DEFINE_TYPE_INTRUSIVE(protections, script_events, rid_join, lessen_breakups, desync_kick) + NLOHMANN_DEFINE_TYPE_INTRUSIVE(protections, script_events, rid_join, lessen_breakups, desync_kick, receive_pickup) } protections{}; struct self diff --git a/src/hooking.cpp b/src/hooking.cpp index 5a5666bd..fa0d672d 100644 --- a/src/hooking.cpp +++ b/src/hooking.cpp @@ -101,6 +101,8 @@ namespace big detour_hook_helper::add("RAU", g_pointers->m_received_array_update); + detour_hook_helper::add("RPI", g_pointers->m_receive_pickup); + g_hooking = this; } diff --git a/src/hooking.hpp b/src/hooking.hpp index 2c9c1af7..9d2dabd4 100644 --- a/src/hooking.hpp +++ b/src/hooking.hpp @@ -145,6 +145,8 @@ namespace big static void* infinite_train_crash(void* carriage); static bool received_array_update(rage::netArrayHandlerBase* array, CNetGamePlayer* sender, rage::datBitBuffer* buffer, int size, std::int16_t cycle); + + static bool receive_pickup(rage::netObject* netobject, void* unk, CPed* ped); }; class minhook_keepalive diff --git a/src/hooks/protections/receive_pickup.cpp b/src/hooks/protections/receive_pickup.cpp new file mode 100644 index 00000000..beef9808 --- /dev/null +++ b/src/hooks/protections/receive_pickup.cpp @@ -0,0 +1,15 @@ +#include "hooking.hpp" + +namespace big +{ + bool hooks::receive_pickup(rage::netObject* object, void* unk, CPed* ped) + { + if (g.protections.receive_pickup) + { + g_notification_service->push_error("PROTECTIONS"_T.data(), "Blocked pickup"); + return false; + } + + return g_hooking->get_original()(object, unk, ped); + } +} \ No newline at end of file diff --git a/src/pointers.cpp b/src/pointers.cpp index 3e394e93..00b3f823 100644 --- a/src/pointers.cpp +++ b/src/pointers.cpp @@ -812,6 +812,12 @@ namespace big m_received_array_update = ptr.as(); }); + // Receive Pickup + main_batch.add("RPI", "49 8B 80 ? ? ? ? 48 85 C0 74 0C F6 80 ? ? ? ? ? 75 03 32 C0 C3", [this](memory::handle ptr) + { + m_receive_pickup = ptr.as(); + }); + auto mem_region = memory::module("GTA5.exe"); if (!main_batch.run(mem_region)) { diff --git a/src/pointers.hpp b/src/pointers.hpp index df1db458..f6f653bc 100644 --- a/src/pointers.hpp +++ b/src/pointers.hpp @@ -237,6 +237,8 @@ namespace big functions::get_entity_attached_to m_get_entity_attached_to; PVOID m_received_array_update; + + PVOID m_receive_pickup{}; }; inline pointers* g_pointers{}; diff --git a/src/views/settings/view_protection_settings.cpp b/src/views/settings/view_protection_settings.cpp index 102b3aac..a8e3b9d1 100644 --- a/src/views/settings/view_protection_settings.cpp +++ b/src/views/settings/view_protection_settings.cpp @@ -45,6 +45,9 @@ namespace big ImGui::Checkbox("LESSEN_BREAKUP_KICK"_T.data(), &g.protections.lessen_breakups); if (ImGui::IsItemHovered()) ImGui::SetTooltip("LESSEN_BREAKUP_KICK_DESCRIPTION"_T.data()); + ImGui::Checkbox("Receive Pickup", &g.protections.receive_pickup); + if (ImGui::IsItemHovered()) + ImGui::SetTooltip("This prevents any pickup from the ground such as unwanted money drops.\nAttention: Normal pickups are also no longer possible."); ImGui::EndGroup(); }