Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public enum PathnodeFlags
- {
- Slow = 1,
- Two = 2,
- Intersection = 4,
- Eight = 8, SlowTraffic = 12, ThirtyTwo = 32, Freeway = 64, FourWayIntersection = 128, BigIntersectionLeft = 512
- }
- public static string GetRoadFlags(Vector3 pos)
- {
- OutputArgument outArgA = new OutputArgument();
- OutputArgument outArgB = new OutputArgument();
- if (Function.Call<bool>(Hash.GET_VEHICLE_NODE_PROPERTIES, pos.X, pos.Y, pos.Z, outArgA, outArgB))
- {
- int busy = outArgA.GetResult<int>();
- int flags = outArgB.GetResult<int>();
- string d = "";
- foreach (int flag in Enum.GetValues(typeof(PathnodeFlags)).Cast<PathnodeFlags>())
- {
- if ((flag & flags) != 0) d += " " + (PathnodeFlags)flag;
- }
- return d; // DisplayHelpTextThisFrame("Flags: " + d);
- }
- return "";
- }
- public static bool RoadHasFlag(Vector3 pos, PathnodeFlags flag)
- {
- OutputArgument outArgA = new OutputArgument();
- OutputArgument outArgB = new OutputArgument();
- if (Function.Call<bool>(Hash.GET_VEHICLE_NODE_PROPERTIES, pos.X, pos.Y, pos.Z, outArgA, outArgB))
- {
- int busy = outArgA.GetResult<int>();
- int flags = outArgB.GetResult<int>();
- if ((flags & (int)flag) != 0) return true;
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement