feat(Mobile): Added teleport into personal vehicle
This commit is contained in:
parent
90bce8256d
commit
6e9fbcdf09
@ -95,6 +95,7 @@ struct globals {
|
|||||||
bool god_mode = false;
|
bool god_mode = false;
|
||||||
bool horn_boost = false;
|
bool horn_boost = false;
|
||||||
bool ls_customs = false; // don't save this to disk
|
bool ls_customs = false; // don't save this to disk
|
||||||
|
bool pv_teleport_into = false;
|
||||||
speedo_meter speedo_meter{};
|
speedo_meter speedo_meter{};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -177,6 +178,7 @@ struct globals {
|
|||||||
|
|
||||||
this->vehicle.god_mode = j["vehicle"]["god_mode"];
|
this->vehicle.god_mode = j["vehicle"]["god_mode"];
|
||||||
this->vehicle.horn_boost = j["vehicle"]["horn_boost"];
|
this->vehicle.horn_boost = j["vehicle"]["horn_boost"];
|
||||||
|
this->vehicle.pv_teleport_into = j["vehicle"]["pv_teleport_into"];
|
||||||
|
|
||||||
this->vehicle.speedo_meter.type = (SpeedoMeter)j["vehicle"]["speedo_meter"]["type"];
|
this->vehicle.speedo_meter.type = (SpeedoMeter)j["vehicle"]["speedo_meter"]["type"];
|
||||||
this->vehicle.speedo_meter.left_side = j["vehicle"]["speedo_meter"]["left_side"];
|
this->vehicle.speedo_meter.left_side = j["vehicle"]["speedo_meter"]["left_side"];
|
||||||
@ -270,6 +272,7 @@ struct globals {
|
|||||||
"vehicle", {
|
"vehicle", {
|
||||||
{ "god_mode", this->vehicle.god_mode },
|
{ "god_mode", this->vehicle.god_mode },
|
||||||
{ "horn_boost", this->vehicle.horn_boost },
|
{ "horn_boost", this->vehicle.horn_boost },
|
||||||
|
{ "pv_teleport_into", this->vehicle.pv_teleport_into },
|
||||||
{
|
{
|
||||||
"speedo_meter", {
|
"speedo_meter", {
|
||||||
{ "type", (int)this->vehicle.speedo_meter.type },
|
{ "type", (int)this->vehicle.speedo_meter.type },
|
||||||
|
@ -86,13 +86,14 @@ namespace big
|
|||||||
|
|
||||||
ImGui::BeginGroup();
|
ImGui::BeginGroup();
|
||||||
|
|
||||||
if (ImGui::Button("Reload Vehicles"))
|
if (ImGui::Button("Load/Reload Personal Vehicles"))
|
||||||
{
|
{
|
||||||
QUEUE_JOB_BEGIN_CLAUSE()
|
QUEUE_JOB_BEGIN_CLAUSE()
|
||||||
{
|
{
|
||||||
g_mobile_service->register_vehicles();
|
g_mobile_service->register_vehicles();
|
||||||
}QUEUE_JOB_END_CLAUSE
|
}QUEUE_JOB_END_CLAUSE
|
||||||
}
|
}
|
||||||
|
ImGui::Checkbox("Spawn in Vehicle", &g.vehicle.pv_teleport_into);
|
||||||
|
|
||||||
ImGui::TreePop();
|
ImGui::TreePop();
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,14 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "core/enums.hpp"
|
#include "core/enums.hpp"
|
||||||
|
#include "globals.hpp"
|
||||||
#include "gta_util.hpp"
|
#include "gta_util.hpp"
|
||||||
#include "misc.hpp"
|
#include "misc.hpp"
|
||||||
#include "natives.hpp"
|
#include "natives.hpp"
|
||||||
|
#include "notify.hpp"
|
||||||
#include "script.hpp"
|
#include "script.hpp"
|
||||||
#include "script_global.hpp"
|
#include "script_global.hpp"
|
||||||
#include "script_local.hpp"
|
#include "script_local.hpp"
|
||||||
|
#include "vehicle.hpp"
|
||||||
|
|
||||||
namespace big::mobile
|
namespace big::mobile
|
||||||
{
|
{
|
||||||
@ -83,6 +86,9 @@ namespace big::mobile
|
|||||||
{
|
{
|
||||||
inline void summon_vehicle_by_index(int veh_idx)
|
inline void summon_vehicle_by_index(int veh_idx)
|
||||||
{
|
{
|
||||||
|
if (*mechanic_global.at(958).as<int*>() != -1)
|
||||||
|
return notify::display_help_text("Mechanic is not ready to deliver a vehicle right now.");
|
||||||
|
|
||||||
// despawn current veh
|
// despawn current veh
|
||||||
util::despawn_current_personal_vehicle();
|
util::despawn_current_personal_vehicle();
|
||||||
mors_mutual::fix_index(veh_idx);
|
mors_mutual::fix_index(veh_idx);
|
||||||
@ -98,6 +104,12 @@ namespace big::mobile
|
|||||||
GtaThread* freemode_thread = gta_util::find_script_thread(RAGE_JOAAT("freemode"));
|
GtaThread* freemode_thread = gta_util::find_script_thread(RAGE_JOAAT("freemode"));
|
||||||
if (freemode_thread)
|
if (freemode_thread)
|
||||||
*script_local(freemode_thread, 17437).at(176).as<int*>() = 0; // spawn vehicle instantly
|
*script_local(freemode_thread, 17437).at(176).as<int*>() = 0; // spawn vehicle instantly
|
||||||
|
|
||||||
|
// blocking call till vehicle is delivered
|
||||||
|
notify::busy_spinner("Delivering vehicle...", mechanic_global.at(958).as<int*>(), -1);
|
||||||
|
|
||||||
|
if (g.vehicle.pv_teleport_into)
|
||||||
|
vehicle::bring(globals::get_personal_vehicle(), ENTITY::GET_ENTITY_COORDS(PLAYER::PLAYER_PED_ID(), true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user