feat: Added Infinite Vehicle Ammo (#3003)

This commit is contained in:
R.K 2024-04-30 11:52:49 -07:00 committed by GitHub
parent 806e1b8fdf
commit 7408350af3
3 changed files with 43 additions and 1 deletions

View File

@ -0,0 +1,40 @@
#include "backend/looped_command.hpp"
#include "natives.hpp"
namespace big
{
class infinite_veh_ammo : looped_command
{
using looped_command::looped_command;
virtual void on_tick() override
{
if (self::veh && VEHICLE::DOES_VEHICLE_HAVE_WEAPONS(self::veh))
{
for (int i = 0; i < 3; i++)
{
VEHICLE::SET_VEHICLE_WEAPON_RESTRICTED_AMMO(self::veh, i, -1);
}
VEHICLE::SET_VEHICLE_BOMB_AMMO(self::veh, -1);
VEHICLE::SET_VEHICLE_COUNTERMEASURE_AMMO(self::veh, -1);
}
}
virtual void on_disable() override
{
if (self::veh && VEHICLE::DOES_VEHICLE_HAVE_WEAPONS(self::veh))
{
for (int i = 0; i < 3; i++)
{
VEHICLE::SET_VEHICLE_WEAPON_RESTRICTED_AMMO(self::veh, i, 20);
}
VEHICLE::SET_VEHICLE_BOMB_AMMO(self::veh, 20);
VEHICLE::SET_VEHICLE_COUNTERMEASURE_AMMO(self::veh, 20);
}
}
};
infinite_veh_ammo g_infinite_veh_ammo("infinitevehammo", "VEHICLE_INFINITE_AMMO", "VEHICLE_INFINITE_AMMO_DESC", g.vehicle.infinite_veh_ammo);
}

View File

@ -753,6 +753,7 @@ namespace big
bool drive_on_water = false;
bool horn_boost = false;
bool instant_brake = false;
bool infinite_veh_ammo = false;
bool block_homing = true;
bool ls_customs = false; // don't save this to disk
bool seatbelt = false;
@ -807,7 +808,7 @@ namespace big
NLOHMANN_DEFINE_TYPE_INTRUSIVE(vehicle_ammo_special, enabled, type, explosion_tag, speed, time_between_shots, alternate_wait_time, weapon_range, rocket_time_between_shots, rocket_alternate_wait_time, rocket_lock_on_range, rocket_range, rocket_reload_time, rocket_explosion_tag, rocket_lifetime, rocket_launch_speed, rocket_time_before_homing, rocket_improve_tracking)
} vehicle_ammo_special{};
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, keep_engine_running, keep_vehicle_clean, vehinvisibility, localveh_visibility, keep_on_ground, no_collision, unlimited_weapons, siren_mute, all_vehs_in_heists, abilities, vehicle_ammo_special)
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, infinite_veh_ammo, block_homing, seatbelt, turn_signals, vehicle_jump, keep_vehicle_repaired, no_water_collision, disable_engine_auto_start, change_engine_state_immediately, keep_engine_running, keep_vehicle_clean, vehinvisibility, localveh_visibility, keep_on_ground, no_collision, unlimited_weapons, siren_mute, all_vehs_in_heists, abilities, vehicle_ammo_special)
} vehicle{};
struct weapons

View File

@ -68,6 +68,7 @@ namespace big
ImGui::BeginGroup();
components::command_checkbox<"vehgodmode">("GOD_MODE"_T.data());
components::command_checkbox<"infinitevehammo">();
components::command_checkbox<"hornboost">();
components::command_checkbox<"vehjump">();
components::command_checkbox<"invisveh">();