ACE3/addons/medical_treatment/functions/fnc_canAccessMedicalEquipment.sqf

29 lines
641 B
Plaintext
Raw Normal View History

#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>
*
* Return Value:
2015-02-22 14:01:31 +00:00
* Can Treat <BOOL>
*
* Example:
2019-03-30 16:07:54 +00:00
* [bob, target] call ace_medical_treatment_fnc_canAccessMedicalEquipment
*
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
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
};