mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
8f46ffd8d5
count -> forEach Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
41 lines
797 B
Plaintext
41 lines
797 B
Plaintext
#include "..\script_component.hpp"
|
|
/*
|
|
* Author: Ruthberg
|
|
* Pick up sandbag
|
|
*
|
|
* Arguments:
|
|
* 0: unit <OBJECT>
|
|
* 1: sandbag <OBJECT>
|
|
*
|
|
* Return Value:
|
|
* None
|
|
*
|
|
* Example:
|
|
* [_unit, _sandbag] call ace_sandbag_fnc_pickup
|
|
*
|
|
* Public: No
|
|
*/
|
|
|
|
params ["_unit", "_sandbag"];
|
|
|
|
[_unit, "PutDown"] call EFUNC(common,doGesture);
|
|
|
|
_unit setVariable [QGVAR(isUsingSandbag), true];
|
|
|
|
[{
|
|
params ["_unit", "_sandbag"];
|
|
|
|
_unit setVariable [QGVAR(isUsingSandbag), false];
|
|
|
|
if (isNull _sandbag) exitWith {};
|
|
|
|
deletevehicle _sandbag;
|
|
|
|
// Force physx update
|
|
{
|
|
_x setPosASL (getPosASL _x);
|
|
} forEach (_unit nearObjects ["ACE_SandbagObject", 5]);
|
|
|
|
[_unit, "ACE_Sandbag_empty"] call EFUNC(common,addToInventory);
|
|
}, [_unit, _sandbag], 1.5] call CBA_fnc_waitAndExecute;
|