ACE3/addons/medical/functions/fnc_actionPlaceInBodyBag.sqf

32 lines
788 B
Plaintext
Raw Normal View History

2015-02-21 20:53:07 +00:00
/*
* Author: Glowbal
* Replace a dead body by a bodybag
*
* Arguments:
* 0: The patient <OBJECT>
* 1: The new item classname <STRING>
*
* Return Value:
* nil
*
* Public: Yes
*/
#include "script_component.hpp"
private ["_target","_caller", "_nameOfUnit", "_onPosition", "_bodyBagCreated"];
_caller = _this select 0;
_target = _this select 1;
2015-04-05 17:27:53 +00:00
_nameOfUnit = [_target] call EFUNC(common,getName);
if (alive _target) then {
[_target, true] call FUNC(setDead);
2015-02-21 20:53:07 +00:00
};
2015-04-05 17:27:53 +00:00
_onPosition = getPos _target;
deleteVehicle _target;
2015-04-06 13:11:54 +00:00
_bodyBagCreated = createVehicle ["ACE_bodyBagObject", _onPosition, [], 0, "NONE"];
2015-02-21 20:53:07 +00:00
// reset the position to ensure it is on the correct one.
2015-04-06 12:51:17 +00:00
_bodyBagCreated setPos [_onPosition select 0, _onPosition select 1, (_onPosition select 2) + 0.2];
2015-02-21 20:53:07 +00:00
_bodyBagCreated;