ACE3/addons/rearm/functions/fnc_canStoreAmmo.sqf
PabstMirror f35f80ee82 Rearm - Pylon Support and Dynamically Add Supply Actions (#5183)
* Dynamic Add

* Support 1.70 Pylon Loadouts

* Properly handle old compat pbos - Update RHS Compat

* Re-add documentation

* cleanup headers (note from other pr)

* Cleanup

* Fix var spelling
2017-06-08 11:47:52 -05:00

31 lines
689 B
Plaintext

/*
* Author: GitHawk
* Check if a unit can store ammo in an ammo truck.
*
* Arguments:
* 0: Target <OBJECT>
* 1: Unit <OBJECT>
*
* Return Value:
* Can Store Ammo <BOOL>
*
* Example:
* [ammo_truck, player] call ace_rearm_fnc_canStoreAmmo
*
* Public: No
*/
#include "script_component.hpp"
params [
["_truck", objNull, [objNull]],
["_unit", objNull, [objNull]]
];
(alive _unit)
&& {_unit isKindOf "CAManBase"}
&& {local _unit}
&& {!isNull (_unit getVariable [QGVAR(dummy), objNull])}
&& {alive _truck}
&& {(_truck distance _unit) < REARM_ACTION_DISTANCE}
&& {[_unit, _truck, ["IsNotInside"]] call EFUNC(common,canInteractWith)} // manually added actions need this