OnChatMessage

From Multi Theft Auto: Wiki
Revision as of 10:45, 30 September 2011 by Arran Fortuna (talk | contribs) (Created page with "{{Server event}} __NOTOC__ {{New feature|3.0120|1.2| '''Available only in MTA SA 1.2 and onwards''' }} This event is triggered when a player uses say, teamsay, me successfully. ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Available only in MTA SA 1.2 and onwards This event is triggered when a player uses say, teamsay, me successfully. Or when any message is sent to a player using outputChatBox.

Parameters

string theMessage, element thePlayer
  • theMessage: The text that was output to the chatbox
  • thePlayer: The player who triggered the event (Needs checking by developer - thePlayer for me was not any element)

Source

The source of this event is the root element.

Example

This example outputs all chat messages to debug view.

[lua]
function onChatMessageHandler(theMessage, thePlayer)
	outputDebugString(theMessage)
end
addEventHandler("onChatMessage", root, onChatMessageHandler)

See Also