2018-07-30 09:22:14 +00:00
|
|
|
#include "script_component.hpp"
|
2015-02-22 14:01:31 +00:00
|
|
|
/*
|
|
|
|
* Author: Glowbal
|
|
|
|
* Check if caller can access targets medical equipment, based upon accessLevel.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: The caller <OBJECT>
|
|
|
|
* 1: The target <OBJECT>
|
|
|
|
*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Return Value:
|
2015-02-22 14:01:31 +00:00
|
|
|
* Can Treat <BOOL>
|
|
|
|
*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Example:
|
2019-03-30 16:07:54 +00:00
|
|
|
* [bob, target] call ace_medical_treatment_fnc_canAccessMedicalEquipment
|
2017-06-08 13:31:51 +00:00
|
|
|
*
|
2019-03-30 16:07:54 +00:00
|
|
|
* Public: No
|
2015-02-22 14:01:31 +00:00
|
|
|
*/
|
|
|
|
|
2015-09-03 13:49:49 +00:00
|
|
|
params ["_caller", "_target"];
|
2015-02-22 14:01:31 +00:00
|
|
|
|
2016-06-13 08:55:19 +00:00
|
|
|
private _accessLevel = _target getVariable [QGVAR(allowSharedEquipmentAccess), -1];
|
2015-02-22 14:01:31 +00:00
|
|
|
|
2018-07-29 21:43:14 +00:00
|
|
|
switch (_accessLevel) do {
|
|
|
|
case 0: { true };
|
|
|
|
case 1: { side _target == side _caller };
|
|
|
|
case 2: { group _target == group _caller };
|
|
|
|
default { false };
|
2015-02-22 14:01:31 +00:00
|
|
|
};
|