ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server events
  3. onChatMessage

Event

onChatMessage

ServerChat and consoleIdentical to MTA:SA

A message is going to chat (from a player or a script). You can hold it back.

Handler

addEventHandler("onChatMessage", root, function(theMessage, theElement) ... end)

Parameters

theMessagestring
The message.
theElementelement
The sender or a resource.

Source

source is the message source or root.

cancelEvent() holds the message back.

Example

addEventHandler("onChatMessage", root, function(message)
    outputServerLog("[czat] " .. message)
end)

See also