ACE3/addons/rearm/functions/fnc_canTakeAmmo.sqf

27 lines
583 B
Plaintext
Raw Normal View History

2015-08-15 16:43:13 +00:00
/*
* Author: GitHawk
* Check if a unit can pick up ammo.
2015-08-15 16:43:13 +00:00
*
* Arguments:
* 0: Target <OBJECT>
* 1: Unit <OBJECT>
2015-08-15 16:43:13 +00:00
*
* Return Value:
* Can Pick Up Ammo <BOOL>
2015-08-15 16:43:13 +00:00
*
* Example:
2016-02-27 20:05:19 +00:00
* [ammo_truck, player] call ace_rearm_fnc_canTakeAmmo
2015-08-15 16:43:13 +00:00
*
* Public: No
*/
#include "script_component.hpp"
2016-02-27 20:05:19 +00:00
params [["_truck", objNull, [objNull]], ["_unit", objNull, [objNull]]];
2015-08-15 16:43:13 +00:00
!(isNull _unit ||
{!(_unit isKindOf "CAManBase")} ||
{!local _unit} ||
2016-02-27 20:05:19 +00:00
{(_truck distance _unit) > REARM_ACTION_DISTANCE} ||
2016-02-27 19:31:07 +00:00
{!isNull (_unit getVariable [QGVAR(dummy), objNull])} ||
{GVAR(level) == 0})