- [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));
- Trigger.ClientEvent(player, "freeze", false);
- Main.Players[player].ExteriorPos = new Vector3();
- Trigger.ClientEvent(player, "destroyCamera");
- NAPI.Entity.SetEntityDimension(player, 0);
- Dimensions.DismissPrivateDimension(player);
- var house = Houses.HouseManager.GetHouse(player, true);
- if (house == null || house.GarageID == 0)
- {
- // Player without garage
- if (VehicleManager.getAllPlayerVehicles(player.Name).Count >= 1)
- {
- Notify.Send(player, NotifyType.Error, NotifyPosition.BottomLeft, $"Нельзя иметь больше 1 машины без дома", 3000);
- return;
- }
- string vNumber = BuyVehicle(player, biz, vName, color);
- if (vNumber != "none")
- {
- VehicleManager.Spawn(vNumber, biz.UnloadPoint, 90, player);
- }
- }
- else
- {
- 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;
- }
- string vNumber = BuyVehicle(player, biz, vName, color);
- if (vNumber != "none")
- {
- garage.SpawnCar(vNumber);
- }
- }
- }
- catch (Exception e) { Log.Write("CarroomBuy: " + e.Message, nLog.Type.Error); }
- }
[text] 1111
Viewer
*** This page was generated with the meta tag "noindex, nofollow". This happened because you selected this option before saving or the system detected it as spam. This means that this page will never get into the search engines and the search bot will not crawl it. There is nothing to worry about, you can still share it with anyone.
Editor
You can edit this paste and save as new: