private void Event_OnClientEventTrigger(Client sender, string eventName, params object[] arguments)
        {
            //args[0] to index na liście pozycji
            if (eventName == "OnPlayerSelectedCrimeBotDiscrict")
            {
                AccountEntity player = sender.GetAccountEntity();
                if (player.CharacterEntity.OnDutyGroup is CrimeGroup group && group.CanPlayerCallCrimeBot(player))
                {
                    if (group.CrimePedEntity != null)
                    {
                        // crime bot already spawned
                        sender.SendChatMessage("~#ffdb00~",
                                               "Wybrany abonent ma wyłączony telefon, bądź znajduje się poza zasięgiem, spróbuj później.");
                        return;
                    }

                    RoleplayContext ctx = Singletons.RoleplayContextFactory.Create();
                    using (CrimeBotsRepository repository = new CrimeBotsRepository(ctx))
                    {
                        CrimeBotModel    crimeBotData = repository.Get(crimeBot => crimeBot.GroupModel.Id == group.Id);
                        CrimeBotPosition position     = XmlHelper.GetXmlObjects <CrimeBotPosition>(
                            Path.Combine(Utils.XmlDirectory, "CrimeBotPositions"))[Convert.ToInt32(arguments[0])];

                        group.CrimePedEntity = new CrimePedEntity(player, group, position.VehiclePosition,
                                                                  crimeBotData.Name, NAPI.Util.PedNameToModel(crimeBotData.PedSkin), position.BotPosition);
                        group.CrimePedEntity.Spawn();
                        sender.TriggerEvent("DrawCrimeBotComponents", position.BotPosition.Position, 500, 2);
                    }
                }
                else
                {
                    sender.SendChatMessage("~#ffdb00~",
                                           "Wybrany abonent ma wyłączony telefon, bądź znajduje się poza zasięgiem, spróbuj później.");
                }
            }
        public CrimePedEntity(AccountEntity player, CrimeGroup group, FullPosition vehiclePosition,
                              string name, PedHash hash, FullPosition position) : base(name, hash, position)
        {
            Player          = player;
            Group           = group;
            VehiclePosition = vehiclePosition;

            RoleplayContext ctx = Singletons.RoleplayContextFactory.Create();

            using (CrimeBotsRepository repository = new CrimeBotsRepository(ctx))
                DbModel = repository.Get(crimeBot => crimeBot.GroupModel.Id == group.Id);

            List <PropertyInfo> properties = new List <PropertyInfo> {
                null
            };

            properties.AddRange(typeof(CrimeBotModel).GetProperties()
                                .Where(f => f.GetValue(DbModel) != null && (f.PropertyType == typeof(int?) || f.PropertyType == typeof(decimal?))));

            if (properties.Count % 3 != 1)
            {
                player.Client.SendError($"Konfiguracja bota grupy {Group} jest nieporawna, skontaktuj się z administratorem.");
                return;
            }

            for (int i = 0; i < properties.Count; i += 3)
            {
                if (i == 0)
                {
                    continue;
                }

                Tuple <string, ItemEntityType> info = Constant.Items.GetCrimeBotItemName(properties[i - 2].Name);
                Items.Add(new CrimeBotItem(info.Item1, ((decimal?)properties[i - 2].GetValue(DbModel)).Value, ((int?)properties[i - 1].GetValue(DbModel)).Value, ((int?)properties[i].GetValue(DbModel)).Value, info.Item2, properties[i - 1].Name));
            }
            Items.ForEach(
                x => NAPI.Chat.SendChatMessageToPlayer(Player.Client, $"Nazwa {x.Name} Koszt {x.Cost}, Ilość {x.Count}, Pole {x.DatabaseField}"));
        }