ACE3/addons/medical_treatment/functions/fnc_canAccessMedicalEquipment.sqf
2019-03-30 11:07:54 -05:00

29 lines
641 B
Plaintext

#include "script_component.hpp"
/*
* Author: Glowbal
* Check if caller can access targets medical equipment, based upon accessLevel.
*
* Arguments:
* 0: The caller <OBJECT>
* 1: The target <OBJECT>
*
* Return Value:
* Can Treat <BOOL>
*
* Example:
* [bob, target] call ace_medical_treatment_fnc_canAccessMedicalEquipment
*
* Public: No
*/
params ["_caller", "_target"];
private _accessLevel = _target getVariable [QGVAR(allowSharedEquipmentAccess), -1];
switch (_accessLevel) do {
case 0: { true };
case 1: { side _target == side _caller };
case 2: { group _target == group _caller };
default { false };
};