Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Written by beta
- //Ideas from GeneralCarver
- //Deploys shellscrape
- private["_pos", "_confAct", "_cancAct", "_dir", "_obj"];
- _obj = "Fort_EnvelopeSmall" createVehicleLocal [0, 0, 0];
- _pos = player modelToWorld [0, 2, 0];
- _dir = getDir player;
- [_pos, _obj, _dir] spawn
- {
- private["_pos", "_dir", "_cancAct", "_confAct", "_obj"];
- _pos = _this select 0;
- _obj = _this select 1;
- _dir = _this select 2;
- _confAct = player addAction ["Confirm Deployment", "bScripts\deploy\placeShellscrape.sqf", ["fort_EnvelopeSmall", _obj], 99, true, false, "", ""];
- _cancAct = player addAction ["Cancel Deployment", "bScripts\deploy\cancelShellscrape.sqf", [_obj], 99, true, false, "", ""];
- while {!(player getVariable "objDeployed") && !(player getVariable "objCancelled") && alive player} do
- {
- _pos = player modelToWorld [0, 2, 0];
- _dir = getDir player;
- _obj setDir _dir;
- _pos = [_pos select 0, _pos select 1, 0.05];
- _obj setPosATL _pos;
- _x = _pos select 0;
- _y = _pos select 1;
- _z = _pos select 2;
- _top = getTerrainHeightASL [_x, _y +1];
- _bottom = getTerrainHeightASL [_x, _y -1];
- _left = getTerrainHeightASL [_x -1, _y];
- _right = getTerrainHeightASL [_x +1, _y];
- _obj setVectorUp [_left - _right, _bottom - _top, 2];
- sleep 0.1;
- };
- player removeAction _confAct;
- player removeAction _cancAct;
- player setVariable ["objDeployed", false, false];
- player setVariable ["objCancelled", false, false];
- if (!alive player) then
- {
- deleteVehicle _obj;
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement