feat: Add Disable siren (#1383)

This commit is contained in:
I am Cypher 2023-06-06 01:02:49 +05:30 committed by GitHub
parent c3d1ffeb5a
commit 4389e57439
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 1 deletions

View File

@ -0,0 +1,29 @@
#include "backend/looped_command.hpp"
#include "natives.hpp"
namespace big
{
class siren_mute : looped_command
{
using looped_command::looped_command;
virtual void on_tick() override
{
if (ENTITY::DOES_ENTITY_EXIST(self::veh))
{
VEHICLE::SET_VEHICLE_HAS_MUTED_SIRENS(self::veh, true); // Enables muted siren state
}
}
virtual void on_disable() override
{
if (ENTITY::DOES_ENTITY_EXIST(self::veh))
{
VEHICLE::SET_VEHICLE_HAS_MUTED_SIRENS(self::veh, false); // Disables muted siren state
}
}
};
siren_mute g_siren_mute("mutesiren", "Mute Siren", "Disables the siren sound of Emergency vehicles",
g.vehicle.siren_mute);
}

View File

@ -644,8 +644,9 @@ namespace big
bool keep_on_ground = false;
bool no_collision = false;
bool unlimited_weapons = false;
bool siren_mute = false;
NLOHMANN_DEFINE_TYPE_INTRUSIVE(vehicle, speedo_meter, fly, rainbow_paint, speed_unit, god_mode, proof_bullet, proof_fire, proof_collision, proof_melee, proof_explosion, proof_steam, proof_water, proof_mask, auto_drive_destination, auto_drive_style, auto_drive_speed, auto_turn_signals, boost_behavior, drive_on_water, horn_boost, instant_brake, block_homing, seatbelt, turn_signals, vehicle_jump, keep_vehicle_repaired, no_water_collision, disable_engine_auto_start, change_engine_state_immediately, vehinvisibility, localveh_visibility, localped_visibility, keep_on_ground, no_collision, unlimited_weapons)
NLOHMANN_DEFINE_TYPE_INTRUSIVE(vehicle, speedo_meter, fly, rainbow_paint, speed_unit, god_mode, proof_bullet, proof_fire, proof_collision, proof_melee, proof_explosion, proof_steam, proof_water, proof_mask, auto_drive_destination, auto_drive_style, auto_drive_speed, auto_turn_signals, boost_behavior, drive_on_water, horn_boost, instant_brake, block_homing, seatbelt, turn_signals, vehicle_jump, keep_vehicle_repaired, no_water_collision, disable_engine_auto_start, change_engine_state_immediately, vehinvisibility, localveh_visibility, localped_visibility, keep_on_ground, no_collision, unlimited_weapons, siren_mute)
} vehicle{};
struct weapons

View File

@ -93,6 +93,8 @@ namespace big
components::command_checkbox<"driveunder">();
components::command_checkbox<"keeponground">();
components::command_checkbox<"mutesiren">();
ImGui::EndGroup();
}
ImGui::Separator();