コード例 #1
0
        /// <summary>
        /// Войти в гараж
        /// </summary>
        private void EnterGarage(Client player, HouseInfo house)
        {
            LoadVehicles(player, house);
            var garage = HousesPositionsGetter.GetGarageInnerPositions(house.Type);

            SetGaragePosition(player, garage.AfterEnter, garage.EnterRotation, (int)house.Id);
            API.sendNativeToPlayer(player, Hash.DISPLAY_RADAR, false);
            API.triggerClientEvent(player, ServerEvent.HIDE_HOUSE_MENU);
        }
コード例 #2
0
        /// <summary>
        /// Загрузить машины в гараж
        /// </summary>
        private void LoadVehicles(Client player, HouseInfo house)
        {
            var vehicles         = _vehicleInfoManager.GetPlayerVehicles(player);
            var parkingPositions = HousesPositionsGetter.GetGarageInnerPositions(house.Type).Positions;
            var positionIndex    = 0;

            foreach (var vehicle in vehicles)
            {
                if (vehicle.HouseId != house.Id)
                {
                    continue;
                }
                var position = parkingPositions[positionIndex];
                vehicle.IsSpawned = true;
                _vehicleManager.CreateVehicle(vehicle, position.Item1, position.Item2, (int)-house.Id);
                _vehicleInfoManager.SetInfo(player, vehicle);
                positionIndex++;
            }
        }