Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # This code snippet returns the closest road position with the respective heading.
- # The heading is actually the traffic direction
- # Not tested with all kind of roads (one-way, off-road)
- Vector3 coords = Game.Character.Player.Position;
- Vector3 closestVehicleNodeCoords;
- float roadheading;
- OutputArgument tempcoords = new OutputArgument();
- OutputArgument temproadheading = new OutputArgument();
- Function.Call<Vector3>(Hash.GET_CLOSEST_VEHICLE_NODE_WITH_HEADING, coords.X, coords.Y, coords.Z, tempcoords, temproadheading, 1, 3, 0);
- closestVehicleNodeCoords = tempcoords.GetResult<Vector3>();
- roadheading = temproadheading.GetResult<float>();
Advertisement
Add Comment
Please, Sign In to add comment