diff --git a/BigBaseV2/src/backend/backend.cpp b/BigBaseV2/src/backend/backend.cpp index 59f30243..cd38f229 100644 --- a/BigBaseV2/src/backend/backend.cpp +++ b/BigBaseV2/src/backend/backend.cpp @@ -22,6 +22,7 @@ namespace big QUEUE_JOB_BEGIN_CLAUSE() { looped::weapons_gravity_gun(); + looped::weapons_repair_gun(); }QUEUE_JOB_END_CLAUSE QUEUE_JOB_BEGIN_CLAUSE() diff --git a/BigBaseV2/src/backend/looped/looped.hpp b/BigBaseV2/src/backend/looped/looped.hpp index d5a6b426..63fcbbc1 100644 --- a/BigBaseV2/src/backend/looped/looped.hpp +++ b/BigBaseV2/src/backend/looped/looped.hpp @@ -9,6 +9,8 @@ namespace big static void self_noclip(); static void weapons_gravity_gun(); + static void weapons_repair_gun(); + static void vehicle_speedo_meter(); }; } \ No newline at end of file diff --git a/BigBaseV2/src/backend/looped/weapons/repair_gun.cpp b/BigBaseV2/src/backend/looped/weapons/repair_gun.cpp new file mode 100644 index 00000000..cc67f506 --- /dev/null +++ b/BigBaseV2/src/backend/looped/weapons/repair_gun.cpp @@ -0,0 +1,44 @@ +#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 }; + + void looped::weapons_repair_gun() + { + bool bRepairGun = g.weapons.custom_weapon == CustomWeapon::REPAIR_GUN; + + if (bRepairGun) + { + 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)) + { + Entity entity; + + if (entity::raycast(&entity)) + { + if (ENTITY::IS_ENTITY_A_VEHICLE(entity)) + { + VEHICLE::SET_VEHICLE_FIXED(entity); + VEHICLE::SET_VEHICLE_DEFORMATION_FIXED(entity); + VEHICLE::SET_VEHICLE_DIRT_LEVEL(entity, 0.f); + } + else + { + notify::above_map("Entity is not a vehicle."); + } + } + 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 9d8a41e2..1c4cba9e 100644 --- a/BigBaseV2/src/core/data/custom_weapons.hpp +++ b/BigBaseV2/src/core/data/custom_weapons.hpp @@ -8,5 +8,6 @@ struct custom_weapon { const custom_weapon custom_weapons[] = { { big::CustomWeapon::NONE, "No weapon" }, - { big::CustomWeapon::GRAVITY_GUN, "Gravity Gun" } + { big::CustomWeapon::GRAVITY_GUN, "Gravity Gun" }, + { big::CustomWeapon::REPAIR_GUN, "Repair Gun" } }; \ No newline at end of file diff --git a/BigBaseV2/src/core/enums.hpp b/BigBaseV2/src/core/enums.hpp index b426c023..65f53080 100644 --- a/BigBaseV2/src/core/enums.hpp +++ b/BigBaseV2/src/core/enums.hpp @@ -5,7 +5,8 @@ namespace big enum class CustomWeapon { NONE, - GRAVITY_GUN + GRAVITY_GUN, + REPAIR_GUN }; enum class SpeedoMeter