2015-06-02 17:30:50 +00:00
|
|
|
/*
|
|
|
|
* Author: Ruthberg
|
|
|
|
* Pick up sandbag
|
|
|
|
*
|
|
|
|
* Arguments:
|
2015-09-26 01:16:55 +00:00
|
|
|
* 0: unit <OBJECT>
|
|
|
|
* 1: sandbag <OBJECT>
|
2015-06-02 17:30:50 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2015-09-26 01:16:55 +00:00
|
|
|
* [_unit, _sandbag] call ace_sandbag_fnc_pickup
|
2015-06-02 17:30:50 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-09-26 01:16:55 +00:00
|
|
|
params ["_unit", "_sandbag"];
|
2015-06-02 17:30:50 +00:00
|
|
|
|
|
|
|
_unit playActionNow "PutDown";
|
|
|
|
|
2015-09-26 01:16:55 +00:00
|
|
|
_unit setVariable [QGVAR(isUsingSandbag), true];
|
|
|
|
|
2015-06-02 17:30:50 +00:00
|
|
|
[{
|
2015-09-26 01:16:55 +00:00
|
|
|
params ["_unit", "_sandbag"];
|
|
|
|
|
|
|
|
_unit setVariable [QGVAR(isUsingSandbag), false];
|
|
|
|
|
|
|
|
if (isNull _sandbag) exitWith {};
|
|
|
|
|
2015-06-02 17:30:50 +00:00
|
|
|
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);
|
2015-09-26 01:16:55 +00:00
|
|
|
}, [_unit, _sandbag], 1.5] call EFUNC(common,waitAndExecute);
|