Пример #1
0
 private static void Update()
 {
     if (CheckUpdate.isNewVersionAvaiable() == 1 && !newUpdateHasBeenShow && CheckUpdate.MessageShow)
     {
         string version = CheckUpdate.newVersion.ToString();
         Game.DisplayNotification("[~b~Police~s~Life~r~S~s~]: New Version (~r~" + version + "~w~) is available, New features are waiting for you");
         newUpdateHasBeenShow = true;
     }
     else if (CheckUpdate.isNewVersionAvaiable() == 2 && !newUpdateHasBeenShow && CheckUpdate.MessageShow)
     {
         string version = CheckUpdate.minVersion.ToString();
         Game.LogTrivial("PoliceLifeS: minimum Version (" + version + ") required!");
         Game.DisplayNotification("[~b~Police~s~Life~r~S~s~]: Not loaded minimum Version: (~r~" + version + "~w~) required, please Update now!");
         newUpdateHasBeenShow = true;
     }
 }
Пример #2
0
        public override void Initialize()
        {
            if (checkForRageVersionClass.checkForRageVersion(requiredVersion))
            {
                // read the gaugefuel positions from the gui.ini file
                ReadIniFile.ReadIni();
                string databaseFile = @"plugins/LSPDFR/PoliceLifeS/Database/PoliceLifeS.db";
                if (!File.Exists(databaseFile))
                {
                    DatabaseManager.CreateDatabaseFile();
                }

                myPlayer  = HungerManager.SelectPlayerLife();
                saveTimer = new SaveTimer(300000, myPlayer);
                sf        = new StaticFinalizer(CleanYourScript);

                newUpdateHasBeenShow = false;
                Update();
                //Only if current Version equals the minVersion
                if (CheckUpdate.isNewVersionAvaiable() != 2 && CheckUpdate.serverurl != "")
                {
                    ScreenWidth  = Game.Resolution.Width;
                    ScreenHeight = Game.Resolution.Height;
                    DrawTexture.initTextures();
                    Progress();
                    Functions.OnOnDutyStateChanged += Functions_OnOnDutyStateChanged;
                }
                else if (CheckUpdate.serverurl == "")
                {
                    NotificationManager.addNotification("[~b~Police~s~Life~r~S~s~]: ~r~Not possible to determine the API-Url, please try again later!");
                }
            }
            else
            {
                NotificationManager.addNotification("[~b~Police~s~Life~r~S~s~]: ~r~Rage Version not valid, RPH " + requiredVersion.ToString() + "+ required!");
            }
        }