OnChatMessage: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 27: Line 27:
{{Requirements|1.1.1-9.03316|n/a|}}
{{Requirements|1.1.1-9.03316|n/a|}}


{{See also/Server event|Server events}}
==See Also==
===Server events===
{{Server_events}}
===Event functions===
{{Event functions}}

Revision as of 02:21, 27 September 2018

This event is triggered when a player uses say, teamsay, me successfully. Or when any message is output to chat using outputChatBox on the server side. It can be used to get the resource responsible for specific outputChatBox call via the second parameter.

Parameters

string theMessage, resource / element theElement
  • theMessage: a string representing the text that was output to the chatbox.
  • theElement: a player element if chatbox output was done via say, teamsay or me. Resource if it was done via outputChatBox.

Source

The source of this event is the root element.

Example

This example outputs all chat messages to debug view.

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

Requirements

This template will be deleted.

See Also

Server events


Event functions