ACE3/addons/common/functions/fnc_dropBackpack.sqf

35 lines
641 B
Plaintext
Raw Normal View History

2015-04-11 13:59:21 +00:00
/*
* Author: commy2
*
2015-04-11 14:27:04 +00:00
* Drops a backback. Also returns the ground wepaon holder object of the dropped backpack.
2015-04-11 13:59:21 +00:00
*
* Argument:
* 0: Unit that has a backpack (Object)
*
* Return value:
2015-04-11 14:27:04 +00:00
* Ground wepaon holder with backpack (Object)
2015-04-11 13:59:21 +00:00
*
*/
#include "script_component.hpp"
private "_unit";
_unit = _this select 0;
private "_backpackObject";
_backpackObject = backpackContainer _unit;
_unit addBackpack "Bag_Base";
removeBackpack _unit;
private "_holder";
_holder = objNull;
{
if (_backpackObject in everyBackpack _x) exitWith {
_holder = _x;
};
} forEach (position _unit nearObjects ["WeaponHolder", 5]);
_holder