feat: Add Disable siren (#1383)
This commit is contained in:
parent
c3d1ffeb5a
commit
4389e57439
29
src/backend/looped/vehicle/disable_siren.cpp
Normal file
29
src/backend/looped/vehicle/disable_siren.cpp
Normal 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);
|
||||||
|
}
|
@ -644,8 +644,9 @@ namespace big
|
|||||||
bool keep_on_ground = false;
|
bool keep_on_ground = false;
|
||||||
bool no_collision = false;
|
bool no_collision = false;
|
||||||
bool unlimited_weapons = 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{};
|
} vehicle{};
|
||||||
|
|
||||||
struct weapons
|
struct weapons
|
||||||
|
@ -93,6 +93,8 @@ namespace big
|
|||||||
components::command_checkbox<"driveunder">();
|
components::command_checkbox<"driveunder">();
|
||||||
components::command_checkbox<"keeponground">();
|
components::command_checkbox<"keeponground">();
|
||||||
|
|
||||||
|
components::command_checkbox<"mutesiren">();
|
||||||
|
|
||||||
ImGui::EndGroup();
|
ImGui::EndGroup();
|
||||||
}
|
}
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
|
Reference in New Issue
Block a user