oOFabioOo
New Member
Hello guys!
I want to share my new script with you.
What it does:
- You can switch from Gunner/Backseat to pilot's seat --> If you pilot looses connection, simply switch to pilot's seat!
- Pilot can switch to Back-/Gunnerseat and a AI Pilot will take place as pilot, so you can shoot people from the gunner, even when you are alone. The AI Pilot is controllable with the "," on the NumPad.
Instructions:
1. Add in your init.sqf at the VERY bottom the following code!
2. Create a folder called "Scripts" and create two files called "seat_action.sqf" and "switchseat.sqf"!
3. Paste in your seat_action.sqf the following code and edit the lines like shown...
4. Add this stuff to your switchseat.sqf!
If you want a AI Pilot:
If you don't want a AI Pilot:
DONE!
Thanks for testing it out and have a nice day

I want to share my new script with you.
What it does:
- You can switch from Gunner/Backseat to pilot's seat --> If you pilot looses connection, simply switch to pilot's seat!
- Pilot can switch to Back-/Gunnerseat and a AI Pilot will take place as pilot, so you can shoot people from the gunner, even when you are alone. The AI Pilot is controllable with the "," on the NumPad.
Instructions:
1. Add in your init.sqf at the VERY bottom the following code!
Code:
[] execVM "Scripts\seat_action.sqf";
2. Create a folder called "Scripts" and create two files called "seat_action.sqf" and "switchseat.sqf"!
3. Paste in your seat_action.sqf the following code and edit the lines like shown...
Code:
sleep 10;
{
If (typeOf _x in ["CH_47F_EP1_DZ","Mi17_DZ","UH60M_EP1_DZ","UH60M_EP1","MH60S","UH1H_DZ","UH1Y_DZ"]) then //Helis with 10+ seats armed
{
nul = _x addAction ["To Pilot's Seat","fixes\switchseat.sqf",["pilot"],5,false,true,"","player in (assignedVehicle _target) and driver _target != player"];
nul = _x addAction ["To Gunner's Seat","fixes\switchseat.sqf",["gunner"],5,false,true,"","driver _target == player"];
nul = _x addAction ["To Backseat","fixes\switchseat.sqf",["back"],5,false,true,"","driver _target == player"];
};
If (typeOf _x in ["Ka60_PMC","Mi17_Civilian_DZ","UH60M_MEV_EP1"]) then //Helis with 10+ seats unarmed
{
nul = _x addAction ["To Pilot's Seat","fixes\switchseat.sqf",["pilot"],5,false,true,"","player in (assignedVehicle _target) and driver _target != player"];
nul = _x addAction ["To Backseat","fixes\switchseat.sqf",["back"],5,false,true,"","driver _target == player"];
};
If (typeOf _x in ["AH6X_DZ","AH6X_EP1","AH6J_EP1","AH6J","GNT_C185","GNT_C185C","GNT_C185F","GNT_C185R","GNT_C185U"]) then //Helis with 2 seats unarmed
{
nul = _x addAction ["To Pilot's Seat","fixes\switchseat.sqf",["pilot"],5,false,true,"","player in (assignedVehicle _target) and driver _target != player"];
nul = _x addAction ["To Backseat","fixes\switchseat.sqf",["backlittle"],5,false,true,"","driver _target == player"];
};
If (typeOf _x in ["Ka137_MG_PMC"]) then //Helis with 2 seats armed
{
nul = _x addAction ["To Pilot's Seat","fixes\switchseat.sqf",["pilot"],5,false,true,"","player in (assignedVehicle _target) and driver _target != player"];
nul = _x addAction ["To Gunner's Seat","fixes\switchseat.sqf",["gunner"],5,false,true,"","driver _target == player"];
};
If (typeOf _x in ["MH6J_DZ","MH6J_EP1","MH6J"]) then //Helis with <7 seats
{
nul = _x addAction ["To Pilot's Seat","fixes\switchseat.sqf",["pilot"],5,false,true,"","player in (assignedVehicle _target) and driver _target != player"];
nul = _x addAction ["To Backseat","fixes\switchseat.sqf",["backmedium"],5,false,true,"","driver _target == player"];
};
} forEach (vehicles);
4. Add this stuff to your switchseat.sqf!
If you want a AI Pilot:
Code:
private ["_PILOT"];
_unit = player;
_veh = vehicle _unit;
_actionArray = _this select 3;
_action = _actionArray select 0;
enableRadio false;
showSubtitles false;
if (_action == "pilot") then
{
if (isNull driver _veh or !alive driver _veh or !isplayer driver _veh) then
{
_DEADORAI = driver _veh;
if (!isplayer driver _veh and alive driver _veh) then
{
driver _veh setpos [0,0,0];
deletevehicle _DEADORAI;
} else {
driver _veh setpos (getpos _veh);
};
sleep 0.5;
_unit action ["movetodriver", _veh];
sleep 1;
_unit action ["AutoHover", _veh];
_unit action ["engineOn", _veh];
sleep 0.5;
hint format ["You are now pilot!"];
} else {
sleep 0.5;
hint format ["There is already a pilot inside!"];
}
};
if (_action == "gunner") then
{
if (((getPos _veh) select 2) > 10) then
{
if (isNull gunner _veh or !alive gunner _veh) then
{
_PILOT = group player createUnit ["US_Pilot_Light_EP1", Position player, [], 0, "CAN_COLLIDE"];
_PILOT setVehicleVarName "_PILOT";
_PILOT setUnitAbility 0.60000002;
_PILOT removeweapon "itemmap";
_PILOT removeweapon "itemradio";
_PILOT removeweapon "itemwatch";
_PILOT removeweapon "itemcompass";
_unit action ["movetogunner", _veh];
sleep 0.1;
_PILOT action ["getindriver", _veh];
hint format ["You are now gunner!"];
} else {
sleep 0.5;
hint format ["There is already a gunner inside!"];
}
} else {
hint format ["You are flying too low!"];
}
};
if (_action == "back") then
{
if (((getPos _veh) select 2) > 10) then
{
_PILOT = group player createUnit ["US_Pilot_Light_EP1", Position player, [], 0, "CAN_COLLIDE"];
_PILOT setVehicleVarName "_PILOT";
_PILOT setUnitAbility 0.60000002;
_PILOT removeweapon "itemmap";
_PILOT removeweapon "itemradio";
_PILOT removeweapon "itemwatch";
_PILOT removeweapon "itemcompass";
_unit action ["movetocargo", _veh, 7];
sleep 0.1;
_PILOT action ["getindriver", _veh];
hint format ["You are now in the back!"];
} else {
hint format ["You are flying too low!"];
}
};
if (_action == "backlittle") then
{
if (((getPos _veh) select 2) > 10) then
{
_PILOT = group player createUnit ["US_Pilot_Light_EP1", Position player, [], 0, "CAN_COLLIDE"];
_PILOT setVehicleVarName "_PILOT";
_PILOT setUnitAbility 0.60000002;
_PILOT removeweapon "itemmap";
_PILOT removeweapon "itemradio";
_PILOT removeweapon "itemwatch";
_PILOT removeweapon "itemcompass";
_unit action ["movetocargo", _veh, 0];
sleep 0.1;
_PILOT action ["getindriver", _veh];
hint format ["You are now in the back!"];
} else {
hint format ["You are flying too low!"];
}
};
if (_action == "backmedium") then
{
if (((getPos _veh) select 2) > 10) then
{
_PILOT = group player createUnit ["US_Pilot_Light_EP1", Position player, [], 0, "CAN_COLLIDE"];
_PILOT setVehicleVarName "_PILOT";
_PILOT setUnitAbility 0.60000002;
_PILOT removeweapon "itemmap";
_PILOT removeweapon "itemradio";
_PILOT removeweapon "itemwatch";
_PILOT removeweapon "itemcompass";
_unit action ["movetocargo", _veh, 4];
sleep 0.1;
_PILOT action ["getindriver", _veh];
hint format ["You are now in the back!"];
} else {
hint format ["You are flying too low!"];
}
};
If you don't want a AI Pilot:
Code:
private ["_PILOT"];
_unit = player;
_veh = vehicle _unit;
_actionArray = _this select 3;
_action = _actionArray select 0;
enableRadio false;
showSubtitles false;
if (_action == "pilot") then
{
if (((getPos _veh) select 2) > 10) then
{
if (isNull driver _veh or !alive driver _veh or !isplayer driver _veh) then
{
_DEADORAI = driver _veh;
if (!isplayer driver _veh and alive driver _veh) then
{
driver _veh setpos [0,0,0];
deletevehicle _DEADORAI;
} else {
driver _veh setpos (getpos _veh);
};
sleep 0.5;
_unit action ["movetodriver", _veh];
sleep 1;
_unit action ["AutoHover", _veh];
_unit action ["engineOn", _veh];
sleep 0.5;
hint format ["You are now pilot!"];
} else {
hint format ["There is already a pilot inside!"];
}
} else {
hint format ["The altitude is too low!"];
}
};
if (_action == "gunner") then
{
if (((getPos _veh) select 2) > 10) then
{
if (isNull gunner _veh or !alive gunner _veh) then
{
_unit action ["movetogunner", _veh];
hint format ["You are now gunner!"];
} else {
sleep 0.1;
hint format ["There is already a gunner inside!"];
}
} else {
hint format ["You are flying too low!"];
}
};
if (_action == "back") then
{
if (((getPos _veh) select 2) > 10) then
{
_unit action ["movetocargo", _veh, 7];
hint format ["You are now in the back!"];
} else {
hint format ["You are flying too low!"];
}
};
if (_action == "backlittle") then
{
if (((getPos _veh) select 2) > 10) then
{
_unit action ["movetocargo", _veh, 0];
hint format ["You are now in the back!"];
} else {
hint format ["You are flying too low!"];
}
};
if (_action == "backmedium") then
{
if (((getPos _veh) select 2) > 10) then
{
_unit action ["movetocargo", _veh, 4];
hint format ["You are now in the back!"];
} else {
hint format ["You are flying too low!"];
}
};
DONE!
Thanks for testing it out and have a nice day

Last edited: