Jump to content
View in the app

A better way to browse. Learn more.

ClassiCube Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Global Chat Messages

How do I implement global chat messages into a custom command?

I use MCGalaxy

Edited by kilgorezer

Featured Replies

  • Author

I am confused, It keeps giving me a error in my code.

Can someone help me?

(It is supposed to send a message between two IRCs)

//    Auto-generated command skeleton class
//    Use this as a basis for custom MCGalaxy commands
//    Naming should be kept consistent (e.g. /update command should have a class name of 'CmdUpdate' and a filename of 'CmdUpdate.cs')
// As a note, MCGalaxy is designed for .NET 4.0

// To reference other assemblies, put a "//reference [assembly filename]" at the top of the file
//   e.g. to reference the System.Data assembly, put "//reference System.Data.dll"

// Add any other using statements you need after this
using System;
using MCGalaxy;

public class CmdSendtomegs : Command
{
    // The command's name (what you put after a slash to use this command)
    public override string name { get { return "Sendtomegs"; } }

    // Command's shortcut, can be left blank (e.g. "/Copy" has a shortcut of "c")
    public override string shortcut { get { return ""; } }

    // Which submenu this command displays in under /Help
    public override string type { get { return "other"; } }

    // Whether or not this command can be used in a museum. Block/map altering commands should return false to avoid errors.
    public override bool museumUsable { get { return true; } }

    // The default rank required to use this command. Valid values are:
    //   LevelPermission.Guest, LevelPermission.Builder, LevelPermission.AdvBuilder,
    //   LevelPermission.Operator, LevelPermission.Admin, LevelPermission.Owner
    public override LevelPermission defaultRank { get { return LevelPermission.Admin; } }

    // This is for when a player executes this command by doing /Sendtomegs
    //   p is the player object for the player executing the command. 
    //   message is the arguments given to the command. (e.g. for '/Sendtomegs this', message is "this")
    public override void Use(Player p, string message)
    {
        Chat.GlobalMessage(".x " + message);
    }

    // This is for when a player does /Help Sendtomegs
    public override void Help(Player p)
    {
        p.Message("/Sendtomegs - Sends a command to megs server");
    }
}

Edited by kilgorezer
found a possible error

4 minutes ago, kilgorezer said:

I am confused, It keeps giving me a error in my code.

Can someone help me?

(It is supposed to send a message between two IRCs)

//    Auto-generated command skeleton class
//    Use this as a basis for custom MCGalaxy commands
//    Naming should be kept consistent (e.g. /update command should have a class name of 'CmdUpdate' and a filename of 'CmdUpdate.cs')
// As a note, MCGalaxy is designed for .NET 4.0

// To reference other assemblies, put a "//reference [assembly filename]" at the top of the file
//   e.g. to reference the System.Data assembly, put "//reference System.Data.dll"

// Add any other using statements you need after this
using System;
using MCGalaxy;

public class CmdSendtomegs : Command
{
    // The command's name (what you put after a slash to use this command)
    public override string name { get { return "Sendtomegs"; } }

    // Command's shortcut, can be left blank (e.g. "/Copy" has a shortcut of "c")
    public override string shortcut { get { return ""; } }

    // Which submenu this command displays in under /Help
    public override string type { get { return "other"; } }

    // Whether or not this command can be used in a museum. Block/map altering commands should return false to avoid errors.
    public override bool museumUsable { get { return true; } }

    // The default rank required to use this command. Valid values are:
    //   LevelPermission.Guest, LevelPermission.Builder, LevelPermission.AdvBuilder,
    //   LevelPermission.Operator, LevelPermission.Admin, LevelPermission.Owner
    public override LevelPermission defaultRank { get { return LevelPermission.Admin; } }

    // This is for when a player executes this command by doing /Sendtomegs
    //   p is the player object for the player executing the command. 
    //   message is the arguments given to the command. (e.g. for '/Sendtomegs this', message is "this")
    public override void Use(Player p, string message)
    {
        Chat.GlobalMessage(".x " + message);
    }

    // This is for when a player does /Help Sendtomegs
    public override void Help(Player p)
    {
        p.Message("/Sendtomegs - Sends a command to megs server");
    }
}

"Args" is a string not string array

  • Author
14 minutes ago, Rulja1234 said:

Chat.GlobalMessage(message);

 

2 minutes ago, Rulja1234 said:

"Args" is a string not string array

The error is

(20:34:13) Error #CS0117 on line 37 - `MCGalaxy.Chat' does not contain a definition for `GlobalMessage'
(20:34:13) Compiling failed. See logs/errors/compiler.log for more detail

Archived

This topic is now archived and is closed to further replies.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.