<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://g1r-mp.com/wiki/index.php?action=history&amp;feed=atom&amp;title=OnPlayerChat</id>
	<title>OnPlayerChat - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://g1r-mp.com/wiki/index.php?action=history&amp;feed=atom&amp;title=OnPlayerChat"/>
	<link rel="alternate" type="text/html" href="https://g1r-mp.com/wiki/index.php?title=OnPlayerChat&amp;action=history"/>
	<updated>2026-09-19T07:26:54Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://g1r-mp.com/wiki/index.php?title=OnPlayerChat&amp;diff=283&amp;oldid=prev</id>
		<title>QCherry: Update Lua event reference</title>
		<link rel="alternate" type="text/html" href="https://g1r-mp.com/wiki/index.php?title=OnPlayerChat&amp;diff=283&amp;oldid=prev"/>
		<updated>2026-08-14T22:31:32Z</updated>

		<summary type="html">&lt;p&gt;Update Lua event reference&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;!-- This page is generated from the verified Lua event definition: onPlayerChat. --&amp;gt;&lt;br /&gt;
= onPlayerChat =&lt;br /&gt;
Triggered when a player submits a normal chat message.&lt;br /&gt;
&lt;br /&gt;
== Availability ==&lt;br /&gt;
This event is available in &amp;#039;&amp;#039;&amp;#039;server-side&amp;#039;&amp;#039;&amp;#039; scripts.&lt;br /&gt;
&lt;br /&gt;
== Callback signature ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
onPlayerChat(playerId, message, channel)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Name !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;playerId&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || The player that sent the message.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;message&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; || The validated message text.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;channel&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; || The chat channel name; the bundled chat resource currently uses global.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
Handle the event:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; line&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerChat&amp;quot;, root, function(playerId, message, channel)&lt;br /&gt;
    outputDebugString(&amp;quot;[&amp;quot; .. channel .. &amp;quot;] &amp;quot; .. getPlayerName(playerId) .. &amp;quot;: &amp;quot; .. message)&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* Slash commands are dispatched through [[onPlayerCommand]] and are not broadcast as chat messages.&lt;br /&gt;
* When a script handles this event, the bundled chat resource does not perform its fallback broadcast.&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua Events]]&lt;br /&gt;
[[Category:Server Events]]&lt;br /&gt;
[[Category:Chat Events]]&lt;/div&gt;</summary>
		<author><name>QCherry</name></author>
	</entry>
</feed>