This script restricts vehicles based on player roles and UIDs.
For example it can be used to restrict aircraft to pilots, door gunner seats to crew chiefs and certain vehicles to members.
Extract the vehicleRestrictions folder into your mission's root folder or any subfolder you want. Then add the following code to your init.sqf file (create one if necessary):
BAKE_VREST_RESTRICTIONS = [ ["blackHawk", "a10"], [ [['["Driver"]'], ["pilot_1", "pilot_2"], "Pilots only."], ], ["a10"], [ [['["Driver"]'], ["123", "456"], "Members only."] ] ]; execVM "vehicleRestrictions\init.sqf";
In the example above the pilot seats of the aircraft named blackHawk and a10 are restricted to the pilot_1 and pilot_2 roles. Furthermore the a10 is restricted to players with the UID 123 or 456.
Per vehicle restriction there are 2 arrays inside the BAKE_VREST_RESTRICTIONS array, one that defines the restricted vehicles and one that contains restriction arrays which consists of 3 values. The first value is an array of restricted vehicle roles, the second one a slot or UID whitelist and the last one a message to display.
To find out the vehicle roles add this line before execVM:
BAKE_VREST_SHOW_ROLE = true;Then enter a vehicle and the current role will be copied to your clipboard.
To suggest features, report issues, contribute or keep track of the development use the Git repository.