Add vehicle jump (#290)

This commit is contained in:
Quentin E. / iDeath 2022-06-27 15:42:53 +02:00 committed by GitHub
parent 2c02b976bc
commit 1384bd600d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 29 additions and 0 deletions

View File

@ -66,6 +66,7 @@ namespace big
looped::vehicle_drive_on_water();
looped::vehicle_god_mode();
looped::vehicle_horn_boost();
looped::vehicle_jump();
looped::vehicle_instant_brake();
looped::vehicle_is_targetable();
looped::vehicle_rainbow_paint();

View File

@ -45,6 +45,7 @@ namespace big
static void vehicle_fly();
static void vehicle_god_mode();
static void vehicle_horn_boost();
static void vehicle_jump();
static void vehicle_instant_brake();
static void vehicle_is_targetable();
static void vehicle_ls_customs();

View File

@ -0,0 +1,23 @@
#include "backend/looped/looped.hpp"
#include "gta/enums.hpp"
#include "natives.hpp"
namespace big
{
void looped::vehicle_jump()
{
if (!g->vehicle.vehicle_jump) return;
const auto vehicle = self::veh;
if (!vehicle || !ENTITY::IS_ENTITY_A_VEHICLE(vehicle))
{
return;
}
if (PAD::IS_CONTROL_JUST_PRESSED(0, (int)ControllerInputs::INPUT_VEH_HANDBRAKE))
{
ENTITY::APPLY_FORCE_TO_ENTITY(vehicle, 1, 0.0, 0.0, 20, 0.0, 0.0, 0.0, 0, 0, 1, 1, 0, 1);
}
}
}

View File

@ -214,6 +214,7 @@ namespace big
bool drive_on_water = false;
bool god_mode = false;
bool horn_boost = false;
bool vehicle_jump = false;
bool instant_brake = false;
bool is_targetable = true;
bool ls_customs = false; // don't save this to disk
@ -490,6 +491,7 @@ namespace big
this->vehicle.driving_style_id = j["vehicle"]["driving_style"];
this->vehicle.god_mode = j["vehicle"]["god_mode"];
this->vehicle.horn_boost = j["vehicle"]["horn_boost"];
this->vehicle.vehicle_jump = j["vehicle"]["vehicle_jump"];
this->vehicle.instant_brake = j["vehicle"]["instant_brake"];
this->vehicle.is_targetable = j["vehicle"]["is_targetable"];
this->vehicle.pv_teleport_into = j["vehicle"]["pv_teleport_into"];
@ -728,6 +730,7 @@ namespace big
{ "driving_style", this->vehicle.driving_style_id },
{ "god_mode", this->vehicle.god_mode },
{ "horn_boost", this->vehicle.horn_boost },
{ "vehicle_jump", this->vehicle.vehicle_jump },
{ "instant_brake", this->vehicle.instant_brake },
{ "is_targetable", this->vehicle.is_targetable },
{ "pv_teleport_into", this->vehicle.pv_teleport_into },

View File

@ -13,6 +13,7 @@ namespace big
ImGui::Checkbox("Can Be Targeted", &g->vehicle.is_targetable);
ImGui::Checkbox("God Mode", &g->vehicle.god_mode);
ImGui::Checkbox("Horn Boost", &g->vehicle.horn_boost);
ImGui::Checkbox("Vehicle Jump", &g->vehicle.vehicle_jump);
ImGui::Checkbox("Instant Brake", &g->vehicle.instant_brake);
ImGui::Checkbox("Drive On Water", &g->vehicle.drive_on_water);