ACE3/addons/rearm/functions/fnc_rearmEntireVehicleSuccess.sqf
2016-03-06 11:14:34 +01:00

35 lines
933 B
Plaintext

/*
* Author: GitHawk
* Rearm an entire vehicle.
*
* Arguments:
* 0: Rearm information <ARRAY>
* 0: Ammo Truck <OBJECT>
* 1: Vehicle <OBJECT
*
* Return Value:
* None
*
* Example:
* [[ammo_truck, tank]] call ace_rearm_fnc_rearmEntireVehicleSuccess
*
* Public: No
*/
#include "script_component.hpp"
params ["_args"];
_args params [["_truck", objNull, [objNull]], ["_vehicle", objNull, [objNull]]];
if (isServer) then {
{
_turretOwnerID = _vehicle turretOwner _x;
if (_turretOwnerID == 0) then {
[QGVAR(rearmEntireVehicleSuccessLocalEH), _truck, [_truck, _vehicle, _x]] call EFUNC(common,objectEvent);
} else {
[QGVAR(rearmEntireVehicleSuccessLocalEH), _turretOwnerID, [_truck, _vehicle, _x]] call EFUNC(common,targetEvent);
};
} count REARM_TURRET_PATHS;
} else {
[_this, QFUNC(rearmEntireVehicleSuccess), 1] call EFUNC(common,execRemoteFnc);
};