/consolemsg

/consolemsg

Postby Breakdown901 » 03 Aug 2013, 19:40

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#. :)
Owner of:
Breakdown901 Lava Survival/Zombie Survival/Freebuild
Host of NeonGaming Lava Survival.
Breakdown901
 
Posts: 320
Joined: 24 May 2013, 12:54

Re: /consolemsg

Postby Clowny » 04 Aug 2013, 06:59

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.
Founder Of MC Classic Hosting Community http://mcclassichosting.webs.com
Founder of MC Classic Software MCReborn http://mcreborn.tk
Professional Hoster and Basic C# Coder
Image
User avatar
Clowny
 
Posts: 112
Joined: 14 Jul 2013, 03:53

Re: /consolemsg

Postby Alshima » 05 Aug 2013, 18:16

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?
Alshima
 
Posts: 160
Joined: 11 Mar 2013, 02:22
Location: Alshima Island

Re: /consolemsg

Postby Warren1001 » 06 Aug 2013, 06:49

That coding has events that are only in MCDawn, plus when did Dawn become open source? ._. Idk...
Anyhow, that command will not work.
Warren1001
 
Posts: 197
Joined: 08 Aug 2012, 03:50

Re: /consolemsg

Postby HETAL » 06 Aug 2013, 15:37

actually I tried to tweak it and theres only 1 problem I need to know how to trigger a sound on the console
YOU HAVENT SEEN THE LAST OF ME ISMELLIKE
HETAL
 
Posts: 397
Joined: 24 May 2013, 12:10


Return to Requests for Addon

Who is online

Users browsing this forum: No registered users and 1 guest

cron