Jump to content
Sign in to follow this  
pvtdancer

Ending Scripted animation based on player location.

Recommended Posts

Hey All, Since I finished up this script and got all my questions answered I'm editing this so if you want you can use this script as well. Attached is a link to download a mission preview and the script itself. This has been tested in SP and MP and on a Dedicated server. It works with all of them.

private ["_heli", "_grp"];

   // lets set some local variables
   _heli = _this select 0;
   _grp = _this select 1;
   _chuteType = "Steerable_Parachute_f";    //parachute type
   _player =  _this;    
   _HQ = [West,"HQ"];  // do not touch this!

   {
   player action ["Eject", vehicle player];
   sleep 0.5;
} forEach (units player);

       _chute = createVehicle [_chuteType, [100, 100, 200], [], 0, 'FLY'];
       _chute setPos [getPosASL _heli select 0, getPosASL _heli select 1, (getPosASL _heli select 2) - 35];
       _grp moveInDriver _chute;
       waitUntil {(position _grp select 2) < .7};

http://filesmelt.com/dl/Eject_Preview.Altis_.zip

Edited by PvtDancer

Share this post


Link to post
Share on other sites
_pilot = player;

_parachute = "Steerable_Parachute_F" createVehicle (getPos _pilot);
_parachute setDir (getDir _pilot);
_parachute setPos (getPos _pilot);

_pilot moveInDriver _parachute;

waitUntil {(position _pilot select 2) < 2};
_pilot action ["eject", vehicle _pilot];
_pilot setDamage 0;
_pilot switchMove "AmovPercMevaSrasWrflDf_AmovPknlMstpSrasWrflDnon";

Share this post


Link to post
Share on other sites

Thanks, I'll give that a shot tonight when I get home. I guess the way I was attaching the chute was the wrong way lol.

Share this post


Link to post
Share on other sites

Thanks again for all the help and sorry for the double post. Below is my current version of this script which I now have working nearly flawlessly. Works with all helicopters moving or hovering. BUT does not work in multiplayer. That will be the next step. I'll start researching but if anyone has advice I'll take it.

private ["_heli", "_grp"];

// lets set some local variables
_heli = _this select 0;
_grp = _this select 1;
   _chuteType = "Steerable_Parachute_f";	
   _player =  _this;	
   _HQ = [West,"HQ"];  // do not touch this!

{
_x action ["EJECT", _heli];
sleep 0.5;
} forEach (units _grp);

	_chute = createVehicle [_chuteType, [100, 100, 200], [], 0, 'FLY'];
	_chute setPos [getPosASL _heli select 0, getPosASL _heli select 1, (getPosASL _heli select 2) - 25];
	_grp moveInDriver _chute;
	waitUntil {(position _grp select 2) < 1.5;
	_grp switchmove "GetOutPara";

Edited by PvtDancer

Share this post


Link to post
Share on other sites

Well I fixed the MP part of it. Wow I searched for 2 days googling my fingers and I couldn't find that. Well while similar to the one you linked all you have to do with this one is add an init line this this addAction["<t color='#ff1111'>Eject</t>", "scripts\eject.sqf",[],1,false,true,"","_this in _target"]; to the vehicles you want this enabled to and link the script and is working great on my dedicated server.

The line I changed was

_x action ["EJECT", _heli]; TO player action ["Eject", vehicle player];

private ["_heli", "_grp"];

// lets set some local variables
_heli = _this select 0;
_grp = _this select 1;
   _chuteType = "Steerable_Parachute_f";	//parachute type
   _player =  _this;	
   _HQ = [West,"HQ"];  // do not touch this!

{
player action ["Eject", vehicle player];
sleep 0.5;
} forEach (units player);

	_chute = createVehicle [_chuteType, [100, 100, 200], [], 0, 'FLY'];
	_chute setPos [getPosASL _heli select 0, getPosASL _heli select 1, (getPosASL _heli select 2) - 35];
	_grp moveInDriver _chute;
	waitUntil {(position _grp select 2) < .7};
	player setUnitPos "Middle";

EDIT: Found it.... Not sure how I lost that bracket.

Edited by PvtDancer

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×