<?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=FuSioN</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=FuSioN"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/FuSioN"/>
	<updated>2026-04-21T12:07:09Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SecondsToTimeDesc&amp;diff=44759</id>
		<title>SecondsToTimeDesc</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SecondsToTimeDesc&amp;diff=44759"/>
		<updated>2015-02-27T18:14:34Z</updated>

		<summary type="html">&lt;p&gt;FuSioN: /* Code */ (Fixed the function)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function converts plain seconds-integer into a user-friendly time description.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;string secondsToTimeDesc ( int seconds )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''seconds''': The integer of seconds to convert into a user-friendly description.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a user-friendly-description, or an empty string if the seconds were invalid/negative.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function secondsToTimeDesc( seconds )&lt;br /&gt;
	if seconds then&lt;br /&gt;
		local results = {}&lt;br /&gt;
		local sec = ( seconds %60 )&lt;br /&gt;
		local min = math.floor ( ( seconds % 3600 ) /60 )&lt;br /&gt;
		local hou = math.floor ( ( seconds % 86400 ) /3600 )&lt;br /&gt;
		local day = math.floor ( seconds /86400 )&lt;br /&gt;
		&lt;br /&gt;
		if day &amp;gt; 0 then table.insert( results, day .. ( day == 1 and &amp;quot; day&amp;quot; or &amp;quot; days&amp;quot; ) ) end&lt;br /&gt;
		if hou &amp;gt; 0 then table.insert( results, hou .. ( hou == 1 and &amp;quot; hour&amp;quot; or &amp;quot; hours&amp;quot; ) ) end&lt;br /&gt;
		if min &amp;gt; 0 then table.insert( results, min .. ( min == 1 and &amp;quot; minute&amp;quot; or &amp;quot; minutes&amp;quot; ) ) end&lt;br /&gt;
		if sec &amp;gt; 0 then table.insert( results, sec .. ( sec == 1 and &amp;quot; second&amp;quot; or &amp;quot; seconds&amp;quot; ) ) end&lt;br /&gt;
		&lt;br /&gt;
		return string.reverse ( table.concat ( results, &amp;quot;, &amp;quot; ):reverse():gsub(&amp;quot; ,&amp;quot;, &amp;quot; dna &amp;quot;, 1 ) )&lt;br /&gt;
	end&lt;br /&gt;
	return &amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
'''Original Author: MrTasty | Remade by FusioN_'''&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server-Side Script&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
in this example we will add the command '''/stt seconds''' that will show in the chat a user-friendly time description for the command parameter ''seconds''.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function stt ( thePlayer, command, seconds ) -- create the function&lt;br /&gt;
	if ( seconds and tonumber(seconds) ) then -- if the player entered a number (which will be the seconds)&lt;br /&gt;
		outputChatBox ( secondsToTimeDesc ( tonumber ( seconds ) ), thePlayer, 0, 255, 0 )&lt;br /&gt;
	else -- otherwise, alert him&lt;br /&gt;
		outputChatBox ( &amp;quot;Use: /stt [seconds] !&amp;quot;, thePlayer, 255, 0, 0 )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;stt&amp;quot;, stt, false, false )&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;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>FuSioN</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnClientSoundBeat&amp;diff=44677</id>
		<title>OnClientSoundBeat</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnClientSoundBeat&amp;diff=44677"/>
		<updated>2015-02-16T13:24:07Z</updated>

		<summary type="html">&lt;p&gt;FuSioN: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client event}}&lt;br /&gt;
{{Needs Example}}&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;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Not done yet&lt;br /&gt;
&amp;lt;/syntaxhighlight&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>FuSioN</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetPlayerMapBoundingBox&amp;diff=44676</id>
		<title>GetPlayerMapBoundingBox</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPlayerMapBoundingBox&amp;diff=44676"/>
		<updated>2015-02-16T01:41:21Z</updated>

		<summary type="html">&lt;p&gt;FuSioN: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{Needs Example}}&lt;br /&gt;
This function gets the GUI bounding box of the radar map texture.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int,int,int,int getPlayerMapBoundingBox ()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
* If the player's map is showing, it returns four integers: ''minX'', ''minY'', ''maxX'', ''maxY''.  These are '''absolute''' position coordinates of where the player's map is drawn on the screen&lt;br /&gt;
** ''minX,minY'' represent the world coordinate ''-3000,-3000'' &lt;br /&gt;
** ''maxX,maxY'' represent the world coordinate ''3000,3000''.  &lt;br /&gt;
** Negative values may be returned if these coordinates are off screen.&lt;br /&gt;
* If the map was not showing, a ''false'' boolean value is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--Needs an example&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client player functions}}&lt;/div&gt;</summary>
		<author><name>FuSioN</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleComponentVisible&amp;diff=44627</id>
		<title>SetVehicleComponentVisible</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleComponentVisible&amp;diff=44627"/>
		<updated>2015-02-13T22:33:32Z</updated>

		<summary type="html">&lt;p&gt;FuSioN: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
&lt;br /&gt;
{{New feature/item|3.0131|1.3.1|4715|&lt;br /&gt;
This function sets component visibility for [[vehicle]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setVehicleComponentVisible ( vehicle theVehicle, string theComponent, bool visible )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theVehicle:''' The [[vehicle]] you wish to set component visibility of.&lt;br /&gt;
*'''theComponent:''' A vehicle component (this is the frame name from the model file of the component you wish to modify)&lt;br /&gt;
*'''visible:''' a ''bool'' which determines if the component should be visible&lt;br /&gt;
&lt;br /&gt;
===Returns=== &lt;br /&gt;
Returns a ''bool'' indicating the visible state of the component.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
'''Example 1:''' This example hide all components when you enter a vehicle.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onClientVehicleEnter&amp;quot;, getRootElement(),&lt;br /&gt;
    function()&lt;br /&gt;
        local getComponent = getVehicleComponents(source) -- get a table with all the components of the vehicle&lt;br /&gt;
        for k in pairs (getComponent) do&lt;br /&gt;
            setVehicleComponentVisible(source, k, false) -- hides the component&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_functions}}&lt;/div&gt;</summary>
		<author><name>FuSioN</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleComponentVisible&amp;diff=44626</id>
		<title>SetVehicleComponentVisible</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleComponentVisible&amp;diff=44626"/>
		<updated>2015-02-13T22:33:09Z</updated>

		<summary type="html">&lt;p&gt;FuSioN: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
