|1)||Ped||ped||The Ped to drive the Vehicle.|
|2)||Vehicle||vehicle||The Vehicle to drive with.|
|3)||float||driveSpeed||The speed of driving in meters per second. (default = 20).|
|4)||int||driveStyle||The AI driving style (behavior) to use. (0-7, see details below).|
|void||This function doesn't return a value.|
There aren't any notes for this function.
There isn't any compatibility information for this function.
driving style behavior
|traffic lights||other cars||pedestrians||blinkers||when stuck|
|0||ignore||drive around||drive around||not used||reverse|
|1||stop on red||stay behind||stop and honk||used on intersections||wait|
|2||ignore||drive around||drive around||not used||reverse|
|4||ignore||stay behind||stop and honk||not used||wait|
|5||stop on red||drive around||drive around||not used||reverse|
|6||stop+reversing||drive around||drive around||not used||reverse|
|7||stop on red||stay behind||stop and honk||used on intersections||wait|
- driving styles 0 and 2 seem to be identical.
- driving styles 1 and 7 seem to be identical.
- using values < 0 or > 7 will behave like 3
- the AI will slow down for corners and intersections, but won't break for "drive around" obstacles.
There could be small distance and/or speed differences when "drive around" is used.
It is also unclear if the AI drivers are able to see objects like light poles or traffic lights while evading.
The vehicle.carWanderRandomly function has the same functionality in the 3D universe games (GTA III, Vice City, and San Andreas). The extra driving parameters for those games can be set with vehicle.setDrivingStyle and vehicle.setCarCruiseSpeed