ACE3/addons/dragging/functions/fnc_createClone.sqf
2020-10-11 20:46:49 +02:00

28 lines
570 B
Plaintext

#include "script_component.hpp"
/*
* Author: BaerMitUmlaut
* Creates a draggable / carryable clone of a dead unit.
*
* Arguments:
* 0: Dead unit <OBJECT>
*
* Return Value:
* Cloned unit.
*
* Example:
* [player] call ace_dragging_fnc_createClone;
*
* Public: No
*/
params ["_unit"];
private _clone = QGVAR(clone) createVehicle [0, 0, 0];
_clone setUnitLoadout getUnitLoadout _unit;
_clone allowDamage false;
_clone setVariable [QGVAR(original), _unit];
_unit setPosATL [0, 0, -10];
[QGVAR(cloneCreated), [_unit, _clone]] call CBA_fnc_globalEvent;
_clone