<?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=AleksCore</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=AleksCore"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/AleksCore"/>
	<updated>2026-05-22T05:56:55Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Settingsmanager&amp;diff=53277</id>
		<title>Resource:Settingsmanager</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Settingsmanager&amp;diff=53277"/>
		<updated>2018-01-06T18:04:51Z</updated>

		<summary type="html">&lt;p&gt;AleksCore: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=15127 Settings manager] is a simple resource to save/load player settings (any data). All settings stored client-side in a XML file placed using private [[filepath]] ( ''\MTA San Andreas\mods\deathmatch\priv\&amp;lt;server-id&amp;gt;\settingsmanager'' )&lt;br /&gt;
&lt;br /&gt;
==Exported functions:==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
saveSetting ( string settingName, var value [, string resourceName ] )             &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
Returns ''true'' if value was successfully saved, ''false'' otherwise.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
loadSetting ( string settingName [, string resourceName ] )             &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Returns the value if it was received successfully, ''nil'' otherwise. Strings &amp;quot;true&amp;quot; and &amp;quot;false&amp;quot; will be returned as booleans.&lt;br /&gt;
&lt;br /&gt;
* Last argument is optional for both functions. It used to store settings in XML file under resourceName node. Default argument is the resource name of the resource which called the exported function.  See example below for more information.&lt;br /&gt;
&lt;br /&gt;
== Example: ==&lt;br /&gt;
For example we have a &amp;quot;language-manager&amp;quot; resource with script like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function changeLanguage ( _, newLang )&lt;br /&gt;
   if no newLang then&lt;br /&gt;
      outputChatBox('Error. Command syntax: /lang &amp;lt;language name&amp;gt;. Available languages: &amp;quot;english&amp;quot;, &amp;quot;russian&amp;quot;')&lt;br /&gt;
      return&lt;br /&gt;
   end&lt;br /&gt;
   exports.settingsmanager:saveSetting(&amp;quot;language&amp;quot;, newLang)&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler( &amp;quot;lang&amp;quot;, changeLaguage )&lt;br /&gt;
&lt;br /&gt;
function onStart ()&lt;br /&gt;
   local playerLanguage = exports.settingsmanager:loadSetting ( &amp;quot;language&amp;quot; )&lt;br /&gt;
   if playerLanguage == nil then --if no language set&lt;br /&gt;
       playerLanguage = &amp;quot;english&amp;quot;&lt;br /&gt;
       exports.settingsmanager:saveSetting(&amp;quot;language&amp;quot;, playerLanguage ) --set default language&lt;br /&gt;
   end&lt;br /&gt;
   outputChatBox ( &amp;quot;Current language is &amp;quot; ..playerLanguage.. &amp;quot;. Type /language to change&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler( &amp;quot;onClientResourceStart&amp;quot;, resourceRoot, onStart )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then XML file will look like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;settings&amp;gt;&lt;br /&gt;
    &amp;lt;language-manager&amp;gt;&lt;br /&gt;
        &amp;lt;language&amp;gt;english&amp;lt;/language&amp;gt;&lt;br /&gt;
    &amp;lt;/language-manager&amp;gt;&lt;br /&gt;
&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
XML node called &amp;quot;language-manager&amp;quot; because resource name of the resource which called exported function is &amp;quot;language-manager&amp;quot;.&lt;/div&gt;</summary>
		<author><name>AleksCore</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Settingsmanager&amp;diff=53276</id>
		<title>Resource:Settingsmanager</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Settingsmanager&amp;diff=53276"/>
		<updated>2018-01-06T18:00:10Z</updated>

		<summary type="html">&lt;p&gt;AleksCore: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=15127 Settings manager] is a simple resource to save/load player settings (any data). All settings stored client-side in a XML file placed using private [[filepath]] ( ''\MTA San Andreas\mods\deathmatch\priv\&amp;lt;server-id&amp;gt;\settingsmanager'' )&lt;br /&gt;
&lt;br /&gt;
==Exported functions:==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
saveSetting ( string settingName, var value [, string resourceName ] )             &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
Returns ''true'' if value was successfully saved, ''false'' otherwise.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
loadSetting ( string settingName [, string resourceName ] )             &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Returns the value if it was received successfully, ''nil'' otherwise. Strings &amp;quot;true&amp;quot; and &amp;quot;false&amp;quot; will be returned as booleans.&lt;br /&gt;
&lt;br /&gt;
* Last argument is optional for both functions. It used to store settings in XML file under resourceName node. Default argument is the resource name of the resource which called the exported function.  See example below for more information.&lt;br /&gt;
&lt;br /&gt;
== Example: ==&lt;br /&gt;
For example we have a &amp;quot;language-manager&amp;quot; resource with script like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function changeLanguage ( _, newLang )&lt;br /&gt;
   if no newLang then&lt;br /&gt;
      outputChatBox('Error. Command syntax: /lang &amp;lt;language name&amp;gt;. Available languages: &amp;quot;english&amp;quot;, &amp;quot;russian&amp;quot;')&lt;br /&gt;
      return&lt;br /&gt;
   end&lt;br /&gt;
   exports.settingsmanager:saveSetting(&amp;quot;language&amp;quot;, newLang)&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler( &amp;quot;lang&amp;quot;, changeLaguage )&lt;br /&gt;
