Try this
// Accelerate.sqf
_vehicle = _this select 0;
_speedmax = _this select 1;
_acceleration = _this select 2;
_seconds = _this select 3;
_vdir = vectorDir _vehicle;
_speed = speed _vehicle / 3.6;
_timeini = dayTime * 3600;
while {(dayTime * 3600) < (_timeini + _seconds)} do
{
if (_speed < _speedmax) then
{
_speed = _speed + _acceleration;
};
_vehicle setVectorDir _vdir;
_vehicle setVelocity [(_vdir select 0)*_speed, (_vdir select 1)*_speed, -1];
Sleep 0.01;
};