ACE3/addons/medical/functions/fnc_actionRemoveTourniquet.sqf

37 lines
964 B
Plaintext
Raw Normal View History

2015-02-23 19:35:36 +00:00
/*
* Author: Glowbal
* Action for removing the tourniquet on specified selection
*
* Arguments:
* 0: The medic <OBJECT>
* 1: The patient <OBJECT>
* 2: SelectionName <STRING>
*
* Return Value:
2015-08-22 14:25:10 +00:00
* None
2015-02-23 19:35:36 +00:00
*
* Public: Yes
*/
#include "script_component.hpp"
2015-08-22 14:25:10 +00:00
private ["_part", "_tourniquets", "_output"];
params ["_caller", "_target", "_selectionName"];
2015-02-23 19:35:36 +00:00
// grab the required data
_part = [_selectionName] call FUNC(selectionNameToNumber);
_tourniquets = _target getvariable [QGVAR(tourniquets), [0,0,0,0,0,0]];
// Check if there is a tourniquet on this bodypart
if ((_tourniquets select _part) == 0) exitwith {
2015-08-29 13:29:02 +00:00
_output = LSTRING(noTourniquetOnBodyPart);
["displayTextStructured", [_caller], [_output, 1.5, _caller]] call EFUNC(common,targetEvent);
2015-02-23 19:35:36 +00:00
};
// Removing the tourniquet
_tourniquets set[_part, 0];
_target setvariable [QGVAR(tourniquets), _tourniquets, true];
// Adding the tourniquet item to the caller
2015-03-21 21:22:28 +00:00
_caller addItem "ACE_tourniquet";