2018-09-17 19:19:29 +00:00
|
|
|
#include "script_component.hpp"
|
2015-08-08 18:22:19 +00:00
|
|
|
/*
|
|
|
|
* Author: Glowbal
|
|
|
|
* Check if ACE_player can Open the medical menu
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Caller <OBJECT>
|
|
|
|
* 1: Target <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* Can open <BOOL>
|
|
|
|
*
|
|
|
|
* Example:
|
2015-10-13 07:01:59 +00:00
|
|
|
* [player, cursorTarget] call ace_medical_menu_fnc_canOpenMenu
|
2015-08-08 18:22:19 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
params ["_caller", "_target"];
|
|
|
|
|
2015-10-13 07:01:59 +00:00
|
|
|
(alive _caller)
|
|
|
|
&& {!isNull _target}
|
2015-10-13 18:40:16 +00:00
|
|
|
&& {((_caller distance _target) < GVAR(maxRange)) || {(vehicle _caller) == (vehicle _target)}} //for now, ignore range when in same vehicle
|
|
|
|
&& {(GVAR(allow) == 1) || {(GVAR(allow) == 2) && {(vehicle _caller != _caller) || {vehicle _target != _target}}}}
|
|
|
|
&& {(GVAR(useMenu) == 1) || {(GVAR(useMenu) == 2) && {(vehicle _caller != _caller) || {vehicle _target != _target}}}}
|