A crash has helped Scott McLaughlin win the virtual IndyCar race at the Indianapolis Motor Speedway.