ACE3/addons/rearm/functions/fnc_rearmEntireVehicleSuccess.sqf

39 lines
959 B
Plaintext
Raw Normal View History

2015-08-16 00:18:53 +00:00
/*
* Author: GitHawk
* Rearm an entire vehicle.
2015-08-16 00:18:53 +00:00
*
* Arguments:
2016-02-27 19:31:07 +00:00
* 0: Rearm information <ARRAY>
2016-02-27 20:05:19 +00:00
* 0: Ammo Truck <OBJECT>
2016-02-27 19:31:07 +00:00
* 1: Vehicle <OBJECT
2015-08-16 00:18:53 +00:00
*
* Return Value:
* None
*
* Example:
2016-02-27 19:31:07 +00:00
* [[ammo_truck, tank]] call ace_rearm_fnc_rearmEntireVehicleSuccess
2015-08-16 00:18:53 +00:00
*
* Public: No
*/
#include "script_component.hpp"
2016-02-27 19:31:07 +00:00
params ["_args"];
_args params [
["_truck", objNull, [objNull]],
["_vehicle", objNull, [objNull]]
];
2015-08-16 00:18:53 +00:00
2015-08-18 16:09:37 +00:00
if (isServer) then {
2015-08-16 00:18:53 +00:00
{
_turretOwnerID = _vehicle turretOwner _x;
if (_turretOwnerID == 0) then {
2016-03-06 10:14:34 +00:00
[QGVAR(rearmEntireVehicleSuccessLocalEH), _truck, [_truck, _vehicle, _x]] call EFUNC(common,objectEvent);
} else {
2016-03-06 10:14:34 +00:00
[QGVAR(rearmEntireVehicleSuccessLocalEH), _turretOwnerID, [_truck, _vehicle, _x]] call EFUNC(common,targetEvent);
};
false
2015-08-18 16:09:37 +00:00
} count REARM_TURRET_PATHS;
} else {
2016-03-07 06:15:01 +00:00
[QGVAR(rearmEntireVehicleSuccessLocalEH), _this] call EFUNC(common,serverEvent);
2015-08-18 16:09:37 +00:00
};