Block traffic protection (#2688)
* fix: don't randomize components if we're cloning an existing ped * feat(protections): add traffic manipulation protection * fix(protections): add a mission check
This commit is contained in:
parent
ad1dfc71d2
commit
240ca76e3b
@ -283,8 +283,9 @@ namespace big
|
||||
bool admin_check = true;
|
||||
bool kick_rejoin = true;
|
||||
bool force_relay_connections = false;
|
||||
bool stop_traffic = true;
|
||||
|
||||
NLOHMANN_DEFINE_TYPE_INTRUSIVE(protections, script_events, rid_join, receive_pickup, admin_check, kick_rejoin, force_relay_connections)
|
||||
NLOHMANN_DEFINE_TYPE_INTRUSIVE(protections, script_events, rid_join, receive_pickup, admin_check, kick_rejoin, force_relay_connections, stop_traffic)
|
||||
} protections{};
|
||||
|
||||
struct self
|
||||
|
@ -564,6 +564,11 @@ namespace big
|
||||
g_pointers->m_gta.m_send_event_ack(event_manager, source_player, target_player, event_index, event_handled_bitset);
|
||||
return;
|
||||
}
|
||||
else if (type == WorldStateDataType::PopMultiplierArea && g.protections.stop_traffic && !NETWORK::NETWORK_IS_ACTIVITY_SESSION())
|
||||
{
|
||||
g_pointers->m_gta.m_send_event_ack(event_manager, source_player, target_player, event_index, event_handled_bitset);
|
||||
return;
|
||||
}
|
||||
|
||||
buffer->Seek(0);
|
||||
break;
|
||||
|
@ -56,6 +56,7 @@ namespace big
|
||||
ImGui::SetTooltip("VIEW_PROTECTION_SETTINGS_RECEIVE_PICKUP_TOOLTIP"_T.data());
|
||||
ImGui::Checkbox("ADMIN_CHECK"_T.data(), &g.protections.admin_check);
|
||||
ImGui::Checkbox("VIEW_PROTECTION_SETTINGS_KICK_REJOIN"_T.data(), &g.protections.kick_rejoin);
|
||||
ImGui::Checkbox("BLOCK_TRAFFIC_MANIPULATION"_T.data(), &g.protections.stop_traffic);
|
||||
components::command_checkbox<"forcerelays">();
|
||||
ImGui::EndGroup();
|
||||
|
||||
|
Reference in New Issue
Block a user