Exemple #1
0
        private async void FB_Explode(float x, float y, float z, int stunTime, int afterTime, float radius)
        {
            int     stunRefTime  = stunTime * 1000;
            int     afterRefTime = afterTime * 1000;
            int     finishTime   = 0;
            Ped     ped          = Game.Player.Character;
            Vector3 pos          = new Vector3(x, y, z);

            PlayParticles(pos);

            float distance = World.GetDistance(ped.Position, pos);

            if (distance <= radius)
            {
                Screen.Effects.Start(ScreenEffect.DontTazemeBro, 0, true);
                GameplayCamera.Shake(CameraShake.Hand, 15f);
                await ped.Task.PlayAnimation(Animation[0], Animation[1], -8f, -8f, -1, AnimationFlags.StayInEndFrame | AnimationFlags.UpperBodyOnly | AnimationFlags.AllowRotation, 8f);

                finishTime = Game.GameTime + stunRefTime;
                while (Game.GameTime < finishTime)
                {
                    Game.Player.DisableFiringThisFrame();
                    await Delay(0);
                }
                ped.Task.ClearAnimation(Animation[0], Animation[1]);
                GameplayCamera.ShakeAmplitude = 10f;
                finishTime = Game.GameTime + afterRefTime;
                while (Game.GameTime < finishTime)
                {
                    await Delay(0);
                }
                GameplayCamera.StopShaking();
                Screen.Effects.Stop(ScreenEffect.DontTazemeBro);
            }
        }
Exemple #2
0
        public override void OnStart()
        {
            ReduceCounter = new ReduceCounter(15 * 1000);
            ReduceCounter.OnFinishedAsync.Subscribe(_ => ParupunteEnd());
            AddProgressBar(ReduceCounter);
            soundPlayerStart?.Play();

            GameplayCamera.StopShaking();
        }
Exemple #3
0
            public override bool Tick()
            {
                if (stumbleTimer.Tick())
                {
                    ped.Euphoria.LeanRandom.Start(rnd.Next(500, 1000));
                    ped.Euphoria.BodyBalance.Start();
                }

                if (timer.Tick())
                {
                    GameplayCamera.StopShaking();
                    ped.ResetPedMovementClipset();
                    ped.SetPedIsDrunk(false);
                    ped.ResetConfigFlag(100);
                    Function.Call(Hash._STOP_SCREEN_EFFECT, "DrugsDrivingOut");
                    return(true);
                }

                return(false);
            }