public DriverPracticeExamManager(IPlayerInfoManager playerInfoManager)
 {
     _playerInfoManager = playerInfoManager;
     ClientEventHandler.Add(ClientEvent.TIME_OF_EXAM_WAS, TimeOfExamWas);
     ClientEventHandler.Add(ClientEvent.DAMAGE_COUNT_EXCEEDED, DamageCountExceeded);
     CreateShapes();
 }
Example #2
0
 /// <summary>
 /// Инициализировать обработчик меню
 /// </summary>
 public void Initialize()
 {
     ClientEventHandler.Add(ClientEvent.ENTER_TO_VEHICLE_PREVIEW, EnterToPreview);
     ClientEventHandler.Add(ClientEvent.EXIT_FROM_VEHICLE_PREVIEW, ExitFromPreview);
     ClientEventHandler.Add(ClientEvent.BUY_VEHICLE, BuyVehicle);
     ClientEventHandler.Add(ClientEvent.SELL_VEHICLE, SellVehicle);
 }
Example #3
0
 /// <summary>
 /// Инициализировать меню работы
 /// </summary>
 public override void Initialize()
 {
     ClientEventHandler.Add(ClientEvent.FOOD_TRUNK_DRIVER, FoodTrunkDriver);
     ClientEventHandler.Add(ClientEvent.FOOD_DELIVERYMAN, FoodDeliveryman);
     ClientEventHandler.Add(ClientEvent.BISTRO_SALARY, BistroSalary);
     ClientEventHandler.Add(ClientEvent.BUY_BISTRO_FOOD, BuyBistroFood);
 }
Example #4
0
 /// <summary>
 /// Инизиализировать место
 /// </summary>
 public override void Initialize()
 {
     ClientEventHandler.Add(ClientEvent.REGISTER_ON_FIGHTING, (entity, args) => PlayerHelper.ProcessAction(entity, Register));
     ClientEventHandler.Add(ClientEvent.CANCEL_REGISTER_ON_FIGHTING, (entity, args) => PlayerHelper.ProcessAction(entity, CancelRegistration));
     ClientEventHandler.Add(ServerEvent.START_FIGHT, (entity, args) => PlayerHelper.ProcessAction(entity, player => player.freeze(false)));
     FightsBoxCreator.CreateBox();
 }
 /// <summary>
 /// Проинициализировать работу
 /// </summary>
 public void Initialize()
 {
     ClientEventHandler.Add(ClientEvent.PROCESS_FISHERMAN_POINT, ProcessPoint);
     ClientEventHandler.Add(ClientEvent.FINISH_FISHERMAN_POINT, FinishPoint);
     CreatePoints(true);
     CreatePoints(false);
 }
 /// <summary>
 /// Инициализировать меню работы
 /// </summary>
 public override void Initialize()
 {
     ClientEventHandler.Add(ClientEvent.WORK_IN_POLICE, WorkInPolice);
     ClientEventHandler.Add(ClientEvent.POLICE_SALARY, GetSalary);
     ClientEventHandler.Add(ClientEvent.PAY_PENALTY, PayPenalty);
     ClientEventHandler.Add(ClientEvent.BUY_WEAPON_LICENSE, BuyWeaponLicense);
 }
        /// <summary>
        /// Запустить гонку
        /// </summary>
        public override void Start()
        {
            const int driverSeat = -1;

            Members = Members.Where(e => API.isPlayerConnected(e)).ToList();
            if (Members.Count < 2)
            {
                return;
            }
            ClientEventHandler.Add(ServerEvent.START_MOUNTAIN_RACE, (player, args) => OnRaceStart(_memberVehicles));
            var index = 0;

            foreach (var member in Members)
            {
                SetPlayerData(member, Dimension.MOUNT_RACE);
                var moto = CreateMemberMoto(index);
                Thread.Sleep(300); // чтобы машина успела появиться
                API.setPlayerIntoVehicle(member, moto, driverSeat);
                MountainTrackHandler.ShowFirstPoint(member);
                API.triggerClientEvent(member, ServerEvent.SET_TIMER, 10, ServerEvent.START_MOUNTAIN_RACE);
                index++;
            }
            FreezeVehicles(_memberVehicles);
            InProgress = true;
        }
Example #8
0
 /// <summary>
 /// Инициализировать админское меню
 /// </summary>
 public void Initialize()
 {
     ClientEventHandler.Add(ClientEvent.GET_POSITION, GetCurrentPosition);
     ClientEventHandler.Add(ClientEvent.GET_ROTATION, GetCurrentRotation);
     ClientEventHandler.Add(ClientEvent.GET_CAR, GetCar);
     ClientEventHandler.Add(ClientEvent.GET_WEAPON, GetWeapon);
 }
