<?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=Jack+Johnson</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=Jack+Johnson"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Jack_Johnson"/>
	<updated>2026-06-16T11:04:10Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPlayerQuit&amp;diff=43976</id>
		<title>OnPlayerQuit</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPlayerQuit&amp;diff=43976"/>
		<updated>2015-01-14T12:59:36Z</updated>

		<summary type="html">&lt;p&gt;Jack Johnson: Shortened down the code&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server event}}&lt;br /&gt;
This event is triggered when a player disconnects from the server.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string quitType, string reason, element responsibleElement&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''quitType''': How the player left.&lt;br /&gt;
This argument can be:&lt;br /&gt;
* &amp;quot;Unknown&amp;quot;&lt;br /&gt;
* &amp;quot;Quit&amp;quot;&lt;br /&gt;
* &amp;quot;Kicked&amp;quot;&lt;br /&gt;
* &amp;quot;Banned&amp;quot;&lt;br /&gt;
* &amp;quot;Bad Connection&amp;quot;&lt;br /&gt;
* &amp;quot;Timed out&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
*'''reason''': If the player was kicked or banned, the reason given goes here. If the player was '''not''' kicked or banned, this will be false.&lt;br /&gt;
&lt;br /&gt;
*'''responsibleElement''': The element that was responsible for kicking or banning the player. This is commonly another player, but can also be the console element.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[player]] that left the server.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example gets the quitting client's name and outputs that he is gone&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- we register quitPlayer as a handler for the event&lt;br /&gt;
function quitPlayer ( quitType )&lt;br /&gt;
	-- send the message to the server telling players that the player has left.&lt;br /&gt;
	outputChatBox ( getPlayerName(source).. &amp;quot; has left the server (&amp;quot; .. quitType .. &amp;quot;)&amp;quot; )&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerQuit&amp;quot;, getRootElement(), quitPlayer )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Player events}}&lt;/div&gt;</summary>
		<author><name>Jack Johnson</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetMaxPlayers&amp;diff=43975</id>
		<title>GetMaxPlayers</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetMaxPlayers&amp;diff=43975"/>
		<updated>2015-01-14T12:56:21Z</updated>

		<summary type="html">&lt;p&gt;Jack Johnson: Shortened down the code&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function returns the maximum number of player slots on the server.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int getMaxPlayers ()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the maximum number of players allowed on the server.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example outputs the current number of players together with the maximum number of players when a player joins.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function showPlayers()&lt;br /&gt;
	outputChatBox(&amp;quot;There are &amp;quot;..getPlayerCount()..&amp;quot;/&amp;quot;..getMaxPlayers()..&amp;quot; players playing.&amp;quot;,source) --output a message to the joined player informing the player count and max players.&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerJoin&amp;quot;,root,showPlayers) --Add an event handler to call the function when a player joins.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Server functions}}&lt;/div&gt;</summary>
		<author><name>Jack Johnson</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OutputConsole&amp;diff=43974</id>
		<title>OutputConsole</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OutputConsole&amp;diff=43974"/>
		<updated>2015-01-14T12:53:52Z</updated>

		<summary type="html">&lt;p&gt;Jack Johnson: Shortened down the function by taking advantage of the command variable.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This outputs the specified text string to the console window (accessed with F8 or ~ key). It can be specified as a message to certain player(s) or all players.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &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;bool outputConsole ( string text )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''text:''' The text string that you wish to send to the console window&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&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;&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool outputConsole ( string text, [ element visibleTo=getRootElement() ] )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''text:''' The text string that you wish to send to the console window&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''visibleTo:''' This specifies who the chat is visible to. Any players in this element will see the chat message. See [[visibility]].&lt;br /&gt;
{{Note|'''visibleTo''' can also be a Team object, in this case, the text will be visible to all the players of that team.}}&amp;lt;/section&amp;gt;&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;This code creates two console commands. One, 'public', will post a message in the consoles of all players, and the other, 'private', will post a message in only the console of the player that executed the command.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function message(player,command)&lt;br /&gt;
	if command == &amp;quot;public&amp;quot; then&lt;br /&gt;
		outputConsole(&amp;quot;Public console message&amp;quot;)&lt;br /&gt;
	else&lt;br /&gt;
		outputConsole(&amp;quot;Private console message&amp;quot;,player)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;public&amp;quot;,message)&lt;br /&gt;
addCommandHandler(&amp;quot;private&amp;quot;,message)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;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>Jack Johnson</name></author>
	</entry>
</feed>