Announcement

Collapse
No announcement yet.

Helicopter Supply Drop

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Helicopter Supply Drop

    in this script a helicopter will spawn in and drop the specified object near the location you pass in. you need to pass in an array for the drop location and a classname (string).

    heres the script:
    Code:
    _location1 = [(_this select 0) select 0,(_this select 0) select 1,0];
    _classname = _this select 1;
    
    _location2 = _location1 distance [8915,21490,0];
    _location3 = _location1 distance [27275,24880,0];
    
    _lowest = _location2;
    _lowest2 = [8915,21490,0];
    if (_location3<_lowest) then {_lowest2 = [27275,24880,0]};
    
    _veh = "B_Heli_Transport_01_F" createvehicle (_lowest);
    _group1 = creategroup west;
    "B_Helipilot_F" createunit [_lowest,_group1,"this moveindriver _veh"];
    _veh flyinheight 100;
    
    _veh domove (_location1);
    
    waituntil {unitReady _veh};
    _veh domove _location1;
    _veh3 = "B_Parachute_02_F" createvehicle ([getpos _veh select 0,getpos _veh select 1,0]);
    
    _veh2 = _classname createvehicle ([getpos (_this select 0) select 0,getpos (_this select 0) select 1,3]);
    _veh3 setpos [(getpos _veh select 0)-3,(getpos _veh select 1)-3,(getpos _veh select 2)-1];
    _veh2 attachto [_veh3,[0,0,0]];
    waituntil {(getpos _veh2 select 2)<= 0};
    detach _veh2;
    _helipad = "Land_HelipadEmpty_F" createvehicle (_location1);
    waituntil {unitReady _veh};
    _driver = driver _veh;
    dogetout _driver;
    waituntil {(count (crew _veh))==0};
    deletevehicle _driver;
    deletevehicle _veh;
    deletevehicle _helipad;
    to call this script you need to call it like this:
    Code:
    nul = [getmarkerpos "dropzone","example_ammo_classname"] execVM "helidrop.sqf";
    //this one is for a marker pos
    
    nul = [getpos teamleader1,"example_ammo_classname"] execVM "helidrop.sqf";
    //this one is for a player
    its very important that the first parameter is an array with two numbers. supplying a unit name without calling getPos will not work.
    however i could make a more universal script upon request
    Yink | Vanilla Pilot | Killer of Stirling | CS GOD | Projects Team

Connect

Collapse

TeamSpeak 3 Server

Collapse

Advertisement

Collapse

Twitter Feed

Collapse

Working...
X