Jump to content
  • 0

heli fast rope


JakeQue

Question

2 answers to this question

Recommended Posts

  • 0

Ok, found this. 

Would it work?!

 

addaction.sqf

Spoiler

_array = _this select 3;
_param = _array select 0;
_code  = _array select 1;
_spawn = _param spawn _code;

 

fastropeinit.sqf

Spoiler

#include "functions.sqf"
BTC_fast_rope_h = 10;
BTC_AI_fast_rope_on_deploy = 1;
BTC_roping_chopper = ["MH60S","UH60M_EP1","CH_47F_EP1_DZE","MH60S_DZE","Mi17_DZE","UH1H_DZE","UH1Y_DZE","UH60M_EP1_DZE"];
{
    _rope = _x addaction [("<t color=""#ED2744"">") + ("Deploy Rope") + "</t>","addAction.sqf",[[],BTC_deploy_rope],7,true,false,"","player == driver _target && format [""%1"",_target getVariable ""BTC_rope""] != ""1"" && ((getPos _target) select 2) < BTC_fast_rope_h && speed _target < 2"];
    _rope = _x addaction [("<t color=""#ED2744"">") + ("Cut Rope") + "</t>","addAction.sqf",[[],BTC_cut_rope],7,true,false,"","player == driver _target && format [""%1"",_target getVariable ""BTC_rope""] == ""1"""];
    _out  = _x addaction [("<t color=""#ED2744"">") + ("Fast Rope") + "</t>","addAction.sqf",[[player],BTC_fast_rope],7,true,false,"","player in (assignedCargo _target) && format [""%1"",_target getVariable ""BTC_rope""] == ""1"""];
} foreach (nearestObjects [player, BTC_roping_chopper, 50000]);

 

functions.sqf

Spoiler

BTC_deploy_rope =
{
    hint "Rope deployed";
    _veh = vehicle player;
    _veh setVariable ["BTC_rope",1,true];
    if (BTC_AI_fast_rope_on_deploy == 1) then {_fast_rope = [_veh] spawn BTC_AI_fast_rope};
    WaitUntil {!Alive _veh || !Alive player || (((getPos player) select 2) > BTC_fast_rope_h) || format ["%1",_veh getVariable "BTC_rope"] != "1"};
    _veh setVariable ["BTC_rope",0,true];
};
BTC_cut_rope =
{
    hint "Rope cut";
    _veh = vehicle player;
    _veh setVariable ["BTC_rope",0,true];
};
BTC_fast_rope =
{
    hint "fast roping";
    _unit = _this select 0;
    _veh = vehicle _unit;
    _unit action ["EJECT",_veh];
    _unit setPos (_veh modelToWorld [2,1,-2]);
    unassignVehicle _unit;
    _unit switchMove "LadderRifleStatic";
    _unit setDir (getDir _veh - 90);
    WaitUntil {!Alive _unit || (((getPos _unit) select 2) < 1.5)};
    if (Alive _unit && (((getPos _veh) select 2) < BTC_fast_rope_h) && speed _veh < 5) then
    {
        _unit setVelocity [0,0,0];
        _unit playMove "LadderRifleDownOff";
        if !(isPlayer _unit) then {_unit move [((getPos _unit) select 0) + 3,((getPos _unit) select 1) + 3,0];};
    };
    if (((getPos _veh) select 2) > BTC_fast_rope_h) then {hint "The chopper flew away! The rope has been cut!";};
};
BTC_AI_fast_rope = 
{
    _veh = _this select 0;
    _veh flyInHeight (BTC_fast_rope_h - 2);
    _time = time + 60;
    WaitUntil {!Alive _veh || !Alive driver _veh || (((getPos _veh) select 2) <= BTC_fast_rope_h) || _time < time};
    doStop _veh;
    if (Alive _veh && Alive driver _veh && (((getPos _veh) select 2) <= (BTC_fast_rope_h + 1))) then
    {
        {
            if !(isPlayer _x) then {_fast_rope = [_x] spawn BTC_fast_rope;sleep 3;};
        } foreach assignedCargo _veh;
    };
    sleep 3;
    _veh move position _veh;
};

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Discord

×
×
  • Create New...