Added variables for common self natives
This commit is contained in:
parent
07bdd6a927
commit
0832ae4603
@ -10,6 +10,7 @@ namespace big
|
|||||||
void backend::loop()
|
void backend::loop()
|
||||||
{
|
{
|
||||||
g->attempt_save();
|
g->attempt_save();
|
||||||
|
looped::system_self_globals();
|
||||||
looped::system_update_pointers();
|
looped::system_update_pointers();
|
||||||
|
|
||||||
if (g_local_player != nullptr && !api::util::signed_in())
|
if (g_local_player != nullptr && !api::util::signed_in())
|
||||||
|
@ -32,6 +32,7 @@ namespace big
|
|||||||
|
|
||||||
static void session_local_time();
|
static void session_local_time();
|
||||||
|
|
||||||
|
static void system_self_globals();
|
||||||
static void system_update_pointers();
|
static void system_update_pointers();
|
||||||
|
|
||||||
static void vehicle_despawn_bypass();
|
static void vehicle_despawn_bypass();
|
||||||
|
@ -36,7 +36,6 @@ namespace big
|
|||||||
for (int control : controls)
|
for (int control : controls)
|
||||||
PAD::DISABLE_CONTROL_ACTION(0, control, true);
|
PAD::DISABLE_CONTROL_ACTION(0, control, true);
|
||||||
|
|
||||||
Vector3 cur_pos = ENTITY::GET_ENTITY_COORDS(ent, true);
|
|
||||||
Vector3 vel = { 0.f, 0.f, 0.f };
|
Vector3 vel = { 0.f, 0.f, 0.f };
|
||||||
float heading = 0.f;
|
float heading = 0.f;
|
||||||
|
|
||||||
@ -77,8 +76,8 @@ namespace big
|
|||||||
ENTITY::FREEZE_ENTITY_POSITION(ent, false);
|
ENTITY::FREEZE_ENTITY_POSITION(ent, false);
|
||||||
|
|
||||||
Vector3 offset = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(ent, vel.x, vel.y, 0.f);
|
Vector3 offset = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(ent, vel.x, vel.y, 0.f);
|
||||||
vel.x = offset.x - cur_pos.x;
|
vel.x = offset.x - self::pos.x;
|
||||||
vel.y = offset.y - cur_pos.y;
|
vel.y = offset.y - self::pos.y;
|
||||||
|
|
||||||
ENTITY::SET_ENTITY_VELOCITY(ent, vel.x * mult, vel.y * mult, vel.z * mult);
|
ENTITY::SET_ENTITY_VELOCITY(ent, vel.x * mult, vel.y * mult, vel.z * mult);
|
||||||
}
|
}
|
||||||
|
@ -14,27 +14,24 @@ namespace big
|
|||||||
{
|
{
|
||||||
if (run_speed < run_cap) run_speed += .5f;
|
if (run_speed < run_cap) run_speed += .5f;
|
||||||
|
|
||||||
Ped player = PLAYER::PLAYER_PED_ID();
|
|
||||||
|
|
||||||
Vector3 pos = ENTITY::GET_ENTITY_COORDS(player, true);
|
|
||||||
|
|
||||||
//Vector3 rot = CAM::GET_GAMEPLAY_CAM_ROT(2);
|
//Vector3 rot = CAM::GET_GAMEPLAY_CAM_ROT(2);
|
||||||
Vector3 rot = ENTITY::GET_ENTITY_ROTATION(player, 2);
|
Vector3 rot = ENTITY::GET_ENTITY_ROTATION(self::ped, 2);
|
||||||
float yaw = math::deg_to_rad(rot.z + 90);
|
float yaw = math::deg_to_rad(rot.z + 90);
|
||||||
|
|
||||||
Vector3 offset;
|
Vector3 offset;
|
||||||
offset.x = pos.x + (run_speed * cos(yaw));
|
offset.x = self::pos.x + (run_speed * cos(yaw));
|
||||||
offset.y = pos.y + (run_speed * sin(yaw));
|
offset.y = self::pos.y + (run_speed * sin(yaw));
|
||||||
offset.z = pos.z + .2f;
|
offset.z = self::pos.z + .2f;
|
||||||
|
|
||||||
float groundZ;
|
float groundZ;
|
||||||
MISC::GET_GROUND_Z_FOR_3D_COORD(offset.x, offset.y, 1000.f, &groundZ, false, false);
|
MISC::GET_GROUND_Z_FOR_3D_COORD(offset.x, offset.y, 1000.f, &groundZ, false, false);
|
||||||
if (groundZ < pos.z)
|
if (groundZ < self::pos.z)
|
||||||
offset.z = groundZ;
|
offset.z = groundZ;
|
||||||
|
|
||||||
Vector3 vel = offset - pos;
|
Vector3 vel = offset - self::pos;
|
||||||
|
|
||||||
ENTITY::SET_ENTITY_VELOCITY(player, vel.x, vel.y, vel.z);
|
ENTITY::SET_ENTITY_VELOCITY(self::ped, vel.x, vel.y, vel.z);
|
||||||
|
|
||||||
g_local_player->m_player_info->m_run_speed = .7f;
|
g_local_player->m_player_info->m_run_speed = .7f;
|
||||||
}
|
}
|
||||||
|
16
BigBaseV2/src/backend/looped/system/self_gloabls.cpp
Normal file
16
BigBaseV2/src/backend/looped/system/self_gloabls.cpp
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#include "backend/looped/looped.hpp"
|
||||||
|
#include "natives.hpp"
|
||||||
|
|
||||||
|
namespace big
|
||||||
|
{
|
||||||
|
void looped::system_self_globals()
|
||||||
|
{
|
||||||
|
self::id = PLAYER::PLAYER_ID();
|
||||||
|
|
||||||
|
self::ped = PLAYER::PLAYER_PED_ID();
|
||||||
|
|
||||||
|
self::pos = ENTITY::GET_ENTITY_COORDS(self::ped, false /*Unused*/);
|
||||||
|
|
||||||
|
self::veh = PED::GET_VEHICLE_PED_IS_IN(self::ped, false);
|
||||||
|
}
|
||||||
|
}
|
@ -11,30 +11,28 @@ namespace big
|
|||||||
|
|
||||||
Player player = PLAYER::PLAYER_ID();
|
Player player = PLAYER::PLAYER_ID();
|
||||||
Ped playerPed = PLAYER::PLAYER_PED_ID();
|
Ped playerPed = PLAYER::PLAYER_PED_ID();
|
||||||
Vehicle veh = PED::GET_VEHICLE_PED_IS_IN(playerPed, 0);
|
DWORD model = ENTITY::GET_ENTITY_MODEL(self::veh);
|
||||||
DWORD model = ENTITY::GET_ENTITY_MODEL(veh);
|
|
||||||
Vector3 pos = ENTITY::GET_ENTITY_COORDS(playerPed, 0);
|
|
||||||
Hash hash = MISC::GET_HASH_KEY("prop_container_ld2");
|
Hash hash = MISC::GET_HASH_KEY("prop_container_ld2");
|
||||||
float height = 0;
|
float height = 0;
|
||||||
|
|
||||||
WATER::SET_DEEP_OCEAN_SCALER(height);
|
WATER::SET_DEEP_OCEAN_SCALER(height);
|
||||||
if ((!(VEHICLE::IS_THIS_MODEL_A_PLANE(ENTITY::GET_ENTITY_MODEL(veh)))) && WATER::GET_WATER_HEIGHT_NO_WAVES(pos.x, pos.y, pos.z, &height)) {
|
if ((!(VEHICLE::IS_THIS_MODEL_A_PLANE(ENTITY::GET_ENTITY_MODEL(self::veh)))) && WATER::GET_WATER_HEIGHT_NO_WAVES(self::pos.x, self::pos.y, self::pos.z, &height)) {
|
||||||
Object container = OBJECT::GET_CLOSEST_OBJECT_OF_TYPE(pos.x, pos.y, pos.z, 4.0, hash, 0, 0, 1);
|
Object container = OBJECT::GET_CLOSEST_OBJECT_OF_TYPE(self::pos.x, self::pos.y, self::pos.z, 4.0, hash, 0, 0, 1);
|
||||||
if (ENTITY::DOES_ENTITY_EXIST(container) && height > -50.0f) {
|
if (ENTITY::DOES_ENTITY_EXIST(container) && height > -50.0f) {
|
||||||
Vector3 pRot = ENTITY::GET_ENTITY_ROTATION(playerPed, 0);
|
Vector3 pRot = ENTITY::GET_ENTITY_ROTATION(playerPed, 0);
|
||||||
if (PED::IS_PED_IN_ANY_VEHICLE(playerPed, 1)) pRot = ENTITY::GET_ENTITY_ROTATION(veh, 0);
|
if (PED::IS_PED_IN_ANY_VEHICLE(playerPed, 1)) pRot = ENTITY::GET_ENTITY_ROTATION(self::veh, 0);
|
||||||
entity::take_control_of(container);
|
entity::take_control_of(container);
|
||||||
ENTITY::SET_ENTITY_COORDS(container, pos.x, pos.y, height - 2.5f, 0, 0, 0, 1);
|
ENTITY::SET_ENTITY_COORDS(container, self::pos.x, self::pos.y, height - 2.5f, 0, 0, 0, 1);
|
||||||
ENTITY::SET_ENTITY_ROTATION(container, 0, 0, pRot.z, 0, 1);
|
ENTITY::SET_ENTITY_ROTATION(container, 0, 0, pRot.z, 0, 1);
|
||||||
Vector3 containerCoords = ENTITY::GET_ENTITY_COORDS(container, 1);
|
Vector3 containerCoords = ENTITY::GET_ENTITY_COORDS(container, 1);
|
||||||
if (pos.z < containerCoords.z) {
|
if (self::pos.z < containerCoords.z) {
|
||||||
if (!PED::IS_PED_IN_ANY_VEHICLE(playerPed, 0)) {
|
if (!PED::IS_PED_IN_ANY_VEHICLE(playerPed, 0)) {
|
||||||
ENTITY::SET_ENTITY_COORDS(playerPed, pos.x, pos.y, containerCoords.z + 2.0f, 0, 0, 0, 1);
|
ENTITY::SET_ENTITY_COORDS(playerPed, self::pos.x, self::pos.y, containerCoords.z + 2.0f, 0, 0, 0, 1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
entity::take_control_of(veh);
|
entity::take_control_of(self::veh);
|
||||||
Vector3 vehc = ENTITY::GET_ENTITY_COORDS(veh, 1);
|
Vector3 vehc = ENTITY::GET_ENTITY_COORDS(self::veh, 1);
|
||||||
ENTITY::SET_ENTITY_COORDS(veh, vehc.x, vehc.y, containerCoords.z + 2.0f, 0, 0, 0, 1);
|
ENTITY::SET_ENTITY_COORDS(self::veh, vehc.x, vehc.y, containerCoords.z + 2.0f, 0, 0, 0, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -42,7 +40,7 @@ namespace big
|
|||||||
Hash model = hash;
|
Hash model = hash;
|
||||||
STREAMING::REQUEST_MODEL(model);
|
STREAMING::REQUEST_MODEL(model);
|
||||||
while (!STREAMING::HAS_MODEL_LOADED(model)) script::get_current()->yield(0ms);
|
while (!STREAMING::HAS_MODEL_LOADED(model)) script::get_current()->yield(0ms);
|
||||||
container = OBJECT::CREATE_OBJECT(model, pos.x, pos.y, pos.z, 1, 1, 0);
|
container = OBJECT::CREATE_OBJECT(model, self::pos.x, self::pos.y, self::pos.z, 1, 1, 0);
|
||||||
entity::take_control_of(container);
|
entity::take_control_of(container);
|
||||||
ENTITY::FREEZE_ENTITY_POSITION(container, 1);
|
ENTITY::FREEZE_ENTITY_POSITION(container, 1);
|
||||||
ENTITY::SET_ENTITY_ALPHA(container, 0, 1);
|
ENTITY::SET_ENTITY_ALPHA(container, 0, 1);
|
||||||
@ -50,7 +48,7 @@ namespace big
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Object container = OBJECT::GET_CLOSEST_OBJECT_OF_TYPE(pos.x, pos.y, pos.z, 4.0, hash, 0, 0, 1);
|
Object container = OBJECT::GET_CLOSEST_OBJECT_OF_TYPE(self::pos.x, self::pos.y, self::pos.z, 4.0, hash, 0, 0, 1);
|
||||||
if (ENTITY::DOES_ENTITY_EXIST(container)) {
|
if (ENTITY::DOES_ENTITY_EXIST(container)) {
|
||||||
entity::take_control_of(container);
|
entity::take_control_of(container);
|
||||||
ENTITY::SET_ENTITY_COORDS(container, 0, 0, -1000.0f, 0, 0, 0, 1);
|
ENTITY::SET_ENTITY_COORDS(container, 0, 0, -1000.0f, 0, 0, 0, 1);
|
||||||
|
@ -12,8 +12,7 @@ namespace big
|
|||||||
{
|
{
|
||||||
if (!g->vehicle.horn_boost) return;
|
if (!g->vehicle.horn_boost) return;
|
||||||
|
|
||||||
const Vehicle veh = PED::GET_VEHICLE_PED_IS_IN(PLAYER::PLAYER_PED_ID(), false);
|
if (self::veh == 0)
|
||||||
if (veh == 0)
|
|
||||||
{
|
{
|
||||||
hornBoostSpeed = hornBoostSpeedDefault;
|
hornBoostSpeed = hornBoostSpeedDefault;
|
||||||
|
|
||||||
@ -21,15 +20,15 @@ namespace big
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (PAD::IS_CONTROL_JUST_PRESSED(0, (int)ControllerInputs::INPUT_VEH_HORN))
|
if (PAD::IS_CONTROL_JUST_PRESSED(0, (int)ControllerInputs::INPUT_VEH_HORN))
|
||||||
hornBoostSpeed = ENTITY::GET_ENTITY_SPEED(veh);
|
hornBoostSpeed = ENTITY::GET_ENTITY_SPEED(self::veh);
|
||||||
|
|
||||||
if (PAD::IS_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_VEH_HORN))
|
if (PAD::IS_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_VEH_HORN))
|
||||||
{
|
{
|
||||||
if (hornBoostSpeed < hostBoostSpeedMax) hornBoostSpeed++;
|
if (hornBoostSpeed < hostBoostSpeedMax) hornBoostSpeed++;
|
||||||
|
|
||||||
const auto velocity =
|
const auto velocity =
|
||||||
ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(veh, 0.f, hornBoostSpeed, 0.f) - ENTITY::GET_ENTITY_COORDS(veh, true);
|
ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(self::veh, 0.f, hornBoostSpeed, 0.f) - ENTITY::GET_ENTITY_COORDS(self::veh, true);
|
||||||
ENTITY::SET_ENTITY_VELOCITY(veh, velocity.x, velocity.y, velocity.z);
|
ENTITY::SET_ENTITY_VELOCITY(self::veh, velocity.x, velocity.y, velocity.z);
|
||||||
}
|
}
|
||||||
else if (PAD::IS_CONTROL_JUST_RELEASED(0, (int)ControllerInputs::INPUT_VEH_HORN))
|
else if (PAD::IS_CONTROL_JUST_RELEASED(0, (int)ControllerInputs::INPUT_VEH_HORN))
|
||||||
hornBoostSpeed = hornBoostSpeedDefault;
|
hornBoostSpeed = hornBoostSpeedDefault;
|
||||||
|
@ -9,13 +9,12 @@ namespace big
|
|||||||
{
|
{
|
||||||
if (!g->vehicle.instant_brake) return;
|
if (!g->vehicle.instant_brake) return;
|
||||||
|
|
||||||
const Vehicle veh = PED::GET_VEHICLE_PED_IS_IN(PLAYER::PLAYER_PED_ID(), false);
|
if (self::veh == 0 || ENTITY::GET_ENTITY_SPEED_VECTOR(self::veh, true).y < 1.f)
|
||||||
if (veh == 0 || ENTITY::GET_ENTITY_SPEED_VECTOR(veh, true).y < 1.f)
|
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PAD::IS_CONTROL_PRESSED(0, 33))
|
if (PAD::IS_CONTROL_PRESSED(0, 33))
|
||||||
VEHICLE::SET_VEHICLE_FORWARD_SPEED(veh, 0);
|
VEHICLE::SET_VEHICLE_FORWARD_SPEED(self::veh, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,9 +5,8 @@ namespace big
|
|||||||
{
|
{
|
||||||
void looped::vehicle_rainbow_paint()
|
void looped::vehicle_rainbow_paint()
|
||||||
{
|
{
|
||||||
const Vehicle veh = PED::GET_VEHICLE_PED_IS_IN(PLAYER::PLAYER_PED_ID(), false);
|
|
||||||
|
|
||||||
if (veh && g->vehicle.rainbow_paint)
|
if (self::veh && g->vehicle.rainbow_paint)
|
||||||
{
|
{
|
||||||
if (g->vehicle.rainbow_paint == 1)
|
if (g->vehicle.rainbow_paint == 1)
|
||||||
{
|
{
|
||||||
@ -20,8 +19,8 @@ namespace big
|
|||||||
g->rgb.fade = false;
|
g->rgb.fade = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
VEHICLE::SET_VEHICLE_CUSTOM_PRIMARY_COLOUR(veh, g->rgb.r, g->rgb.g, g->rgb.b);
|
VEHICLE::SET_VEHICLE_CUSTOM_PRIMARY_COLOUR(self::veh, g->rgb.r, g->rgb.g, g->rgb.b);
|
||||||
VEHICLE::SET_VEHICLE_CUSTOM_PRIMARY_COLOUR(veh, g->rgb.r, g->rgb.g, g->rgb.b);
|
VEHICLE::SET_VEHICLE_CUSTOM_PRIMARY_COLOUR(self::veh, g->rgb.r, g->rgb.g, g->rgb.b);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -10,12 +10,10 @@ namespace big
|
|||||||
|
|
||||||
if (speedo_type == SpeedoMeter::DISABLED || HUD::IS_PAUSE_MENU_ACTIVE() || HUD::IS_WARNING_MESSAGE_ACTIVE() || CAM::IS_SCREEN_FADED_OUT() || CAM::IS_SCREEN_FADING_OUT() || CAM::IS_SCREEN_FADING_IN()) return;
|
if (speedo_type == SpeedoMeter::DISABLED || HUD::IS_PAUSE_MENU_ACTIVE() || HUD::IS_WARNING_MESSAGE_ACTIVE() || CAM::IS_SCREEN_FADED_OUT() || CAM::IS_SCREEN_FADING_OUT() || CAM::IS_SCREEN_FADING_IN()) return;
|
||||||
|
|
||||||
Vehicle veh = PED::GET_VEHICLE_PED_IS_IN(PLAYER::PLAYER_PED_ID(), false);
|
if (self::veh == 0) return;
|
||||||
|
|
||||||
if (veh == 0) return;
|
|
||||||
|
|
||||||
char speed_type[16], speed[16];
|
char speed_type[16], speed[16];
|
||||||
float veh_speed = ENTITY::GET_ENTITY_SPEED(veh);
|
float veh_speed = ENTITY::GET_ENTITY_SPEED(self::veh);
|
||||||
switch (speedo_type)
|
switch (speedo_type)
|
||||||
{
|
{
|
||||||
case SpeedoMeter::KMH:
|
case SpeedoMeter::KMH:
|
||||||
|
@ -31,9 +31,8 @@ namespace big
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Vector3 player = ENTITY::GET_ENTITY_COORDS(PLAYER::PLAYER_PED_ID(), true);
|
|
||||||
Vector3 entLoc = ENTITY::GET_ENTITY_COORDS(entity, true);
|
Vector3 entLoc = ENTITY::GET_ENTITY_COORDS(entity, true);
|
||||||
double dist = math::distance_between_vectors(player, entLoc);
|
double dist = math::distance_between_vectors(self::pos, entLoc);
|
||||||
|
|
||||||
if (dist > 500)
|
if (dist > 500)
|
||||||
{
|
{
|
||||||
|
@ -13,7 +13,6 @@ namespace big
|
|||||||
|
|
||||||
if (bVehicleGun)
|
if (bVehicleGun)
|
||||||
{
|
{
|
||||||
Ped player = PLAYER::PLAYER_PED_ID();
|
|
||||||
|
|
||||||
if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 25))
|
if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 25))
|
||||||
{
|
{
|
||||||
@ -23,7 +22,7 @@ namespace big
|
|||||||
|
|
||||||
if (PAD::IS_DISABLED_CONTROL_JUST_RELEASED(0, 24))
|
if (PAD::IS_DISABLED_CONTROL_JUST_RELEASED(0, 24))
|
||||||
{
|
{
|
||||||
Vector3 location = ENTITY::GET_ENTITY_COORDS(player, true);
|
Vector3 location = self::pos;
|
||||||
|
|
||||||
Vector3 rot = CAM::GET_GAMEPLAY_CAM_ROT(2);
|
Vector3 rot = CAM::GET_GAMEPLAY_CAM_ROT(2);
|
||||||
float pitch = math::deg_to_rad(rot.x); // vertical
|
float pitch = math::deg_to_rad(rot.x); // vertical
|
||||||
@ -37,7 +36,7 @@ namespace big
|
|||||||
Vehicle veh = vehicle::spawn(
|
Vehicle veh = vehicle::spawn(
|
||||||
(const char*)g->weapons.vehicle_gun_model,
|
(const char*)g->weapons.vehicle_gun_model,
|
||||||
location,
|
location,
|
||||||
ENTITY::GET_ENTITY_HEADING(player)
|
ENTITY::GET_ENTITY_HEADING(self::ped)
|
||||||
);
|
);
|
||||||
|
|
||||||
Vector3 velocity;
|
Vector3 velocity;
|
||||||
|
@ -70,3 +70,11 @@ namespace big
|
|||||||
|
|
||||||
inline CPed* g_local_player;
|
inline CPed* g_local_player;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace self
|
||||||
|
{
|
||||||
|
inline Ped ped;
|
||||||
|
inline Player id;
|
||||||
|
inline Vector3 pos;
|
||||||
|
inline Vehicle veh;
|
||||||
|
}
|
||||||
|
@ -112,7 +112,7 @@ namespace big::mobile
|
|||||||
notify::busy_spinner("Delivering vehicle...", mechanic_global.at(958).as<int*>(), -1);
|
notify::busy_spinner("Delivering vehicle...", mechanic_global.at(958).as<int*>(), -1);
|
||||||
|
|
||||||
if (g->vehicle.pv_teleport_into)
|
if (g->vehicle.pv_teleport_into)
|
||||||
vehicle::bring(globals::get_personal_vehicle(), ENTITY::GET_ENTITY_COORDS(PLAYER::PLAYER_PED_ID(), true));
|
vehicle::bring(globals::get_personal_vehicle(), self::pos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -24,10 +24,8 @@ namespace big::teleport
|
|||||||
|
|
||||||
ent = PED::GET_VEHICLE_PED_IS_IN(ent, false);
|
ent = PED::GET_VEHICLE_PED_IS_IN(ent, false);
|
||||||
|
|
||||||
Vector3 location = ENTITY::GET_ENTITY_COORDS(PLAYER::PLAYER_PED_ID(), true);
|
|
||||||
|
|
||||||
if (entity::take_control_of(ent))
|
if (entity::take_control_of(ent))
|
||||||
ENTITY::SET_ENTITY_COORDS(ent, location.x, location.y, location.z, 0, 0, 0, 0);
|
ENTITY::SET_ENTITY_COORDS(ent, self::pos.x, self::pos.y, self::pos.z, 0, 0, 0, 0);
|
||||||
else
|
else
|
||||||
g_notification_service->push_warning("Teleport", "Failed to take control of player vehicle.");
|
g_notification_service->push_warning("Teleport", "Failed to take control of player vehicle.");
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ namespace big::toxic
|
|||||||
else {
|
else {
|
||||||
ent = PED::GET_VEHICLE_PED_IS_IN(ent, false);
|
ent = PED::GET_VEHICLE_PED_IS_IN(ent, false);
|
||||||
|
|
||||||
Vector3 location = ENTITY::GET_ENTITY_COORDS(PLAYER::PLAYER_PED_ID(), true);
|
Vector3 location = self::pos;
|
||||||
|
|
||||||
if (entity::take_control_of(ent))
|
if (entity::take_control_of(ent))
|
||||||
ENTITY::APPLY_FORCE_TO_ENTITY(ent, 1, 0.f, 0.f, 50000.f, 0.f, 0.f, 0.f, 0, 0, 1, 1, 0, 1);
|
ENTITY::APPLY_FORCE_TO_ENTITY(ent, 1, 0.f, 0.f, 50000.f, 0.f, 0.f, 0.f, 0, 0, 1, 1, 0, 1);
|
||||||
|
@ -30,9 +30,7 @@ namespace big
|
|||||||
Vehicle veh = globals::get_personal_vehicle();
|
Vehicle veh = globals::get_personal_vehicle();
|
||||||
if (ENTITY::IS_ENTITY_DEAD(veh, false)) return g_notification_service->push_error("Teleport", "Invalid vehicle handle...");
|
if (ENTITY::IS_ENTITY_DEAD(veh, false)) return g_notification_service->push_error("Teleport", "Invalid vehicle handle...");
|
||||||
|
|
||||||
Vector3 location = ENTITY::GET_ENTITY_COORDS(PLAYER::PLAYER_PED_ID(), true);
|
vehicle::bring(veh, self::pos);
|
||||||
|
|
||||||
vehicle::bring(veh, location);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
components::button("Teleport to Personal Vehicle", [] {
|
components::button("Teleport to Personal Vehicle", [] {
|
||||||
|
@ -64,7 +64,7 @@ namespace big
|
|||||||
{
|
{
|
||||||
components::selectable(item["DisplayName"], item["Name"] == search, [&item]
|
components::selectable(item["DisplayName"], item["Name"] == search, [&item]
|
||||||
{
|
{
|
||||||
const auto location = ENTITY::GET_ENTITY_COORDS(PLAYER::PLAYER_PED_ID(), true);
|
const auto location = self::pos;
|
||||||
const Vehicle veh = vehicle::spawn(item["Name"], location, 0.f);
|
const Vehicle veh = vehicle::spawn(item["Name"], location, 0.f);
|
||||||
|
|
||||||
if (g->spawn.spawn_inside)
|
if (g->spawn.spawn_inside)
|
||||||
|
@ -19,9 +19,8 @@ namespace big
|
|||||||
ImGui::BeginGroup();
|
ImGui::BeginGroup();
|
||||||
|
|
||||||
components::button("Repair", [] {
|
components::button("Repair", [] {
|
||||||
Vehicle veh = PED::GET_VEHICLE_PED_IS_IN(PLAYER::PLAYER_PED_ID(), false);
|
|
||||||
|
|
||||||
vehicle::repair(veh);
|
vehicle::repair(self::veh);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (ImGui::TreeNode("Paint"))
|
if (ImGui::TreeNode("Paint"))
|
||||||
|
Reference in New Issue
Block a user