2015-12-07 16:24:52 +00:00
|
|
|
/*
|
|
|
|
Author: Aaron Clark - EpochMod.com
|
|
|
|
|
|
|
|
Contributors:
|
|
|
|
|
|
|
|
Description:
|
|
|
|
repair object via hit index
|
|
|
|
|
|
|
|
Licence:
|
|
|
|
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
|
|
|
|
|
|
|
|
Github:
|
2016-06-13 16:54:19 +00:00
|
|
|
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/vehicles/EPOCH_client_repairVehicle.sqf
|
2015-12-07 16:24:52 +00:00
|
|
|
*/
|
2016-09-01 00:29:08 +00:00
|
|
|
//[[[cog import generate_private_arrays ]]]
|
2019-03-03 01:23:14 +00:00
|
|
|
private ["_currentDMG","_god"];
|
2016-09-01 00:29:08 +00:00
|
|
|
//[[[end]]]
|
2016-04-08 20:21:46 +00:00
|
|
|
params ["_vehicle","_value"];
|
2015-09-14 20:55:36 +00:00
|
|
|
if (local _vehicle) then {
|
2019-03-03 01:23:14 +00:00
|
|
|
_god = !(isDamageAllowed _vehicle);
|
|
|
|
if (_god) then {_vehicle allowdamage true;};
|
2017-07-31 16:28:18 +00:00
|
|
|
{
|
|
|
|
if ((_x select 0) isequaltype 0) then {
|
|
|
|
_vehicle setHitIndex [_x select 0, _x select 1];
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
_vehicle setHitPointDamage [_x select 0, _x select 1];
|
|
|
|
};
|
|
|
|
} foreach _value;
|
2019-03-03 01:23:14 +00:00
|
|
|
if (_god) then {_vehicle allowdamage false;};
|
2017-07-31 16:28:18 +00:00
|
|
|
|
|
|
|
if !({_x > 0} count ((getAllHitPointsDamage _vehicle) select 2) > 0) then {
|
|
|
|
[_vehicle,["ALL",0],player,Epoch_personalToken] remoteExec ["EPOCH_server_repairVehicle",2];
|
|
|
|
};
|
|
|
|
|
|
|
|
_vehicle call EPOCH_interact;
|
|
|
|
if !(EPOCH_arr_interactedObjs isEqualTo[]) then {
|
|
|
|
[EPOCH_arr_interactedObjs] remoteExec['EPOCH_server_save_vehicles', 2];
|
|
|
|
EPOCH_arr_interactedObjs = [];
|
|
|
|
};
|
2015-12-07 16:24:52 +00:00
|
|
|
};
|