TmpMenu/src/backend/looped/weapons/repair_gun.cpp

39 lines
1015 B
C++
Raw Normal View History

2021-05-20 18:19:01 +02:00
#include "backend/looped/looped.hpp"
#include "core/enums.hpp"
#include "gta/enums.hpp"
2021-05-20 18:19:01 +02:00
#include "util/entity.hpp"
#include "util/vehicle.hpp"
2021-05-20 18:19:01 +02:00
namespace big
{
void looped::weapons_repair_gun()
{
2023-04-16 18:28:49 +00:00
if (g.weapons.custom_weapon == CustomWeapon::REPAIR_GUN && (!g.self.custom_weapon_stop || WEAPON::IS_PED_ARMED(self::ped, 4 | 2)))
2021-05-20 18:19:01 +02:00
{
if (PAD::IS_DISABLED_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_AIM))
2021-05-20 18:19:01 +02:00
{
if (PAD::IS_DISABLED_CONTROL_JUST_RELEASED(0, (int)ControllerInputs::INPUT_ATTACK))
2021-05-20 18:19:01 +02:00
{
Entity entity;
if (entity::raycast(&entity))
{
if (ENTITY::IS_ENTITY_A_VEHICLE(entity))
{
vehicle::repair(entity);
2021-05-20 18:19:01 +02:00
}
else
{
g_notification_service.push_warning("BACKEND_LOOPED_WEAPONS_REPAIR_GUN"_T.data(), "VEHICLE_INVALID"_T.data());
2021-05-20 18:19:01 +02:00
}
}
else
{
g_notification_service.push_warning("BACKEND_LOOPED_WEAPONS_REPAIR_GUN"_T.data(), "BACKEND_LOOPED_WEAPONS_CAGE_GUN_NO_ENTITY_FOUND"_T.data());
}
2021-05-20 18:19:01 +02:00
}
}
}
}
}