Sarge-AI/scripts/UPSMON/COMMON/vehicles/fnc/UPSMON_checkleaveVehicle.sqf
Teh Dango 3ac749d64b 2.1.0
This is the latest stable version of Sarge AI for Arma 3: Exile.
2016-02-19 21:49:51 -05:00

36 lines
718 B
Plaintext

/****************************************************************
File: UPSMON_checkleaveVehicle.sqf
Author: MONSADA
Description:
If every on is outside, make sure driver can move
Parameter(s):
<--- leader
<--- vehicle
<--- driver
Returns:
Nothing
****************************************************************/
private["_npc","_vehicle","_driver","_in"];
_npc = _this select 0;
_vehicle = _this select 1;
_driver = _this select 2;
_in = false;
//Take time to go all units
sleep 5;
{
if (_x != vehicle _x) then {_in = true};
}foreach units _npc;
// if no one is inside
if (!_in) then {
_driver enableAI "MOVE";
sleep 1;
_driver stop false;
sleep 1;
_driver leaveVehicle _vehicle;
sleep 1;
};