ACE3/addons/flags/functions/fnc_carryFlag.sqf

27 lines
546 B
Plaintext
Raw Normal View History

2022-06-10 19:46:06 +00:00
#include "script_component.hpp"
/*
* Author: Timi007
* Attaches flag to the back of the unit and removes his flag item.
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Flag item <STRING>
*
* Return Value:
* Nothing
*
* Example:
* [player, "ace_flags_white"] call ace_flags_fnc_carryFlag
*
* Public: No
*/
params ["_unit", "_item"];
2022-06-10 20:53:29 +00:00
TRACE_2("Carry flag", _unit, _item);
2022-06-10 19:46:06 +00:00
2022-06-10 20:53:29 +00:00
(GVAR(flagItemCache) get _item) params ["", "_texture"];
2022-06-10 19:46:06 +00:00
_unit forceFlagTexture _texture;
2022-06-10 20:53:29 +00:00
_unit setVariable [QGVAR(carryingFlag), _item, true];
_unit removeItem _item;