public async Task OnEnterColshape(IColShape colShape, IEntity targetEntity, bool state) => await AltAsync.Do(() => { if (!state) { return; } if (colShape == null || !colShape.Exists) { return; } if (targetEntity.Type != BaseObjectType.Player) { return; } AltAsync.Log("Shop"); ShopEntity shopEntity = colShape.GetShopEntity(); if (shopEntity == null || shopEntity.ColShape != colShape) { return; } IPlayer player = targetEntity as IPlayer; if (player.IsInVehicle) { return; } player.SetData("current:shop", shopEntity); new Interaction(player, "shop:openWindow", "aby otworzyć ~g~sklep"); });
public static async Task LoadShopAsync(UnitOfWork unit) { foreach (ShopModel shop in await unit.ShopRepository.GetAll()) { Alt.Log($"[SHOP-ENTITY: LOAD]: sklep o ID: {shop.Id} został wczytany poprawnie!"); ShopEntity shopEntity = new ShopEntity(shop); await shopEntity.Spawn(); } }