These are a couple of simple codes I am using, which are working both in editor and MP missions.
I call them to add two permanent, different actions on the scroll menu, and they are shown only when player is on pilot seat, and to such pilot alone.
Please note that "_currentVehicle" is a variable name, so you need to change it according to your situation - most likely replace it for "this" if you wanna use it on editor ("init" field on vehicle's properties), or for "cursorObject" (in case you wanna paste the whole code for immediately testing purposes - but remember to delete all comments after "//" in this case).
#[READY] Create and Delete AI gunners for attack and support helicopters
1 messages · Page 1 of 1 (latest)
For Kajman and Blackfoot
`
// This code is meant for use on Kajman (East) and Blackfoot (West) only;
_currentVehicle addAction // replace "_currentVehicle" accordingly;
[
"<t color='#f0cc0f'>Recruit AI Gunner</t>",
{
_aiGunner = (group player) createUnit ["B_Deck_Crew_F", [0,0,0], [], 0, "NONE"];
sleep 0.25;
_aiGunner moveInGunner (vehicle player);
_aiGunner setCombatBehaviour "COMBAT"; // check wiki for other options;
_aiGunner setCombatMode "RED"; // check wiki for other options;
},
nil,
-8,
false,
true,
"",
"_this == _target turretUnit [-1]", //shown only for the pilot;
10,
false
];
_currentVehicle addAction
[
"<t color='#00000f'>Dismiss AI Gunner</t>",
{
_aiGunner = (vehicle player) turretUnit [0];
_aiGunner spawn
{
sleep 0.25;
deleteVehicle _this;
};
},
nil,
-9,
false,
true,
"",
"_this == _target turretUnit [-1]",
10,
false
];
`
Bohemia Interactive Forums
These are a couple of simple codes I am using, which are working both in editor and MP missions. I call them to add two permanent, different actions on the scroll menu, and they are shown only when player is on pilot seat, and to such pilot alone. Please note that _currentVehicle is a variable na...