ACE3/addons/sandbag/functions/fnc_pickup.sqf

41 lines
780 B
Plaintext
Raw Normal View History

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
*/
#include "script_component.hpp"
params ["_unit", "_sandbag"];
2015-06-02 17:30:50 +00:00
_unit playActionNow "PutDown";
_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 EFUNC(common,waitAndExecute);