示例#1
0
 /// <summary>
 /// Выдает награду полицейскому
 /// </summary>
 private void SetPolicemanReward(Client policeman, Client prisoner, bool copSuccess)
 {
     if (copSuccess)
     {
         _policeRewardManager.SetEffortReward(policeman, prisoner);
     }
     else
     {
         API.sendNotificationToPlayer(policeman, "~r~Разыскиваемый игрок погиб");
         _policeRewardManager.SetPatrolReward(policeman);
     }
 }
        /// <summary>
        /// Обработчик завершения патрулирования
        /// </summary>
        private void OnFinishAlert(Client player, object[] args)
        {
            if (!player.hasData(WorkData.ALERT_ZONE_KEY))
            {
                API.sendNotificationToPlayer(player, "~r~Вы не находитесь в зоне партрулирования", true);
                return;
            }
            var alertId = (int)player.getData(WorkData.ALERT_ZONE_KEY);

            if (PlayerHelper.PlayerCorrect(player, true))
            {
                var patrolGroup = API.getPlayersInRadiusOfPlayer(10f, player).Where(e => e != null && e.hasData(WorkData.IS_POLICEMAN)).ToList();
                foreach (var policeman in patrolGroup)
                {
                    _policeRewardManager.SetPatrolReward(policeman);
                }
            }
            _policeAlertManager.FinishAlert(alertId);
            player.resetData(WorkData.ALERT_ZONE_KEY);
            API.triggerClientEvent(player, ServerEvent.HIDE_POLICEMAN_MENU);
        }