Allow Trusted Players & Friends to Request Control (#3047)

This commit is contained in:
R.K 2024-05-06 11:15:53 -07:00 committed by GitHub
parent d9576584f5
commit d75bebd386
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -533,6 +533,13 @@ namespace big
|| personal_vehicle == veh //Or we're in our personal vehicle. || personal_vehicle == veh //Or we're in our personal vehicle.
|| self::spawned_vehicles.contains(net_id)) // Or it's a vehicle we spawned. || 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. 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. g_pointers->m_gta.m_send_event_ack(event_manager, source_player, target_player, event_index, event_handled_bitset); // Tell them to get bent.