Пример #1
0
        public PoliceSection(Trainer trainer) : base(trainer)
        {
            Config.SetDefault("PoliceDisable", "false");
            Config.SetDefault("PoliceIgnore", "false");

            Trainer.RegisterNUICallback("policeignore", TogglePoliceIgnore);
            Trainer.RegisterNUICallback("wantedlevel", SetWantedLevel);
            Trainer.RegisterNUICallback("policedisable", TogglePoliceDisable);

            Trainer.AddTick(DisablePolice);
        }
Пример #2
0
        public UISection(Trainer trainer) : base(trainer)
        {
            Config.SetDefault("BigMap", "false");
            Config.SetDefault("BigMapOnDown", "true");

            Trainer.RegisterNUICallback("bigmap", ToggleBigMap);
            Trainer.RegisterNUICallback("bigmapondown", ToggleBigMapOnDown);

            EventHandlers["virakal:configFetched"] += new Action(OnConfigFetched);

            Trainer.AddTick(MapOnDownTick);
        }
Пример #3
0
        public PlayerSection(Trainer trainer) : base(trainer)
        {
            Config.SetDefault("GodMode", "true");
            Config.SetDefault("InfiniteStamina", "false");
            Config.SetDefault("CurrentSkin", "");
            Config.SetDefault("AutoGiveParachute", "true");
            Config.SetDefault("AutoLoadDefaultSkin", "true");

            Trainer.RegisterNUICallback("player", OnPlayer);
            Trainer.RegisterAsyncNUICallback("playerskin", OnPlayerSkinChange);
            Trainer.RegisterNUICallback("savedefaultskin", OnSaveDefaultSkin);
            Trainer.RegisterNUICallback("loaddefaultskin", OnLoadDefaultSkin);
            Trainer.RegisterNUICallback("autoloaddefaultskin", OnAutoLoadDefaultSkin);

            EventHandlers["virakal:skinChange"]    += new Action <int>(OnVirakalSkinChange);
            EventHandlers["playerSpawned"]         += new Action(OnPlayerSpawnedRestoreSkin);
            EventHandlers["virakal:configFetched"] += new Action(OnConfigFetched);

            Trainer.AddTick(OnTick);
        }
Пример #4
0
        public VehicleSection(Trainer trainer) : base(trainer)
        {
            Garage = Trainer.Garage;

            Config.SetDefault("AutoDespawnVehicle", "true");
            Config.SetDefault("BoostOnHorn", "true");
            Config.SetDefault("RainbowPaint", "false");
            Config.SetDefault("RainbowChrome", "false");
            Config.SetDefault("RainbowNeon", "false");
            Config.SetDefault("RainbowNeonInverse", "false");
            Config.SetDefault("InvincibleVehicle", "true");
            Config.SetDefault("SpawnInVehicle", "true");
            Config.SetDefault("MaintainVehicleVelocityOnSwitch", "true");
            Config.SetDefault("BoostPower", "75");
            Config.SetDefault("RainbowSpeed", "0.5");

            // General
            Trainer.RegisterNUICallback("veh", OnVeh);
            Trainer.RegisterAsyncNUICallback("vehspawn", OnVehSpawn);
            Trainer.RegisterAsyncNUICallback("vehsearch", OnVehSearch);
            Trainer.RegisterNUICallback("vehseat", OnVehSeat);

            // Garage
            Trainer.RegisterNUICallback("vehsave", OnVehSave);
            Trainer.RegisterAsyncNUICallback("vehload", OnVehLoad);

            // Colours
            Trainer.RegisterNUICallback("vehprimary", OnVehPrimary);
            Trainer.RegisterNUICallback("vehsecondary", OnVehSecondary);
            Trainer.RegisterNUICallback("vehboth", OnVehBoth);
            Trainer.RegisterNUICallback("vehpearl", OnVehPearl);
            Trainer.RegisterNUICallback("vehcustomboth", OnVehCustomBoth);
            Trainer.RegisterNUICallback("vehcustomprimary", OnVehCustomPrimary);
            Trainer.RegisterNUICallback("vehcustomsecondary", OnVehCustomSecondary);
            Trainer.RegisterAsyncNUICallback("vehlivery", OnVehLivery);
            Trainer.RegisterNUICallback("vehrooflivery", OnVehRoofLivery);
            Trainer.RegisterNUICallback("vehrim", OnVehRim);
            Trainer.RegisterNUICallback("vehdashcolour", OnVehDashColour);
            Trainer.RegisterNUICallback("vehdashtrimcolour", OnVehTrimColour);
            Trainer.RegisterNUICallback("vehtint", OnVehTint);
            Trainer.RegisterNUICallback("vehcolourcombo", OnVehColourCombo);
            Trainer.RegisterNUICallback("rainbowspeed", OnRainbowSpeed);
            Trainer.RegisterAsyncNUICallback("vehplatetext", OnVehPlateText);
            Trainer.RegisterNUICallback("vehplatestyle", OnVehPlateStyle);
            Trainer.RegisterAsyncNUICallback("vehneon", OnVehNeon);
            Trainer.RegisterAsyncNUICallback("vehtyresmokecolour", OnVehTyreSmokeColour);
            Trainer.RegisterNUICallback("vehmod", OnVehMod);
            Trainer.RegisterNUICallback("vehmodother", OnVehModOther);

            // Boost
            Trainer.RegisterNUICallback("boostpower", OnBoostPower);

            EventHandlers["virakal:newVehicle"] += new Action <int, int>(OnNewVehicle);

            Trainer.AddTick(RainbowTick);
            Trainer.AddTick(BoostTick);
            Trainer.AddTick(InvincibleCarTick);
            Trainer.AddTick(CheckChangedCar);

            var success = double.TryParse(Config["RainbowSpeed"], out double rainbowSpeed);

            RainbowSpeed = success ? rainbowSpeed : 0.5;
        }