Skip to content

Instantly share code, notes, and snippets.

@jameslkingsley
Last active July 12, 2016 18:15
Show Gist options
  • Save jameslkingsley/f381657bd1823472587793f33e576bbb to your computer and use it in GitHub Desktop.
Save jameslkingsley/f381657bd1823472587793f33e576bbb to your computer and use it in GitHub Desktop.
private _objects = ["Land_PillboxBunker_01_rectangle_F", "Land_PillboxBunker_01_big_F", "Land_PillboxBunker_01_hex_F"];
{
{
_x addAction ["Pick up fort", {
params ["_target", "_caller", "_id"];
_target removeAction _id;
private _handle = [{
params ["_args", "_handle"];
_args params ["_target", "_caller"];
private _start = positionCameraToWorld [0,0,0];
private _end = (_start vectorAdd (getCameraViewDirection _caller vectorMultiply 10));
player setVariable ["Ebola", true];
_target attachTo [_caller, _caller worldToModel _end, "Pelvis"];
}, 0, _this] call CBA_fnc_addPerFrameHandler;
_caller addAction ["Detach", {
params ["_target", "_caller", "_id", "_args"];
_args params ["_pfhHandle"];
_target removeAction _id;
{
detach _x;
} forEach attachedObjects _target;
_target setVariable ["Ebola", false];
[_pfhHandle] call CBA_fnc_removePerFrameHandler;
}, [_handle]];
}, nil, 1.5, true, true, "", "!(player getVariable ['Ebola', false])"];
} forEach (allMissionObjects _x);
} forEach _objects;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment