Page 1 of 1

/consolemsg

PostPosted: 03 Aug 2013, 19:40
by Breakdown901
It sort of pointless, but say someone said with putting /consolemsg, "gtg" , it would make the console send a message saying "Bye! See you soon!" Thats just an example. I'm asking for this to see if its possible to make, and it could help me learn more in C#. :)

Re: /consolemsg

PostPosted: 04 Aug 2013, 06:59
by Clowny
well exactly I think it's just kind of um.. pointless however yes it would be a possible thing to do maybe not directly from "console" but you could make it look like console if you even wanted using:
Code: Select all
Player.GlobalMessage("&eConsole[&aAlive&e]: &fbla bla bla");

and you would just set it up to say different things that you wanted it to say.. using "else if" or "case" to put in the different options if you understand what I'm saying.

Re: /consolemsg

PostPosted: 05 Aug 2013, 18:16
by Alshima
Clowny wrote:well exactly I think it's just kind of um.. pointless however yes it would be a possible thing to do maybe not directly from "console" but you could make it look like console if you even wanted using:
Code: Select all
Player.GlobalMessage("&eConsole[&aAlive&e]: &fbla bla bla");

and you would just set it up to say different things that you wanted it to say.. using "else if" or "case" to put in the different options if you understand what I'm saying.


Yeah I understand what your saying. Well I think Breakdown901 is saying that he wants to send a message to the host's computer. Well I didn't know how to explain it. So I went to the MCDawn source since it had a command that was related to this post. I was just wondering if someone can edit the coding so the code can work for MCDzienny. I don't take any credit for this code.

Here is the code

Code: Select all
using System;
using System.Windows.Forms;

namespace MCDawn
{
    public class CmdCallConsole : Command
    {
        public override string name { get { return "callconsole"; } }
        public override string[] aliases { get { return new string[] { }; } }
        public override string type { get { return "other"; } }
        public override bool museumUsable { get { return true; } }
        public override LevelPermission defaultRank { get { return LevelPermission.Guest; } }
        public CmdCallConsole() { }

        public override void Use(Player p, string message)
        {
            if (p == null) { Server.s.Log("Command not usable from Console."); return; }
            bool orig = true;
            if (!Server.consoleSound) { Server.consoleSound = true; orig = false; }
            if (message == "")
            {
                Server.s.Log(p.name + " is calling you.");
                try { MessageBox.Show(p.name + " is calling you.", "MCDawn Console", MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification); }
                catch { }
            }
            else
            {
                Server.s.Log(p.name + " is calling you: " + message);
                try { MessageBox.Show(p.name + " is calling you: " + message, "MCDawn Console", MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification); }
                catch { }
            }
            //if (MCDawn.Gui.Window.thisWindow.WindowState == FormWindowState.Minimized) { MCDawn.Gui.Window.thisWindow.WindowState = FormWindowState.Normal; }
            if (!orig) { Server.consoleSound = false; }
            Player.SendMessage(p, "Calling the Console...");
        }
        public override void Help(Player p)
        {
            Player.SendMessage(p, "/callconsole <message> - Calls the Console.");
        }
    }
}


Maybe you can get an idea from this?

Re: /consolemsg

PostPosted: 06 Aug 2013, 06:49
by Warren1001
That coding has events that are only in MCDawn, plus when did Dawn become open source? ._. Idk...
Anyhow, that command will not work.

Re: /consolemsg

PostPosted: 06 Aug 2013, 15:37
by HETAL
actually I tried to tweak it and theres only 1 problem I need to know how to trigger a sound on the console