Exemplo n.º 1
0
        public override CommandResult OnExecute(ICommandSource src, ICommandArgs args)
        {
            if (args.Length == 0)
            {
                return(CommandResult.ShowUsage());
            }

            if (!Conversations.ContainsKey(src.DisplayName))
            {
                return(CommandResult.Lang(EssLang.NOBODY_TO_REPLY));;
            }

            var target = (from conversation
                          in Conversations
                          where conversation.Value.Equals(src.DisplayName)
                          select UPlayer.From(conversation.Key)
                          ).FirstOrDefault();

            if (target == null)
            {
                return(CommandResult.Lang(EssLang.NO_LONGER_ONLINE));
            }

            src.DispatchCommand($"tell \"{target.DisplayName}\" \"{args.Join( 0 )}\"");

            return(CommandResult.Success());
        }
Exemplo n.º 2
0
        public override CommandResult OnExecute(ICommandSource src, ICommandArgs args)
        {
            var playerId = src.ToPlayer().CSteamId.m_SteamID;

            if (!Conversations.ContainsKey(playerId))
            {
                return(CommandResult.Lang("NOBODY_TO_REPLY"));
            }

            var target = (
                from conversation
                in Conversations
                where conversation.Value.Equals(playerId)
                select UPlayer.From(conversation.Key)
                ).FirstOrDefault();

            if (target == null)
            {
                return(CommandResult.Lang("NO_LONGER_ONLINE"));
            }

            src.DispatchCommand($"tell \"{target.DisplayName}\" \"{args.Join(0)}\"");

            return(CommandResult.Success());
        }
Exemplo n.º 3
0
        public override CommandResult OnExecute(ICommandSource src, ICommandArgs args)
        {
            var playerId = src.ToPlayer().CSteamId.m_SteamID;

            if (!ReplyTo.TryGetValue(playerId, out var targetId))
            {
                return(CommandResult.LangError("NOBODY_TO_REPLY"));
            }

            var target = UPlayer.From(targetId);

            if (target == null)
            {
                return(CommandResult.LangError("NO_LONGER_ONLINE"));
            }

            src.DispatchCommand($"tell \"{target.DisplayName}\" \"{args.Join(0)}\"");

            return(CommandResult.Success());
        }
Exemplo n.º 4
0
        public override void OnExecute( ICommandSource source, ICommandArgs parameters )
        {
            if ( parameters.Length == 0 )
            {
                ShowUsage( source );
            }
            else
            {
                var target = ( from conversation
                               in Conversations
                               where conversation.Value.Equals( source.DisplayName )
                               select UPlayer.From( conversation.Key )
                              ).FirstOrDefault();

                if ( target == null )
                {
                    EssLang.NO_LONGER_ONLINE.SendTo( source );
                    return;
                }

                source.DispatchCommand( $"tell {target.DisplayName} {parameters.Join( 0 )}" );
            }
        }