ACE3/addons/medical_gui/functions/fnc_canOpenMenu.sqf
johnb432 ac9044f2d6
Zeus - Add medical menu module (#9367)
* open medical menu from Zeus

* fix function header

* Zeus can use every action, add room for more buttons in medical menu

* Update addons/medical_treatment/functions/fnc_treatment.sqf

* Added zeus treatment time coeff

* Update addons/medical_gui/functions/fnc_canOpenMenu.sqf

Co-authored-by: PabstMirror <pabstmirror@gmail.com>

* Update fnc_canOpenMenu.sqf

* Update initSettings.sqf

* Update fnc_moduleMedicalMenu.sqf

* Added check + documentation

* Update fnc_canTreat.sqf

---------

Authored-by: Brett <brett@mayson.io>
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2023-11-20 13:52:29 -08:00

32 lines
838 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: Glowbal, mharis001, johnb43
* Checks if the player can open the Medical Menu for the target.
*
* Arguments:
* 0: Player <OBJECT>
* 1: Target <OBJECT>
*
* Return Value:
* Can open <BOOL>
*
* Example:
* [player, cursorTarget] call ace_medical_gui_fnc_canOpenMenu
*
* Public: No
*/
params ["_player", "_target"];
// If in Zeus
if (!isNull findDisplay 312) exitWith {
!isNull _target &&
{missionNamespace getVariable [QGVAR(enableZeusModule), true]} &&
{GVAR(enableMedicalMenu) > 0}
};
_player call EFUNC(common,isAwake) &&
{!isNull _target} &&
{_player distance _target < GVAR(maxDistance) || {vehicle _player == vehicle _target}} &&
{GVAR(enableMedicalMenu) == 1 || {GVAR(enableMedicalMenu) == 2 && {vehicle _player != _player || {vehicle _target != _target}}}}