From 257fd5495615e44d5a5bb0b24cf9a3ec2e2be5e9 Mon Sep 17 00:00:00 2001 From: Yimura Date: Wed, 26 Jan 2022 15:23:57 +0100 Subject: [PATCH] feat(ScriptEventHandler): Prevent network bail --- BigBaseV2/src/core/enums.hpp | 1 + BigBaseV2/src/core/globals.hpp | 3 +++ BigBaseV2/src/gui/window/main/tab_settings.cpp | 1 + BigBaseV2/src/hooks/script_event_handler.cpp | 5 +++++ 4 files changed, 10 insertions(+) diff --git a/BigBaseV2/src/core/enums.hpp b/BigBaseV2/src/core/enums.hpp index cf0d1a29..56ed7338 100644 --- a/BigBaseV2/src/core/enums.hpp +++ b/BigBaseV2/src/core/enums.hpp @@ -43,6 +43,7 @@ namespace big FakeDeposit = 677240627, ForceMission = 2020588206, GtaBanner = 1572255940, + NetworkBail = 1228916411, PersonalVehicleDestroyed = 802133775, RemoteOffradar = -391633760, RotateCam = 801199324, diff --git a/BigBaseV2/src/core/globals.hpp b/BigBaseV2/src/core/globals.hpp index bff8050b..c82ee645 100644 --- a/BigBaseV2/src/core/globals.hpp +++ b/BigBaseV2/src/core/globals.hpp @@ -36,6 +36,7 @@ struct globals { bool force_mission = true; bool force_teleport = true; bool gta_banner = true; + bool network_bail = true; bool personal_vehicle_destroyed = true; bool remote_off_radar = true; bool send_to_cutscene = true; @@ -158,6 +159,7 @@ struct globals { this->protections.script_events.force_mission = j["protections"]["script_events"]["force_mission"]; this->protections.script_events.force_teleport = j["protections"]["script_events"]["force_teleport"]; this->protections.script_events.gta_banner = j["protections"]["script_events"]["gta_banner"]; + this->protections.script_events.network_bail = j["protections"]["script_events"]["network_bail"]; this->protections.script_events.personal_vehicle_destroyed = j["protections"]["script_events"]["personal_vehicle_destroyed"]; this->protections.script_events.remote_off_radar = j["protections"]["script_events"]["remote_off_radar"]; this->protections.script_events.send_to_cutscene = j["protections"]["script_events"]["send_to_cutscene"]; @@ -233,6 +235,7 @@ struct globals { { "force_mission", this->protections.script_events.force_mission }, { "force_teleport", this->protections.script_events.force_teleport }, { "gta_banner", this->protections.script_events.gta_banner }, + { "network_bail", this->protections.script_events.network_bail }, { "personal_vehicle_destroyed", this->protections.script_events.personal_vehicle_destroyed }, { "remote_off_radar", this->protections.script_events.remote_off_radar }, { "send_to_cutscene", this->protections.script_events.send_to_cutscene }, diff --git a/BigBaseV2/src/gui/window/main/tab_settings.cpp b/BigBaseV2/src/gui/window/main/tab_settings.cpp index 231a0177..0eff8c34 100644 --- a/BigBaseV2/src/gui/window/main/tab_settings.cpp +++ b/BigBaseV2/src/gui/window/main/tab_settings.cpp @@ -39,6 +39,7 @@ namespace big ImGui::Checkbox("Force Mission", &g.protections.script_events.force_mission); ImGui::Checkbox("Force Teleport", &g.protections.script_events.force_teleport); ImGui::Checkbox("GTA Banner", &g.protections.script_events.gta_banner); + ImGui::Checkbox("Network Bail", &g.protections.script_events.network_bail); ImGui::Checkbox("Destroy Personal Vehicle", &g.protections.script_events.personal_vehicle_destroyed); ImGui::Checkbox("Remote Off Radar", &g.protections.script_events.remote_off_radar); ImGui::Checkbox("Send to Cutscene", &g.protections.script_events.send_to_cutscene); diff --git a/BigBaseV2/src/hooks/script_event_handler.cpp b/BigBaseV2/src/hooks/script_event_handler.cpp index 8e06e2c9..e6568e06 100644 --- a/BigBaseV2/src/hooks/script_event_handler.cpp +++ b/BigBaseV2/src/hooks/script_event_handler.cpp @@ -54,6 +54,11 @@ namespace big if (g.protections.script_events.gta_banner) strcpy(type, "GTA Banner"); + break; + case eRemoteEvent::NetworkBail: + if (g.protections.script_events.network_bail) + strcpy(type, "Network Bail"); + break; case eRemoteEvent::PersonalVehicleDestroyed: if (g.protections.script_events.personal_vehicle_destroyed)