varunchhangani Posted June 22, 2021 Share Posted June 22, 2021 I am currently just wandering using AI::TASK_VEHICLE_DRIVE_WANDER(ped, vehicle, _setSpeed, _drivingMode); I need a function to help me locate the coordinates of the waypoint, if set. Can I get the coordinates of the waypoint so as to be able to use AI::TASK_VEHICLE_DRIVE_TO_COORD() or AI::TASK_VEHICLE_DRIVE_TO_COORD_LONGRANGE() when the waypoint is set, or wander otherwise. Or Is there a task to directly drive to the waypoint if it exists? Link to comment Share on other sites More sharing options...
DuncanMac Posted June 22, 2021 Share Posted June 22, 2021 Do you want to script driving to a location once you know the coordinates or do you want to find them first? There are native functions that will allow you to do either one. Or you can use a trainer, like Menyoo, to display the coordinates - which you can then use in your script. You will also see there are different driving styles and you can set the speed, whether to stay on road, etc. Personally I keep things simple: PedName.Task.DriveTo(Vehicle2, new Vector3(-1278, -3099, 14), 3.0F, 55); Search the natives db for a get function with coordinates. I've never done that but I'm sure you will find one or more. In the worst case, you can just dump an object there and use it to get your coordinates. GET_ENTITY_COORDS Again, if you can hard code the coords, just get them from your trainer - they will not be exactly the same when your script but that's easy to tweak. Also, very few people are active here regarding scripting but most write in C#. Link to comment Share on other sites More sharing options...
mcal Posted July 2, 2021 Share Posted July 2, 2021 For c# i use this wepDealer.destination = World.GetNextPositionOnStreet(World.GetWaypointPosition()); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now