Example #9
0
 /// <summary>
 /// Инициализировать меню
 /// </summary>
 public void Initialize()
 {
     ClientEventHandler.Add(ClientEvent.THEORY_EXAM, TheoryExam);
     ClientEventHandler.Add(ClientEvent.PRACTICE_EXAM, PracticeExam);
     ClientEventHandler.Add(ClientEvent.BRIBE_LICENCE, BribeLicence);
     ClientEventHandler.Add(ClientEvent.FINISH_THEORY_EXAM, FinishTheoryExam);
 }
 /// <summary>
 /// Инициализировать меню
 /// </summary>
 public void Initialize()
 {
     ClientEventHandler.Add(ClientEvent.BUY_FOOD, OnBuyFood);
     ClientEventHandler.Add(ClientEvent.BUY_THING, OnBuyThing);
     ClientEventHandler.Add(ClientEvent.REPLENISH_PHONE_BALANCE, ReplenishPhoneBalance);
     ClientEventHandler.Add(ClientEvent.BUY_PHONE, BuyPhone);
 }
Example #11
0
 /// <summary>
 /// Инициализирует квест
 /// </summary>
 public override void Initialize()
 {
     ClientEventHandler.Add(ClientEvent.ASK_CLAN_QUEST_KEY, AskQuestKey);
     ClientEventHandler.Add(ClientEvent.CHANGE_INTO_POLICE, ChangeIntoPolice);
     ClientEventHandler.Add(ClientEvent.FINISH_CASE_FALSIFICATION, FinishFalsification);
     CreateWardrobe();
     CreateRepository();
 }
Example #12
0
 /// <summary>
 /// Инициализировать обработчик меню
 /// </summary>
 public void Initialize()
 {
     ClientEventHandler.Add(ClientEvent.TRIGGER_PLAYER_ACTION_MENU, TriggerActionMenu);
     ClientEventHandler.Add(ClientEvent.PLAY_PLAYER_ANIM, PlayPlayerAnimation);
     ClientEventHandler.Add(ClientEvent.STOP_PLAYER_ANIM, (player, args) => API.stopPlayerAnimation(player));
     ClientEventHandler.Add(ClientEvent.SEND_MONEY_TO_PLAYER, SendMoneyToPlayer);
     ClientEventHandler.Add(ClientEvent.TELEPORT_TO_HOUSE, TeleportToHouse);
 }
 /// <summary>
 /// Проинициализировать голосовой сервер
 /// </summary>
 public void Initialize()
 {
     ClientEventHandler.Add(ClientEvent.GET_PHONE_INFO, (player, objects) => SendPhoneInfo(player));
     ClientEventHandler.Add(ClientEvent.START_CALL, StartCall);
     ClientEventHandler.Add(ClientEvent.ANSWER_CALL, AnswerCall);
     ClientEventHandler.Add(ClientEvent.HANGUP_CALL, HangupCall);
     ClientEventHandler.Add(ClientEvent.ADD_PHONE_CONTACT, AddNewContact);
     ClientEventHandler.Add(ClientEvent.TRIGGER_PHONE_VISIBLE, TriggerPhone);
 }
 /// <summary>
 /// Инициализировать меню
 /// </summary>
 public void Initialize()
 {
     ClientEventHandler.Add(ClientEvent.GET_HOUSE_RENT, GetHouseRent);
     ClientEventHandler.Add(ClientEvent.ENTER_HOUSE, EnterHouse);
     ClientEventHandler.Add(ClientEvent.EXIT_HOUSE, ExitHouse);
     ClientEventHandler.Add(ClientEvent.LOCK_HOUSE, LockHouse);
     ClientEventHandler.Add(ClientEvent.ENTER_GARAGE, EnterGarage);
     ClientEventHandler.Add(ClientEvent.EXIT_GARAGE, ExitGarage);
 }
