ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Client events
  3. onClientChatMessage

Event

onClientChatMessage

A message is appearing in the player's chat. You can hide it.

Handler

addEventHandler("onClientChatMessage", root, function(text, r, g, b) ... end)

Parameters

textstring
The text.
rint
Red colour.
gint
Green colour.
bint
Blue colour.

Differences from MTA:SA

  • These MTA:SA parameters are not here: int messageType

In MTA:SA

function(string text, int r, int g, int b, int messageType)

Source

source is root.

cancelEvent() hides the message. The event also comes for outputChatBox from a client script.

Example

addEventHandler("onClientChatMessage", root, function(text)
    if text:find("reklama", 1, true) then cancelEvent() end
end)

See also