Making AI drivers in C++ follow and pick up player


I am trying to make NPC drivers follow the player and also go to markers but when I tell them to do so they just turn their steering wheel toward me and do not drive forward.

static void DriveTo(Ped character, Vehicle car, float speed = 40.0f, int DriveMode = 786603) {
	Ped driver = DriverOf(car);
	AI::TASK_VEHICLE_TEMP_ACTION(driver, car, 9, 2000);
	AI::_TASK_VEHICLE_FOLLOW(driver, car, character, DriveMode, speed, 10);


DriveTo(character, vehicle, 40.0f, AIDriveStyle);

and i still need help with allowing the driver to stay in the vehicle when the player enters so they can be driven to the marker


I’m not 100% sure but i dont think fivem supports c++ scripting for neither server or client side


they support .asi plugins (visual studio compiles c++ projects to this) like lambda which are most likely also written in c++


mmm i know how too do in c# can send pm the script you can look how i did in c#


^^ (info discord ?).


:open_mouth: ? what you mean xD


or mabye take a look on this one its also c# but yeah