Example #15
0
 /// <summary>
 /// Инициализировать обработчик меню
 /// </summary>
 public void Initialize()
 {
     ClientEventHandler.Add(ClientEvent.SET_VEHICLE_MOD, SelectOrBuyVehicleMod);
     ClientEventHandler.Add(ClientEvent.SET_NEON, SetNeon);
     ClientEventHandler.Add(ClientEvent.SET_ENGINE_POWER, SetEnginePower);
     ClientEventHandler.Add(ClientEvent.SET_VEHICLE_COLOR, SetVehicleColor);
     ClientEventHandler.Add(ClientEvent.REPAIR_VEHICLE, RepairVehicle);
     ClientEventHandler.Add(ClientEvent.EXIT_FROM_TUNING_GARAGE, ExitFromGarage);
 }
 public void Initialize()
 {
     ClientEventHandler.Add("OnStartRacecourseRace", OnStartRace);
     ClientEventHandler.Add("StartRacecourseRace", StartRace);
     ClientEventHandler.Add("StopRacecourseRace", (client, objects) => FinishRace());
     ClientEventHandler.Add("SpawnRacecourseCars", SpawnRaceVehicles);
     ClientEventHandler.Add("RemoveRacecourseCars", (client, objects) => RemoveRaceVehicles());
     CreateRaceCircleCounter();
     CreateRaceObjects();
 }
 /// <summary>
 /// Проинициализировать меню управления транспортом
 /// </summary>
 public void Initialize()
 {
     ClientEventHandler.Add(ClientEvent.TRIGGER_VEHICLE_ACTION_MENU, TriggerVehicleMenu);
     ClientEventHandler.Add(ClientEvent.TURN_ENGINE, TriggerEngine);
     ClientEventHandler.Add(ClientEvent.LOCK_VEHICLE, OnLockTrigger);
     ClientEventHandler.Add(ClientEvent.CHANGE_DOOR_STATE, ChangeDoorState);
     ClientEventHandler.Add(ClientEvent.PUT_IN_TRUNK, PutInTrunk);
     ClientEventHandler.Add(ClientEvent.TAKE_FROM_TRUNK, TakeFromTrunk);
     ClientEventHandler.Add(ClientEvent.TRIGGER_VANS_TRUNK, TriggerVansTrunk);
 }
Example #18
0
        /// <summary>
        /// Проинициализировать дворик
        /// </summary>
        public void Initialize(long clanId, ClanCourtyardInfo courtyard)
        {
            CreateMissionEndPoint(clanId, courtyard.MissionEndPoint);
            CreateVansGarage(clanId, courtyard);
            var blip = _pointCreator.CreateBlip(courtyard.VansGarage, 357, 19, name: "Фургоны для миссии");

            API.setBlipTransparency(blip, 0);
            _vansBlips.Add(blip);
            ClientEventHandler.Add(ClientEvent.SPAWN_MISSION_VANS, OnSpawnMissionVans);
        }
Example #19
0
        /// <summary>
        /// Инизиализировать парковку
        /// </summary>
        public override void Initialize()
        {
            ClientEventHandler.Add(ClientEvent.GET_VEHICLE_FROM_PARKING, GetVehicleFromParking);
            ClientEventHandler.Add(ClientEvent.PARK_VEHICLE, ParkVehicle);

            var parking = API.createSphereColShape(new Vector3(-316.40, -758.54, 33.97), 50f);

            parking.onEntityEnterColShape += (shape, entity) => ParkingAction(entity, vehicle => vehicle.setData(ON_PARKING, true));
            parking.onEntityExitColShape  += (shape, entity) => ParkingAction(entity, vehicle => vehicle.resetData(ON_PARKING));
        }
Example #20
0
        public CreatingCharManager(IPlayersProvider playersProvider, IPlayersAppearanceProvider playersAppearanceProvider,
                                   IPlayerInfoManager playerInfoManager, IGtaCharacter gtaCharacter, IGiftsManager giftsManager)
        {
            _playersProvider           = playersProvider;
            _playersAppearanceProvider = playersAppearanceProvider;
            _playerInfoManager         = playerInfoManager;
            _gtaCharacter = gtaCharacter;
            _giftsManager = giftsManager;

            ClientEventHandler.Add(ClientEvent.SAVE_CHARACTER, SaveCharacter);
        }
Example #21
0
        /// <summary>
        /// Инициализация голосового чата
        /// </summary>
        private void OnStart()
        {
            var teamSpeakConfig = new VoiceServerConfiguration("194.87.101.165", 23332, "8nwm0jHKWfrtSCTc1JYXsded55A=", 3, "GtaVGrimeVoice"); // prod

            //var teamSpeakConfig = new VoiceServerConfiguration("localhost", 23332, "Av0yWcX9rmJg6QWS1Hw1NG7HNK0=", 3, "qwe123"); // local
            VoiceServer = GtmpVoice.CreateServer(API, teamSpeakConfig);
            VoiceServer.AddTask(new PositionalTask());
            AttachToVoiceServerEvents();
            ClientEventHandler.Add(VOICE_ROTATION, (client, args) => client.SetVoiceRotation((float)args[0]));
            VoiceServer.Start();
        }
