Sarge-AI/ModName.MapName/scripts/UPSMON/COMMON/vehicles/fnc/UPSMON_checkleaveVehicle.sqf
Teh Dango 65e4453908 2.4.0
Major Update. Now supporting DesolationRedux, Epoch and Exile.
2017-12-31 03:16:37 -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;
};