feat(Vehicle): invisible car (#833)

This commit is contained in:
TheGreenBandit 2023-01-08 15:27:23 -05:00 committed by GitHub
parent 703d1ef07f
commit 86c44f38b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 41 additions and 2 deletions

View File

@ -0,0 +1,30 @@
#include "backend/looped/looped.hpp"
#include "fiber_pool.hpp"
#include "natives.hpp"
#include "backend/looped_command.hpp"
namespace big
{
class vehinvisibility : looped_command
{
using looped_command::looped_command;
virtual void on_tick() override
{
ENTITY::SET_ENTITY_VISIBLE(self::veh, false, 0);
if (g.vehicle.localveh_visibility)
NETWORK::SET_ENTITY_LOCALLY_VISIBLE(self::veh);
if (g.vehicle.localped_visibility && g.vehicle.vehinvisibility)
ENTITY::SET_ENTITY_VISIBLE(self::ped, true, 0);
}
virtual void on_disable() override
{
ENTITY::SET_ENTITY_VISIBLE(self::veh, true, 0);
}
};
vehinvisibility g_vehinvisibility("invisveh", "Vehicle Invisiblity", "Makes your car invisible", g.vehicle.vehinvisibility);
bool_command g_localveh_visibility("localinvisveh", "Visible Locally", "Makes your car visible to yourself, other players will still not be able to see it", g.vehicle.localveh_visibility);
bool_command g_localped_visibility("localinvisped", "Self Visible", "Makes yourself visible driving the vehicle to others and yourself,\n car will still be invisible but you can be", g.vehicle.localped_visibility);
}

View File

@ -504,13 +504,17 @@ namespace big
bool no_water_collision = false;
bool disable_engine_auto_start = false;
bool change_engine_state_immediately = false;
bool vehinvisibility = false;
bool localveh_visibility = false;
bool localped_visibility = true;
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_vehicle_repaired, no_water_collision, disable_engine_auto_start, change_engine_state_immediately,
vehinvisibility, localveh_visibility, localped_visibility)
} vehicle{};
struct weapons

View File

@ -71,6 +71,12 @@ namespace big
ImGui::Checkbox("God Mode", &g.vehicle.god_mode);
components::command_checkbox<"hornboost">();
components::command_checkbox<"vehjump">();
components::command_checkbox<"invisveh">();
if (g.vehicle.vehinvisibility)
{
components::command_checkbox<"localinvisveh">();
components::command_checkbox<"localinvisped">();
}
ImGui::EndGroup();
ImGui::SameLine();
@ -175,7 +181,6 @@ namespace big
}
ImGui::Separator();
components::sub_title("Speedo Meter");
{
ImGui::Checkbox("Enabled", &g.vehicle.speedo_meter.enabled);