Example #22
0
        /// <summary>
        /// Инициализация голосового чата
        /// </summary>
        private void OnStart()
        {
            // more info: https://github.com/AlternateLife/JustAnotherVoiceChat-Server
            var teamSpeakConfig = new VoiceServerConfiguration("localhost", 23332, "virtualserver_unique_identifier", 2, "chanel pass");

            VoiceServer = GtmpVoice.CreateServer(API, teamSpeakConfig);
            VoiceServer.AddTask(new PositionalTask());
            AttachToVoiceServerEvents();
            ClientEventHandler.Add(VOICE_ROTATION, (client, args) => client.SetVoiceRotation((float)args[0]));
            VoiceServer.Start();
        }
 /// <summary>
 /// Инициализировать обработчик действий полицейских
 /// </summary>
 public void Initialize()
 {
     _policeAlertManager.RunAlertsGenerator();
     ClientEventHandler.Add(ClientEvent.CHECK_PLAYER, OnCheckPlayer);
     ClientEventHandler.Add(ClientEvent.ARREST_PLAYER, OnArrestPlayer);
     ClientEventHandler.Add(ClientEvent.GIVE_PENALTY, OnGivePenalty);
     ClientEventHandler.Add(ClientEvent.FINISH_POLICE_ALERT, OnFinishAlert);
     ClientEventHandler.Add(ClientEvent.PUT_IN_CAR, PutPrisonerInCar);
     ClientEventHandler.Add(ClientEvent.TAKE_FROM_CAR, TakePrisonerFromCar);
     ClientEventHandler.Add(ClientEvent.RELEASE_PLAYER, OnReleasePlayer);
     ClientEventHandler.Add(ClientEvent.GET_POLICE_MENU, OnGetPoliceMenu);
 }
Example #24
0
 /// <summary>
 /// Подготовка эвента
 /// </summary>
 public void Initialize()
 {
     _eventInfo = GetEventInfo();
     _members   = new List <Client>(_eventInfo.MaxMembers);
     _redTeam   = new List <Client>(_eventInfo.MaxMembers / 2);
     _blueTeam  = new List <Client>(_eventInfo.MaxMembers / 2);
     API.sendChatMessageToAll($"~g~Открыта регистрация на эвент \"{_eventInfo.Name}\".");
     ClientEventHandler.Add(ClientEvent.EVENT_PARTICIPATION, ChangeEventParticipation);
     ClientEventHandler.Add(ClientEvent.START_EVENT, (player, args) => player.freeze(false));
     _eventZone = CreateEventZone();
     _eventZone.onEntityEnterColShape += OnPlayerEnterEventZone;
     _eventZone.onEntityExitColShape  += OnPlayerLeaveEventZone;
 }
 /// <summary>
 /// Проинициализировать работу пилотов
 /// </summary>
 public void Initialize()
 {
     ClientEventHandler.Add(ClientEvent.PROCESS_PILOT_DELIVERY, ProcessDelivery);
     foreach (var contract in AirPort.Contracts)
     {
         var point = API.createSphereColShape(contract.TargetPosition, 8f);
         point.setData(POINT_CONTRACT_TYPE, contract.Type);
         point.onEntityEnterColShape += (shape, entity) =>
                                        ProcessTargetColShape(entity, pilot => OnPlayerComeToPoint(pilot, shape));
         point.onEntityExitColShape += (shape, entity) =>
                                       ProcessTargetColShape(entity, pilot => pilot.resetData(ON_TARGET));
     }
 }
Example #26
0
 /// <summary>
 /// Инициализирует квест
 /// </summary>
 public override void Initialize()
 {
     ClientEventHandler.Add(ClientEvent.FINISH_DRUG_DELIVERY_POINT, OnFinishDelivery);
     foreach (var npc in DrugDealers.Npcs)
     {
         _pointCreator.CreatePed(npc.Hash, npc.Position, npc.Rotation);
         var shape = API.createCylinderColShape(npc.ShapePosition, 1.5f, 2f);
         shape.setData(SHAPE_INDEX, npc.Index);
         shape.onEntityEnterColShape += (colShape, entity) =>
                                        ProcessShapeEvent(shape, entity, player => player.setSyncedData(ON_TARGET_POINT, true));
         shape.onEntityExitColShape += (colShape, entity) =>
                                       ProcessShapeEvent(shape, entity, player => player.resetSyncedData(ON_TARGET_POINT));
     }
 }
