ACE3/addons/medical/functions/fnc_hasItems.sqf

33 lines
690 B
Plaintext
Raw Normal View History

2015-02-22 17:38:06 +00:00
/*
* Author: Glowbal
* Check if all items are present between the patient and the medic.
*
* Arguments:
* 0: Medic <OBJECT>
* 1: Patient <OBJECT>
* 2: Items <ARRAY<STRING>>
2015-02-22 17:38:06 +00:00
*
* ReturnValue:
* Has the items <BOOL>
2015-02-22 17:38:06 +00:00
*
* Public: Yes
*/
#include "script_component.hpp"
private ["_medic", "_patient", "_items", "_return"];
2015-08-22 14:25:10 +00:00
params ["_medic", "_patient", "_items"];
2015-02-22 17:38:06 +00:00
_return = true;
{
2015-02-28 18:28:05 +00:00
//
if (typeName _x == "ARRAY" && {({[_medic, _patient, _x] call FUNC(hasItem)}count _x == 0)}) exitwith {
_return = false;
};
if (typeName _x == "STRING" && {!([_medic, _patient, _x] call FUNC(hasItem))}) exitwith {
_return = false;
};
2015-02-22 17:38:06 +00:00
}foreach _items;
2015-08-22 14:25:10 +00:00
_return