diff --git a/BigBaseV2/src/backend/backend.cpp b/BigBaseV2/src/backend/backend.cpp index 4a5d806f..b24938a7 100644 --- a/BigBaseV2/src/backend/backend.cpp +++ b/BigBaseV2/src/backend/backend.cpp @@ -24,6 +24,7 @@ namespace big looped::weapons_cage_gun(); looped::weapons_delete_gun(); looped::weapons_gravity_gun(); + looped::weapons_steal_vehicle_gun(); looped::weapons_repair_gun(); looped::weapons_vehicle_gun(); }QUEUE_JOB_END_CLAUSE diff --git a/BigBaseV2/src/backend/looped/looped.hpp b/BigBaseV2/src/backend/looped/looped.hpp index 63b3fa0e..ba292c69 100644 --- a/BigBaseV2/src/backend/looped/looped.hpp +++ b/BigBaseV2/src/backend/looped/looped.hpp @@ -12,6 +12,7 @@ namespace big static void weapons_delete_gun(); static void weapons_gravity_gun(); static void weapons_repair_gun(); + static void weapons_steal_vehicle_gun(); static void weapons_vehicle_gun(); static void vehicle_speedo_meter(); diff --git a/BigBaseV2/src/backend/looped/weapons/steal_vehicle_gun.cpp b/BigBaseV2/src/backend/looped/weapons/steal_vehicle_gun.cpp new file mode 100644 index 00000000..cd6c153c --- /dev/null +++ b/BigBaseV2/src/backend/looped/weapons/steal_vehicle_gun.cpp @@ -0,0 +1,42 @@ +#include "backend/looped/looped.hpp" +#include "core/enums.hpp" +#include "util/entity.hpp" +#include "util/notify.hpp" + +namespace big +{ + static const int controls[] = { 14, 15, 24 }; + static Entity ent; + + void looped::weapons_steal_vehicle_gun() + { + bool bStealVehicleGun = g.weapons.custom_weapon == CustomWeapon::STEAL_VEHICLE_GUN; + + if (bStealVehicleGun) + { + Ped player = PLAYER::PLAYER_PED_ID(); + + if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 25)) + { + PLAYER::DISABLE_PLAYER_FIRING(PLAYER::PLAYER_ID(), true); + for (int control : controls) + PAD::DISABLE_CONTROL_ACTION(0, control, true); + + if (PAD::IS_DISABLED_CONTROL_JUST_RELEASED(0, 24)) + { + if (entity::raycast(&ent)) + { + if (ENTITY::IS_ENTITY_A_VEHICLE(ent)) + { + Ped ped = VEHICLE::GET_PED_IN_VEHICLE_SEAT(ent, -1, 0); + TASK::CLEAR_PED_TASKS_IMMEDIATELY(ped); + + PED::SET_PED_INTO_VEHICLE(PLAYER::PLAYER_PED_ID(), ent, -1); + } + } + else notify::above_map("No entity found."); + } + } + } + } +} \ No newline at end of file diff --git a/BigBaseV2/src/core/data/custom_weapons.hpp b/BigBaseV2/src/core/data/custom_weapons.hpp index eea02370..3022b4ed 100644 --- a/BigBaseV2/src/core/data/custom_weapons.hpp +++ b/BigBaseV2/src/core/data/custom_weapons.hpp @@ -3,7 +3,7 @@ struct custom_weapon { big::CustomWeapon id; - const char name[16]; + const char name[32]; }; const custom_weapon custom_weapons[] = { @@ -11,6 +11,7 @@ const custom_weapon custom_weapons[] = { { big::CustomWeapon::CAGE_GUN, "Cage Gun" }, { big::CustomWeapon::DELETE_GUN, "Delete Gun" }, { big::CustomWeapon::GRAVITY_GUN, "Gravity Gun" }, + { big::CustomWeapon::STEAL_VEHICLE_GUN, "Steal Vehicle Gun" }, { big::CustomWeapon::REPAIR_GUN, "Repair Gun" }, { big::CustomWeapon::VEHICLE_GUN, "Vehicle Gun" } }; \ No newline at end of file diff --git a/BigBaseV2/src/core/enums.hpp b/BigBaseV2/src/core/enums.hpp index 13ba32f0..c2a536c9 100644 --- a/BigBaseV2/src/core/enums.hpp +++ b/BigBaseV2/src/core/enums.hpp @@ -8,6 +8,7 @@ namespace big CAGE_GUN, DELETE_GUN, GRAVITY_GUN, + STEAL_VEHICLE_GUN, REPAIR_GUN, VEHICLE_GUN };