Esempio n. 1
0
        private async Task OnTick()
        {
            var hud = HeadupDisplay.GetModule();

            if (!hud.IsDisabled)
            {
                var ped    = API.PlayerPedId();
                var anchor = hud.GetMinimapAnchor();

                ScreenInterface.DrawText(
                    $"Tonläge: {(API.NetworkIsPlayerTalking(API.PlayerId()) ? "~b~" : "")}{Translate()}", 0.25f,
                    !API.IsPedSittingInAnyVehicle(ped)
                        ? new Vector2(anchor.X + 0.0005f,
                                      (float)(anchor.BottomY - anchor.UnitY * 18f / 2 / 2) - anchor.UnitY * 18f * 2 - 0.0005f)
                        : new Vector2(anchor.X + anchor.Width + 0.001f, (float)(anchor.BottomY - anchor.Height / 2)),
                    Color.FromArgb(200, 200, 200, 200));

                if (Game.IsControlPressed(0, Control.Sprint) && Game.IsControlJustPressed(0, Control.VehicleHeadlight))
                {
                    IterateRange();
                }
            }

            await Task.FromResult(0);
        }
Esempio n. 2
0
        public void EnableHud()
        {
            API.DisplayRadar(true);

            HeadupDisplay.GetModule().IsDisabled = false;
        }
Esempio n. 3
0
        public void DisableHud()
        {
            API.DisplayRadar(false);

            HeadupDisplay.GetModule().IsDisabled = true;
        }