mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
8f46ffd8d5
count -> forEach Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
35 lines
932 B
Plaintext
35 lines
932 B
Plaintext
#include "..\script_component.hpp"
|
|
/*
|
|
* Author: GitHawk
|
|
* Rearm an entire vehicle.
|
|
*
|
|
* Arguments:
|
|
* 0: Ammo Truck <OBJECT>
|
|
* 1: Vehicle <OBJECT>
|
|
*
|
|
* Return Value:
|
|
* None
|
|
*
|
|
* Example:
|
|
* [ammo_truck, tank] call ace_rearm_fnc_rearmEntireVehicleSuccess
|
|
*
|
|
* Public: No
|
|
*/
|
|
|
|
params ["_truck", "_vehicle"];
|
|
TRACE_2("rearmEntireVehicleSuccess",_truck,_vehicle);
|
|
|
|
if (isServer) then {
|
|
private _turrets = [_vehicle] call FUNC(getAllRearmTurrets);
|
|
{
|
|
private _turretOwnerID = _vehicle turretOwner _x;
|
|
if (_turretOwnerID == 0) then {
|
|
[QGVAR(rearmEntireVehicleSuccessLocalEH), [_truck, _vehicle, _x], [_vehicle]] call CBA_fnc_targetEvent;
|
|
} else {
|
|
[QGVAR(rearmEntireVehicleSuccessLocalEH), [_truck, _vehicle, _x], _turretOwnerID] call CBA_fnc_ownerEvent;
|
|
};
|
|
} forEach _turrets;
|
|
} else {
|
|
[QGVAR(rearmEntireVehicleSuccessEH), _this] call CBA_fnc_serverEvent;
|
|
};
|