feat(Vehicle): Added horn boost
This commit is contained in:
parent
f8784c3255
commit
367323b930
@ -31,6 +31,7 @@ namespace big
|
|||||||
|
|
||||||
QUEUE_JOB_BEGIN_CLAUSE()
|
QUEUE_JOB_BEGIN_CLAUSE()
|
||||||
{
|
{
|
||||||
|
looped::vehicle_horn_boost();
|
||||||
looped::vehicle_speedo_meter();
|
looped::vehicle_speedo_meter();
|
||||||
}QUEUE_JOB_END_CLAUSE
|
}QUEUE_JOB_END_CLAUSE
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,7 @@ namespace big
|
|||||||
static void weapons_steal_vehicle_gun();
|
static void weapons_steal_vehicle_gun();
|
||||||
static void weapons_vehicle_gun();
|
static void weapons_vehicle_gun();
|
||||||
|
|
||||||
|
static void vehicle_horn_boost();
|
||||||
static void vehicle_speedo_meter();
|
static void vehicle_speedo_meter();
|
||||||
};
|
};
|
||||||
}
|
}
|
32
BigBaseV2/src/backend/looped/vehicle/horn_boost.cpp
Normal file
32
BigBaseV2/src/backend/looped/vehicle/horn_boost.cpp
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
#include "backend/looped/looped.hpp"
|
||||||
|
#include "gta/enums.hpp"
|
||||||
|
#include "natives.hpp"
|
||||||
|
#include "util/math.hpp"
|
||||||
|
|
||||||
|
namespace big
|
||||||
|
{
|
||||||
|
void looped::vehicle_horn_boost()
|
||||||
|
{
|
||||||
|
if (!g.vehicle.horn_boost) return;
|
||||||
|
|
||||||
|
if (PAD::IS_DISABLED_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_VEH_HORN))
|
||||||
|
{
|
||||||
|
Vehicle veh = PED::GET_VEHICLE_PED_IS_IN(PLAYER::PLAYER_PED_ID(), false);
|
||||||
|
|
||||||
|
if (veh == 0) return;
|
||||||
|
|
||||||
|
Vector3 rot = ENTITY::GET_ENTITY_ROTATION(veh, 2);
|
||||||
|
float pitch = math::deg_to_rad(rot.x); // vertical
|
||||||
|
//float roll = rot.y;
|
||||||
|
float yaw = math::deg_to_rad(rot.z + 90); // horizontal
|
||||||
|
|
||||||
|
Vector3 velocity;
|
||||||
|
const float dist = 50.f;
|
||||||
|
velocity.x = dist * cos(pitch) * cos(yaw);
|
||||||
|
velocity.y = dist * sin(yaw) * cos(pitch);
|
||||||
|
velocity.z = dist * sin(pitch);
|
||||||
|
|
||||||
|
ENTITY::SET_ENTITY_VELOCITY(veh, velocity.x, velocity.y, velocity.z);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -15,6 +15,7 @@ struct globals {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct vehicle {
|
struct vehicle {
|
||||||
|
bool horn_boost = false;
|
||||||
SpeedoMeter speedo_meter = SpeedoMeter::DISABLED;
|
SpeedoMeter speedo_meter = SpeedoMeter::DISABLED;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -31,6 +32,7 @@ struct globals {
|
|||||||
{
|
{
|
||||||
this->self.godmode = j["self"]["godmode"];
|
this->self.godmode = j["self"]["godmode"];
|
||||||
|
|
||||||
|
this->vehicle.horn_boost = j["vehicle"]["horn_boost"];
|
||||||
this->vehicle.speedo_meter = (SpeedoMeter)j["vehicle"]["speedo_meter"];
|
this->vehicle.speedo_meter = (SpeedoMeter)j["vehicle"]["speedo_meter"];
|
||||||
|
|
||||||
this->weapons.custom_weapon = (CustomWeapon)j["weapons"]["custom_weapon"];
|
this->weapons.custom_weapon = (CustomWeapon)j["weapons"]["custom_weapon"];
|
||||||
@ -41,23 +43,18 @@ struct globals {
|
|||||||
return nlohmann::json{
|
return nlohmann::json{
|
||||||
{
|
{
|
||||||
"self", {
|
"self", {
|
||||||
{
|
{ "godmode", this->self.godmode }
|
||||||
"godmode", this->self.godmode
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"vehicle", {
|
"vehicle", {
|
||||||
{
|
{ "horn_boost", this->vehicle.horn_boost },
|
||||||
"speedo_meter", (int)this->vehicle.speedo_meter
|
{ "speedo_meter", (int)this->vehicle.speedo_meter }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"weapons", {
|
"weapons", {
|
||||||
{
|
{ "custom_weapon", (int)this->weapons.custom_weapon }
|
||||||
"custom_weapon", (int)this->weapons.custom_weapon
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -32,6 +32,8 @@ namespace big
|
|||||||
ImGui::TreePop();
|
ImGui::TreePop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ImGui::Checkbox("Horn Boost", &g.vehicle.horn_boost);
|
||||||
|
|
||||||
ImGui::EndTabItem();
|
ImGui::EndTabItem();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user