dominion Posted September 7, 2020 Posted September 7, 2020 I have a small problem, after migrating to 1.1, cars in the car dealership and garage do not spawn and chat does not work. Tell me please where what has changed, I can't find
dominion Posted September 7, 2020 Author Posted September 7, 2020 I read this. The chat has already been set up, but I still can't figure out what to change in cars
dominion Posted September 11, 2020 Author Posted September 11, 2020 В 07.09.2020 в 16:38, Xabi сказал: public static void OpenCarromMenu(Player player, int biztype) { biztype -= 2; var prices = new List<int>(); Business biz = BusinessManager.BizList[player.GetData<int>("CARROOMID")]; foreach (var p in biz.Products) prices.Add(p.Price); Trigger.ClientEvent(player, "openAuto", JsonConvert.SerializeObject(BusinessManager.CarsNames[biztype]), JsonConvert.SerializeObject(prices)); } [RemoteEvent("carroomBuy")] public static void RemoteEvent_carroomBuy(Player player, string vName, string color) { try { Business biz = BusinessManager.BizList[player.GetData<int>("CARROOMID")]; NAPI.Entity.SetEntityPosition(player, new Vector3(biz.EnterPoint.X, biz.EnterPoint.Y, biz.EnterPoint.Z + 1.5)); // player.FreezePosition = false; Main.Players[player].ExteriorPos = new Vector3(); Trigger.ClientEvent(player, "destroyCamera"); NAPI.Entity.SetEntityDimension(player, 1);// Dimensions.DismissPrivateDimension(player); var house = Houses.HouseManager.GetHouse(player, true); if (house == null) { Notify.Send(player, NotifyType.Error, NotifyPosition.BottomCenter, $"У Вас нет личного дома", 3000); return; } if (house.GarageID == 0) { Notify.Send(player, NotifyType.Error, NotifyPosition.BottomCenter, $"У Вас нет гаража", 3000); return; } var garage = Houses.GarageManager.Garages[house.GarageID]; if (VehicleManager.getAllPlayerVehicles(player.Name).Count >= Houses.GarageManager.GarageTypes[garage.Type].MaxCars) { Notify.Send(player, NotifyType.Error, NotifyPosition.BottomCenter, $"У Вас максимальное кол-во машин", 3000); return; } var prod = biz.Products.FirstOrDefault(p => p.Name == vName); if (Main.Players[player].Money < prod.Price) { Notify.Send(player, NotifyType.Error, NotifyPosition.BottomCenter, "Недостаточно средств", 3000); return; } if (!BusinessManager.takeProd(biz.ID, 1, vName, prod.Price)) { Notify.Send(player, NotifyType.Error, NotifyPosition.BottomCenter, "Машин этой модели больше нет на складе", 3000); return; } MoneySystem.Wallet.Change(player, -prod.Price); GameLog.Money($"player({Main.Players[player].UUID})", $"biz({biz.ID})", prod.Price, $"buyCar({vName})"); var vNumber = VehicleManager.Create(player.Name, vName, carColors[color], carColors[color]); garage.SpawnCar(vNumber); Notify.Send(player, NotifyType.Info, NotifyPosition.BottomCenter, $"Вы купили {vName} с номером {vNumber}", 3000); Notify.Send(player, NotifyType.Info, NotifyPosition.BottomCenter, $"В скором времени она будет доставлена в Ваш гараж", 5000); } catch (Exception e) { Log.Write("CarroomBuy: " + e.Message, nLog.Type.Error); } } Could you please tell me what to fix here?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now