&lt;br /&gt;
function onStart ()&lt;br /&gt;
   local playerLanguage = exports.settingsmanager:loadSetting ( &amp;quot;language&amp;quot; )&lt;br /&gt;
   if playerLanguage == nil then&lt;br /&gt;
       exports.settingsmanager:saveSetting(&amp;quot;language&amp;quot;, &amp;quot;english&amp;quot;) --here we set default language&lt;br /&gt;
   end&lt;br /&gt;
   outputChatBox ( &amp;quot;Current language is &amp;quot; ..playerLanguage.. &amp;quot;. Type /language to change&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler( &amp;quot;onClientResourceStart&amp;quot;, resourceRoot, onStart )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then XML file will look like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;settings&amp;gt;&lt;br /&gt;
    &amp;lt;language-manager&amp;gt;&lt;br /&gt;
        &amp;lt;language&amp;gt;english&amp;lt;/language&amp;gt;&lt;br /&gt;
    &amp;lt;/language-manager&amp;gt;&lt;br /&gt;
&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
XML node called &amp;quot;language-manager&amp;quot; because resource name of the resource which called exported function is &amp;quot;language-manager&amp;quot;.&lt;/div&gt;</summary>
		<author><name>AleksCore</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Settingsmanager&amp;diff=53275</id>
		<title>Resource:Settingsmanager</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Settingsmanager&amp;diff=53275"/>
		<updated>2018-01-06T17:51:39Z</updated>

		<summary type="html">&lt;p&gt;AleksCore: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=15127 Settings manager] is a simple resource to save/load player settings (any data). All settings stored client-side in a XML file placed using private [[filepath]] ( ''\MTA San Andreas\mods\deathmatch\priv\&amp;lt;server-id&amp;gt;\settingsmanager'' )&lt;br /&gt;
&lt;br /&gt;
==Exported functions:==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
saveSetting ( string settingName, var value [, string resourceName ] )             &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
Returns ''true'' if value was successfully saved, ''false'' otherwise.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
loadSetting ( string settingName [, string resourceName ] )             &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Returns the value if it was received successfully, ''nil'' otherwise. Strings &amp;quot;true&amp;quot; and &amp;quot;false&amp;quot; will be returned as booleans.&lt;br /&gt;
&lt;br /&gt;
* Last argument is optional for both functions. It used to store settings in XML file under resourceName node. Default argument is the resource name of the resource which called the exported function.  See example below for more information.&lt;br /&gt;
&lt;br /&gt;
== Example: ==&lt;br /&gt;
For example we have a &amp;quot;language-manager&amp;quot; resource with script like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function changeLanguage ( _, newLang )&lt;br /&gt;
   if no newLang then&lt;br /&gt;
      outputChatBox('Error. Command syntax: /lang &amp;lt;language name&amp;gt;. Available languages: &amp;quot;english&amp;quot;, &amp;quot;russian&amp;quot;')&lt;br /&gt;
      return&lt;br /&gt;
   end&lt;br /&gt;
   exports.settingsmanager:saveSetting(&amp;quot;language&amp;quot;, newLang)&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler( &amp;quot;lang&amp;quot;, changeLaguage )&lt;br /&gt;
&lt;br /&gt;
function onStart ()&lt;br /&gt;
   local playerLanguage = exports.settingsmanager:loadSetting ( &amp;quot;language&amp;quot; )&lt;br /&gt;
   if no playerLanguage then&lt;br /&gt;
       exports.settingsmanager:saveSetting(&amp;quot;language&amp;quot;, &amp;quot;english&amp;quot;) --here we set default language&lt;br /&gt;
   end&lt;br /&gt;
   outputChatBox ( &amp;quot;Current language is &amp;quot; ..playerLanguage.. &amp;quot;. Type /language to change&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler( &amp;quot;onClientResourceStart&amp;quot;, resourceRoot, onStart )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then XML file will look like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;settings&amp;gt;&lt;br /&gt;
    &amp;lt;language-manager&amp;gt;&lt;br /&gt;
        &amp;lt;language&amp;gt;english&amp;lt;/language&amp;gt;&lt;br /&gt;
    &amp;lt;/language-manager&amp;gt;&lt;br /&gt;
&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
XML node called &amp;quot;language-manager&amp;quot; because resource name of the resource which called exported function is &amp;quot;language-manager&amp;quot;.&lt;/div&gt;</summary>
		<author><name>AleksCore</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Settingsmanager&amp;diff=53274</id>
		<title>Resource:Settingsmanager</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Settingsmanager&amp;diff=53274"/>
		<updated>2018-01-06T17:47:01Z</updated>

		<summary type="html">&lt;p&gt;AleksCore: Created page with &amp;quot;[https://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=15127 Settings manager] is a simple resource to save/load player settings. '''All settings stored clie...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=15127 Settings manager] is a simple resource to save/load player settings. '''All settings stored client-side in a XML file placed using private [[filepath]]''' ( ''\MTA San Andreas\mods\deathmatch\priv\&amp;lt;'''server-id'''&amp;gt;\settingsmanager'' )&lt;br /&gt;
&lt;br /&gt;
==Exported functions:==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
saveSetting ( string settingName, var value [, string resourceName ] )             &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
Returns true if value was successfully saved, false otherwise.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
loadSetting ( string settingName [, string resourceName ] )             &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Returns the value if it was received successfully, '''nil''' otherwise. Strings &amp;quot;true&amp;quot; and &amp;quot;false&amp;quot; will be returned as booleans.&lt;br /&gt;
&lt;br /&gt;
* '''Last argument is optional for both functions. It used to store settings in XML file under resourceName node.''' Default argument is the resource name of the resource which called the exported function.  See example below for more information.&lt;br /&gt;
&lt;br /&gt;
== Example: ==&lt;br /&gt;
For example we have a &amp;quot;language-manager&amp;quot; resource with script like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function changeLanguage ( _, newLang )&lt;br /&gt;
   if no newLang then&lt;br /&gt;
      outputChatBox('Error. Command syntax: /lang &amp;lt;language name&amp;gt;. Available languages: &amp;quot;english&amp;quot;, &amp;quot;russian&amp;quot;')&lt;br /&gt;
      return&lt;br /&gt;
   end&lt;br /&gt;
   exports.settingsmanager:saveSetting(&amp;quot;language&amp;quot;, newLang)&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler( &amp;quot;lang&amp;quot;, changeLaguage )&lt;br /&gt;
&lt;br /&gt;
function onStart ()&lt;br /&gt;
   local playerLanguage = exports.settingsmanager:loadSetting ( &amp;quot;language&amp;quot; )&lt;br /&gt;
   if no playerLanguage then&lt;br /&gt;
       exports.settingsmanager:saveSetting(&amp;quot;language&amp;quot;, &amp;quot;english&amp;quot;) --here we set default language&lt;br /&gt;
   end&lt;br /&gt;
   outputChatBox ( &amp;quot;Current language is &amp;quot; ..playerLanguage.. &amp;quot;. Type /language to change&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler( &amp;quot;onClientResourceStart&amp;quot;, resourceRoot, onStart )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then XML file will look like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;settings&amp;gt;&lt;br /&gt;
    &amp;lt;language-manager&amp;gt;&lt;br /&gt;
        &amp;lt;language&amp;gt;english&amp;lt;/language&amp;gt;&lt;br /&gt;
    &amp;lt;/language-manager&amp;gt;&lt;br /&gt;
&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
XML node called &amp;quot;language-manager&amp;quot; because resource name of the resource which called exported function is &amp;quot;language-manager&amp;quot;.&lt;/div&gt;</summary>
		<author><name>AleksCore</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Server_functions&amp;diff=49459</id>
		<title>Template:Server functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Server_functions&amp;diff=49459"/>
		<updated>2016-10-09T17:03:44Z</updated>

		<summary type="html">&lt;p&gt;AleksCore: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[addCommandHandler]]&lt;br /&gt;
*[[executeCommandHandler]]&lt;br /&gt;
*[[fromJSON]]&lt;br /&gt;
*[[getFPSLimit]]&lt;br /&gt;
*[[getMaxPlayers]]&lt;br /&gt;
*[[getServerHttpPort]]&lt;br /&gt;
*[[getServerName]]&lt;br /&gt;
*[[getServerPassword]]&lt;br /&gt;
*[[getServerPort]]&lt;br /&gt;
*[[getVersion]]&lt;br /&gt;
{{New items|3.0153|1.5.3|&lt;br /&gt;
*[[getCommandHandlers]]&lt;br /&gt;
}}&lt;br /&gt;
*[[isGlitchEnabled]]&lt;br /&gt;
*[[outputChatBox]]&lt;br /&gt;
*[[outputConsole]]&lt;br /&gt;
*[[outputDebugString]]&lt;br /&gt;
*[[outputServerLog]]&lt;br /&gt;
*[[removeCommandHandler]]&lt;br /&gt;
*[[setFPSLimit]]&lt;br /&gt;
*[[setGlitchEnabled]]&lt;br /&gt;
*[[setMaxPlayers]]&lt;br /&gt;
*[[setServerPassword]]&lt;br /&gt;
*[[showChat]]&lt;br /&gt;
*[[shutdown]]&lt;br /&gt;
*[[toJSON]]&lt;/div&gt;</summary>
		<author><name>AleksCore</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetCommandHandlers&amp;diff=49458</id>
		<title>GetCommandHandlers</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetCommandHandlers&amp;diff=49458"/>
		<updated>2016-10-09T16:56:55Z</updated>

		<summary type="html">&lt;p&gt;AleksCore: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server function}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
{{New items|3.0153|1.5.3|&lt;br /&gt;
This function is used to retrieve a list of all the registered command handlers of a given resource (or of all resources).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&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;
table getCommandHandlers ( [ resource theResource ] ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
*'''theResource:''' The resource from which you wish to retrieve all command handlers. Or leave it empty to retrieve command handlers of all resources.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing all the commands of the given resource or a table with subtables containing the command and theResource pointer ( { &amp;quot;command&amp;quot;, theResource } ). See examples below if you don't understand it.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section class=&amp;quot;server&amp;quot; name=&amp;quot;Server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example add a command to output list of all commands in the chat.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler( &amp;quot;commands&amp;quot;, &lt;br /&gt;
	function(player)&lt;br /&gt;
		local commandsList = {} --table to store commands&lt;br /&gt;
		&lt;br /&gt;
		--store/sort commands in the table where key is resource and value is table with commands&lt;br /&gt;
		for _, subtable in pairs( getCommandHandlers() ) do&lt;br /&gt;
			local commandName = subtable[1]&lt;br /&gt;
			local theResource = subtable[2]&lt;br /&gt;
			&lt;br /&gt;
			if not commandsList[theResource] then&lt;br /&gt;
				commandsList[theResource] = {}&lt;br /&gt;
			end&lt;br /&gt;
			&lt;br /&gt;
			table.insert( commandsList[theResource], commandName )&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		--output sorted information in the chat&lt;br /&gt;
		for theResource, commands in pairs( commandsList ) do&lt;br /&gt;
			local resourceName = getResourceInfo( theResource, &amp;quot;name&amp;quot; ) or getResourceName( theResource ) --try to get full name, if no full name - use short name&lt;br /&gt;
			outputChatBox( &amp;quot;== &amp;quot;..resourceName.. &amp;quot; ==&amp;quot;, player, 0, 255, 0 )&lt;br /&gt;
			&lt;br /&gt;
			--output list of commands&lt;br /&gt;
			for _, command in pairs( commands ) do&lt;br /&gt;
				outputChatBox( &amp;quot;/&amp;quot;..command, player, 255, 255, 255 )&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;
&amp;lt;section class=&amp;quot;server&amp;quot; name=&amp;quot;Server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example add a command to output list of all commands for the resource in the chat. Syntax: /commands [resource-name]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler( &amp;quot;commands&amp;quot;, &lt;br /&gt;
	function( player, _, resourceName )&lt;br /&gt;
		if not resourceName then &lt;br /&gt;
			resourceName = &amp;quot;&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		local theResource = getResourceFromName( resourceName )&lt;br /&gt;
		&lt;br /&gt;
		if not theResource then &lt;br /&gt;
			outputChatBox( &amp;quot;Can't find resource with name \&amp;quot;&amp;quot; .. resourceName .. &amp;quot;\&amp;quot;.&amp;quot;, player, 255, 0, 0 ) &lt;br /&gt;
			return false &lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		outputChatBox( &amp;quot;== Commands from \&amp;quot;&amp;quot;..resourceName.. &amp;quot;\&amp;quot; resource ==&amp;quot;, player, 0, 255, 0 )&lt;br /&gt;
		&lt;br /&gt;
		local commands = getCommandHandlers( theResource )&lt;br /&gt;
		for _, command in pairs( commands ) do&lt;br /&gt;
			outputChatBox( &amp;quot;/&amp;quot;..command, player, 255, 255, 255 )&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;
{{Server functions}}&lt;/div&gt;</summary>
		<author><name>AleksCore</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetCommandHandlers&amp;diff=49447</id>
		<title>GetCommandHandlers</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetCommandHandlers&amp;diff=49447"/>
		<updated>2016-10-09T14:16:47Z</updated>

		<summary type="html">&lt;p&gt;AleksCore: /* Returns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server function}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function is used to retrieve a list of all the registered command handlers of a given resource (or of all resources).&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&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;
table getElementsByType ( [ resource theResource ] ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
*'''theResource:''' The resource from which you wish to retrieve all command handlers. Or leave it empty to retrieve command handlers of all resources.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing all the commands of the given resource or a table with subtables containing the command and theResource pointer ( { &amp;quot;command&amp;quot;, theResource } ). See examples below if you don't understand it.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section class=&amp;quot;server&amp;quot; name=&amp;quot;Server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example add a command to output list of all commands in the chat.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler( &amp;quot;commands&amp;quot;, &lt;br /&gt;
	function(player)&lt;br /&gt;
		local commandsList = {} --table to store commands&lt;br /&gt;
		&lt;br /&gt;
		--store/sort commands in the table where key is resource and value is table with commands&lt;br /&gt;
		for _, subtable in pairs( getCommandHandlers() ) do&lt;br /&gt;
			local commandName = subtable[1]&lt;br /&gt;
			local theResource = subtable[2]&lt;br /&gt;
			&lt;br /&gt;
			if not commandsList[theResource] then&lt;br /&gt;
				commandsList[theResource] = {}&lt;br /&gt;
			end&lt;br /&gt;
			&lt;br /&gt;
			table.insert( commandsList[theResource], commandName )&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		--output sorted information in the chat&lt;br /&gt;
		for theResource, commands in pairs( commandsList ) do&lt;br /&gt;
			local resourceName = getResourceInfo( theResource, &amp;quot;name&amp;quot; ) or getResourceName( theResource ) --try to get full name, if no full name - use short name&lt;br /&gt;
			outputChatBox( &amp;quot;== &amp;quot;..resourceName.. &amp;quot; ==&amp;quot;, player, 0, 255, 0 )&lt;br /&gt;
			&lt;br /&gt;
			--output list of commands&lt;br /&gt;
			for _, command in pairs( commands ) do&lt;br /&gt;
				outputChatBox( &amp;quot;/&amp;quot;..command, player, 255, 255, 255 )&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;
&amp;lt;section class=&amp;quot;server&amp;quot; name=&amp;quot;Server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example add a command to output list of all commands for the resource in the chat. Syntax: /commands [resource-name]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler( &amp;quot;commands&amp;quot;, &lt;br /&gt;
	function( player, _, resourceName )&lt;br /&gt;
		if not resourceName then &lt;br /&gt;
			resourceName = &amp;quot;&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		local theResource = getResourceFromName( resourceName )&lt;br /&gt;
		&lt;br /&gt;
		if not theResource then &lt;br /&gt;
			outputChatBox( &amp;quot;Can't find resource with name \&amp;quot;&amp;quot; .. resourceName .. &amp;quot;\&amp;quot;.&amp;quot;, player, 255, 0, 0 ) &lt;br /&gt;
			return false &lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		outputChatBox( &amp;quot;== Commands from \&amp;quot;&amp;quot;..resourceName.. &amp;quot;\&amp;quot; resource ==&amp;quot;, player, 0, 255, 0 )&lt;br /&gt;
		&lt;br /&gt;
		local commands = getCommandHandlers( theResource )&lt;br /&gt;
		for _, command in pairs( commands ) do&lt;br /&gt;
			outputChatBox( &amp;quot;/&amp;quot;..command, player, 255, 255, 255 )&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;
{{Server functions}}&lt;/div&gt;</summary>
		<author><name>AleksCore</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetCommandHandlers&amp;diff=49446</id>
		<title>GetCommandHandlers</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetCommandHandlers&amp;diff=49446"/>
		<updated>2016-10-09T14:12:56Z</updated>

		<summary type="html">&lt;p&gt;AleksCore: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server function}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function is used to retrieve a list of all the registered command handlers of a given resource (or of all resources).&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&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;
table getElementsByType ( [ resource theResource ] ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
*'''theResource:''' The resource from which you wish to retrieve all command handlers. Or leave it empty to retrieve command handlers of all resources.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing all the commands of the given resource or a table with subtables containing the command and theResource pointer ( { &amp;quot;command&amp;quot;, theResource } )&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section class=&amp;quot;server&amp;quot; name=&amp;quot;Server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example add a command to output list of all commands in the chat.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler( &amp;quot;commands&amp;quot;, &lt;br /&gt;
	function(player)&lt;br /&gt;
		local commandsList = {} --table to store commands&lt;br /&gt;
		&lt;br /&gt;
		--store/sort commands in the table where key is resource and value is table with commands&lt;br /&gt;
		for _, subtable in pairs( getCommandHandlers() ) do&lt;br /&gt;
			local commandName = subtable[1]&lt;br /&gt;
			local theResource = subtable[2]&lt;br /&gt;
			&lt;br /&gt;
			if not commandsList[theResource] then&lt;br /&gt;
				commandsList[theResource] = {}&lt;br /&gt;
			end&lt;br /&gt;
			&lt;br /&gt;
			table.insert( commandsList[theResource], commandName )&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		--output sorted information in the chat&lt;br /&gt;
		for theResource, commands in pairs( commandsList ) do&lt;br /&gt;
			local resourceName = getResourceInfo( theResource, &amp;quot;name&amp;quot; ) or getResourceName( theResource ) --try to get full name, if no full name - use short name&lt;br /&gt;
			outputChatBox( &amp;quot;== &amp;quot;..resourceName.. &amp;quot; ==&amp;quot;, player, 0, 255, 0 )&lt;br /&gt;
			&lt;br /&gt;
			--output list of commands&lt;br /&gt;
			for _, command in pairs( commands ) do&lt;br /&gt;
				outputChatBox( &amp;quot;/&amp;quot;..command, player, 255, 255, 255 )&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;
&amp;lt;section class=&amp;quot;server&amp;quot; name=&amp;quot;Server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example add a command to output list of all commands for the resource in the chat. Syntax: /commands [resource-name]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler( &amp;quot;commands&amp;quot;, &lt;br /&gt;
	function( player, _, resourceName )&lt;br /&gt;
		if not resourceName then &lt;br /&gt;
			resourceName = &amp;quot;&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		local theResource = getResourceFromName( resourceName )&lt;br /&gt;
		&lt;br /&gt;
		if not theResource then &lt;br /&gt;
			outputChatBox( &amp;quot;Can't find resource with name \&amp;quot;&amp;quot; .. resourceName .. &amp;quot;\&amp;quot;.&amp;quot;, player, 255, 0, 0 ) &lt;br /&gt;
			return false &lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		outputChatBox( &amp;quot;== Commands from \&amp;quot;&amp;quot;..resourceName.. &amp;quot;\&amp;quot; resource ==&amp;quot;, player, 0, 255, 0 )&lt;br /&gt;
		&lt;br /&gt;
		local commands = getCommandHandlers( theResource )&lt;br /&gt;
		for _, command in pairs( commands ) do&lt;br /&gt;
			outputChatBox( &amp;quot;/&amp;quot;..command, player, 255, 255, 255 )&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;
{{Server functions}}&lt;/div&gt;</summary>
		<author><name>AleksCore</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetCommandHandlers&amp;diff=49445</id>
		<title>GetCommandHandlers</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetCommandHandlers&amp;diff=49445"/>
		<updated>2016-10-09T13:57:32Z</updated>

		<summary type="html">&lt;p&gt;AleksCore: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server function}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function is used to retrieve a list of all the registered command handlers of a given resource (or of all resources).&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&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;
table getElementsByType ( [ resource theResource ] ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
*'''theResource:''' The resource from which you wish to retrieve all command handlers. Or leave it empty to retrieve command handlers of all resources.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing all the commands of the given resource or a table with subtables containing the command and theResource pointer ( { &amp;quot;command&amp;quot;, theResource } )&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section class=&amp;quot;server&amp;quot; name=&amp;quot;Server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This simple example add a command to output list of all commands in the chat.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler( &amp;quot;commands&amp;quot;, &lt;br /&gt;
	function(player)&lt;br /&gt;
		local commandsList = {} --table to store commands&lt;br /&gt;
		&lt;br /&gt;
		--store/sort commands in the table where key is resource and value is table with commands&lt;br /&gt;
		for _, subtable in pairs( getCommandHandlers() ) do&lt;br /&gt;
			local commandName = subtable[1]&lt;br /&gt;
			local theResource = subtable[2]&lt;br /&gt;
			&lt;br /&gt;
			if not commandsList[theResource] then&lt;br /&gt;
				commandsList[theResource] = {}&lt;br /&gt;
			end&lt;br /&gt;
			&lt;br /&gt;
			table.insert( commandsList[theResource], commandName )&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		--output sorted information in the chat&lt;br /&gt;
		for theResource, commands in pairs( commandsList ) do&lt;br /&gt;
			local resourceName = getResourceInfo( theResource, &amp;quot;name&amp;quot; ) or getResourceName( theResource ) --try to get full name, if no full name - use short name&lt;br /&gt;
			outputChatBox( &amp;quot;== &amp;quot;..resourceName.. &amp;quot; ==&amp;quot;, player, 0, 255, 0 )&lt;br /&gt;
			&lt;br /&gt;
			--output list of commands&lt;br /&gt;
			for _, command in pairs( commands ) do&lt;br /&gt;
				outputChatBox( &amp;quot;/&amp;quot;..command, player, 255, 255, 255 )&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;
==See Also==&lt;br /&gt;
{{Server functions}}&lt;/div&gt;</summary>
		<author><name>AleksCore</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetCommandHandlers&amp;diff=49444</id>
		<title>GetCommandHandlers</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetCommandHandlers&amp;diff=49444"/>
		<updated>2016-10-09T13:33:38Z</updated>

		<summary type="html">&lt;p&gt;AleksCore: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server function}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function is used to retrieve a list of all the registered command handlers of a given resource (or of all resources).&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&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;
table getElementsByType ( [ resource theResource ] ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
*'''theResource:''' The resource from which you wish to retrieve all command handlers. Or leave it empty to retrieve command handlers of all resources.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing all the commands of the given resource or a table with subtables containing the command and theResource pointer ( { &amp;quot;command&amp;quot;, theResource } )&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section class=&amp;quot;server&amp;quot; name=&amp;quot;Server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This simple example add a command to output list of all commands in the chat.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler(&amp;quot;commands&amp;quot;, &lt;br /&gt;
	function()&lt;br /&gt;
		local commandsList = {}&lt;br /&gt;
		&lt;br /&gt;
		for _, subtable in pairs( getCommandHandlers() ) do&lt;br /&gt;
			local commandName = subtable[1]&lt;br /&gt;
			local theResource = subtable[2]&lt;br /&gt;
			&lt;br /&gt;
			if not commandsList[theResource] then&lt;br /&gt;
				commandsList[theResource] = {}&lt;br /&gt;
			end&lt;br /&gt;
			&lt;br /&gt;
			table.insert(commandsList[theResource], commandName)&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		for theResource, commands in pairs(commandsList) do&lt;br /&gt;
			local resourceName = getResourceInfo(theResource, &amp;quot;name&amp;quot;) or getResourceName(theResource)&lt;br /&gt;
			&lt;br /&gt;
			outputChatBox(&amp;quot;== &amp;quot;..resourceName.. &amp;quot; ==&amp;quot;)&lt;br /&gt;
			&lt;br /&gt;
			for _, command in pairs(commands) do&lt;br /&gt;
				outputChatBox(&amp;quot;/&amp;quot;..command)&lt;br /&gt;
			end&lt;br /&gt;
			&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;
{{Server functions}}&lt;/div&gt;</summary>
		<author><name>AleksCore</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetCommandHandlers&amp;diff=49443</id>
		<title>GetCommandHandlers</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetCommandHandlers&amp;diff=49443"/>
		<updated>2016-10-09T13:32:33Z</updated>

		<summary type="html">&lt;p&gt;AleksCore: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server function}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function is used to retrieve a list of all the registered command handlers of a given resource (or of all resources).&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&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;
table getElementsByType ( [ resource theResource ] ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
*'''theResource:''' The resource from which you wish to retrieve all command handlers. Or leave it empty to retrieve command handlers of all resources.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing all the commands of the given resource or a table with subtables containing the command and theResource pointer ( { &amp;quot;command&amp;quot;, theResource } )&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section class=&amp;quot;server&amp;quot; name=&amp;quot;Server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This simple example add a command to output list of all commands in the chat.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler(&amp;quot;commands&amp;quot;, &lt;br /&gt;
	function()&lt;br /&gt;
		local commandsList = {}&lt;br /&gt;
		&lt;br /&gt;
		for _, subtable in pairs( getCommandHandlers() ) do&lt;br /&gt;
			local commandName = subtable[1]&lt;br /&gt;
			local res = subtable[2]&lt;br /&gt;
			&lt;br /&gt;
			if not commandsList[res] then&lt;br /&gt;
				commandsList[res] = {}&lt;br /&gt;
			end&lt;br /&gt;
			&lt;br /&gt;
			table.insert(commandsList[res], commandName)&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		for res, commands in pairs(commandsList) do&lt;br /&gt;
			local resourceName = getResourceInfo(res, &amp;quot;name&amp;quot;) or getResourceName(res)&lt;br /&gt;
			&lt;br /&gt;
			outputChatBox(&amp;quot;== &amp;quot;..resourceName.. &amp;quot; ==&amp;quot;)&lt;br /&gt;
			&lt;br /&gt;
			for _, command in pairs(commands) do&lt;br /&gt;
				outputChatBox(&amp;quot;/&amp;quot;..command)&lt;br /&gt;
			end&lt;br /&gt;
			&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;
{{Server functions}}&lt;/div&gt;</summary>
		<author><name>AleksCore</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetCommandHandlers&amp;diff=49442</id>
		<title>GetCommandHandlers</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetCommandHandlers&amp;diff=49442"/>
		<updated>2016-10-09T13:28:22Z</updated>

		<summary type="html">&lt;p&gt;AleksCore: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server function}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function is used to retrieve a list of all the registered command handlers of a given resource (or of all resources).&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&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;
table getElementsByType ( [ resource theResource ] ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
*'''theResource:''' The resource from which you wish to retrieve all command handlers. Or leave it empty to retrieve command handlers of all resources.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing all the commands of the given resource or a table with subtables containing the command and theResource pointer ( { &amp;quot;command&amp;quot;, theResource } )&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section class=&amp;quot;server&amp;quot; name=&amp;quot;Server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This simple example add a command to output list of all commands in the chat.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler(&amp;quot;commands&amp;quot;, &lt;br /&gt;
	function()&lt;br /&gt;
		local commandsList = {}&lt;br /&gt;
		&lt;br /&gt;
		for _, subtable in pairs( getCommandHandlers() ) do&lt;br /&gt;
			local commandName = subtable[1]&lt;br /&gt;
			local res = subtable[2]&lt;br /&gt;
			&lt;br /&gt;
			if not commandsList[res] then&lt;br /&gt;
				commandsList[res] = {}&lt;br /&gt;
			end&lt;br /&gt;
			&lt;br /&gt;
			table.insert(commandsList[res], commandName)&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		for res, commands in pairs(commandsList) do&lt;br /&gt;
			local resName = getresInfo(res, &amp;quot;name&amp;quot;) or getresName(res)&lt;br /&gt;
			&lt;br /&gt;
			outputChatBox(&amp;quot;== &amp;quot;..resName.. &amp;quot; ==&amp;quot;)&lt;br /&gt;
			&lt;br /&gt;
			for _, command in pairs(commands) do&lt;br /&gt;
				outputChatBox(&amp;quot;/&amp;quot;..command)&lt;br /&gt;
			end&lt;br /&gt;
			&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;
{{Server functions}}&lt;/div&gt;</summary>
		<author><name>AleksCore</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetCommandHandlers&amp;diff=49441</id>
		<title>GetCommandHandlers</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetCommandHandlers&amp;diff=49441"/>
		<updated>2016-10-09T13:26:09Z</updated>

		<summary type="html">&lt;p&gt;AleksCore: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server function}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function is used to retrieve a list of all the registered command handlers of a given resource (or of all resources).&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&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;
table getElementsByType ( [ resource theResource ] ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
*'''theResource:''' The resource from which you wish to retrieve all command handlers. Or leave it empty to retrieve command handlers of all resources.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing all the commands of the given resource or a table with subtables containing the command and theResource pointer ( { &amp;quot;command&amp;quot;, theResource } )&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section class=&amp;quot;server&amp;quot; name=&amp;quot;Server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This simple example add a command to output list of all commands in the chat.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler(&amp;quot;commands&amp;quot;, &lt;br /&gt;
	function()&lt;br /&gt;
		local commandsList = {}&lt;br /&gt;
		&lt;br /&gt;
		for _, subtable in pairs( getCommandHandlers() ) do&lt;br /&gt;
			local commandName = subtable[1]&lt;br /&gt;
			local resource = subtable[2]&lt;br /&gt;
			&lt;br /&gt;
			if not commandsList[resource] then&lt;br /&gt;
				commandsList[resource] = {}&lt;br /&gt;
			end&lt;br /&gt;
			&lt;br /&gt;
			table.insert(commandsList[resource], commandName)&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		for resource, commands in pairs(commandsList) do&lt;br /&gt;
			local resourceName = getResourceInfo(resource, &amp;quot;name&amp;quot;) or getResourceName(resource)&lt;br /&gt;
			&lt;br /&gt;
			outputChatBox(&amp;quot;== &amp;quot;..resourceName.. &amp;quot; ==&amp;quot;)&lt;br /&gt;
			&lt;br /&gt;
			for _, command in pairs(commands) do&lt;br /&gt;
				outputChatBox(&amp;quot;/&amp;quot;..command)&lt;br /&gt;
			end&lt;br /&gt;
			&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;
{{Server functions}}&lt;/div&gt;</summary>
		<author><name>AleksCore</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetCommandHandlers&amp;diff=49440</id>
		<title>GetCommandHandlers</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetCommandHandlers&amp;diff=49440"/>
		<updated>2016-10-09T13:14:21Z</updated>

		<summary type="html">&lt;p&gt;AleksCore: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server function}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function is used to retrieve a list of all the registered command handlers of a given resource (or of all resources).&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&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;
table getElementsByType ( [ resource theResource ] ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
*'''theResource:''' The resource from which you wish to retrieve all command handlers. Or leave it empty to retrieve command handlers of all resources.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing all the commands of the given resource or a table with subtables containing the command and theResource pointer ( { &amp;quot;command&amp;quot;, theResource } )&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Server functions}}&lt;/div&gt;</summary>
		<author><name>AleksCore</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetCommandHandlers&amp;diff=49438</id>
		<title>GetCommandHandlers</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetCommandHandlers&amp;diff=49438"/>
		<updated>2016-10-09T12:57:42Z</updated>

		<summary type="html">&lt;p&gt;AleksCore: /* Returns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server function}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function is used to retrieve a list of all the registered command handlers of a given resource (or of all resources).&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&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;
table getElementsByType ( [ resource theResource ] ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
*'''theResource:''' The resource from which you wish to retrieve all command handlers. Or leave it empty to retrieve command handlers of all resources.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing all the commands of the given resource or a table with subtables containing the command and theResource pointer ( { &amp;quot;command&amp;quot;, theResource } )&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Server functions}}&lt;/div&gt;</summary>
		<author><name>AleksCore</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetCommandHandlers&amp;diff=49437</id>
		<title>GetCommandHandlers</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetCommandHandlers&amp;diff=49437"/>
		<updated>2016-10-09T12:53:37Z</updated>

		<summary type="html">&lt;p&gt;AleksCore: Created page with &amp;quot;{{Server function}} __NOTOC__  This function is used to retrieve a list of all the registered command handlers of a given resource (or of all resources).  ==Syntax==  &amp;lt;section...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server function}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function is used to retrieve a list of all the registered command handlers of a given resource (or of all resources).&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&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;
table getElementsByType ( [ resource theResource ] ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
*'''theResource:''' The resource from which you wish to retrieve all command handlers. Or leave it empty to retrieve command handlers of all resources.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
TODO&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Server functions}}&lt;/div&gt;</summary>
		<author><name>AleksCore</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetOriginalHandling&amp;diff=46030</id>
		<title>GetOriginalHandling</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetOriginalHandling&amp;diff=46030"/>
		<updated>2015-10-10T20:55:20Z</updated>

		<summary type="html">&lt;p&gt;AleksCore: fixed wrong example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}} &lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function returns a table of the original vehicle handling. Use [[getVehicleHandling]] if you wish to get the current handling of a vehicle, or [[getModelHandling]] for a specific vehicle model.&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 getOriginalHandling ( int modelID ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''modelID:''' The vehicle ID you wish to get the original handling from.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing all the handling data, ''false'' otherwise. Here a list of valid table properties and what they return:&lt;br /&gt;
{{Handling Properties}}&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server &amp;amp; Client&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example creates a new function called getVehicleOriginalProperty, which simulates the previous syntax of this function.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function getVehicleOriginalProperty( element, property )&lt;br /&gt;
    if isElement ( element ) and getElementType ( element ) == &amp;quot;vehicle&amp;quot; and type ( property ) == &amp;quot;string&amp;quot; then -- Make sure there's a valid vehicle and a property string&lt;br /&gt;
        local modelID = getElementModel ( element )&lt;br /&gt;
        local handlingTable = getOriginalHandling ( modelID ) -- Get the handling as table and save as handlingTable&lt;br /&gt;
        local value = handlingTable[property] -- Get the value from the table&lt;br /&gt;
        &lt;br /&gt;
        if value then -- If there's a value (valid property)&lt;br /&gt;
            return value -- Return it&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    return false -- Not an element, not a vehicle or no valid property string. Return failure&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 other vehicle functions==&lt;br /&gt;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>AleksCore</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:AleksCore&amp;diff=35550</id>
		<title>User:AleksCore</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:AleksCore&amp;diff=35550"/>
		<updated>2013-04-24T20:14:26Z</updated>

		<summary type="html">&lt;p&gt;AleksCore: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I Love MTA :)&lt;br /&gt;
&lt;br /&gt;
А милитари лалка&lt;/div&gt;</summary>
		<author><name>AleksCore</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:AleksCore&amp;diff=35549</id>
		<title>User:AleksCore</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:AleksCore&amp;diff=35549"/>
		<updated>2013-04-24T20:13:44Z</updated>

		<summary type="html">&lt;p&gt;AleksCore: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I Love MTA :)&lt;br /&gt;
&lt;br /&gt;
lukum :P&lt;/div&gt;</summary>
		<author><name>AleksCore</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:AleksCore&amp;diff=29538</id>
		<title>User:AleksCore</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:AleksCore&amp;diff=29538"/>
		<updated>2012-03-01T18:03:28Z</updated>

		<summary type="html">&lt;p&gt;AleksCore: Created page with &amp;quot;I Love MTA :)&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I Love MTA :)&lt;/div&gt;</summary>
		<author><name>AleksCore</name></author>
	</entry>
</feed>