From d75bebd3862a961924585487249e079f00567324 Mon Sep 17 00:00:00 2001 From: "R.K" Date: Mon, 6 May 2024 11:15:53 -0700 Subject: [PATCH] Allow Trusted Players & Friends to Request Control (#3047) --- src/hooks/protections/received_event.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/hooks/protections/received_event.cpp b/src/hooks/protections/received_event.cpp index 7a3c812b..679942ba 100644 --- a/src/hooks/protections/received_event.cpp +++ b/src/hooks/protections/received_event.cpp @@ -533,6 +533,13 @@ namespace big || personal_vehicle == veh //Or we're in our personal vehicle. || self::spawned_vehicles.contains(net_id)) // Or it's a vehicle we spawned. { + auto plyr = g_player_service->get_by_id(source_player->m_player_id); + // Let trusted friends and players request control (e.g., they want to hook us to their tow-truck or something) + if (plyr && (plyr->is_trusted || (g.session.trust_friends && plyr->is_friend()))) + { + return; + } + if (g_local_player->m_vehicle->m_driver != source_player->m_player_info->m_ped) //This will block hackers who are not in the car but still want control. { g_pointers->m_gta.m_send_event_ack(event_manager, source_player, target_player, event_index, event_handled_bitset); // Tell them to get bent.