Example #1
0
        private void Gamble(Entity player)
        {
            IsUsing = true;
            player.SetField("isgambling", 1);

            Laptop.Call("moveto", Laptop.Origin + new Vector3(0, 0, 30), 2);
            Laptop.AfterDelay(8000, e =>
            {
                Laptop.Call("moveto", Laptop.Origin - new Vector3(0, 0, 30), 2);
            });

            player.PrintlnBold("^210");
            player.PlayLocalSound("ui_mp_nukebomb_timer");
            player.AfterDelay(1000, e => player.PrintlnBold("^29"));
            player.AfterDelay(1000, e => player.PlayLocalSound("ui_mp_nukebomb_timer"));
            player.AfterDelay(2000, e => player.PrintlnBold("^28"));
            player.AfterDelay(2000, e => player.PlayLocalSound("ui_mp_nukebomb_timer"));
            player.AfterDelay(3000, e => player.PrintlnBold("^27"));
            player.AfterDelay(3000, e => player.PlayLocalSound("ui_mp_nukebomb_timer"));
            player.AfterDelay(4000, e => player.PrintlnBold("^26"));
            player.AfterDelay(4000, e => player.PlayLocalSound("ui_mp_nukebomb_timer"));
            player.AfterDelay(5000, e => player.PrintlnBold("^25"));
            player.AfterDelay(5000, e => player.PlayLocalSound("ui_mp_nukebomb_timer"));
            player.AfterDelay(6000, e => player.PrintlnBold("^24"));
            player.AfterDelay(6000, e => player.PlayLocalSound("ui_mp_nukebomb_timer"));
            player.AfterDelay(7000, e => player.PrintlnBold("^23"));
            player.AfterDelay(7000, e => player.PlayLocalSound("ui_mp_nukebomb_timer"));
            player.AfterDelay(8000, e => player.PrintlnBold("^22"));
            player.AfterDelay(8000, e => player.PlayLocalSound("ui_mp_nukebomb_timer"));
            player.AfterDelay(9000, e => player.PrintlnBold("^21"));
            player.AfterDelay(9000, e => player.PlayLocalSound("ui_mp_nukebomb_timer"));
            player.AfterDelay(10000, e => GambleThink(player));
            player.AfterDelay(10000, ex => IsUsing = false);
        }
Example #2
0
        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    if (Laptop != null)
                    {
                        Laptop.Notify("stop_rotate");
                    }
                }

                AfterDelay(100, e =>
                {
                    Call("delete");
                    if (Laptop != null)
                    {
                        Laptop.Call("delete");
                    }
                    if (Shader != null)
                    {
                        Shader.Call("destroy");
                    }

                    if (isObjective)
                    {
                        Function.SetEntRef(-1);
                        Function.Call("objective_delete", ObjectiveId);
                    }
                });
            }
        }