public static bool GetVehicleSpawnPointTowardsStartPoint(this Vector3 StartPoint, float SpawnDistance, bool UseSpecialID, out SpawnPoint sp) { Vector3 tempspawn = World.GetNextPositionOnStreet(StartPoint.Around2D(SpawnDistance + 5f)); Vector3 spawnPoint = Vector3.Zero; float Heading = 0; bool specialIDused = true; if (!UseSpecialID || !NativeFunction.Natives.GET_NTH_CLOSEST_VEHICLE_NODE_FAVOUR_DIRECTION <bool>(tempspawn.X, tempspawn.Y, tempspawn.Z, StartPoint.X, StartPoint.Y, StartPoint.Z, 0, out spawnPoint, out Heading, 0, 0x40400000, 0) || !ExtensionMethods.IsNodeSafe(spawnPoint)) { spawnPoint = World.GetNextPositionOnStreet(StartPoint.Around2D(SpawnDistance + 5f)); Vector3 directionFromVehicleToPed1 = (StartPoint - spawnPoint); directionFromVehicleToPed1.Normalize(); Heading = MathHelper.ConvertDirectionToHeading(directionFromVehicleToPed1); specialIDused = false; } sp = new SpawnPoint(spawnPoint, Heading); return(specialIDused); }
public static bool IsKeyCombinationDownRightNowComputerCheck(Keys MainKey, Keys ModifierKey) { if (MainKey != Keys.None) { return(ExtensionMethods.IsKeyDownRightNowComputerCheck(MainKey) && ((ExtensionMethods.IsKeyDownRightNowComputerCheck(ModifierKey) || (ModifierKey == Keys.None && !ExtensionMethods.IsKeyDownRightNowComputerCheck(Keys.Shift) && !ExtensionMethods.IsKeyDownRightNowComputerCheck(Keys.Control) && !ExtensionMethods.IsKeyDownRightNowComputerCheck(Keys.LControlKey) && !ExtensionMethods.IsKeyDownRightNowComputerCheck(Keys.LShiftKey))))); } else { return(false); } }