Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Written by beta
- //Ideas from GeneralCarver
- //Places shellscrape
- private["_type", "_id", "_pos", "_dir", "_obj", "_nearShellscrapes", "_newObj"];
- _id = _this select 2;
- _type = _this select 3 select 0;
- _obj = _this select 3 select 1;
- _nearShellscrapes = nearestObjects [player, [_type], 3];
- _nearShellscrapes = _nearShellscrapes - [_obj];
- if ((count _nearShellscrapes) < 1) then {
- player removeAction _id;
- player setVariable ["objDeployed", true, false];
- _pos = getPosATL _obj;
- _dir = getDir _obj;
- deleteVehicle _obj;
- _pos = [_pos select 0, _pos select 1, 0.05];
- _newObj = _type createVehicle _pos;
- _x = _pos select 0;
- _y = _pos select 1;
- _z = _pos select 2;
- _newObj setDir _dir;
- player playMove "AinvPknlMstpSlayWrflDnon_medic";
- _startTime = time;
- _duration = 150;
- _startDepth = 0.46;
- _newObj setPosATL [_x, _y, _z - _startDepth];
- _top = getTerrainHeightASL [_x, _y +1];
- _bottom = getTerrainHeightASL [_x, _y -1];
- _left = getTerrainHeightASL [_x -1, _y];
- _right = getTerrainHeightASL [_x +1, _y];
- _newObj setVectorUp [_left - _right, _bottom - _top, 2];
- _stopAction = player addAction ["Stop Digging", "bScripts\deploy\stopShellscrape.sqf", [_obj], 99, true, false, "", ""];
- _depth = _startDepth;
- while {_depth >= 0 && !(player getVariable ["stopDigging", false])} do {
- if (animationState player != "AinvPknlMstpSlayWrflDnon_medic") then {
- player playMove "AinvPknlMstpSlayWrflDnon_medic";
- };
- _depth = (1 - ((time - _startTime) / _duration)) * _startDepth;
- _newObj setPosATL [_x, _y, _z - _depth];
- sleep 0.1;
- };
- player removeAction _stopAction;
- player setVariable ["stopDigging", false, false];
- } else {
- hintSilent "You cannot deploy a shellscrape within 3m of another shellscrape";
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement