<?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=Szampan</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=Szampan"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Szampan"/>
	<updated>2026-04-21T20:11:56Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnClientVehicleExit&amp;diff=77542</id>
		<title>OnClientVehicleExit</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnClientVehicleExit&amp;diff=77542"/>
		<updated>2023-08-31T14:24:58Z</updated>

		<summary type="html">&lt;p&gt;Szampan: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client event}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This event gets fired when a [[ped]] or [[player]] gets out of a vehicle.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
ped thePed, int seat&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''thePed:''' the [[player]] or [[ped]] element that exited the vehicle&lt;br /&gt;
*'''seat:''' the number of the seat that the player was sitting on. 0 = driver, higher numbers are passenger seats.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The source of the event is the vehicle that the ped exited.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This code updates a GUI label with the name of the vehicle the local player is in.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
lblVehicle = guiCreateLabel(10, 200, 150, 20, &amp;quot;Currently on foot&amp;quot;, false)&lt;br /&gt;
addEventHandler(&amp;quot;onClientVehicleEnter&amp;quot;, getRootElement(),&lt;br /&gt;
    function(thePlayer, seat)&lt;br /&gt;
        if thePlayer == localPlayer then&lt;br /&gt;
            guiSetText(lblVehicle, &amp;quot;Currently in a &amp;quot; .. getVehicleName(source))&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientVehicleExit&amp;quot;, getRootElement(),&lt;br /&gt;
    function(thePlayer, seat)&lt;br /&gt;
        if thePlayer == localPlayer then&lt;br /&gt;
            guiSetText(lblVehicle, &amp;quot;Currently on foot&amp;quot;)&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
===Client vehicle events===&lt;br /&gt;
{{Client_vehicle_events}}&lt;br /&gt;
===Client event functions===&lt;br /&gt;
{{Client_event_functions}}&lt;br /&gt;
[[es:onClientVehicleExit]]&lt;/div&gt;</summary>
		<author><name>Szampan</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnClientSoundBeat&amp;diff=77530</id>
		<title>OnClientSoundBeat</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnClientSoundBeat&amp;diff=77530"/>
		<updated>2023-08-28T14:13:19Z</updated>

		<summary type="html">&lt;p&gt;Szampan: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client event}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
{{New feature|3.0131|1.3.1|&lt;br /&gt;
This event is triggered when a '''sound''' beats.&lt;br /&gt;
}}&lt;br /&gt;
{{Note|This event does not work correctly pre 1.3.1-9-04627&lt;br /&gt;
}}&lt;br /&gt;
{{Note|This event is triggered ahead of a sound beat the number passed is the play time at which the beat occurs&lt;br /&gt;
}}&lt;br /&gt;
==Parameters== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
double theTime&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''theTime''': the position in the song of the beat&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[Element/Sound|sound's element]].&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This code will change the vehicle color to a random value if the sound beats and the localPlayer is inside a vehicle&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
 function playMySound()&lt;br /&gt;
    playSound(&amp;quot;sound.mp3&amp;quot;) -- play the sound used for onClientSoundBeat&lt;br /&gt;
    addEventHandler(&amp;quot;onClientSoundBeat&amp;quot;, getRootElement(), changeVehicleColorOnSoundBeat)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getRootElement(), playMySound)&lt;br /&gt;
&lt;br /&gt;
function changeVehicleColorOnSoundBeat()&lt;br /&gt;
    if getPedOccupiedVehicle(localPlayer) then -- if the player is inside a vehicle&lt;br /&gt;
    setVehicleColor( getPedOccupiedVehicle(localPlayer), math.random(0,255), math.random(0,255), math.random(0,255) ) -- apply the color to the vehicle&lt;br /&gt;
    outputChatBox(&amp;quot;The color of your vehicle was changed.&amp;quot;) &lt;br /&gt;
    else &lt;br /&gt;
    outputChatBox(&amp;quot;Could not change the vehicle color, the localPlayer is not inside a vehicle.&amp;quot;) &lt;br /&gt;
    return end;&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;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3.0-9.04162}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
