private bool ProcessMessage(MessageEvent messageEvent, String text, Hooks hook, int whoAmI)
        {
            messageEvent.Message = text;
            messageEvent.Sender = Main.players[whoAmI];
            Program.server.getPluginManager().processHook(hook, messageEvent);

            return !messageEvent.Cancelled;
        }
Exemplo n.º 2
0
 public override void onPlayerChat(MessageEvent Event)
 {
     var player = ((Player) Event.Sender).whoAmi;
     var pname = ((Player) Event.Sender).Name;
     var message = Event.Message;
     Console.WriteLine("<" + Server + "> " + message); //Displays chat in the console.
     try
     {
         SendAllMessage(
           "<" + PermissionManager.FindPlayer(player).GetPrefix() + pname + "> " + message,
           PermissionManager.FindPlayer(player).GetColor()[0],
           PermissionManager.FindPlayer(player).GetColor()[1],
           PermissionManager.FindPlayer(player).GetColor()[2]);
     }
     catch (Exception)
     {
         SendAllMessage("<" + pname + "> " + message, 255f, 240f, 20f);
     }
     Event.Cancelled = true;
     return;
 }
 /// <summary>
 /// Hook method for player chat
 /// </summary>
 /// <param name="Event">MessageEvent info</param>
 public virtual void onPlayerChat(MessageEvent Event)
 {
 }
 public override void onPlayerChat(MessageEvent Event)
 {
     if (userperm == "silenced" && Event.Sender.Op == false)
     {
         Event.Sender.sendMessage("You are silenced and can not speak.", 255, 255f, 0f, 0f);
         Event.Cancelled = true;
     }
 }
Exemplo n.º 5
0
 public override void onPlayerChat(MessageEvent Event)
 {
     String msg = "<" + Event.Sender.Name + "> " + Event.Message;
     if (mircc.getIrcColors()) { msg = AIRCH.CODE_COLOR + "1" + msg; }
     mircc.sendToChan(msg);
     base.onPlayerChat(Event);
 }