Example #1
0
        private void ShowNooseModStats(ParameterCollection parameterCollection)
        {
            // Get the data from the Table Adapter
            StatsDataSet.OverallStatsDataTable overallstatsdt = overallstatsadp.GetData();
            if (overallstatsdt.Rows.Count != 0 && overallstatsdt.IsInitialized && LPlayer.LocalPlayer.IsOnDuty)
            {
                try
                {
                    int tempVar1 = overallstatsdt.FindBySession(loginNumbers).Suspects_Killed,
                        tempVar2 = overallstatsdt.FindBySession(loginNumbers).Suspects_Arrested,
                        tempVar3 = overallstatsdt.FindBySession(loginNumbers).Hostages_Killed,
                        tempVar4 = overallstatsdt.FindBySession(loginNumbers).Hostages_Rescued,
                        tempVar5 = overallstatsdt.FindBySession(loginNumbers).Officer_Casualties,
                        tempVar6 = overallstatsdt.FindBySession(loginNumbers).Squad_Casualties;

                    // Print the statistics to console
                    Game.Console.Print("NooseMod Statistics");
                    Game.Console.Print("---");
                    Game.Console.Print("Your login session: " + loginNumbers);
                    Game.Console.Print("Total Suspects killed: " + tempVar1);
                    Game.Console.Print("Total Suspects arrested: " + tempVar2);
                    Game.Console.Print("Total Hostages killed: " + tempVar3);
                    Game.Console.Print("Total Hostages rescued: " + tempVar4);
                    Game.Console.Print("Total Officers killed in mission: " + tempVar5);
                    Game.Console.Print("Total Squad casualties: " + tempVar6);
                }
                catch (Exception ex) { Game.Console.Print("NooseMod Statistics: Error loading stats: " + ex); }
            }
            else
            {
                Game.Console.Print("NooseMod Statistics: no session is loaded");
            }
        }
Example #2
0
        /// <summary>
        /// Called when player changed the on duty state.
        /// </summary>
        /// <param name="onDuty">The new on duty state.</param>
        public void Functions_OnOnDutyStateChanged(bool onDuty)
        {
            // Register callouts to LCPDFR depending on skin model
            if (onDuty && (LPlayer.LocalPlayer.Skin.Model == new Model("M_Y_SWAT") | LPlayer.LocalPlayer.Skin.Model == new Model("M_Y_NHELIPILOT")))
            {
                // SWAT model used: register NooseMod
                Functions.RegisterCallout(typeof(NooseMod)); // Progressive through gameplay
                Functions.RegisterCallout(typeof(Pursuit));  // Regular Pursuit for bypassing the time check

                if (overallstatsadp.Connection.State == ConnectionState.Open)
                {
                    // Get the data from the Table Adapter
                    StatsDataSet.OverallStatsDataTable overallstatsdt = overallstatsadp.GetData();

                    // Build new Stats row
                    overallstatsdt.AddOverallStatsRow(0, 0, 0, 0, 0, 0);
                    overallstatsdt.AcceptChanges();
                    int fin = overallstatsadp.Update(overallstatsdt);

                    // Record how many rows made
                    loginNumbers = overallstatsdt.Rows.Count;

                    Log.Debug("NooseMod callout initialized, return value is " + fin, this);
                }
                else
                {
                    throw new Exception("Database is in closed state, or is in use");
                }
            }
            else if (onDuty && (LPlayer.LocalPlayer.Skin.Model != new Model("M_Y_SWAT") | LPlayer.LocalPlayer.Skin.Model != new Model("M_Y_NHELIPILOT")))
            {
                // Otherwise register TerroristPursuit callout
                Functions.RegisterCallout(typeof(TerroristPursuit));
                Log.Debug("Played as a model other than SWAT, Terrorist Pursuit callout initialized", this);
            }
            Functions.AddWorldEvent(typeof(ProvostPatrol), "Provost Patrol"); // WIP
        }