OnChatMessage
From Multi Theft Auto: Wiki
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 output to chat using outputChatBox. It can be used to get the resource responsible for specific outputChatBox call via the second parameter.
Parameters
- theMessage: The text that was output to the chatbox
- theElement: 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
| Minimum supported server | 1.1.1-9.03316 |
|---|---|
| Minimum supported client | n/a |
See Also
Server events
- onChatMessage
Event functions
- addEvent
- addEventHandler
- cancelEvent
- getCancelReason
- removeEventHandler
- triggerClientEvent
- triggerEvent
- wasEventCancelled
FROM VERSION 1.3.1 ONWARDS