mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-01-07 09:53:50 +08:00
feat(CustomWeapons): Added repair gun
This commit is contained in:
parent
371432ea4e
commit
f6ee0687fa
@ -22,6 +22,7 @@ namespace big
|
|||||||
QUEUE_JOB_BEGIN_CLAUSE()
|
QUEUE_JOB_BEGIN_CLAUSE()
|
||||||
{
|
{
|
||||||
looped::weapons_gravity_gun();
|
looped::weapons_gravity_gun();
|
||||||
|
looped::weapons_repair_gun();
|
||||||
}QUEUE_JOB_END_CLAUSE
|
}QUEUE_JOB_END_CLAUSE
|
||||||
|
|
||||||
QUEUE_JOB_BEGIN_CLAUSE()
|
QUEUE_JOB_BEGIN_CLAUSE()
|
||||||
|
@ -9,6 +9,8 @@ namespace big
|
|||||||
static void self_noclip();
|
static void self_noclip();
|
||||||
|
|
||||||
static void weapons_gravity_gun();
|
static void weapons_gravity_gun();
|
||||||
|
static void weapons_repair_gun();
|
||||||
|
|
||||||
static void vehicle_speedo_meter();
|
static void vehicle_speedo_meter();
|
||||||
};
|
};
|
||||||
}
|
}
|
44
BigBaseV2/src/backend/looped/weapons/repair_gun.cpp
Normal file
44
BigBaseV2/src/backend/looped/weapons/repair_gun.cpp
Normal file
@ -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.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -8,5 +8,6 @@ struct custom_weapon {
|
|||||||
|
|
||||||
const custom_weapon custom_weapons[] = {
|
const custom_weapon custom_weapons[] = {
|
||||||
{ big::CustomWeapon::NONE, "No weapon" },
|
{ big::CustomWeapon::NONE, "No weapon" },
|
||||||
{ big::CustomWeapon::GRAVITY_GUN, "Gravity Gun" }
|
{ big::CustomWeapon::GRAVITY_GUN, "Gravity Gun" },
|
||||||
|
{ big::CustomWeapon::REPAIR_GUN, "Repair Gun" }
|
||||||
};
|
};
|
@ -5,7 +5,8 @@ namespace big
|
|||||||
enum class CustomWeapon
|
enum class CustomWeapon
|
||||||
{
|
{
|
||||||
NONE,
|
NONE,
|
||||||
GRAVITY_GUN
|
GRAVITY_GUN,
|
||||||
|
REPAIR_GUN
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class SpeedoMeter
|
enum class SpeedoMeter
|
||||||
|
Loading…
x
Reference in New Issue
Block a user