<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Cuervofi</id>
	<title>Multi Theft Auto: Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Cuervofi"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Cuervofi"/>
	<updated>2026-05-19T09:03:27Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnClientPlayerVoiceStart&amp;diff=82731</id>
		<title>OnClientPlayerVoiceStart</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnClientPlayerVoiceStart&amp;diff=82731"/>
		<updated>2026-02-17T04:25:35Z</updated>

		<summary type="html">&lt;p&gt;Cuervofi: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client event}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px dotted blue; background: #00CC66;padding:4px;margin-bottom:2px;&amp;quot;&amp;gt;'''Note''':  This event should only be used as a low-level function for advanced users.  For typical Voice scripting, please see the [[Resource:Voice|Voice Resource]]&amp;lt;/div&amp;gt;&lt;br /&gt;
This event is triggered when a player starts talking through voice chat.&lt;br /&gt;
&lt;br /&gt;
__NOTOC__ {{Note|This event triggers inconsistently (https://github.com/multitheftauto/mtasa-blue/issues/1700). You should use onPlayerVoiceStart and trigger a custom client-sided event to get similar results, minus the cancelEvent effect.}}&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
No parameters.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the player [[element]] that just started talking through voice chat.&lt;br /&gt;
&lt;br /&gt;
==Cancel effect==&lt;br /&gt;
* If the [[event system#Event source|source]] is the local player, the local player will not broadcast his voice chat to the server&lt;br /&gt;
* If the [[event system#Event source|source]] is a remote player, the player who started talking will not be heard.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example outputs to the console the player that started talking.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 1&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onClientPlayerVoiceStart&amp;quot;,root,function()&lt;br /&gt;
	outputConsole(getPlayerName(source)..&amp;quot; has started talking.&amp;quot;)&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example prevents the function from running multiple times due to inconsistent event execution.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 2&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot; &amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local toggleFix = 0&lt;br /&gt;
addEventHandler('onClientPlayerVoiceStart', localPlayer,&lt;br /&gt;
	function()&lt;br /&gt;
		if toggleFix == 0 then&lt;br /&gt;
			outputConsole(&amp;quot;You've started talking&amp;quot;)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
addEventHandler('onClientPlayerVoiceStop', localPlayer,&lt;br /&gt;
	function()&lt;br /&gt;
		if not getKeyState(&amp;quot;z&amp;quot;) then&lt;br /&gt;
			toggleFix = 0&lt;br /&gt;
			outputConsole(&amp;quot;You've stopped talking&amp;quot;)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_player_events}}&lt;/div&gt;</summary>
		<author><name>Cuervofi</name></author>
	</entry>
</feed>