===Client sound events===&lt;br /&gt;
{{Sound_events}}&lt;br /&gt;
===Client event functions===&lt;br /&gt;
{{Client_event_functions}}&lt;/div&gt;</summary>
		<author><name>Szampan</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnClientSoundBeat&amp;diff=77529</id>
		<title>OnClientSoundBeat</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnClientSoundBeat&amp;diff=77529"/>
		<updated>2023-08-28T14:12:58Z</updated>

		<summary type="html">&lt;p&gt;Szampan: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client event}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
{{New feature|3.0131|1.3.1|&lt;br /&gt;
This event is triggered when a '''sound''' beats.&lt;br /&gt;
}}&lt;br /&gt;
{{Note|This event does not work correctly pre 1.3.1-9-04627&lt;br /&gt;
}}&lt;br /&gt;
{{Note|This event is triggered ahead of a sound beat the number passed is the play time at which the beat occurs&lt;br /&gt;
}}&lt;br /&gt;
==Parameters== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
double theTime&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''theTime''': the position in the song of the beat&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[Element/Sound|sound's element]].&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This code will change the vehicle color to a random value if the sound beats and the localPlayer is inside a vehicle&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
 function playMySound()&lt;br /&gt;
    playSound(&amp;quot;sound.mp3&amp;quot;) -- play the sound used for onClientSoundBeat&lt;br /&gt;
    addEventHandler(&amp;quot;onClientSoundBeat&amp;quot;, getRootElement(), changeVehicleColorOnSoundBeat)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getRootElement(), playMySound)&lt;br /&gt;
&lt;br /&gt;
function changeVehicleColorOnSoundBeat()&lt;br /&gt;
    if getPedOccupiedVehicle(localPlayer) then -- if the player is inside a vehicle&lt;br /&gt;
    setVehicleColor( getPedOccupiedVehicle(localPlayer), math.random(0,255), math.random(0,255), math.random(0,255)) -- apply the color to the vehicle&lt;br /&gt;
    outputChatBox(&amp;quot;The color of your vehicle was changed.&amp;quot;) &lt;br /&gt;
    else &lt;br /&gt;
    outputChatBox(&amp;quot;Could not change the vehicle color, the localPlayer is not inside a vehicle.&amp;quot;) &lt;br /&gt;
    return end;&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;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3.0-9.04162}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
===Client sound events===&lt;br /&gt;
{{Sound_events}}&lt;br /&gt;
===Client event functions===&lt;br /&gt;
{{Client_event_functions}}&lt;/div&gt;</summary>
		<author><name>Szampan</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnClientSoundBeat&amp;diff=77528</id>
		<title>OnClientSoundBeat</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnClientSoundBeat&amp;diff=77528"/>
		<updated>2023-08-27T17:49:32Z</updated>

		<summary type="html">&lt;p&gt;Szampan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client event}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
{{New feature|3.0131|1.3.1|&lt;br /&gt;
This event is triggered when a '''sound''' beats.&lt;br /&gt;
}}&lt;br /&gt;
{{Note|This event does not work correctly pre 1.3.1-9-04627&lt;br /&gt;
}}&lt;br /&gt;
{{Note|This event is triggered ahead of a sound beat the number passed is the play time at which the beat occurs&lt;br /&gt;
}}&lt;br /&gt;
==Parameters== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
double theTime&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''theTime''': the position in the song of the beat&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[Element/Sound|sound's element]].&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This code will change the vehicle color to a random value if the sound beats and the localPlayer is inside a vehicle&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
 function playMySound()&lt;br /&gt;
    playSound(&amp;quot;sound.mp3&amp;quot;) -- play the sound used for onClientSoundBeat&lt;br /&gt;
    addEventHandler(&amp;quot;onClientSoundBeat&amp;quot;, getRootElement(), changeVehicleColorOnSoundBeat)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getRootElement(), playMySound)&lt;br /&gt;
&lt;br /&gt;
function changeVehicleColorOnSoundBeat()&lt;br /&gt;
    if getPedOccupiedVehicle(localPlayer) then -- if the player is inside a vehicle&lt;br /&gt;
    local randomcolor = math.random(0,255) -- generate a random color value&lt;br /&gt;
    setVehicleColor( getPedOccupiedVehicle(localPlayer), randomcolor, randomcolor, randomcolor ) -- apply the color to the vehicle&lt;br /&gt;
    outputChatBox(&amp;quot;The color of your vehicle was changed.&amp;quot;) &lt;br /&gt;
    else &lt;br /&gt;
    outputChatBox(&amp;quot;Could not change the vehicle color, the localPlayer is not inside a vehicle.&amp;quot;) &lt;br /&gt;
    return end;&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;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3.0-9.04162}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
===Client sound events===&lt;br /&gt;
{{Sound_events}}&lt;br /&gt;
===Client event functions===&lt;br /&gt;
{{Client_event_functions}}&lt;/div&gt;</summary>
		<author><name>Szampan</name></author>
	</entry>
</feed>