OnChatMessage: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
m (updated needs checkin)
Line 1: Line 1:
{{Server event}}
{{Server event}}
{{Needs_Checking|thePlayer for Arran was not defined}}
__NOTOC__  
__NOTOC__  
{{New feature|3.0120|1.2|
{{New feature|3.0120|1.2|
Line 11: Line 12:
</syntaxhighlight>
</syntaxhighlight>
*'''theMessage:''' The text that was output to the chatbox
*'''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)
*'''thePlayer:''' The player who triggered the event (needs checking)


==Source==
==Source==

Revision as of 18:25, 1 October 2011

Dialog-information.png This article needs checking.

Reason(s): thePlayer for Arran was not defined

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)

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

Server events


Event functions