Guest User

[.Net] GET_CLOSEST_VEHICLE_NODE_WITH_HEADING

a guest
Jun 26th, 2016
1,935
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.64 KB | None | 0 0
  1. # This code snippet returns the closest road position with the respective heading.
  2. # The heading is actually the traffic direction
  3. # Not tested with all kind of roads (one-way, off-road)
  4.  
  5. Vector3 coords = Game.Character.Player.Position;
  6. Vector3 closestVehicleNodeCoords;
  7. float roadheading;
  8.  
  9. OutputArgument tempcoords = new OutputArgument();
  10. OutputArgument temproadheading = new OutputArgument();
  11.  
  12. Function.Call<Vector3>(Hash.GET_CLOSEST_VEHICLE_NODE_WITH_HEADING, coords.X, coords.Y, coords.Z, tempcoords, temproadheading, 1, 3, 0);
  13. closestVehicleNodeCoords = tempcoords.GetResult<Vector3>();
  14. roadheading = temproadheading.GetResult<float>();
Advertisement
Add Comment
Please, Sign In to add comment