Jump to content
Sign in to follow this  
frezinator

Need help on scripting for arma 2 "Pilots can only fly planes"

Recommended Posts

I made my own mission and i want only the pilots to fly the C-130J Planes. Also, i want the pilots to be unarmed and are not allowed to go the ammo crates. Can someone help me plzzzz????

I don't know what to put for int.sqf and pilotCheck.sqf :(

Share this post


Link to post
Share on other sites

Wrong forum, fella. This is Armed Assault, you want to Arma2 forums, further up. :)

Share this post


Link to post
Share on other sites

Simple google search gives results in first hit.

pilotcheck.sqf

 if (typeof player != "US_Soldier_Pilot_EP1") then {
   private "_v";
   while {alive player} do {
     waituntil {vehicle player != player};
     _v = vehicle player;
     if (_v iskindof "Helicopter" && !(_v iskindof "ParachuteBase")) then {
       if (driver _v == player) then {
         player action ["eject",_v];
         waituntil {vehicle player == player};
         hint "We shall leave the piloting to those with the appropriate training.";
       };
     };
   };
 };

Run from pilots init line

nul = [] execVM "pilotCheck.sqf";

or from init.sqf in a mission

player execVM "pilotCheck.sqf";

Note that "US_Soldier_Pilot_EP1" is a class of your pilot, so if you use any other pilot than this one replace it in the script with your class.

Pilotcheck.sqf needs to be in your mission folder and it is root. If you place it inside your missions "mymission.chernarus\scripts\" folder then you need to change the init line to accommodate it. Ie:

Pilots init line

nul = [] execVM "scripts\pilotCheck.sqf";

Edited by _MaSSive

Share this post


Link to post
Share on other sites

erm dude wtf?? i copied and paste the code to my pilotcheck.sqf and i pasted the code u wrote into my pilots init box.when i use pilot class it tells me that we should leave piloting to those with appropriate training.when i use other class same thing happens.please help i use arma 2 free

Share this post


Link to post
Share on other sites

First of all, you need to be nicer to someone who went out of their way to help.....'wtf' really isn't the way to go about it.....

Are the pilots you're using the one he specified in the script?

From above....'Note that "US_Soldier_Pilot_EP1" is a class of your pilot, so if you use any other pilot than this one replace it in the script with your class.'

Thats the first question to be answered.

Share this post


Link to post
Share on other sites
First of all, you need to be nicer to someone who went out of their way to help.....'wtf' really isn't the way to go about it.....

Are the pilots you're using the one he specified in the script?

From above....'Note that "US_Soldier_Pilot_EP1" is a class of your pilot, so if you use any other pilot than this one replace it in the script with your class.'

Thats the first question to be answered.

how do i find out my pilots class?

Share this post


Link to post
Share on other sites

Google bro it's called google. There are many threads and things on google about this.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×