1. I have a problem if to use in an event of OnPlayerChat return true or false, remaining messages don't come to the general chat
     
  2. a void cannot return true or false.

    try

    Code:
    bool OnPlayerChat(ConsoleSystem.Arg arg)
    {
    ///your stuff
    return false
    }
     
  3. When using return global chat stops working
     
  4. Code:
    object OnPlayerChat(ConsoleSystem.Arg arg)
    {
        return null;
    }
     
    Last edited by a moderator: Aug 21, 2015
  5. Code:
            void OnPlayerChat(ConsoleSystem.Arg arg)
            {
                BasePlayer player = (BasePlayer)arg.connection.player;
                string message = arg.GetString(0, "text");
                if (arg.connection.authLevel > 0)
                {
                    var myClan = FindClanByUser(player.userID.ToString());
                    if (myClan == null)
                    {
                        SendReply(player, "{0}", _("You are currently not a member of a clan."));
                        return;
                    }
                    if (string.IsNullOrEmpty(message))
                        return;
                    myClan.Broadcast(StripTag(player.displayName, myClan) + ": " + message);
                }
            }
    i wanna make, that what admin tells, only goes to clan chat, and what others tell, goes in normal chat, how can i do that?
    i though return should avoid sending message to chat, but this way message gets sent to clan chat and to normal chat too.
     
  6. Code:
    object OnPlayerChat(ConsoleSystem.Arg arg)
    {
     BasePlayer player = (BasePlayer)arg.connection.player;
     string message = arg.GetString(0, "text");
     if (arg.connection.authLevel > 0)
     {
     var myClan = FindClanByUser(player.userID.ToString());
     if (myClan == null)
     {
     SendReply(player, "{0}", _("You are currently not a member of a clan."));
     return false;
     }
     if (string.IsNullOrEmpty(message))
     return false;
     myClan.Broadcast(StripTag(player.displayName, myClan) + ": " + message);
     return false;
     }
     return null;
    }