OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: 70gunner on 21 May 2007, 23:45:56

Title: Authorisedscript
Post by: 70gunner on 21 May 2007, 23:45:56
Currently looking for the an authorisation script for the use of any vehicle.

Only pilots can fly
crewmembers can only use driver/gunner/commanderseat in armor

Can somebody point me inthe right direction.

Thanks in advance
Title: Re: Authorisedscript
Post by: Mandoble on 22 May 2007, 00:02:19
Try running this script in the init field of each vehicle you want to proctect.
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;
};
Title: Re: Authorisedscript
Post by: 70gunner on 23 May 2007, 07:46:17
Thx working like it should  :good: