2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-08-16 00:18:53 +00:00
|
|
|
/*
|
|
|
|
* Author: GitHawk
|
2015-08-18 00:32:10 +00:00
|
|
|
* Rearm an entire vehicle.
|
2015-08-16 00:18:53 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
2018-10-13 17:07:32 +00:00
|
|
|
* 0: Ammo Truck <OBJECT>
|
|
|
|
* 1: Vehicle <OBJECT>
|
2015-08-16 00:18:53 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2018-10-13 17:07:32 +00:00
|
|
|
* [ammo_truck, tank] call ace_rearm_fnc_rearmEntireVehicleSuccess
|
2015-08-16 00:18:53 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2018-10-13 17:07:32 +00:00
|
|
|
params ["_truck", "_vehicle"];
|
2017-07-10 15:17:44 +00:00
|
|
|
TRACE_2("rearmEntireVehicleSuccess",_truck,_vehicle);
|
2015-08-16 00:18:53 +00:00
|
|
|
|
2015-08-18 16:09:37 +00:00
|
|
|
if (isServer) then {
|
2017-09-29 19:53:25 +00:00
|
|
|
private _turrets = [_vehicle] call FUNC(getAllRearmTurrets);
|
2015-08-16 00:18:53 +00:00
|
|
|
{
|
2017-05-18 16:13:31 +00:00
|
|
|
private _turretOwnerID = _vehicle turretOwner _x;
|
2015-08-19 15:33:32 +00:00
|
|
|
if (_turretOwnerID == 0) then {
|
2017-07-10 15:17:44 +00:00
|
|
|
[QGVAR(rearmEntireVehicleSuccessLocalEH), [_truck, _vehicle, _x], [_vehicle]] call CBA_fnc_targetEvent;
|
2015-08-19 15:33:32 +00:00
|
|
|
} else {
|
2017-05-18 16:13:31 +00:00
|
|
|
[QGVAR(rearmEntireVehicleSuccessLocalEH), [_truck, _vehicle, _x], _turretOwnerID] call CBA_fnc_ownerEvent;
|
2015-08-19 15:33:32 +00:00
|
|
|
};
|
2016-05-12 12:55:40 +00:00
|
|
|
false
|
2017-09-29 19:53:25 +00:00
|
|
|
} count _turrets;
|
2015-08-18 16:09:37 +00:00
|
|
|
} else {
|
2017-07-10 15:17:44 +00:00
|
|
|
[QGVAR(rearmEntireVehicleSuccessEH), _this] call CBA_fnc_serverEvent;
|
2015-08-18 16:09:37 +00:00
|
|
|
};
|