From b3dd9a6756758cdc9c43cdea4c00ea2e1405130d Mon Sep 17 00:00:00 2001 From: Yimura Date: Fri, 23 Jul 2021 11:58:43 +0200 Subject: [PATCH] feat(Util/Vehicle): Added repair function --- BigBaseV2/src/util/vehicle.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/BigBaseV2/src/util/vehicle.hpp b/BigBaseV2/src/util/vehicle.hpp index 44b800ea..c6afd38d 100644 --- a/BigBaseV2/src/util/vehicle.hpp +++ b/BigBaseV2/src/util/vehicle.hpp @@ -29,6 +29,17 @@ namespace big::vehicle return VEHICLE::GET_CLOSEST_VEHICLE(location.x, location.y, location.z, range, 0, flags); } + inline bool repair(Vehicle veh) + { + if (!ENTITY::IS_ENTITY_A_VEHICLE(veh)) return false; + + VEHICLE::SET_VEHICLE_FIXED(veh); + VEHICLE::SET_VEHICLE_DEFORMATION_FIXED(veh); + VEHICLE::SET_VEHICLE_DIRT_LEVEL(veh, 0.f); + + return true; + } + inline int spawn(const char* model, Vector3 location, float heading) { Hash hash = rage::joaat(model);