Simple Para DroppingbyBroBeans Description A simple ParaDrop script that lets you keep your original backpack and loadout without the need to have a parachute. You can assign any backpack you want, let the unit board a Helo then paradrop and keep their original assigned backpack. Once outside the aircraft this script will spawn a parachute and move the unit into it. Once the unit hits the ground, the parachute disappears and the unit gets his original backpack back again. Code ParaDrop.sqf if (!isServer) exitWith {};
private ["_paras","_chopper","_chuteHeight","_dir"];
_paras = _this select 0;
_chopper = _this select 1;
_chuteheight = if ( count _this > 1 ) then { _this select 2 } else { 100 };
_chopper allowDamage false;
_dir = direction _chopper;
paraLandSafe =
{
private ["_unit"];
_unit = _this select 0;
_chuteheight = _this select 1;
(vehicle _unit) allowDamage false;
0=[_unit,_chuteheight] spawn OpenPlayerchute;
waitUntil { isTouchingGround _unit || (position _unit select 2) < 1 };
_unit action ["eject", vehicle _unit];
sleep 1;
_inv = name _unit;
[_unit, [missionNamespace, format["%1%2", "Inventory",_inv]]] call BIS_fnc_loadInventory;// Reload Loadout.
_unit allowdamage true;// Now you can take damage.
};
OpenPlayerChute =
{
private ["_paraPlayer"];
_paraPlayer = _this select 0;
_chuteheight = _this select 1;
waitUntil {(position _paraPlayer select 2) < _chuteheight};
_paraPlayer action ["openParachute", _paraPlayer];
};
{
_inv = name _x;
[_x, [missionNamespace, format["%1%2", "Inventory",_inv]]] call BIS_fnc_saveInventory;// Save Loadout
removeBackpack _x;
_x disableCollisionWith _chopper;// Sometimes units take damage when being ejected.
_x allowdamage false;// Trying to prevent damage.
_x addBackPack "B_parachute";
unassignvehicle _x;
moveout _x;
_x setDir (_dir + 90);// Exit the chopper at right angles.
sleep 0.3;
} forEach _paras;
_chopper allowDamage true;
{
[_x,_chuteheight] spawn paraLandSafe;
} forEach _paras; Syntax [GROUP,VEHICLE, ALTITUDE] execVM "ParaDrop.sqf"; Parameters 0: GROUP : Group - name of group that will be paradropped (group) 1: VEHICLE : Object - name of vehicle that will be doing the paradrop (helicopter) 2: ALTITUDE : Number (optional) - the altitude where the group will open their parachute (number) Usage TRIGGER/WAYPOINT - On Act Example _drop =[Alpha,Heli,135] execVM "ParaDrop.sqf"; Credits
|
Pay attention for assignedCargo command which not returns all the seats of an helicopter (for example, the MH9 benches are not assigned, as cargo or else). For better result, you should use assignAsCargo command prior to this script.
Total comments : 1, displayed on page: 1