private void onTick(object sender, EventArgs e)
        {
            try
            {
                if (!Game.IsLoading)
                {
                    if (!initial)
                    {
                        foreach (Vehicle v in World.GetAllVehicles())
                        {
                            if (v.Model == VehicleHash.Bus)
                            {
                                v.Delete();
                            }
                            Wait(10);
                        }
                        Game.Player.CanControlCharacter = true;
                        if (Game.Player.Character.IsInVehicle())
                        {
                            Game.Player.Character.CurrentVehicle.IsVisible = true;
                        }
                        try
                        {
                            client = new SimpleTCP.SimpleTcpClient();
                            client.StringEncoder = Encoding.UTF8;
                            //client.DataReceived += luancherdata;
                            client.Connect("127.0.0.1", 10757);
                            UI.Notify("Connection: " + client.TcpClient.Connected);
                            string launcher = client.WriteLineAndGetReply("script running", new TimeSpan(0, 0, 1)).MessageString;

                            if (launcher.Contains("Launcher running"))
                            {
                                Sounds.initialLoad(true);
                                if (Sounds.Intro.getPlayState())
                                {
                                    Sounds.Intro.Play();
                                }
                                ResponceList(client.WriteLineAndGetReply("send saved display xy", new TimeSpan(0, 0, 30)).MessageString);

                                connection_success = true;

                                if (servTime)
                                {
                                    ResponceList(client.WriteLineAndGetReply("send display time", new TimeSpan(0, 0, 30)).MessageString);
                                    servTime = false;
                                }
                            }
                            else
                            {
                            }

                            //rooterror = "connectionstart begining";
                            //if (!connectstart)
                            //{
                            //    Wait(10);
                            //    rooterror = "new simpleTCP";
                            //    client = new SimpleTCP.SimpleTcpClient();
                            //    Wait(10);
                            //    rooterror = "Encode";
                            //    client.StringEncoder = Encoding.UTF8;
                            //    Wait(10);
                            //    rooterror = "datareceived";
                            //    client.DataReceived += luancherdata;
                            //    Wait(10);
                            //    rooterror = "connect to launcher";
                            //    client.Connect("127.0.0.1", 10757);
                            //    Wait(10);
                            //    rooterror = "WriteLine";
                            //    connectstart = true;
                            //    client.WriteLineAndGetReply("script running", new TimeSpan(0, 0, 20));
                            //    rooterror = "connectionstart true";
                            //    Wait(10);
                            //}
                            //rooterror = "new TTTF";
                        }
                        catch (Exception f)
                        {
                            try
                            {
                                UI.Notify(f.Message);
                                UI.Notify("load sounds");
                                Sounds.initialLoad(false);
                                UI.Notify("check if not playing");
                                if (Sounds.Intro.getPlayStateStopped())
                                {
                                    UI.Notify("play");
                                    Sounds.Intro.Play();
                                    UI.Notify("No connection to laucher");
                                }
                            }
                            catch (Exception g)
                            {
                                int count = 0;
                                Sounds.unLoad();
                                while (count < 100)
                                {
                                    UI.Notify(g.Message);
                                    UI.Notify(g.StackTrace);
                                    UI.Notify(g.TargetSite.Name);
                                    UI.Notify(g.ToString());
                                    Wait(10);
                                }
                            }
                        }
                        TTTF    = new TTTFmenu();
                        initial = true;
                    }

                    try
                    {
                        TTTF.OnTick();

                        if (Game.Player.Character.IsInVehicle())
                        {
                            if (Game.Player.Character.CurrentVehicle.FriendlyName == new Model("dmc12"))
                            {
                                Game.Player.Character.CurrentVehicle.CanBeVisiblyDamaged = !TTTF.invincible;
                                Game.Player.Character.CurrentVehicle.IsInvincible        = TTTF.invincible;
                                Game.Player.Character.CurrentVehicle.EngineCanDegrade    = !TTTF.invincible;
                            }
                        }

                        //UI.ShowSubtitle("Is in flying vehicle: " + Function.Call<bool>(Hash.IS_PED_IN_FLYING_VEHICLE, Game.Player.Character));
                    }
                    catch
                    {
                    }
                    Libeads.tick();
                    helpFromDoc.tick();
                    Traveler.tick();
                    DeloreanManagement.tick();

                    R = Game.IsKeyPressed(Keys.R);
                    C = Game.IsKeyPressed(Keys.C);

                    if (R && C)
                    {
                        if (!rcenable)
                        {
                            TTTF.quickRC();
                            rcenable = true;
                        }
                    }
                    else
                    {
                        rcenable = false;
                    }

                    //if (Properties.Settings.Default.presday1 == 2 && Properties.Settings.Default.presday2 == 9 && Properties.Settings.Default.presmonth1 == 0 && Properties.Settings.Default.presmonth2 == 4 && Properties.Settings.Default.presy1 == 1 && Properties.Settings.Default.presy2 == 9 && Properties.Settings.Default.presy3 == 9 && Properties.Settings.Default.presy4 == 2)
                    //{
                    //    riot();
                    //}
                    //else if (Properties.Settings.Default.presday1 == 3 && Properties.Settings.Default.presday2 == 0 && Properties.Settings.Default.presmonth1 == 0 && Properties.Settings.Default.presmonth2 == 4 && Properties.Settings.Default.presy1 == 1 && Properties.Settings.Default.presy2 == 9 && Properties.Settings.Default.presy3 == 9 && Properties.Settings.Default.presy4 == 2)
                    //{
                    //    riot();
                    //}
                    //else if (Properties.Settings.Default.presday1 == 0 && Properties.Settings.Default.presday2 == 1 && Properties.Settings.Default.presmonth1 == 0 && Properties.Settings.Default.presmonth2 == 5 && Properties.Settings.Default.presy1 == 1 && Properties.Settings.Default.presy2 == 9 && Properties.Settings.Default.presy3 == 9 && Properties.Settings.Default.presy4 == 2)
                    //{
                    //    riot();
                    //}
                    //else if (Properties.Settings.Default.presday1 == 0 && Properties.Settings.Default.presday2 == 2 && Properties.Settings.Default.presmonth1 == 0 && Properties.Settings.Default.presmonth2 == 5 && Properties.Settings.Default.presy1 == 1 && Properties.Settings.Default.presy2 == 9 && Properties.Settings.Default.presy3 == 9 && Properties.Settings.Default.presy4 == 2)
                    //{
                    //    riot();
                    //}
                    //else if (Properties.Settings.Default.presday1 == 0 && Properties.Settings.Default.presday2 == 3 && Properties.Settings.Default.presmonth1 == 0 && Properties.Settings.Default.presmonth2 == 5 && Properties.Settings.Default.presy1 == 1 && Properties.Settings.Default.presy2 == 9 && Properties.Settings.Default.presy3 == 9 && Properties.Settings.Default.presy4 == 2)
                    //{
                    //    riot();
                    //}
                    //else if (Properties.Settings.Default.presday1 == 0 && Properties.Settings.Default.presday2 == 4 && Properties.Settings.Default.presmonth1 == 0 && Properties.Settings.Default.presmonth2 == 5 && Properties.Settings.Default.presy1 == 1 && Properties.Settings.Default.presy2 == 9 && Properties.Settings.Default.presy3 == 9 && Properties.Settings.Default.presy4 == 2)
                    //{
                    //    riot();
                    //}
                }
            }
            catch (Exception d)
            {
                try
                {
                    UIText debug2 = new UIText("object: " + d.TargetSite + " location: " + d.StackTrace + " Error: " + d.Message, new System.Drawing.Point(100, 50), (float)0.6);
                    debug2.Draw();
                    UIText debug = new UIText("location: " + d.StackTrace, new System.Drawing.Point(100, 200), (float)0.6);
                    debug.Draw();
                    UIText debug3 = new UIText("Error: " + d.Message, new System.Drawing.Point(100, 350), (float)0.6);
                    debug3.Draw();
                }
                catch
                {
                }

                Sounds.unLoad();
                while (true)
                {
                    UI.Notify(d.Message);
                    UI.Notify(d.StackTrace);
                    UI.Notify(d.TargetSite.Name);
                    UI.Notify(d.ToString());
                    Wait(10);
                }
            }
        }
