ACE3/addons/sandbag/functions/fnc_pickup.sqf

41 lines
795 B
Plaintext
Raw Normal View History

#include "..\script_component.hpp"
2015-06-02 17:30:50 +00:00
/*
* Author: Ruthberg
* Pick up sandbag
*
* Arguments:
* 0: unit <OBJECT>
* 1: sandbag <OBJECT>
2015-06-02 17:30:50 +00:00
*
* Return Value:
* None
*
* Example:
* [_unit, _sandbag] call ace_sandbag_fnc_pickup
2015-06-02 17:30:50 +00:00
*
* Public: No
*/
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
_unit setVariable [QGVAR(isUsingSandbag), true];
2015-06-02 17:30:50 +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
// 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);
}, [_unit, _sandbag], 1.5] call CBA_fnc_waitAndExecute;