2015-06-02 17:30:50 +00:00
|
|
|
/*
|
|
|
|
* Author: Ruthberg
|
|
|
|
* Pick up sandbag
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: sandbag <OBJECT>
|
|
|
|
* 1: unit <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2015-08-08 00:00:00 +00:00
|
|
|
* [_sandbag, _unit] call ace_sandbag_fnc_pickup
|
2015-06-02 17:30:50 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-08-08 00:00:00 +00:00
|
|
|
params ["_sandbag", "_unit"];
|
2015-06-02 17:30:50 +00:00
|
|
|
|
|
|
|
_unit playActionNow "PutDown";
|
|
|
|
|
|
|
|
_unit setVariable [QGVAR(usingSandbag), true];
|
|
|
|
[{
|
2015-08-08 00:00:00 +00:00
|
|
|
params ["_sandbag", "_unit"];
|
2015-06-02 17:30:50 +00:00
|
|
|
_unit setVariable [QGVAR(usingSandbag), false];
|
|
|
|
deletevehicle _sandbag;
|
2015-08-08 00:00:00 +00:00
|
|
|
|
2015-06-04 09:13:12 +00:00
|
|
|
// Force physx update
|
|
|
|
{
|
|
|
|
_x setPosASL (getPosASL _x);
|
2015-08-08 00:00:00 +00:00
|
|
|
} count (_unit nearObjects ["ACE_SandbagObject", 5]);
|
|
|
|
|
2015-06-02 17:30:50 +00:00
|
|
|
[_unit, "ACE_Sandbag_empty"] call EFUNC(common,addToInventory);
|
|
|
|
}, [_sandbag, _unit], 1.5, 0.5] call EFUNC(common,waitAndExecute);
|