示例#2
0
        public static void unLoad()
        {
            inputerror?.remove();
            inputenter?.remove();
            inputoff?.remove();
            inputon?.remove();
            inputonempty?.remove();
            cirerror?.remove();
            cirerrorbttf3?.remove();
            inputenterbttf3?.remove();
            inputoffbttf3?.remove();
            inputonbttf2error?.remove();
            inputonbttf3?.remove();
            Mrfrusionfill?.remove();
            hoverboost?.remove();
            hoverup?.remove();
            pr0load?.remove();
            cold?.remove();
            empty?.remove();
            engineoff?.remove();
            engineon?.remove();
            Lightningbttf2?.remove();
            Lightningcuttscene?.remove();
            sparks?.remove();
            sparksbttf3?.remove();
            sparksfeul?.remove();
            Vent?.remove();
            trainenter?.remove();
            trainstart?.remove();
            Intro?.remove();
            DeloreonEnter?.remove();
            Experimentstart?.remove();
            Experimentstartintro?.remove();
            Experimentstartwithremote?.remove();
            Experimentstartwithreentry?.remove();
            Experimentsuccess?.remove();
            Libeads?.remove();
            Chasescene?.remove();

            reenterybttf2               = null;
            reenterybttf3               = null;
            RCcontrolstop               = null;
            num0                        = null;
            num1                        = null;
            num2                        = null;
            num3                        = null;
            num4                        = null;
            num5                        = null;
            num6                        = null;
            num7                        = null;
            num8                        = null;
            num9                        = null;
            inputerror                  = null;
            inputenter                  = null;
            inputoff                    = null;
            inputon                     = null;
            inputonempty                = null;
            cirerror                    = null;
            cirerrorbttf3               = null;
            inputenterbttf3             = null;
            inputoffbttf3               = null;
            inputonbttf2error           = null;
            inputonbttf3                = null;
            Beep                        = null;
            inputonfeul                 = null;
            Mrfrusionfill               = null;
            hoveron                     = null;
            hoveroff                    = null;
            hoverboost                  = null;
            hoverup                     = null;
            plate                       = null;
            pr0load                     = null;
            trend                       = null;
            cold                        = null;
            empty                       = null;
            engineoff                   = null;
            engineon                    = null;
            Lightningbttf2              = null;
            Lightningcuttscene          = null;
            Timetravelreentery          = null;
            Timetravelreentery2         = null;
            Timetravelreentery2f        = null;
            Timetravelreentery3         = null;
            Timetravelreenterycutscene  = null;
            Timetravelreenterycutscene3 = null;
            reenterybttf1               = null;
            reenterybttf1incar          = null;
            reenterybttf2               = null;
            reenterybttf3               = null;
            sparks                      = null;
            sparksbttf3                 = null;
            sparksfeul                  = null;
            RCcontrolstart              = null;
            RCcontrol                   = null;
            RCcontrolhandbreak          = null;
            Vent                        = null;
            Plut                        = null;
            trainenter                  = null;
            trainstart                  = null;
            greatscott                  = null;
            doorcold                    = null;
            dooropen                    = null;
            doorclose                   = null;
            Intro                       = null;
            DeloreonEnter               = null;
            Experimentstart             = null;
            Experimentstartintro        = null;
            Experimentstartwithremote   = null;
            Experimentstartwithreentry  = null;
            Experimentsuccess           = null;
            Libeads                     = null;
            Chasescene                  = null;
        }