2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
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
|
|
|
|
*/
|
|
|
|
|
2015-09-26 01:16:55 +00:00
|
|
|
params ["_unit", "_sandbag"];
|
2015-06-02 17:30:50 +00:00
|
|
|
|
2016-07-12 14:16:01 +00:00
|
|
|
[_unit, "PutDown"] call EFUNC(common,doGesture);
|
2015-06-02 17:30:50 +00:00
|
|
|
|
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);
|
2016-05-22 13:27:24 +00:00
|
|
|
}, [_unit, _sandbag], 1.5] call CBA_fnc_waitAndExecute;
|