Jump to content

Recommended Posts

Greets guys (and girls if there are any) !

 

I need a script bu which only pilots can use choppers and planes. Can anyone explain how to do that? 

 

Thanks

 

Share this post


Link to post
Share on other sites

https://community.bistudio.com/wiki/getUnitTrait

I didn't test but this can return the pilot trait. If not you can check the class of the unit if it is pilot or not via

https://community.bistudio.com/wiki/isKindOf

classes are here

https://community.bistudio.com/wiki/Arma_3_CfgVehicles_WEST

 

then you can use event handler get in on the vehicle which you want the restriction

https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#GetIn

 

and in case unit is not pilot youc an kick him out via

 

https://community.bistudio.com/wiki/moveOut

 

This is what I would do as aproach. Didn't tested it so cannot guarantee if it will achieve your desired result (KillzoneKid protection sentence :P )

Share this post


Link to post
Share on other sites

Give this a go. Assumes that you want to the pilot and copilot to be a pilot-type soldier. Doesn't handle switch seats.
 

player addEventhandler ["GetInMan", {
	params ["_unit", "", "_vehicle"];
	
	if (_vehicle isKindOf "Air" && {!(_vehicle isKindOf "ParachuteBase") && {assignedVehicleRole _unit in [['driver'], ['Turret', [0]]] && {!((toUpper typeOf _unit find toUpper "Pilot") > -1)}}}) then {
		moveOut _unit;
		hint "YOU ARE NOT A PILOT; THOUT SHALL NOT ENTER";
	};
}];

 

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

×