&lt;br /&gt;
{{New feature/item|3.0131|1.3.1|4715|&lt;br /&gt;
This function sets component visibility for [[vehicle]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setVehicleComponentVisible ( vehicle theVehicle, string theComponent, bool visible )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theVehicle:''' The [[vehicle]] you wish to set component visibility of.&lt;br /&gt;
*'''theComponent:''' A vehicle component (this is the frame name from the model file of the component you wish to modify)&lt;br /&gt;
*'''visible:''' a ''bool'' which determines if the component should be visible&lt;br /&gt;
&lt;br /&gt;
===Returns=== &lt;br /&gt;
Returns a ''bool'' indicating the visible state of the component.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
'''Example 1:''' This example hide all components when you enter a vehicle.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onClientVehicleEnter&amp;quot;, getRootElement(),&lt;br /&gt;
    function()&lt;br /&gt;
        local getComponent = getVehicleComponents(source) -- returns table with all the components of the vehicle&lt;br /&gt;
        for k in pairs (getComponent) do&lt;br /&gt;
            setVehicleComponentVisible(source, k, false) -- hides the component&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_functions}}&lt;/div&gt;</summary>
		<author><name>FuSioN</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetScreenFromWorldPosition&amp;diff=44625</id>
		<title>GetScreenFromWorldPosition</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetScreenFromWorldPosition&amp;diff=44625"/>
		<updated>2015-02-13T22:28:35Z</updated>

		<summary type="html">&lt;p&gt;FuSioN: Added example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function gets the screen position of a point in the world. This is useful for attaching 2D gui elements to parts of the world (e.g. players) or detecting if a point is on the screen (though it does not check if it is actually visible, you should use [[processLineOfSight]] for that).&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
float float getScreenFromWorldPosition ( float x, float y, float z, [ float edgeTolerance=0, bool relative=true ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''x:''' A float value indicating the x position in the world.&lt;br /&gt;
*'''y:''' A float value indicating the y position in the world.&lt;br /&gt;
*'''z:''' A float value indicating the z position in the world.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
{{New feature/item|3|1.0||&lt;br /&gt;
*'''edgeTolerance:''' A [[float]] value indicating the distance the position can be off screen before the function returns false.&lt;br /&gt;
*'''relative:''' A [[boolean]] value that indicates if edgeTolerance is in pixels [false], or relative to the screen size [true].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns two ''x'', ''y'' [[float]]s indicating the screen position and [[float]] distance between screen and given position if successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;section class=&amp;quot;client&amp;quot; name=&amp;quot;Client-side Script&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example add a '3d' text at coordinates 0, 0, 0 (center of map).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler ( &amp;quot;onClientRender&amp;quot;, root,&lt;br /&gt;
function ( )&lt;br /&gt;
	if ( getDistanceBetweenPoints3D ( 0, 0, 3, getElementPosition ( localPlayer ) ) ) &amp;lt; 50 then&lt;br /&gt;
		local coords = { getScreenFromWorldPosition ( 0, 0, 3 ) }&lt;br /&gt;
		if coords[1] and coords[2] then&lt;br /&gt;
			dxDrawText ( &amp;quot;Hello !&amp;quot;, coords[1], coords[2], coords[1], coords[2], tocolor(255,255,255), 1, &amp;quot;default-bold&amp;quot; )&lt;br /&gt;
		end&lt;br /&gt;
	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;
==See Also==&lt;br /&gt;
{{Client_world_functions}}&lt;/div&gt;</summary>
		<author><name>FuSioN</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SecondsToTimeDesc&amp;diff=44624</id>
		<title>SecondsToTimeDesc</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SecondsToTimeDesc&amp;diff=44624"/>
		<updated>2015-02-13T22:12:57Z</updated>

		<summary type="html">&lt;p&gt;FuSioN: Function remade and example added&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function converts plain seconds-integer into a user-friendly time description.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;string secondsToTimeDesc ( int seconds )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''seconds''': The integer of seconds to convert into a user-friendly description.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a user-friendly-description, or an empty string if the seconds were invalid/negative.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client- and/or serverside Script&amp;quot; class=&amp;quot;both&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;
function secondsToTimeDesc ( seconds )&lt;br /&gt;
	if seconds then&lt;br /&gt;
		local results = {}&lt;br /&gt;
		local hours = ( math.floor( seconds / 3600 ) == 24 and 0 or math.floor( seconds / 3600 ) )&lt;br /&gt;
		local days  = math.floor ( ( seconds /86400) - hours )&lt;br /&gt;
		local mins  = math.floor( ( seconds - ( ( math.floor( seconds / 3600 ) )*3600 ) ) / 60)&lt;br /&gt;
		local secs  = math.floor( seconds % 60 )&lt;br /&gt;
		&lt;br /&gt;
		local daysF  = days &amp;gt; 0 and table.insert ( results, days .. ( days == 1 and &amp;quot; day&amp;quot; or &amp;quot; days&amp;quot; ) )&lt;br /&gt;
		local hoursF = hours &amp;gt; 0 and table.insert ( results, hours .. ( hours == 1 and &amp;quot; hour&amp;quot; or &amp;quot; hours&amp;quot; ) )&lt;br /&gt;
		local minsF  = mins &amp;gt; 0 and table.insert ( results, mins .. ( mins == 1 and &amp;quot; minute&amp;quot; or &amp;quot; minutes&amp;quot; ) )&lt;br /&gt;
		local secsF  = secs &amp;gt; 0 and table.insert ( results, secs .. ( secs == 1 and &amp;quot; second&amp;quot; or &amp;quot; seconds&amp;quot; ) )&lt;br /&gt;
		return table.concat ( results, &amp;quot;, &amp;quot; ):reverse():gsub((&amp;quot;, &amp;quot;):reverse(), (&amp;quot; and &amp;quot;):reverse(), 1):reverse()&lt;br /&gt;
	end&lt;br /&gt;
	return &amp;quot;&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;
'''Original Author: MrTasty | Remade by FusioN_'''&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server-Side Script&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
in this example we will add the command '''/stt seconds''' that will show in the chat a user-friendly time description for the command parameter ''seconds''.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function stt ( thePlayer, command, seconds ) -- create the function&lt;br /&gt;
	if ( seconds and tonumber(seconds) ) then -- if the player entered a number (which will be the seconds)&lt;br /&gt;
		outputChatBox ( secondsToTimeDesc ( tonumber ( seconds ) ), thePlayer, 0, 255, 0 )&lt;br /&gt;
	else -- otherwise, alert him&lt;br /&gt;
		outputChatBox ( &amp;quot;Use: /stt [seconds] !&amp;quot;, thePlayer, 255, 0, 0 )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;stt&amp;quot;, stt, false, false )&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;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>FuSioN</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetVehicleComponents&amp;diff=44178</id>
		<title>GetVehicleComponents</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetVehicleComponents&amp;diff=44178"/>
		<updated>2015-01-31T13:29:05Z</updated>

		<summary type="html">&lt;p&gt;FuSioN: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New feature/item|3.0131|1.3.1|4748|&lt;br /&gt;
This function gets a table of the components currently on a [[vehicle]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table getVehicleComponents ( vehicle theVehicle )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theVehicle:''' The [[vehicle]] you wish to get the components of.&lt;br /&gt;
&lt;br /&gt;
===Returns=== &lt;br /&gt;
Returns a ''table'' containing the name of the component as the key and visibility flag of that component as the value&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;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler ( &amp;quot;gvc&amp;quot;,&lt;br /&gt;
    function ( )&lt;br /&gt;
        local theVehicle = getPedOccupiedVehicle ( localPlayer )&lt;br /&gt;
        if ( theVehicle ) then&lt;br /&gt;
            for k in pairs ( getVehicleComponents ( theVehicle ) ) do&lt;br /&gt;
                outputChatBox ( k )&lt;br /&gt;
            end&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;
&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 example draw all components names on the player screen.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler ( &amp;quot;onClientRender&amp;quot;, root,&lt;br /&gt;
function()&lt;br /&gt;
	if isPedInVehicle ( localPlayer ) and getPedOccupiedVehicle ( localPlayer ) then&lt;br /&gt;
		local veh = getPedOccupiedVehicle ( localPlayer )&lt;br /&gt;
		for v in pairs ( getVehicleComponents(veh) ) do&lt;br /&gt;
			local x,y,z = getVehicleComponentPosition ( veh, v, &amp;quot;world&amp;quot; )&lt;br /&gt;
			local wx,wy,wz = getScreenFromWorldPosition ( x, y, z )&lt;br /&gt;
			if wx and wy then&lt;br /&gt;
				dxDrawText ( v, wx -1, wy -1, 0 -1, 0 -1, tocolor(0,0,0), 1, &amp;quot;default-bold&amp;quot; )&lt;br /&gt;
				dxDrawText ( v, wx +1, wy -1, 0 +1, 0 -1, tocolor(0,0,0), 1, &amp;quot;default-bold&amp;quot; )&lt;br /&gt;
				dxDrawText ( v, wx -1, wy +1, 0 -1, 0 +1, tocolor(0,0,0), 1, &amp;quot;default-bold&amp;quot; )&lt;br /&gt;
				dxDrawText ( v, wx +1, wy +1, 0 +1, 0 +1, tocolor(0,0,0), 1, &amp;quot;default-bold&amp;quot; )&lt;br /&gt;
				dxDrawText ( v, wx, wy, 0, 0, tocolor(0,255,255), 1, &amp;quot;default-bold&amp;quot; )&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
by '''FusioN'''.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_vehicle_functions}}&lt;/div&gt;</summary>
		<author><name>FuSioN</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsSoundFinished&amp;diff=43979</id>
		<title>IsSoundFinished</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsSoundFinished&amp;diff=43979"/>
		<updated>2015-01-14T17:37:23Z</updated>

		<summary type="html">&lt;p&gt;FuSioN: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function check if sound finish.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isSoundFinished ( element theSound )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theSound''': The sound element which finish state you want to return.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the [[sound]] element is finished, ''false'' if unfinished or invalid arguments were passed.&lt;br /&gt;
&lt;br /&gt;
==Code==&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;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function isSoundFinished(theSound)&lt;br /&gt;
    return ( getSoundPosition(theSound) == getSoundLength(theSound) )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
'''Function created by WASSIm.'''&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example will check and see if the sound is finished or not, and tell the player.&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;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler(&amp;quot;checkfinish&amp;quot;,&lt;br /&gt;
function ()&lt;br /&gt;
    local sound = playSound(&amp;quot;music/song.mp3&amp;quot;)&lt;br /&gt;
    if (isSoundFinished(sound)) then&lt;br /&gt;
        outputChatBox(&amp;quot;The sound is finished!&amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox(&amp;quot;The sound is not finished!&amp;quot;)&lt;br /&gt;
    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;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>FuSioN</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsSoundFinished&amp;diff=43978</id>
		<title>IsSoundFinished</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsSoundFinished&amp;diff=43978"/>
		<updated>2015-01-14T17:37:09Z</updated>

		<summary type="html">&lt;p&gt;FuSioN: /* Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function check if sound finish.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isSoundFinished ( element theSound )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theSound''': The sound element which finish state you want to return.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the [[sound]] element is finished, ''false'' if unfinished or invalid arguments were passed.&lt;br /&gt;
&lt;br /&gt;
==Code==&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;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function isSoundFinished(theSound)&lt;br /&gt;
    return ( getSoundPosition(theSound) == getSoundLength(theSound) )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
'''Function created by WASSIm.'''&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example will check and see if the sound is finished or not, and tell the player.&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;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler(&amp;quot;checkfinish&amp;quot;,&lt;br /&gt;
function ()&lt;br /&gt;
    local sound = playSound(&amp;quot;music/song.mp3&amp;quot;)&lt;br /&gt;
    if (isSoundFinished(sound)) then&lt;br /&gt;
        outputChatBox(&amp;quot;The sound is finished!&amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox(&amp;quot;The sound is not finished!&amp;quot;)&lt;br /&gt;
    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;
'''Author:''' WASSIm.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>FuSioN</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleComponentVisible&amp;diff=43977</id>
		<title>SetVehicleComponentVisible</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleComponentVisible&amp;diff=43977"/>
		<updated>2015-01-14T17:36:40Z</updated>

		<summary type="html">&lt;p&gt;FuSioN: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
&lt;br /&gt;
{{New feature/item|3.0131|1.3.1|4715|&lt;br /&gt;
This function sets component visibility for [[vehicle]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setVehicleComponentVisible ( vehicle theVehicle, string theComponent, bool visible )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theVehicle:''' The [[vehicle]] you wish to set component visibility of.&lt;br /&gt;
*'''theComponent:''' A vehicle component (this is the frame name from the model file of the component you wish to modify)&lt;br /&gt;
*'''visible:''' a ''bool'' which determines if the component should be visible&lt;br /&gt;
&lt;br /&gt;
===Returns=== &lt;br /&gt;
Returns a ''bool'' indicating the visible state of the component.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
'''Example 1:''' This example gets all the component and then hides them when you get into a vehicle.  &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onClientVehicleEnter&amp;quot;, getRootElement(),&lt;br /&gt;
    function()&lt;br /&gt;
        local getComponent = getVehicleComponents(source) -- returns table with all the components of the vehicle&lt;br /&gt;
        for k in pairs (getComponent) do&lt;br /&gt;
            setVehicleComponentVisible(source, k, false) -- hides the component&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_functions}}&lt;/div&gt;</summary>
		<author><name>FuSioN</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsSoundFinished&amp;diff=43324</id>
		<title>IsSoundFinished</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsSoundFinished&amp;diff=43324"/>
		<updated>2014-12-17T01:10:58Z</updated>

		<summary type="html">&lt;p&gt;FuSioN: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function check if sound finish.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isSoundFinished ( element theSound )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theSound''': The sound element which finish state you want to return.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the [[sound]] element is finished, ''false'' if unfinished or invalid arguments were passed.&lt;br /&gt;
&lt;br /&gt;
==Code==&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;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function isSoundFinished(theSound)&lt;br /&gt;
    return ( getSoundPosition(theSound) == getSoundLength(theSound) )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
'''Function created by WASSIm. Edited by FuSioN'''&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example will check and see if the sound is finished or not, and tell the player.&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;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler(&amp;quot;checkfinish&amp;quot;,&lt;br /&gt;
function ()&lt;br /&gt;
    local sound = playSound(&amp;quot;music/song.mp3&amp;quot;)&lt;br /&gt;
    if (isSoundFinished(sound)) then&lt;br /&gt;
        outputChatBox(&amp;quot;The sound is finished!&amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox(&amp;quot;The sound is not finished!&amp;quot;)&lt;br /&gt;
    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;
'''Author:''' WASSIm.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>FuSioN</name></author>
	</entry>
</feed>