ACE3/addons/vehicles/functions/fnc_startEngine.sqf

26 lines
678 B
Plaintext
Raw Normal View History

2015-01-16 13:20:41 +00:00
// by commy2
#include "script_component.hpp"
private ["_vehicle", "_isEngineOn"];
_vehicle = _this select 0;
_isEngineOn = _this select 1;
if (!_isEngineOn || {floor abs speed _vehicle > 0}) exitWith {};
[{
private ["_vehicle", "_time", "_direction"];
_vehicle = _this select 0 select 0;
_time = _this select 0 select 1;
_direction = _this select 0 select 2;
if (time > _time) exitWith {
[_this select 1] call CBA_fnc_removePerFrameHandler;
};
_vehicle setVelocity [0, 0, 0];
_vehicle setVectorDirAndUp _direction;
} , 0, [_vehicle, time + STARTUP_DELAY, [vectorDir _vehicle, vectorUp _vehicle]]] call CBA_fnc_addPerFrameHandler;