Adding a simple switch to turn player controlled input to a.i. controlled input in unity based racing game

I am trying to make a simple .DLL script for unity racing games that will allow the player controlled vehicle to be switched to a.i. controlled. I wanted to use this for a game on steam called Star Racer as well as Super Pilot, because I love to see them race. As well as seeing how to enable free cam mode on these kinds of games.