Skip to content

Authorized Crew Check

shadow-fa edited this page Feb 1, 2018 · 1 revision
File location f\authorisedCrew\fn_authorisedCrewCheck.sqf
Enabled by default? no
Enable/Disable in init.sqf
Runs on client

One way of encouraging players to stick to their designated roles is to prevent certain units from acting as pilots / drivers / gunners or commanders of specialist vehicles such as tanks and aircraft. The Authorised Crew Check component is a quick and easy way of ensuring that only players in selected slots are able to act as crew-members on particular vehicles. If a player that is not authorised to act as crew attempts to get in as anything except cargo (passenger), they will be automatically ejected with a warning message. The Authorised Crew Check component can also restrict crews of particular vehicles to unit types (such as pilots).

Usage

Setting specific units as authorised crew for a vehicle

In the ArmA 3 editor, select the vehicle and ensure it has a name in the Name field (such as MyTank).

Still in the editor, make sure the playable slots that you want to have as the authorised crew-members also have unique entries in their Name field (such as MyDriver, MyCommander and MyGunner). Note that all units in the F3 Folk ARPS Platoons have values in their Name fields already, which you can use.

Open the file init.sqf and look for the code segment entitled:

// F3 - Authorised Crew Check

Edit the following line, removing the // at the start, replacing VehicleName with the name of the vehicle, and the array [UnitName1,UnitName2] with an array containing the names of the authorised crew members.

// VehicleName addEventhandler ["GetIn", {[_this,[UnitName1,UnitName2],false] call f_fnc_authorisedCrewCheck}];

Example

For example, to ensure that only MyDriver, MyCommander and MyGunner can act as the crew of MyTank, change the line to:

MyTank addEventhandler ["GetIn", {[_this,[MyDriver,MyCommander,MyGunner],false] call f_fnc_authorisedCrewCheck}];

Setting specific type of units as authorised crew for a vehicle

For example, to ensure that only units of the class "B_Soldier_F" can act as the crew of MyTank, change the line to:

MyTank addEventhandler ["GetIn", {[_this,["B_Soldier_F"],false] call f_fnc_authorisedCrewCheck}];

This script also checks for all sub-classes of the parsed class. For example, to allow only any type of NATO soldier to MyTank, change the line to:

MyTank addEventhandler ["GetIn", {[_this,["B_Soldier_base_F"],false] call f_fnc_authorisedCrewCheck}];
Common unit types

Common unit types that you may want to use are:

Faction Type Classname
NATO General class B_Soldier_base_F
Pilot B_Helipilot_F
Armoured Crew B_crew_F
CSAT General class O_Soldier_base_F
Pilot O_helipilot_F
Armoured Crew O_crew_F
AAF General class I_Soldier_base_F
Pilot I_helipilot_F
Armoured Crew I_crew_F
FIA General class I_G_Soldier_base_F

Restricting cargo seats

If the last parameter is changed from false to true, the crew restrictions will apply to the vehicle's cargo slots as well. For example, in the following line only the unit named UnitNATO_CO would be allowed to either crew the vehicle named MyTruck or take any of its cargo seats.

MyTruck addEventhandler ["GetIn", {[_this,[UnitNATO_CO],true] call f_fnc_authorisedCrewCheck}];

Tips

  • There is a known limitation with this feature: if a unit enters a vehicle as a passenger, s/he can sometimes use the action menu to move to a pilot / driver / commander / gunner position.

Clone this wiki locally