feat(Vehicle): invisible car (#833)
This commit is contained in:
parent
703d1ef07f
commit
86c44f38b5
30
src/backend/looped/vehicle/invisibility.cpp
Normal file
30
src/backend/looped/vehicle/invisibility.cpp
Normal 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);
|
||||
}
|
@ -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
|
||||
|
@ -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);
|
||||
|
Reference in New Issue
Block a user