<?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=OnPlayerVoiceStateChange</id>
	<title>OnPlayerVoiceStateChange - 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=OnPlayerVoiceStateChange"/>
	<link rel="alternate" type="text/html" href="https://g1r-mp.com/wiki/index.php?title=OnPlayerVoiceStateChange&amp;action=history"/>
	<updated>2026-09-19T07:26:56Z</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=OnPlayerVoiceStateChange&amp;diff=653&amp;oldid=prev</id>
		<title>QCherry: Document Protocol 23 voice and player presentation APIs</title>
		<link rel="alternate" type="text/html" href="https://g1r-mp.com/wiki/index.php?title=OnPlayerVoiceStateChange&amp;diff=653&amp;oldid=prev"/>
		<updated>2026-08-24T06:15:14Z</updated>

		<summary type="html">&lt;p&gt;Document Protocol 23 voice and player presentation APIs&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: onPlayerVoiceStateChange. --&amp;gt;&lt;br /&gt;
= onPlayerVoiceStateChange =&lt;br /&gt;
Triggered after a player&amp;#039;s authoritative voice-routing or capture policy changes.&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;
onPlayerVoiceStateChange(playerId, mode, rangePreset, flags, channelId, range, volume)&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 affected connected player ID.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mode&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || Voice mode: 0 disabled, 1 proximity, 2 channel, or 3 global.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;rangePreset&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || Range preset: 0 whisper, 1 normal, 2 shout, or 3 custom.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;flags&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || Bitmask: enabled 1, speaking 2, server-muted 4, and push-to-talk 8.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;channelId&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || The authoritative voice channel identifier.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || The effective proximity range in metres.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;volume&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || The authoritative volume multiplier from 0.0 through 2.0.&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;onPlayerVoiceStateChange&amp;quot;, root, function(playerId, mode, rangePreset, flags, channelId, range, volume)&lt;br /&gt;
    outputDebugString(&amp;quot;Voice state updated for player &amp;quot; .. playerId .. &amp;quot;, mode &amp;quot; .. mode)&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* The state is reliable and replayed during late join.&lt;br /&gt;
* Use the voice getter functions when string mode or preset names are more convenient than numeric protocol values.&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua Events]]&lt;br /&gt;
[[Category:Server Events]]&lt;br /&gt;
[[Category:Voice Events]]&lt;/div&gt;</summary>
		<author><name>QCherry</name></author>
	</entry>
</feed>