mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge pull request #476 from acemod/dropbackpack
function to drop backpack
This commit is contained in:
commit
0bf32bfb3a
@ -39,6 +39,7 @@ PREP(displayText);
|
||||
PREP(displayTextPicture);
|
||||
PREP(displayTextStructured);
|
||||
PREP(doAnimation);
|
||||
PREP(dropBackpack);
|
||||
PREP(endRadioTransmission);
|
||||
PREP(eraseCache);
|
||||
PREP(execNextFrame);
|
||||
|
34
addons/common/functions/fnc_dropBackpack.sqf
Normal file
34
addons/common/functions/fnc_dropBackpack.sqf
Normal file
@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
*
|
||||
* Drops a backback. Also returns the ground wepaon holder object of the dropped backpack.
|
||||
*
|
||||
* Argument:
|
||||
* 0: Unit that has a backpack (Object)
|
||||
*
|
||||
* Return value:
|
||||
* Ground wepaon holder with backpack (Object)
|
||||
*
|
||||
*/
|
||||
#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
|
Loading…
Reference in New Issue
Block a user