private static void EnableIslandMinimap(bool enable) { bool running = minimapFiber?.IsAlive == true; if (running && !enable) { minimapFiber.Abort(); } if (!running && enable) { if (!mapBoundsBlip) { mapBoundsBlip = new Blip(new Vector3(7000, -7000, 0)); mapBoundsBlip.Scale = 0; mapBoundsBlip.Alpha = 1; } minimapFiber = GameFiber.ExecuteNewWhile(() => { NativeFunction.Natives.SET_RADAR_AS_INTERIOR_THIS_FRAME(Game.GetHashKey("h4_fake_islandx"), 4700.0f, -5145.0f, 0, 0); NativeFunction.Natives.SET_RADAR_AS_EXTERIOR_THIS_FRAME(); }, () => true); } }
private static void DebugBones([ConsoleCommandParameter(Name = "Enabled")] bool enabled) { debugFiber?.Abort(); if (enabled) { debugFiber = GameFiber.ExecuteNewWhile(() => { Vehicle truck = controller.Truck; Vector3 a1 = truck.GetBonePosition("arm_1"); Vector3 a2 = truck.GetBonePosition("arm_2"); Vector3 rb = truck.GetBonePosition("rotating_base"); Vector3 bk = truck.GetBonePosition("bucket"); Quaternion bq = truck.GetBoneOrientation("bucket"); Vector3 bucketBox = controller.GetBucketPosition; Debug.DrawWireBox(bucketBox, bq, Settings.Bucket.BucketSize, Color.Purple); Debug.DrawSphere(a1, 0.3f, Color.Red); Debug.DrawSphere(a2, 0.3f, Color.Green); Debug.DrawSphere(rb, 0.3f, Color.Orange); Debug.DrawSphere(bk, 0.3f, Color.Blue); Debug.DrawLine(rb, a1, Color.HotPink); Debug.DrawLine(a1, a2, Color.HotPink); Debug.DrawLine(a2, bk, Color.HotPink); Vector3 py1 = Game.LocalPlayer.Character.GetOffsetPositionFront(1f); Vector3 py2 = Game.LocalPlayer.Character.GetOffsetPositionFront(-1f); Vector3 pz1 = Game.LocalPlayer.Character.GetOffsetPositionUp(1f); Vector3 pz2 = Game.LocalPlayer.Character.GetOffsetPositionUp(-1f); Vector3 px1 = Game.LocalPlayer.Character.GetOffsetPositionRight(1f); Vector3 px2 = Game.LocalPlayer.Character.GetOffsetPositionRight(-1f); Color c = controller.IsEntityInBucket(Game.LocalPlayer.Character) ? Color.Green : Color.Red; Debug.DrawLine(py1, py2, c); Debug.DrawLine(px1, px2, c); Debug.DrawLine(pz1, pz2, c); }, () => controller != null && controller.Truck); } }