Solved Logging of chat

Discussion in 'Plugin Requests' started by kpoIIIkaeHo7, Oct 26, 2014.

  1. So.. Possible to hook users chat say? Log this crap into file is possible:)[DOUBLEPOST=1414367617][/DOUBLEPOST]Solved
    Try to create my first resource on this community :)
     
    Last edited by a moderator: Oct 26, 2014
  2. Wulf

    Wulf Community Admin

    You can use OnRunCommand and pick out the chat from the chat.say command.
     
  3. I can exclude chat commands started with "/" and "!" ? I'm tried and not successfull.
     
  4. Wulf

    Wulf Community Admin

    You would just need to check for arg.cmd.namefull and chat.say with arg:GetString(0, "text").

    I will be adding chat logging as an option to my Logger plugin soon by the way.
     
    Last edited: Oct 27, 2014
  5. I'm tried with this one
    local cmd = arg.cmd.namefull
    local argument = arg:GetString(0, "text")

    if cmd and cmd == "chat.say" then
    if (argument.Length == 0) then return end

    print("[CHAT] " .. player.displayName .. ": " .. argument)
    end But this log empty messages (open chat to read last messages for example) too. Like this
    argument[0] == '/' don't work too to skip chat commands to log:(
     
  6. Wulf

    Wulf Community Admin