2021-05-20 18:19:01 +02:00
|
|
|
#include "backend/looped/looped.hpp"
|
|
|
|
#include "core/enums.hpp"
|
2023-03-09 12:23:01 +00:00
|
|
|
#include "gta/enums.hpp"
|
2021-05-20 18:19:01 +02:00
|
|
|
#include "util/entity.hpp"
|
2021-07-23 11:59:01 +02:00
|
|
|
#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
|
|
|
{
|
2022-05-23 06:38:45 +08:00
|
|
|
if (PAD::IS_DISABLED_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_AIM))
|
2021-05-20 18:19:01 +02:00
|
|
|
{
|
2022-05-23 06:38:45 +08: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))
|
|
|
|
{
|
2021-07-23 11:59:01 +02:00
|
|
|
vehicle::repair(entity);
|
2021-05-20 18:19:01 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2023-10-20 12:24:44 -04:00
|
|
|
g_notification_service->push_warning("BACKEND_LOOPED_WEAPONS_REPAIR_GUN"_T.data(), "VEHICLE_INVALID"_T.data());
|
2021-05-20 18:19:01 +02:00
|
|
|
}
|
|
|
|
}
|
2023-03-01 21:27:15 +00:00
|
|
|
else
|
2023-10-20 12:24:44 -04:00
|
|
|
{
|
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-04-15 17:17:43 -04:00
|
|
|
}
|