Example #27
0
        /// <summary>
        /// Запускает войну за район
        /// </summary>
        public void StartWar()
        {
            ClientEventHandler.Add(ClientEvent.CAPTURE_DISTRICT, CaptureStreet);
            _district = _districtsProvider.GetNext();
            _clanManager.RemoveDistrict(_district.Id);
            var position = PositionConverter.ToVector3(_district.Position);

            _blip         = _pointCreator.CreateBlip(position, 439, 4, scale: 2f, name: "Война за район");
            _capturePoint = _pointCreator.CreateMarker(Marker.VerticalCylinder, position, Colors.White, 3.7f, "Точка захвата района");
            _capturePoint.ColShape.onEntityEnterColShape += PlayerComeToCapturePoint;
            _capturePoint.ColShape.onEntityExitColShape  += PlayerAwayFromCapturePoint;
            API.setMarkerScale(_capturePoint.Marker, new Vector3(4, 4, 4));
            API.setEntityPosition(_capturePoint.Label, _capturePoint.Label.position.Add(new Vector3(0, 0, 2)));
            API.sendChatMessageToAll($"~b~[Банды] Началось сражение за район \"{_district.Name}\"!");
        }
Example #28
0
 /// <summary>
 /// Инизиализировать место
 /// </summary>
 public override void Initialize()
 {
     ClientEventHandler.Add(ClientEvent.BUY_WEAPON, BuyWeapon);
     ClientEventHandler.Add(ClientEvent.BUY_AMMO, BuyAmmo);
     foreach (var shop in AmmuNationData.Shops)
     {
         _pointCreator.CreateBlip(shop.LeftDoorPosition, 110, 45, name: shop.Name);
         var leftDoodId  = _doormanager.Register(97297972, shop.LeftDoorPosition);
         var rightDoorId = _doormanager.Register(-8873588, shop.RightDoorPosition);
         _doormanager.SetDoorState(leftDoodId, false, 1);
         _doormanager.SetDoorState(rightDoorId, false, 1);
         var seller = _pointCreator.CreatePed(
             PedHash.Ammucity01SMY, "Продавец", shop.SellerPosition,
             shop.SellerRotation, shop.Marker, Colors.VividCyan
             );
         seller.ColShape.onEntityEnterColShape += (shape, entity) => PlayerComeToSeller(entity, shop.District);
         seller.ColShape.onEntityExitColShape  += PlayerAwayFromSeller;
     }
 }
Example #29
0
        /// <summary>
        /// Инизиализировать место прыжков с парашютом
        /// </summary>
        public override void Initialize()
        {
            var position = new Vector3(-75.68, -826.21, 326.18);

            _pointCreator.CreateBlip(position, 377, 63, scale: 1.3f, name: "Прыжок с парашютом");
            CreateEnters();
            var ped = _pointCreator.CreatePed(
                PedHash.ExArmy01, NAME, position, new Vector3(0.00, 0.00, -15.22),
                new Vector3(-75.47, -825.44, 325.18), Colors.VividCyan
                );

            ped.ColShape.onEntityEnterColShape += (shape, entity) =>
                                                  PlayerHelper.ProcessAction(entity, player => API.triggerClientEvent(player, ServerEvent.SHOW_PARACHUTE_MENU)
                                                                             );
            ped.ColShape.onEntityExitColShape += (shape, entity) =>
                                                 PlayerHelper.ProcessAction(entity, player => API.triggerClientEvent(player, ServerEvent.HIDE_PARACHUTE_MENU)
                                                                            );
            ClientEventHandler.Add(ClientEvent.BUY_PARACHUTE, BuyParachute);
        }
Example #30
0
        /// <summary>
        /// Запустить гонку
        /// </summary>
        public override void Start()
        {
            const int driverSeat = -1;

            Members = Members.Where(e => API.isPlayerConnected(e.Key)).ToDictionary(e => e.Key, e => e.Value);
            if (Members.Count < 2)
            {
                return;
            }
            ClientEventHandler.Add(ServerEvent.START_CAR_RACE, (player, args) => OnRaceStart(_memberVehicles));
            var index = 0;

            foreach (var member in Members)
            {
                var car = CreateMemberCar(member.Value, index);
                SetPlayerData(member.Key, Dimension.CAR_RACE);
                CarTrackHandler.ShowFirstPoint(member.Key);
                API.triggerClientEvent(member.Key, ServerEvent.SET_TIMER, 10, ServerEvent.START_CAR_RACE);
                API.setPlayerIntoVehicle(member.Key, car, driverSeat);
                index++;
            }
            FreezeVehicles(_memberVehicles);
            InProgress = true;
        }