Jump to content
Sign in to follow this  
frezinator

Need help on scripting ( 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
You could try a getIn eventhandler, then check for the player type.

http://community.bistudio.com/wiki/ArmA_2:_Event_Handlers#GetIn

Sorry I don't how to use event handler :/ I only know how to use codes or script, and im playing arma 2 free version btw.

do you know any scripts or codes that I can use to make pilots only fly planes??? I don't want other soldiers to fly the planes

Share this post


Link to post
Share on other sites

["Tank", "US_Soldier_Crew_EP1"] execVM "pilotCheck.sqf"; dont use this one!

otherwise - use the top code to create sqf pilotcheck

and place the other code in your init.

Share this post


Link to post
Share on other sites
["Tank", "US_Soldier_Crew_EP1"] execVM "pilotCheck.sqf"; dont use this one!

otherwise - use the top code to create sqf pilotcheck

and place the other code in your init.

kk im using MV-22 aircraft, I only want pilots to fly but soldiers can still get in the mv-22 for transport.

Can you specifically tell me what am I supposed to put in int.sqf and pilotCheck.sqf?

---------- Post added at 02:03 ---------- Previous post was at 01:18 ----------

kk its working, it kicks soldiers but my problem is it also kick pilots.

im using MV-22 so I changed the "Helicopter" to "Plane".

This is what I put in pilotCheck.sqf

_vehicleType = _this select 0;  // "Plane" / "Tank"
_crewType = _this select 1;  // "US_Soldier_Pilot_EP1"

//hint format["%1 - %2",_crewType, _vehicleType];
 if (typeof player != _crewType) then {
   private "_v";
   while {alive player} do {
     waituntil {vehicle player != player};
     _v = vehicle player;
     if (_v iskindof _vehicleType && !(_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.";
       };
     };
   };
 };

This what I used for int.sqf

["Plane", "US_Soldier_Pilot_EP1"] execVM "pilotCheck.sqf";

execVM "TKP.sqf";

veh = [this] execVM "vehicle.sqf"

//begin init.sqf

//Add briefing
execVM "briefing.sqf";

if(true) exitWith {};

Do you see any errors that I can fix????? I've been working for this like 16 hours and I cant find any solution, I almost giving up

Edited by frezinator

Share this post


Link to post
Share on other sites

sounds like you have the wrong pilot

place this in the pilots init box and it should display the pilot type

 hint str typeof this

and if it's not this "US_Soldier_Pilot_EP1" either select the right pilot or change the code to match.

example

["Plane", "USMC_Soldier_Pilot"] execVM "pilotCheck.sqf";

Share this post


Link to post
Share on other sites
sounds like you have the wrong pilot

place this in the pilots init box and it should display the pilot type

 hint str typeof this

and if it's not this "US_Soldier_Pilot_EP1" either select the right pilot or change the code to match.

example

["Plane", "USMC_Soldier_Pilot"] execVM "pilotCheck.sqf";

Thank you so much!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! I love you !!!!!!!!!!!!!! no homo lol!! thank you thank you thank you thank you!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! I finally fixed it!!!!!! you were right!!!! My pilot was different, I have a USMC_Soldier_pilot, then in the script I used "US_Soldier_Pilot_Ep1", That's why when I go to pilot class it kicks me out of the plane. So, what I did is I followed ur instructions and I changed "US_Soldier_Pilot_Ep1" to "USMC_Soldier_pilot" then it works!!!! Pilot can fly and soldiers can't fly the plane!!!

Thank you so much!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! God bless you!!!!

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
Sign in to follow this  

×