Author Message

gorgoil

pt
Posts: 271

Location: Portugal , "Oh Cristiano Ronaldo" Island
Occupation: Valo City Drag Racer/Organizer
Age: 27
V$: 0
#138834   2018-03-13 14:31          
# amilmand : You can but you would have to give the control of the players car away to a bot (only one controller can have control over a given car either player input or the bot) with a script like
Bot raceBot = new Bot( 0, 1, 1, 2.0, 2.0, 1.0);
player.controller.command( "leave " + player.car.id() );
raceBot.car = player.car;
raceBot.enterCar(raceBot.car);
raceBot.brain.command( "AI_BeginRace 1.0" );
raceBot.followSplineTrack( SplineWidth, "maps\\RaceSpl\\temp_spl_"+bot_i+".spl", 0 );
you would probably have to reset the camera aswell
You could perhaps monitor player input in a track's handleevent or similar method and give back control to the player upon keypress
raceBot.leaveCar(0);//traffic id should be 0
player.controller.command( "controllable " + player.car.id() );
it gives me this error:

!Mighty ERROR