ACE3/addons/medical/functions/fnc_ActionCheckPulse.sqf
Glowbal 155503d4a1 Merged GUI into common.
Removed unnecessary GUI functions.
Updated displayIcon function to be more dynamic
Added client side settings for displaying icons.
2015-02-14 20:06:55 +01:00

40 lines
1.4 KiB
Plaintext

/**
* fn_checkPulse.sqf
* @Descr: Displays specified units current pulse
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
#include "script_component.hpp"
private ["_caller","_target","_title","_content"];
_caller = _this select 0;
_target = _this select 1;
if ([_caller] call FUNC(isSetTreatmentMutex)) exitwith {};
[_caller, true] call FUNC(treatmentMutex);
_title = format["STR_ACE_CHECK_PULSE"];
_content = ["STR_ACE_CHECK_PULSE_CONTENT"];
[_caller, _title, _content] call EFUNC(common,sendDisplayInformationTo);
_caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller];
[2 + round(random(1)),
{((vehicle (_this select 0) != (_this select 0)) ||((getPos (_this select 0)) distance ((_this select 0) getvariable QGVAR(StartingPositionHandleTreatment)) < 1))}, // the condition
{
private ["_caller","_target"];
_caller = _this select 0;
_target = _this select 1;
[[_caller, _target], QUOTE(FUNC(actionCheckPulseLocal)), _target] call EFUNC(common,execRemoteFnc);
[_caller,false] call FUNC(treatmentMutex);
}, // on success
{
[(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(common,sendDisplayInformationTo);
[(_this select 0),false] call FUNC(treatmentMutex);
}, // on failure
[_caller, _target] // arguments
] call EFUNC(common,loadingBar);