Beispiel #1
0
        public async Task OnColshape(IColShape colShape, IEntity targetEntity, bool state) => await AltAsync.Do(() =>
        {
            if (!state)
            {
                return;
            }

            if (colShape == null || !colShape.Exists)
            {
                return;
            }
            if (targetEntity.Type != BaseObjectType.Player)
            {
                return;
            }
            Alt.Log("Banki");

            AtmEntity atmEntity = colShape.GetAtmEntity();

            if (atmEntity == null || atmEntity.ColShape != colShape)
            {
                return;
            }

            IPlayer player = targetEntity as IPlayer;
            if (player.IsInVehicle)
            {
                return;
            }

            new Interaction(player, "atm:openWindow", "aby otworzyć ~g~ATM");
        });
Beispiel #2
0
        public async Task CreateAtmCMD(IPlayer sender) => await AltAsync.Do(async() =>
        {
            if (!sender.GetAccountEntity().HasRank((int)EAdmin.Supporter))
            {
                return;
            }

            if (!sender.GetAccountEntity().OnAdminDuty)
            {
                sender.SendErrorNotify("Wystąpił bląd!", "Aby użyć tej komendy musisz wejść na służbę administratora");
                return;
            }

            CharacterEntity characterEntity = sender.GetAccountEntity().characterEntity;
            AtmModel atm = new AtmModel()
            {
                PosX      = sender.Position.X,
                PosY      = sender.Position.Y,
                PosZ      = sender.Position.Z - 0.9f,
                CreatorId = sender.GetAccountEntity().DbModel.Id
            };

            AtmEntity atmEntity = new AtmEntity(atm);
            await atmEntity.Spawn(true);
        });
Beispiel #3
0
 public static async Task LoadAtmsAsync(UnitOfWork unit)
 {
     foreach (AtmModel atm in await unit.AtmRepository.GetAll())
     {
         Alt.Log($"[ATM-ENTITY: LOAD]: atm o ID: {atm.Id} został wczytany poprawnie!");
         AtmEntity atmEntity = new AtmEntity(atm);
         await atmEntity.Spawn();
     }
 }