<?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=Zneext</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=Zneext"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Zneext"/>
	<updated>2026-04-28T00:14:12Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetElementDimension&amp;diff=50522</id>
		<title>SetElementDimension</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetElementDimension&amp;diff=50522"/>
		<updated>2017-02-28T22:30:11Z</updated>

		<summary type="html">&lt;p&gt;Zneext: Add note about the -1 parameter.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function allows you to set the [[dimension]] of any element. The dimension determines what/who the element is visible to.&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 setElementDimension ( element theElement, int dimension )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[element]]:setDimension|dimension|getElementDimension}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theElement:''' The element in which you'd like to set the dimension of.&lt;br /&gt;
*'''dimension:''' An integer representing the dimension ID. {{New feature/item|3.0154|1.5.3|11199|You can also use '''-1''' to make the element visible in all dimensions (only valid to objects).}}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if '''theElement''' and '''dimension''' are valid, ''false'' otherwise.&lt;br /&gt;
Also returns false if '''theElement''' is a player and it's not alive.&lt;br /&gt;
&lt;br /&gt;
==Example==&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;
In this example the player's dimension is set to ID 1 when they enter a vehicle, and set back to dimension 0 when they exit the vehicle.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function onPlayerEnterVehicle ( theVehicle, seat, jacked )&lt;br /&gt;
      if ( getElementDimension ( source ) == 0 ) then    -- if the player is in dimension 0&lt;br /&gt;
            setElementDimension ( source, 1 )            -- set his dimension to 1&lt;br /&gt;
            setElementDimension ( theVehicle, 1 )        -- set his vehicle's dimension to 1 as well&lt;br /&gt;
      end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerVehicleEnter&amp;quot;, root, onPlayerEnterVehicle )&lt;br /&gt;
&lt;br /&gt;
function onPlayerExitVehicle ( theVehicle, seat, jacker )&lt;br /&gt;
      if ( getElementDimension ( source ) == 1 ) then    -- if the player is in dimension 1&lt;br /&gt;
            setElementDimension ( source, 0 )            -- set his dimension back to 0&lt;br /&gt;
            setElementDimension ( theVehicle, 0 )        -- set his vehicle's dimension back to 0 as well&lt;br /&gt;
      end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerVehicleExit&amp;quot;, root, onPlayerExitVehicle )&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;
{{Element functions}}&lt;br /&gt;
&lt;br /&gt;
[[de:setElementDimension]]&lt;/div&gt;</summary>
		<author><name>Zneext</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Server_functions&amp;diff=49455</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=49455"/>
		<updated>2016-10-09T15:00:55Z</updated>

		<summary type="html">&lt;p&gt;Zneext: Add getCommandHandlers to the list&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;
*[[getCommandHandlers]]&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>Zneext</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetCommandHandlers&amp;diff=49454</id>
		<title>GetCommandHandlers</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetCommandHandlers&amp;diff=49454"/>
		<updated>2016-10-09T14:54:07Z</updated>

		<summary type="html">&lt;p&gt;Zneext: /* Syntax */&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 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>Zneext</name></author>
	</entry>
</feed>