Jump to content
Sign in to follow this  
75thRanger

need someone who knows a great deal with scripting

Recommended Posts

I was wondering if some could help me make a script where if your the gunner of a helicopter you can switch to the pilot to fly then switch back to thegunner i know about slx car mod and gdt mod but that allows you to use the gunner optics i need to be the gunner then switch to pilot thanks for reading and considering heping -joel

Share this post


Link to post
Share on other sites

this will work in SP / MP environments

a simple way to do it is

in the init of the chopper add

 _nill = [this] execVM "Swap_Actions.sqf";

Swap_Actions.sqf

_veh = _this select 0;

//Swap Actions
//------------

_veh addAction ["Move To Gunner" , "To_Gunner.sqf",[],0,false,false,"","(isplayer (driver _target)) and !(isplayer (gunner _target))"];
_veh addAction ["Move To Driver" , "To_Driver.sqf",[],0,false,false,"","!(isplayer (driver _target)) and (isplayer (gunner _target))"];

To_Driver.sqf

private ["_veh","_driver","_gunner"];

_veh = _this select 0;
_driver = driver _veh;
_gunner = gunner _veh;

_driver setpos [0,0,1];
_driver setVelocity [0, 0, 0];
waituntil {((_veh emptypositions "Driver") == 1)};
_gunner action ["moveToDriver", _veh];
_driver moveinGunner _veh;
_driver assignasGunner _veh;

To_Gunner.sqf

private ["_veh","_driver","_gunner"];

_veh = _this select 0;
_driver = driver _veh;
_gunner = gunner _veh;

_gunner setpos [0,0,1];
_gunner setVelocity [0, 0, 0];
waituntil {((_veh emptypositions "Gunner") == 1)};
_driver action ["moveTogunner", _veh];
_gunner moveindriver _veh;
_gunner assignasdriver _veh;

Edited by Zonekiller

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  

×