ACE3/addons/medical/functions/fnc_hasItems.sqf

34 lines
722 B
Plaintext
Raw Normal View History

#include "script_component.hpp"
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
*
* Return Value:
* Has the items <BOOL>
2015-02-22 17:38:06 +00:00
*
* Example:
* [bob, patient, ["bandage", "morphine"]] call ace_medical_fnc_hasItems
*
2015-02-22 17:38:06 +00:00
* Public: Yes
*/
2015-08-22 14:25:10 +00:00
params ["_medic", "_patient", "_items"];
2015-02-22 17:38:06 +00:00
private _return = true;
2015-02-22 17:38:06 +00:00
{
2015-02-28 18:28:05 +00:00
//
if (_x isEqualType [] && {({[_medic, _patient, _x] call FUNC(hasItem)}count _x == 0)}) exitwith {
2015-02-28 18:28:05 +00:00
_return = false;
};
if (_x isEqualType "" && {!([_medic, _patient, _x] call FUNC(hasItem))}) exitwith {
2015-02-28 18:28:05 +00:00
_return = false;
};
2015-02-22 17:38:06 +00:00
}foreach _items;
2015-08-22 14:25:10 +00:00
_return