OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: sharkattack on 19 Apr 2008, 12:30:30

Title: only pilot s can fly
Post by: sharkattack on 19 Apr 2008, 12:30:30
hi
how can i lock aircraft to all but pilots   ???
many thanks

edit
====
found  a script to do it  .. but cant get it working

script by mandoble

Code: [Select]
// Only pilots.sqf
// Only pilots piloting

_vehicle = _this select 0;
_pilotstypes = ["SoldierWPilot", "BISCamelPilot", "SoldierEPilot", "BISCamelPilot2"];
_driver = objNull;

while {damage _vehicle < 0.5} do
{
   _driver = driver _vehicle;
   if (!isNull _driver) then
   {
      if (!((typeOf _driver) in _pilotstypes)) then
      {
         _driver action ["GETOUT", _vehicle];
      };
   };   
   Sleep 1;
};

and in init field of chopper i have

nul= [] execVM "onlypilots.sqf" 

anyone tell me what im doing wrong   as anyone is still able to fly the chopper
Title: Re: only pilot s can fly
Post by: Mandoble on 19 Apr 2008, 13:01:28

nul= [this] execVM "onlypilots.sqf" 
Title: Re: only pilot s can fly
Post by: sharkattack on 19 Apr 2008, 13:02:51
thank you   :good: