Exemple #1
0
        /// <summary>
        /// Создает транспорт игрока
        /// </summary>
        private VehInst CreateMemberCar(Vehicle vehicleInfo, int index)
        {
            var startPosition = CarRaceData.StartPositions[index];
            var car           = VehicleManager.CreateVehicle(vehicleInfo, startPosition.Item1, startPosition.Item2, Dimension.CAR_RACE);

            car.engineStatus = true;
            _memberVehicles.Add(car);
            return(car);
        }
Exemple #2
0
        /// <summary>
        /// Создает транспорт игрока
        /// </summary>
        private VehInst CreateMemberMoto(Vehicle vehicleInfo, int index)
        {
            var startPosition = MotoRaceData.StartPositions[index];
            var moto          = VehicleManager.CreateVehicle(vehicleInfo, startPosition.Item1, startPosition.Item2, Dimension.MOTO_RACE);

            moto.engineStatus = true;
            _memberVehicles.Add(moto);
            return(moto);
        }
Exemple #3
0
        /// <summary>
        /// Добавить участника
        /// </summary>
        public override void AddMember(Client player, int hash = 0)
        {
            var vehicle = new Vehicle {
                Hash   = hash,
                Fuel   = 80,
                Tuning = new VehicleTuning {
                    PrimaryColor = 0, SecondColor = 0
                }
            };

            AddMember(player, vehicle);
        }
        /// <summary>
        /// Создает транспорт игрока
        /// </summary>
        private VehInst CreateMemberMoto(int index)
        {
            var vehicleInfo = new Vehicle {
                Hash   = (int)VehicleHash.Sanchez,
                Fuel   = 50,
                Tuning = new VehicleTuning {
                    PrimaryColor = 0, SecondColor = 0
                }
            };
            var startPosition = MountainRaceData.StartPositions[index];
            var moto          = VehicleManager.CreateVehicle(vehicleInfo, startPosition.Item1, startPosition.Item2, Dimension.MOUNT_RACE);

            moto.engineStatus = true;
            _memberVehicles.Add(moto);
            return(moto);
        }
Exemple #5
0
        /// <summary>
        /// Создать транспорт игрока
        /// </summary>
        public Vehicle CreateVehicle(VehicleInfo vehicleInfo, Vector3 position, Vector3 rotation, int dimension = 0)
        {
            const int minFuel = 5;
            var       vehicle = API.createVehicle(vehicleInfo.Hash, position, rotation, 0, 0, dimension);

            vehicle.setData(VEHICLE_ID, vehicleInfo.Id);
            vehicle.setData(OWNER_ID, vehicleInfo.OwnerId);
            vehicle.setData(MAX_FUEL, vehicleInfo.MaxFuel);
            var fuelLevel = vehicleInfo.Fuel < minFuel ? minFuel : vehicleInfo.Fuel;

            vehicleInfo.Instance = vehicle;
            API.setVehicleFuelLevel(vehicle, fuelLevel);
            API.setVehicleEngineStatus(vehicle, false);
            SetVehicleTuning(vehicle, vehicleInfo.Tuning);
            return(vehicle);
        }
Exemple #6
0
        /// <summary>
        /// Создает транспорт игрока
        /// </summary>
        private VehInst CreateMemberCar(int index)
        {
            var vehicleInfo = new Vehicle {
                Hash   = (int)VehicleHash.Brawler,
                Fuel   = 70,
                Tuning = new VehicleTuning {
                    PrimaryColor = 160, SecondColor = 0
                }
            };
            var startPosition = RallyRaceData.StartPositions[index];
            var car           = VehicleManager.CreateVehicle(vehicleInfo, startPosition.Item1, startPosition.Item2, Dimension.RALLY);

            car.engineStatus = true;
            _memberVehicles.Add(car);
            return(car);
        }
Exemple #7
0
        /// <summary>
        /// Поместить машину в свободный гараж
        /// </summary>
        private bool SetVehicleInHouse(Client player, Vehicle vehicle, long accountId)
        {
            var houses = _houseManager.GetPlayerHouses(accountId);

            if (!houses.Any())
            {
                API.sendNotificationToPlayer(player, "~r~У вас не арендовано ни одного дома", true);
                return(false);
            }
            var house = GetFreeHouse(player, houses);

            if (house == null)
            {
                API.sendNotificationToPlayer(player, "~r~Нет свободных мест в гараже", true);
                return(false);
            }
            vehicle.HouseId = house.Id;
            _houseManager.SetHouse(house);
            return(true);
        }
 /// <summary>
 /// Добавить участника
 /// </summary>
 public override void AddMember(Client player, Vehicle vehicle = null)
 {
     Members.Add(player);
 }