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); WAIT(5); AI::_TASK_VEHICLE_FOLLOW(driver, car, character, DriveMode, speed, 10); }
used:
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 and soon i need to add a waving animation
-
@Wunder-Wulfe There is something similar already -> https://www.gta5-mods.com/scripts/vautodrive