<?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=3ash8Alsherq</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=3ash8Alsherq"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/3ash8Alsherq"/>
	<updated>2026-05-13T03:49:45Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Shared_function&amp;diff=34400</id>
		<title>Template:Shared function</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Shared_function&amp;diff=34400"/>
		<updated>2013-01-06T21:33:43Z</updated>

		<summary type="html">&lt;p&gt;3ash8Alsherq: Blanked the page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>3ash8Alsherq</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Shared_function&amp;diff=34399</id>
		<title>Template:Shared function</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Shared_function&amp;diff=34399"/>
		<updated>2013-01-06T21:33:26Z</updated>

		<summary type="html">&lt;p&gt;3ash8Alsherq: /* Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
{{Adding_Pages_to_Categories_and_Templates}}&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function check if the player in the team.&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;
This example check if the cop team.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
createTeam( 'Cop', 255, 0, 0 )&lt;br /&gt;
&lt;br /&gt;
addCommandHandler( 'InTeam', &lt;br /&gt;
	function( aPlayer )&lt;br /&gt;
		if isPlayerInTeam( aPlayer, 'Cop' ) then&lt;br /&gt;
			outputChatBox( 'You\'re in cop team.', aPlayer )&lt;br /&gt;
		else&lt;br /&gt;
			outputChatBox( 'You\'re not in cop team.', aPlayer )&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;
Author(s): -&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>3ash8Alsherq</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Shared_function&amp;diff=34398</id>
		<title>Template:Shared function</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Shared_function&amp;diff=34398"/>
		<updated>2013-01-06T21:33:11Z</updated>

		<summary type="html">&lt;p&gt;3ash8Alsherq: /* Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
{{Adding_Pages_to_Categories_and_Templates}}&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function check if the player in the team.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Serverside Script&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;
function isPlayerInTeam( thePlayer, teamName )&lt;br /&gt;
	local pTeam = getPlayerTeam( thePlayer )&lt;br /&gt;
	local fTeam = getTeamFromName( teamName )&lt;br /&gt;
	if not ( pTeam ) and ( fTeam ) then&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
	if ( pTeam == fTeam ) then&lt;br /&gt;
		return true &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;
==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;
This example check if the cop team.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
createTeam( 'Cop', 255, 0, 0 )&lt;br /&gt;
&lt;br /&gt;
addCommandHandler( 'InTeam', &lt;br /&gt;
	function( aPlayer )&lt;br /&gt;
		if isPlayerInTeam( aPlayer, 'Cop' ) then&lt;br /&gt;
			outputChatBox( 'You\'re in cop team.', aPlayer )&lt;br /&gt;
		else&lt;br /&gt;
			outputChatBox( 'You\'re not in cop team.', aPlayer )&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;
Author(s): -&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>3ash8Alsherq</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsPlayerInTeam&amp;diff=34397</id>
		<title>IsPlayerInTeam</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsPlayerInTeam&amp;diff=34397"/>
		<updated>2013-01-06T21:30:07Z</updated>

		<summary type="html">&lt;p&gt;3ash8Alsherq: /* 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 the player in the team.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isPlayerInTeam( player thePlayer, string teamName )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''thePlayer''': The player whose team you want to find out.&lt;br /&gt;
* '''teamName''': A string determining the name of the team you wish to find..&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Return true if player in Team, false otherwise.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Serverside Script&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;
function isPlayerInTeam( thePlayer, teamName )&lt;br /&gt;
	local pTeam = getPlayerTeam( thePlayer )&lt;br /&gt;
	local fTeam = getTeamFromName( teamName )&lt;br /&gt;
	if ( pTeam ) and ( fTeam ) then&lt;br /&gt;
		if ( pTeam == fTeam ) then&lt;br /&gt;
			return true &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;
==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;
This example checks if player in team cop.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
createTeam( 'Cop', 255, 0, 0 )&lt;br /&gt;
&lt;br /&gt;
addCommandHandler( 'InTeam', &lt;br /&gt;
	function( player )&lt;br /&gt;
		if isPlayerInTeam( aPlayer, 'Cop' ) then&lt;br /&gt;
			outputChatBox( 'You\'re in cop team.', player )&lt;br /&gt;
		else&lt;br /&gt;
			outputChatBox( 'You\'re not in cop team.', player )&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;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>3ash8Alsherq</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsPlayerInTeam&amp;diff=34396</id>
		<title>IsPlayerInTeam</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsPlayerInTeam&amp;diff=34396"/>
		<updated>2013-01-06T21:22:16Z</updated>

		<summary type="html">&lt;p&gt;3ash8Alsherq: /* 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 the player in the team.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isPlayerInTeam( player thePlayer, string teamName )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''thePlayer''': The player whose team you want to find out.&lt;br /&gt;
* '''teamName''': A string determining the name of the team you wish to find..&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Return true if player in Team, false otherwise.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Serverside Script&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;
function isPlayerInTeam( thePlayer, teamName )&lt;br /&gt;
	local pTeam = getPlayerTeam( thePlayer )&lt;br /&gt;
	local fTeam = getTeamFromName( teamName )&lt;br /&gt;
	if ( pTeam ) and ( fTeam ) then&lt;br /&gt;
		if ( pTeam == fTeam ) then&lt;br /&gt;
			return true &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;
==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;
This example check if the cop team.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
createTeam( 'Cop', 255, 0, 0 )&lt;br /&gt;
&lt;br /&gt;
addCommandHandler( 'InTeam', &lt;br /&gt;
	function( aPlayer )&lt;br /&gt;
		if isPlayerInTeam( aPlayer, 'Cop' ) then&lt;br /&gt;
			outputChatBox( 'You\'re in cop team.', aPlayer )&lt;br /&gt;
		else&lt;br /&gt;
			outputChatBox( 'You\'re not in cop team.', aPlayer )&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;
Author(s): -&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>3ash8Alsherq</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsPlayerInTeam&amp;diff=34395</id>
		<title>IsPlayerInTeam</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsPlayerInTeam&amp;diff=34395"/>
		<updated>2013-01-06T21:21:17Z</updated>

		<summary type="html">&lt;p&gt;3ash8Alsherq: &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 the player in the team.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isPlayerInTeam( player thePlayer, string teamName )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''thePlayer''': The player whose team you want to find out.&lt;br /&gt;
* '''teamName''': A string determining the name of the team you wish to find..&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Return true if player in Team, false otherwise.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Serverside Script&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;
function isPlayerInTeam( thePlayer, teamName )&lt;br /&gt;
	local pTeam = getPlayerTeam( thePlayer )&lt;br /&gt;
	local fTeam = getTeamFromName( teamName )&lt;br /&gt;
	if not ( pTeam ) and ( fTeam ) then&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
	if ( pTeam == fTeam ) then&lt;br /&gt;
		return true &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;
==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;
This example check if the cop team.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
createTeam( 'Cop', 255, 0, 0 )&lt;br /&gt;
&lt;br /&gt;
addCommandHandler( 'InTeam', &lt;br /&gt;
	function( aPlayer )&lt;br /&gt;
		if isPlayerInTeam( aPlayer, 'Cop' ) then&lt;br /&gt;
			outputChatBox( 'You\'re in cop team.', aPlayer )&lt;br /&gt;
		else&lt;br /&gt;
			outputChatBox( 'You\'re not in cop team.', aPlayer )&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;
Author(s): -&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>3ash8Alsherq</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsPlayerInTeam&amp;diff=34394</id>
		<title>IsPlayerInTeam</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsPlayerInTeam&amp;diff=34394"/>
		<updated>2013-01-06T21:18:12Z</updated>

		<summary type="html">&lt;p&gt;3ash8Alsherq: Created page with &amp;quot;{{Useful Function}} &amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt; __NOTOC__ This function check if the player in the team.  ==Syntax== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isPlayerInTeam( player thePlayer, str...&amp;quot;&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 the player in the team.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isPlayerInTeam( player thePlayer, string teamName )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''thePlayer''': The player whose team you want to find out.&lt;br /&gt;
* '''teamName''': A string determining the name of the team you wish to find..&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Serverside Script&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;
function isPlayerInTeam( thePlayer, teamName )&lt;br /&gt;
	local pTeam = getPlayerTeam( thePlayer )&lt;br /&gt;
	local fTeam = getTeamFromName( teamName )&lt;br /&gt;
	if not ( pTeam ) and ( fTeam ) then&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
	if ( pTeam == fTeam ) then&lt;br /&gt;
		return true &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;
==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;
This example check if the cop team.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
createTeam( 'Cop', 255, 0, 0 )&lt;br /&gt;
&lt;br /&gt;
addCommandHandler( 'InTeam', &lt;br /&gt;
	function( aPlayer )&lt;br /&gt;
		if isPlayerInTeam( aPlayer, 'Cop' ) then&lt;br /&gt;
			outputChatBox( 'You\'re in cop team.', aPlayer )&lt;br /&gt;
		else&lt;br /&gt;
			outputChatBox( 'You\'re not in cop team.', aPlayer )&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;
Author(s): -&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>3ash8Alsherq</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Useful_Functions&amp;diff=34393</id>
		<title>Template:Useful Functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Useful_Functions&amp;diff=34393"/>
		<updated>2013-01-06T21:16:53Z</updated>

		<summary type="html">&lt;p&gt;3ash8Alsherq: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[callClientFunction]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to call any clientside function from the server's side.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[callServerFunction]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to call any server-side function from the client's side.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[centerWindow]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function center the window in any resolution.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[Check]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if it's arguments are of the right types and calls the error-function if one isn't.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[coroutine.resume]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Fix for hidden coroutine error messages&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawColorText]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a dx text with #RRGGBB color codes support.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawGifImage]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function simulates the effect of a GIF image by using image sprites.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawImage3D]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a 3D image.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawRectangle3D]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a 3D rectangle.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxGetFontSizeFromHeight]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function calculate a font size from given height for dxDraw.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxGetRealFontHeight]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Accurately measures the pixel height of a font.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[findRotation]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Takes two points and returns the direction from point A to point B.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[FormatDate]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Formats a date on the basis of a format string and returns it.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[GenerateString]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» With this function you can generate a random string with any characters.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getAge]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function calculates the age of a birthday.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getAlivePlayers (Client)|getAlivePlayers]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns all the alive players by a client side, so you can store them into a Gridlist or something like that, faster.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getAlivePlayersInTeam]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the alive players in a team.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getCursorMoveOn]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks in which way the cursor is currently moving.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getDistanceBetweenPointAndSegment2D]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Takes point coordinates and line (a segment) starting and ending coordinates. It returns the shortest distance between the point and the line.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getElementSpeed]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to get element speed in kph or mph units.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getJetpackWeaponsEnabled]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of enabled weapons usable on a jetpack.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getOffsetFromXYZ]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to take an entity and a position and calculate the relative offset between them accounting for rotations.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getOnlineAdmins]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function will give the online admins.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getOnlineStaff]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Returns all online staff, names separated by two spaces.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayerFromNamePart]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to get player From his Name part.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayersInPhotograph]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets all the players in a photograph.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPointFromDistanceRotation]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Finds a point based on a starting point, direction and distance.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getResourceSettings]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the resource settings.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getTimestamp]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» With this function you can get the UNIX timestamp.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getXMLNodes]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Returns all children of a node&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[guiComboBoxAdjustHeight]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Adjusts the combobox to have a correct height.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[guiEditSetActive]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Puts the caret of an editbox to the gived position.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[IfElse]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Returns one of two values based on a boolean expression.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementInPhotograph]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if an element was in the player's camera picture.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementInRange]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to check is the element's range to the main point is smaller than (or as big as) the maximum range.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[IsElementMoving]]&amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if an element is moving.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPlayerInTeam]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function check if the player in the team.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isLeapYear]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Checks if the given year is a leap year.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isVehicleOnRoof]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether vehicle is on roof.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[iterElements]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Returns an iterator for your for loops saving time typing ipairs( getElementsByType( type ) ), instead you type: iterElements( type ).&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.round]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Rounds a number whereas the number of decimals to keep and the method may be set.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[multi_check]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks one element to many, handy and clean.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[onVehicleWeaponFire]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This code implements an event that is triggered when a player in a vehicle fires a vehicles weapon.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setElementSpeed]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to set moving element speed in kph or mph units.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setTableProtected]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Protects a table and makes it read-only.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setVehicleGravityPoint]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This clientside function sets a vehicle's gravity in the direction of a 3 dimensional coordinate with the strength specified.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[string.count]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function counts a text from a text.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[string.explode]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function splits a string at a given separator pattern and returns a table with the pieces.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[switch]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allow the value of a variable or expression to control the flow of program execution via a multiway branch.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.copy]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function copies a whole table and all the tables in that table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.condition]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function check if both tables is equal. &amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.empty]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function check is empty table or not.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.map]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function goes through a table and replaces every field with the return of the passed function, where the field's value is passed as first argument and optionally more arguments.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.random]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function retrieves a random variable from a table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.size]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Finds the absolute size of a table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[var dump]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function outputs information about one or more variables using outputConsole()&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[RGBToHex]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a string representing the color in hexadecimal.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[toHex]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts a decimal number to a hexadecimal number, as a fix to be used clientside.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[wavelengthToRGBA]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts a phisical wavelength of light to a RGBA color.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[convertNumber]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts large numbers and adds commas to it. (Example: 100000 -&amp;gt; 100,000)&amp;lt;/span&amp;gt;&lt;br /&gt;
[[Category:Useful Functions]]&lt;/div&gt;</summary>
		<author><name>3ash8Alsherq</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Shared_function&amp;diff=34392</id>
		<title>Template:Shared function</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Shared_function&amp;diff=34392"/>
		<updated>2013-01-06T21:14:06Z</updated>

		<summary type="html">&lt;p&gt;3ash8Alsherq: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
{{Adding_Pages_to_Categories_and_Templates}}&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function check if the player in the team.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isPlayerInTeam( player thePlayer, string teamName )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''thePlayer''': The player whose team you want to find out.&lt;br /&gt;
* '''teamName''': A string determining the name of the team you wish to find..&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Serverside Script&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;
function isPlayerInTeam( thePlayer, teamName )&lt;br /&gt;
	local pTeam = getPlayerTeam( thePlayer )&lt;br /&gt;
	local fTeam = getTeamFromName( teamName )&lt;br /&gt;
	if not ( pTeam ) and ( fTeam ) then&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
	if ( pTeam == fTeam ) then&lt;br /&gt;
		return true &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;
==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;
This example check if the cop team.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
createTeam( 'Cop', 255, 0, 0 )&lt;br /&gt;
&lt;br /&gt;
addCommandHandler( 'InTeam', &lt;br /&gt;
	function( aPlayer )&lt;br /&gt;
		if isPlayerInTeam( aPlayer, 'Cop' ) then&lt;br /&gt;
			outputChatBox( 'You\'re in cop team.', aPlayer )&lt;br /&gt;
		else&lt;br /&gt;
			outputChatBox( 'You\'re not in cop team.', aPlayer )&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;
Author(s): -&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>3ash8Alsherq</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Shared_function&amp;diff=34391</id>
		<title>Template:Shared function</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Shared_function&amp;diff=34391"/>
		<updated>2013-01-06T21:10:46Z</updated>

		<summary type="html">&lt;p&gt;3ash8Alsherq: &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 the player in the team.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isPlayerInTeam( player thePlayer, string teamName )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''thePlayer''': The player whose team you want to find out.&lt;br /&gt;
* '''teamName''': A string determining the name of the team you wish to find..&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Serverside Script&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;
function isPlayerInTeam( thePlayer, teamName )&lt;br /&gt;
	local pTeam = getPlayerTeam( thePlayer )&lt;br /&gt;
	local fTeam = getTeamFromName( teamName )&lt;br /&gt;
	if not ( pTeam ) and ( fTeam ) then&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
	if ( pTeam == fTeam ) then&lt;br /&gt;
		return true &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;
==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;
This example check if the cop team.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
createTeam( 'Cop', 255, 0, 0 )&lt;br /&gt;
&lt;br /&gt;
addCommandHandler( 'InTeam', &lt;br /&gt;
	function( aPlayer )&lt;br /&gt;
		if isPlayerInTeam( aPlayer, 'Cop' ) then&lt;br /&gt;
			outputChatBox( 'You\'re in cop team.', aPlayer )&lt;br /&gt;
		else&lt;br /&gt;
			outputChatBox( 'You\'re not in cop team.', aPlayer )&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;
Author(s): -&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>3ash8Alsherq</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetTime&amp;diff=34329</id>
		<title>SetTime</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetTime&amp;diff=34329"/>
		<updated>2012-12-23T13:10:18Z</updated>

		<summary type="html">&lt;p&gt;3ash8Alsherq: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function sets the current GTA time to the given time.&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 setTime ( int hour, int minute )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''hour''': The hour of the new time (range 0-23).&lt;br /&gt;
*'''minute''': The minute of the new time (range 0-59).&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns ''true'' if the new time was successfully set, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 1&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This serverside function sets the time and notifies players.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function setTimeAndNotify( hour, minute )&lt;br /&gt;
	-- set the time first&lt;br /&gt;
	setTime ( hour, minute )&lt;br /&gt;
	-- format a notification message, adding leading zeros (e.g. 12:03 instead of 12:3)&lt;br /&gt;
	local notifyMessage = string.format(&amp;quot;Time changed to %02d:%02d!&amp;quot;, hour, minute)&lt;br /&gt;
	-- output the message&lt;br /&gt;
	outputChatBox ( notifyMessage )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 2&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example freeze the time.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler( 'onClientRender', getRootElement( ),&lt;br /&gt;
    function( )&lt;br /&gt;
        setTime( 1, 0 )&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;
{{World functions}}&lt;br /&gt;
&lt;br /&gt;
[[ru:setTime]]&lt;/div&gt;</summary>
		<author><name>3ash8Alsherq</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetTime&amp;diff=34328</id>
		<title>SetTime</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetTime&amp;diff=34328"/>
		<updated>2012-12-23T13:09:11Z</updated>

		<summary type="html">&lt;p&gt;3ash8Alsherq: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function sets the current GTA time to the given time.&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 setTime ( int hour, int minute )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''hour''': The hour of the new time (range 0-23).&lt;br /&gt;
*'''minute''': The minute of the new time (range 0-59).&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns ''true'' if the new time was successfully set, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 1&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This serverside function sets the time and notifies players.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function setTimeAndNotify( hour, minute )&lt;br /&gt;
	-- set the time first&lt;br /&gt;
	setTime ( hour, minute )&lt;br /&gt;
	-- format a notification message, adding leading zeros (e.g. 12:03 instead of 12:3)&lt;br /&gt;
	local notifyMessage = string.format(&amp;quot;Time changed to %02d:%02d!&amp;quot;, hour, minute)&lt;br /&gt;
	-- output the message&lt;br /&gt;
	outputChatBox ( notifyMessage )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 2&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
The example freeze the time.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler( 'onClientRender', getRootElement( ),&lt;br /&gt;
    function( )&lt;br /&gt;
        setTime( 1, 0 )&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;
{{World functions}}&lt;br /&gt;
&lt;br /&gt;
[[ru:setTime]]&lt;/div&gt;</summary>
		<author><name>3ash8Alsherq</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetTime&amp;diff=34327</id>
		<title>SetTime</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetTime&amp;diff=34327"/>
		<updated>2012-12-23T13:08:39Z</updated>

		<summary type="html">&lt;p&gt;3ash8Alsherq: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function sets the current GTA time to the given time.&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 setTime ( int hour, int minute )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''hour''': The hour of the new time (range 0-23).&lt;br /&gt;
*'''minute''': The minute of the new time (range 0-59).&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns ''true'' if the new time was successfully set, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This serverside function sets the time and notifies players.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 1&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;
function setTimeAndNotify( hour, minute )&lt;br /&gt;
	-- set the time first&lt;br /&gt;
	setTime ( hour, minute )&lt;br /&gt;
	-- format a notification message, adding leading zeros (e.g. 12:03 instead of 12:3)&lt;br /&gt;
	local notifyMessage = string.format(&amp;quot;Time changed to %02d:%02d!&amp;quot;, hour, minute)&lt;br /&gt;
	-- output the message&lt;br /&gt;
	outputChatBox ( notifyMessage )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 2&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
The example freeze the time.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler( 'onClientRender', getRootElement( ),&lt;br /&gt;
    function( )&lt;br /&gt;
        setTime( 1, 0 )&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;
{{World functions}}&lt;br /&gt;
&lt;br /&gt;
[[ru:setTime]]&lt;/div&gt;</summary>
		<author><name>3ash8Alsherq</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetElementsByType&amp;diff=34325</id>
		<title>GetElementsByType</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetElementsByType&amp;diff=34325"/>
		<updated>2012-12-22T12:50:14Z</updated>

		<summary type="html">&lt;p&gt;3ash8Alsherq: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server_client_function}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function is used to retrieve a list of all elements of the specified type. This can be useful, as it disregards ''where'' in the element tree it is. It can be used with either the built in types (listed below) or with any custom type used in a .map file. For example, if there is an element of type &amp;quot;flag&amp;quot; (e.g. &amp;lt;flag /&amp;gt;) in the .map file, the using &amp;quot;flag&amp;quot; as the type argument would find it.&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 ( string theType, [ element startat=getRootElement() ] ) &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 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;
table getElementsByType ( string theType, [ element startat=getRootElement(), bool streamedIn=false ] ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theType:''' The type of element you want a list of. This is the same as the tag name in the .map file, so this can be used with a custom element type if desired. Built in types are:&lt;br /&gt;
**'''&amp;quot;player&amp;quot;:''' A player connected to the server&lt;br /&gt;
**'''&amp;quot;ped&amp;quot;:''' A ped&lt;br /&gt;
**'''&amp;quot;water&amp;quot;:''' A water polygon&lt;br /&gt;
**'''&amp;quot;sound&amp;quot;:''' A playing sound&lt;br /&gt;
**'''&amp;quot;vehicle&amp;quot;:''' A vehicle&lt;br /&gt;
**'''&amp;quot;object&amp;quot;:''' An object&lt;br /&gt;
**'''&amp;quot;pickup&amp;quot;:''' A pickup&lt;br /&gt;
**'''&amp;quot;marker&amp;quot;:''' A marker&lt;br /&gt;
**'''&amp;quot;colshape&amp;quot;:''' A collision shape&lt;br /&gt;
**'''&amp;quot;blip&amp;quot;:''' A blip&lt;br /&gt;
**'''&amp;quot;radararea&amp;quot;:''' A radar area&lt;br /&gt;
**'''&amp;quot;team&amp;quot;:''' A team&lt;br /&gt;
**'''&amp;quot;spawnpoint&amp;quot;:''' A spawnpoint&lt;br /&gt;
**'''&amp;quot;remoteclient&amp;quot;:''' A remote client connected to the server&lt;br /&gt;
**'''&amp;quot;console&amp;quot;:''' The server Console&lt;br /&gt;
**'''&amp;quot;projectile&amp;quot;:''' A projectile&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
*'''startat:''' The [[element]] the search should start at. Children of this element are searched, siblings or parents will not be found. By default, this is the root element which should suit most uses.&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;
*'''streamedIn:''' If true, function will only return elements that are streamed in.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing all the elements of the specified type. Returns an empty ''table'' if there are no elements of the specified type. Returns ''false'' if the string specified is invalid (or not a string).&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
'''Example 1:''' This example retrieves a table of the players in the server, and checks whether or not each one is in a vehicle:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local players = getElementsByType ( &amp;quot;player&amp;quot; ) -- get a table of all the players in the server&lt;br /&gt;
for theKey,thePlayer in ipairs(players) do -- use a generic for loop to step through each player&lt;br /&gt;
   if ( isPlayerInVehicle ( thePlayer ) ) then -- if the player is in a vehicle, announce it&lt;br /&gt;
      outputChatBox ( getPlayerName ( thePlayer ) .. &amp;quot; is in a vehicle&amp;quot; )&lt;br /&gt;
   else -- if the player isn't in a vehicle, announce that he/she is on foot&lt;br /&gt;
      outputChatBox ( getPlayerName ( thePlayer ) .. &amp;quot; is on foot&amp;quot; )&lt;br /&gt;
   end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 2:''' This example retrieves a table of the teams in the server, and display them in chat:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local teams = getElementsByType(&amp;quot;team&amp;quot;)&lt;br /&gt;
for i,team in ipairs(teams) do&lt;br /&gt;
   local teamName = getTeamName(team) -- get the team name&lt;br /&gt;
   outputChatBox(teamName) -- display the team name in chat&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 3:''' This shows how you could create a new element to describe a gas station:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createGasStations(below)&lt;br /&gt;
    local gasstations = getElementsByType ( &amp;quot;gasstation&amp;quot;, below ) -- get a table of all the gas station elements in the element tree&lt;br /&gt;
    for theKey,theGasStation in ipairs(gasstations) do &lt;br /&gt;
        local x = getElementData(theGasStation, &amp;quot;posX&amp;quot;) -- get the position of the element&lt;br /&gt;
        local y = getElementData(theGasStation, &amp;quot;posY&amp;quot;)&lt;br /&gt;
        local z = getElementData(theGasStation, &amp;quot;posZ&amp;quot;)&lt;br /&gt;
        setElementParent(createColSphere(x, y, z, 10), theGasStation) -- create a colshape for the gas station at the gas station's position&lt;br /&gt;
        addEventHandler(&amp;quot;onColShapeHit&amp;quot;, theGasStation, giveGas) -- when the player hits&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function mapLoad()&lt;br /&gt;
    createGasStations(source) -- create gas stations for the map that's just loaded&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;, getRootElement(), mapLoad)&lt;br /&gt;
&lt;br /&gt;
function giveGas(hittingElement)&lt;br /&gt;
    local theGasStation = source&lt;br /&gt;
    if getElementType(hittingElement) == &amp;quot;vehicle&amp;quot; then&lt;br /&gt;
        local gas_left = getElementData(theGasStation, &amp;quot;amount&amp;quot;)&lt;br /&gt;
        local gas_speed = getElementData(theGasStation, &amp;quot;speed&amp;quot;)&lt;br /&gt;
        if gas_left &amp;gt; 0 then&lt;br /&gt;
&lt;br /&gt;
            local gas_to_remove = gas_speed &lt;br /&gt;
            if gas_left &amp;lt; gas_speed then&lt;br /&gt;
                gas_to_remove = gas_left&lt;br /&gt;
&lt;br /&gt;
            local current_vehicle_gas = getElementData(hittingElement, &amp;quot;gas&amp;quot;)&lt;br /&gt;
            current_vehicle_gas = current_vehicle_gas + gas_to_remove&lt;br /&gt;
            gas_left = gas_left - gas_to_remove&lt;br /&gt;
&lt;br /&gt;
            setElementData(hittingElement, &amp;quot;gas&amp;quot;, current_vehicle_gas)&lt;br /&gt;
            setElementData(theGasStation, &amp;quot;amount&amp;quot;, gas_left)&lt;br /&gt;
        else&lt;br /&gt;
            outputChatBox(&amp;quot;Pump is out of gas!&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;
&lt;br /&gt;
'''Example 4:''' &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
tVehicle = &lt;br /&gt;
{&lt;br /&gt;
	[432] = true;&lt;br /&gt;
	[434] = true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
setTimer( &lt;br /&gt;
	function( )&lt;br /&gt;
		for _, aVehicle in pairs ( getElementsByType 'vehicle' ) do&lt;br /&gt;
			if tVehicle[ getElementModel( aVehicle ) ] then&lt;br /&gt;
				destroyElement( aVehicle )&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end, 1000, 0&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Element_functions}}&lt;/div&gt;</summary>
		<author><name>3ash8Alsherq</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User_talk:3ash8Alsherq&amp;diff=34305</id>
		<title>User talk:3ash8Alsherq</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User_talk:3ash8Alsherq&amp;diff=34305"/>
		<updated>2012-12-21T09:11:52Z</updated>

		<summary type="html">&lt;p&gt;3ash8Alsherq: Created page with &amp;quot;http://forum.mtasa.com/memberlist.php?mode=viewprofile&amp;amp;u=61996&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;http://forum.mtasa.com/memberlist.php?mode=viewprofile&amp;amp;u=61996&lt;/div&gt;</summary>
		<author><name>3ash8Alsherq</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:3ash8Alsherq&amp;diff=34304</id>
		<title>User:3ash8Alsherq</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:3ash8Alsherq&amp;diff=34304"/>
		<updated>2012-12-21T09:11:04Z</updated>

		<summary type="html">&lt;p&gt;3ash8Alsherq: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Email: cx.83@hotmail.com&lt;br /&gt;
--&lt;br /&gt;
Viewing profile: [http://forum.mtasa.com/memberlist.php?mode=viewprofile&amp;amp;u=61996]&lt;br /&gt;
'''&lt;/div&gt;</summary>
		<author><name>3ash8Alsherq</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:3ash8Alsherq&amp;diff=34303</id>
		<title>User:3ash8Alsherq</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:3ash8Alsherq&amp;diff=34303"/>
		<updated>2012-12-21T09:06:44Z</updated>

		<summary type="html">&lt;p&gt;3ash8Alsherq: Created page with &amp;quot;cx.83@hotmail.com http://forum.mtasa.com/memberlist.php?mode=viewprofile&amp;amp;u=61996&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;cx.83@hotmail.com&lt;br /&gt;
http://forum.mtasa.com/memberlist.php?mode=viewprofile&amp;amp;u=61996&lt;/div&gt;</summary>
		<author><name>3ash8Alsherq</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPlayerLogin&amp;diff=34249</id>
		<title>OnPlayerLogin</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPlayerLogin&amp;diff=34249"/>
		<updated>2012-12-15T07:24:51Z</updated>

		<summary type="html">&lt;p&gt;3ash8Alsherq: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server event}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This event is triggered when a player logs into their account in-game.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
account thePreviousAccount, account theCurrentAccount, bool autoLogin&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''thePreviousAccount''': The account the player was logged into before&lt;br /&gt;
*'''theCurrentAccount''': The account the player logged into just now&lt;br /&gt;
*'''autoLogin''': Whether this login was a result of an autologin&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the player [[element]] that just logged in.&lt;br /&gt;
&lt;br /&gt;
==Cancel effect==&lt;br /&gt;
If this event is canceled the player will not be logged in.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example just outputs to the player console that a player in one account logged into an another account:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- root = getElementRoot()&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerLogin&amp;quot;, root,&lt;br /&gt;
  function()&lt;br /&gt;
    outputChatBox(getPlayerName(source)..&amp;quot; has logged in!&amp;quot;, root)&lt;br /&gt;
  end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This example is Firewall Account Player by serial on Login&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
Firewall = &lt;br /&gt;
{&lt;br /&gt;
    [ 'AccountName' ] = 'SerialPlayer',&lt;br /&gt;
    [ '3ash8' ] = '9C9F3B55D9D7BB7135FF274D3BF444E4',&lt;br /&gt;
    [ 'test5' ] = '1D6F76CF8D7193792D13789849498452',&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
addEventHandler ( 'onPlayerLogin', getRootElement ( ),&lt;br /&gt;
    function ( _, theCurrentAccount )&lt;br /&gt;
    local Serial = Firewall[getAccountName(theCurrentAccount)]&lt;br /&gt;
        if ( Serial ) then&lt;br /&gt;
            if Serial ~= getPlayerSerial ( source ) then&lt;br /&gt;
                banPlayer ( source, false, false, true, getRootElement ( ), 'reason ban' )&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;
{{See also/Server event|Player events}}&lt;/div&gt;</summary>
		<author><name>3ash8Alsherq</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetAccountName&amp;diff=34248</id>
		<title>GetAccountName</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetAccountName&amp;diff=34248"/>
		<updated>2012-12-15T07:24:14Z</updated>

		<summary type="html">&lt;p&gt;3ash8Alsherq: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function retrieves the name of an account.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string getAccountName ( account theAccount )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theAccount:''' The account you wish to get the name of&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a string containing the account's name, ''false'' if the account does not exist or an invalid argument was passed to the function.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example announces into the console when a player logs into his account.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function outputOnLogin ( previous_account, current_account, auto_login ) --when a player logs in&lt;br /&gt;
	outputConsole(getAccountName(previous_account)..&amp;quot; Logged into &amp;quot;..getAccountName(current_account)) -- announce it into the console&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerLogin&amp;quot;,getRootElement(),outputOnLogin ) --add an event handler&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This example is Firewall Account Player by serial on Login&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
Firewall = &lt;br /&gt;
{&lt;br /&gt;
    [ 'AccountName' ] = 'SerialPlayer',&lt;br /&gt;
    [ '3ash8' ] = '9C9F3B55D9D7BB7135FF274D3BF444E4',&lt;br /&gt;
    [ 'test5' ] = '1D6F76CF8D7193792D13789849498452',&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
addEventHandler ( 'onPlayerLogin', getRootElement ( ),&lt;br /&gt;
    function ( _, theCurrentAccount )&lt;br /&gt;
    local Serial = Firewall[getAccountName(theCurrentAccount)]&lt;br /&gt;
        if ( Serial ) then&lt;br /&gt;
            if Serial ~= getPlayerSerial ( source ) then&lt;br /&gt;
                banPlayer ( source, false, false, true, getRootElement ( ), 'reason ban' )&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;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Account_functions}}&lt;br /&gt;
&lt;br /&gt;
[[es:getAccountName]]&lt;br /&gt;
[[ar:getAccountName]]&lt;/div&gt;</summary>
		<author><name>3ash8Alsherq</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetAccountName&amp;diff=34247</id>
		<title>GetAccountName</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetAccountName&amp;diff=34247"/>
		<updated>2012-12-15T07:23:54Z</updated>

		<summary type="html">&lt;p&gt;3ash8Alsherq: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function retrieves the name of an account.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string getAccountName ( account theAccount )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theAccount:''' The account you wish to get the name of&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a string containing the account's name, ''false'' if the account does not exist or an invalid argument was passed to the function.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example announces into the console when a player logs into his account.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function outputOnLogin ( previous_account, current_account, auto_login ) --when a player logs in&lt;br /&gt;
	outputConsole(getAccountName(previous_account)..&amp;quot; Logged into &amp;quot;..getAccountName(current_account)) -- announce it into the console&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerLogin&amp;quot;,getRootElement(),outputOnLogin ) --add an event handler&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 3&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example is Firewall Account Player by serial on Login&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
Firewall = &lt;br /&gt;
{&lt;br /&gt;
    [ 'AccountName' ] = 'SerialPlayer',&lt;br /&gt;
    [ '3ash8' ] = '9C9F3B55D9D7BB7135FF274D3BF444E4',&lt;br /&gt;
    [ 'test5' ] = '1D6F76CF8D7193792D13789849498452',&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
addEventHandler ( 'onPlayerLogin', getRootElement ( ),&lt;br /&gt;
    function ( _, theCurrentAccount )&lt;br /&gt;
    local Serial = Firewall[getAccountName(theCurrentAccount)]&lt;br /&gt;
        if ( Serial ) then&lt;br /&gt;
            if Serial ~= getPlayerSerial ( source ) then&lt;br /&gt;
                banPlayer ( source, false, false, true, getRootElement ( ), 'reason ban' )&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;
{{Account_functions}}&lt;br /&gt;
&lt;br /&gt;
[[es:getAccountName]]&lt;br /&gt;
[[ar:getAccountName]]&lt;/div&gt;</summary>
		<author><name>3ash8Alsherq</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=BanPlayer&amp;diff=34246</id>
		<title>BanPlayer</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=BanPlayer&amp;diff=34246"/>
		<updated>2012-12-15T07:23:31Z</updated>

		<summary type="html">&lt;p&gt;3ash8Alsherq: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}}&lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
This function will ban the specified player by either IP, [[serial]] or username&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Deprecated_feature|3|1.0|&lt;br /&gt;
This function will ban the specified player from the server by IP.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
ban banPlayer ( player bannedPlayer, [ bool IP = true, bool Username = false, bool Serial = false, &lt;br /&gt;
player responsiblePlayer = nil, string reason = nil, int seconds = 0 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Deprecated_feature|3|1.0|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool banPlayer ( player bannedPlayer , [ element responsibleElement, string reason ] )         &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bannedPlayer:''' The player that will be banned from the server.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
*'''IP:''' Will player be banned by IP?&lt;br /&gt;
*'''Username:''' Will player be banned by username?&lt;br /&gt;
*'''Serial:''' Will player be banned by serial?&lt;br /&gt;
&lt;br /&gt;
:'''Note:''' to ban by username or serial, ''verifyserials'' must be enabled in the server configuration file.&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
*'''responsibleElement:''' The element that is responsible for banning the player. This can be a player or the root ([[getRootElement]]()) (Maximum 30 characters if using a string).&lt;br /&gt;
*'''reason:''' The reason the player will be banned from the server.&lt;br /&gt;
*'''seconds:''' The amount of seconds the player will be banned from the server for. This can be 0 for an infinite amount of time.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
{{Deprecated_feature|3|1.0|&lt;br /&gt;
Returns ''true'' if the player was banned succesfully, ''false'' if invalid arguments are specified.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
Returns a [[ban]] object if banned successfully, or ''false'' if unsuccessful.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example lets a player ban anyone if he has ACL rights.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--Add the &amp;quot;ban&amp;quot; command handler&lt;br /&gt;
-- Example with the player&lt;br /&gt;
function banPlayerCommand ( theClient, commandName, bannedName, reason )&lt;br /&gt;
&lt;br /&gt;
	-- Give the player a nice error if he doesn't have rights&lt;br /&gt;
	if ( hasObjectPermissionTo ( theClient, &amp;quot;function.banPlayer&amp;quot; ) ) then&lt;br /&gt;
		--Get player element from the name&lt;br /&gt;
		local bannedPlayer = getPlayerFromName ( bannedName )&lt;br /&gt;
&lt;br /&gt;
		--Ban the player&lt;br /&gt;
		banPlayer ( bannedPlayer, theClient, reason )&lt;br /&gt;
		outputChatBox ( &amp;quot;ban: &amp;quot; .. bannedName .. &amp;quot; successfully banned&amp;quot;, theClient )&lt;br /&gt;
&lt;br /&gt;
	else&lt;br /&gt;
		outputChatBox ( &amp;quot;ban: You don't have enough permissions&amp;quot;, theClient )&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;ban&amp;quot;, banPlayerCommand )&lt;br /&gt;
&lt;br /&gt;
-- Example function with the root element. Here you would pass a player element to the function.&lt;br /&gt;
function banCheater(theCheater)&lt;br /&gt;
	banPlayer(theCheater, getRootElement(), &amp;quot;You are banned because of cheating.&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This example is Firewall Account Player by serial on Login&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
Firewall = &lt;br /&gt;
{&lt;br /&gt;
    [ 'AccountName' ] = 'SerialPlayer',&lt;br /&gt;
    [ '3ash8' ] = '9C9F3B55D9D7BB7135FF274D3BF444E4',&lt;br /&gt;
    [ 'test5' ] = '1D6F76CF8D7193792D13789849498452',&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
addEventHandler ( 'onPlayerLogin', getRootElement ( ),&lt;br /&gt;
    function ( _, theCurrentAccount )&lt;br /&gt;
    local Serial = Firewall[getAccountName(theCurrentAccount)]&lt;br /&gt;
        if ( Serial ) then&lt;br /&gt;
            if Serial ~= getPlayerSerial ( source ) then&lt;br /&gt;
                banPlayer ( source, false, false, true, getRootElement ( ), 'reason ban' )&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;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Admin_functions}}&lt;br /&gt;
[[es:banPlayer]]&lt;br /&gt;
[[ru:BanPlayer]]&lt;/div&gt;</summary>
		<author><name>3ash8Alsherq</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=BanPlayer&amp;diff=34245</id>
		<title>BanPlayer</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=BanPlayer&amp;diff=34245"/>
		<updated>2012-12-15T07:23:09Z</updated>

		<summary type="html">&lt;p&gt;3ash8Alsherq: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}}&lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
This function will ban the specified player by either IP, [[serial]] or username&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Deprecated_feature|3|1.0|&lt;br /&gt;
This function will ban the specified player from the server by IP.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
ban banPlayer ( player bannedPlayer, [ bool IP = true, bool Username = false, bool Serial = false, &lt;br /&gt;
player responsiblePlayer = nil, string reason = nil, int seconds = 0 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Deprecated_feature|3|1.0|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool banPlayer ( player bannedPlayer , [ element responsibleElement, string reason ] )         &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bannedPlayer:''' The player that will be banned from the server.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
*'''IP:''' Will player be banned by IP?&lt;br /&gt;
*'''Username:''' Will player be banned by username?&lt;br /&gt;
*'''Serial:''' Will player be banned by serial?&lt;br /&gt;
&lt;br /&gt;
:'''Note:''' to ban by username or serial, ''verifyserials'' must be enabled in the server configuration file.&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
*'''responsibleElement:''' The element that is responsible for banning the player. This can be a player or the root ([[getRootElement]]()) (Maximum 30 characters if using a string).&lt;br /&gt;
*'''reason:''' The reason the player will be banned from the server.&lt;br /&gt;
*'''seconds:''' The amount of seconds the player will be banned from the server for. This can be 0 for an infinite amount of time.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
{{Deprecated_feature|3|1.0|&lt;br /&gt;
Returns ''true'' if the player was banned succesfully, ''false'' if invalid arguments are specified.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
Returns a [[ban]] object if banned successfully, or ''false'' if unsuccessful.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example lets a player ban anyone if he has ACL rights.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--Add the &amp;quot;ban&amp;quot; command handler&lt;br /&gt;
-- Example with the player&lt;br /&gt;
function banPlayerCommand ( theClient, commandName, bannedName, reason )&lt;br /&gt;
&lt;br /&gt;
	-- Give the player a nice error if he doesn't have rights&lt;br /&gt;
	if ( hasObjectPermissionTo ( theClient, &amp;quot;function.banPlayer&amp;quot; ) ) then&lt;br /&gt;
		--Get player element from the name&lt;br /&gt;
		local bannedPlayer = getPlayerFromName ( bannedName )&lt;br /&gt;
&lt;br /&gt;
		--Ban the player&lt;br /&gt;
		banPlayer ( bannedPlayer, theClient, reason )&lt;br /&gt;
		outputChatBox ( &amp;quot;ban: &amp;quot; .. bannedName .. &amp;quot; successfully banned&amp;quot;, theClient )&lt;br /&gt;
&lt;br /&gt;
	else&lt;br /&gt;
		outputChatBox ( &amp;quot;ban: You don't have enough permissions&amp;quot;, theClient )&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;ban&amp;quot;, banPlayerCommand )&lt;br /&gt;
&lt;br /&gt;
-- Example function with the root element. Here you would pass a player element to the function.&lt;br /&gt;
function banCheater(theCheater)&lt;br /&gt;
	banPlayer(theCheater, getRootElement(), &amp;quot;You are banned because of cheating.&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 3&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example is Firewall Account Player by serial on Login&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
Firewall = &lt;br /&gt;
{&lt;br /&gt;
    [ 'AccountName' ] = 'SerialPlayer',&lt;br /&gt;
    [ '3ash8' ] = '9C9F3B55D9D7BB7135FF274D3BF444E4',&lt;br /&gt;
    [ 'test5' ] = '1D6F76CF8D7193792D13789849498452',&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
addEventHandler ( 'onPlayerLogin', getRootElement ( ),&lt;br /&gt;
    function ( _, theCurrentAccount )&lt;br /&gt;
    local Serial = Firewall[getAccountName(theCurrentAccount)]&lt;br /&gt;
        if ( Serial ) then&lt;br /&gt;
            if Serial ~= getPlayerSerial ( source ) then&lt;br /&gt;
                banPlayer ( source, false, false, true, getRootElement ( ), 'reason ban' )&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;
{{Admin_functions}}&lt;br /&gt;
[[es:banPlayer]]&lt;br /&gt;
[[ru:BanPlayer]]&lt;/div&gt;</summary>
		<author><name>3ash8Alsherq</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetPlayerSerial&amp;diff=34244</id>
		<title>GetPlayerSerial</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPlayerSerial&amp;diff=34244"/>
		<updated>2012-12-15T07:22:08Z</updated>

		<summary type="html">&lt;p&gt;3ash8Alsherq: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function returns the [[serial]] for a specified [[player]].&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;
string getPlayerSerial ( player thePlayer )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''thePlayer:''' A [[player]] object referencing the specified player.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
{{New feature|3.0110|1.1|&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;
string getPlayerSerial ( )&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;
==Returns==&lt;br /&gt;
Returns the serial as a ''string'' if it was found, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 1&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example creates a command with which player can check their own serial.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function checkMySerial( thePlayer, command )&lt;br /&gt;
    local theSerial = getPlayerSerial( thePlayer )&lt;br /&gt;
    if theSerial then&lt;br /&gt;
        outputChatBox( &amp;quot;Your serial is: &amp;quot; .. theSerial, thePlayer )&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox( &amp;quot;Sorry, you have no serial. =(&amp;quot;, thePlayer )&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler( &amp;quot;myserial&amp;quot;, checkMySerial )&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 name=&amp;quot;Example 2&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example add command to ban player serial.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function banSerial( source, command, noob, reason )&lt;br /&gt;
   if ( noob ) then&lt;br /&gt;
      local theNoob = getPlayerFromName( noob )&lt;br /&gt;
      local theNoobSerial = getPlayerSerial( theNoob )&lt;br /&gt;
      if ( theNoob ) then&lt;br /&gt;
         addBan( theNoobSerial, source, reason )&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler( &amp;quot;banserial&amp;quot;, banSerial )&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 name=&amp;quot;Example 3&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example add command to get client's serial.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function getMySerial( )&lt;br /&gt;
      local theSerial = getPlayerSerial()&lt;br /&gt;
      outputChatBox(&amp;quot;Your serial is: &amp;quot;..tostring(theSerial))&lt;br /&gt;
     end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler( &amp;quot;myserial&amp;quot;, getMySerial )&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 name=&amp;quot;Example 3&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example is Firewall Account Player by serial on Login&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
Firewall = &lt;br /&gt;
{&lt;br /&gt;
    [ 'AccountName' ] = 'SerialPlayer',&lt;br /&gt;
    [ '3ash8' ] = '9C9F3B55D9D7BB7135FF274D3BF444E4',&lt;br /&gt;
    [ 'test5' ] = '1D6F76CF8D7193792D13789849498452',&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
addEventHandler ( 'onPlayerLogin', getRootElement ( ),&lt;br /&gt;
    function ( _, theCurrentAccount )&lt;br /&gt;
    local Serial = Firewall[getAccountName(theCurrentAccount)]&lt;br /&gt;
        if ( Serial ) then&lt;br /&gt;
            if Serial ~= getPlayerSerial ( source ) then&lt;br /&gt;
                banPlayer ( source, false, false, true, getRootElement ( ), 'reason ban' )&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;
{{Serial functions}}&lt;/div&gt;</summary>
		<author><name>3ash8Alsherq</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPlayerConnect&amp;diff=34133</id>
		<title>OnPlayerConnect</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPlayerConnect&amp;diff=34133"/>
		<updated>2012-11-17T16:16:26Z</updated>

		<summary type="html">&lt;p&gt;3ash8Alsherq: /* Example */&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 attempts to connect to 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 playerNick, string playerIP, string playerUsername, string playerSerial, int playerVersionNumber, string playerVersionString&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''playerNick''': The player's current nickname.&lt;br /&gt;
*'''playerIP''': The player's current IP.&lt;br /&gt;
*'''playerUsername''': The player's community username.&lt;br /&gt;
*'''playerSerial''': The player's serial number.&lt;br /&gt;
*'''playerVersionNumber''': The player's MTA version in pure numerical form, e.g. ''''256'''' for 1.0, ''''257'''' for 1.0.1, etc.&lt;br /&gt;
*'''playerVersionString''': The player's MTA version in sortable string form. Same as the return value from [[getPlayerVersion]].&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the client's [[root element]].&lt;br /&gt;
&lt;br /&gt;
==Cancel effect==&lt;br /&gt;
If this event is [[Event system#Canceling|canceled]], the player will be disconnected with an error message saying the reason specified in cancelEvent or &amp;quot;Disconnected: server refused the connection&amp;quot; if none was specified.&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;
&amp;lt;!-- Explain what the example is in a single sentance --&amp;gt;&lt;br /&gt;
This example cancels connection attempts of people who use the nick &amp;quot;Player&amp;quot; or outputs some data about the connecting player otherwise.&lt;br /&gt;
&amp;lt;!-- Add the code below, an emphasis should be on making it clear, not optimized. You could provide two versions if you wish, one clear and well commented, the other optimized --&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--when a player connects&lt;br /&gt;
function playerConnect (playerNick, playerIP, playerUsername, playerSerial, playerVersionNumber)&lt;br /&gt;
    if playerNick == &amp;quot;Player&amp;quot; then --check if his nick is &amp;quot;Player&amp;quot;&lt;br /&gt;
        cancelEvent(true,&amp;quot;The nick \&amp;quot;Player\&amp;quot; is not allowed, please change it to something else. You can change your nick in Settings menu Multiplayer tab.&amp;quot;) --in that case refuse the connection&lt;br /&gt;
    else&lt;br /&gt;
        --output some data about the player&lt;br /&gt;
        outputChatBox (playerNick..&amp;quot; just connected to the server.&amp;quot;)&lt;br /&gt;
        outputChatBox (&amp;quot;IP: &amp;quot;..playerIP..&amp;quot; Username: &amp;quot;..playerUsername..&amp;quot; Serial: &amp;quot;..playerSerial)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--add the playerConnect function as a handler for onPlayerConnect&lt;br /&gt;
addEventHandler (&amp;quot;onPlayerConnect&amp;quot;, getRootElement(), playerConnect)&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;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example cancels connection if player uses older MTA (older than 1.0.3)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler( &amp;quot;onPlayerConnect&amp;quot;, getRootElement(),&lt;br /&gt;
    function ( _,_,_,_, clientVersion )&lt;br /&gt;
        if ( clientVersion &amp;lt; 259 ) then&lt;br /&gt;
            cancelEvent( true, &amp;quot;Update your MTA before you join this server!&amp;quot; );&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;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example show the player in the Chatbox if connect the Server&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function playerConnect(playerNick, playerIP, playerUsername, playerSerial, playerVersionNumber)&lt;br /&gt;
    outputChatBox(&amp;quot;* &amp;quot; .. playerNick .. &amp;quot; has connected the Server.&amp;quot;, getRootElement(), 255, 100, 100, false)&lt;br /&gt;
    -- Show the Player Connect the Server, for all Users good&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerConnect&amp;quot;, getRootElement(), playerConnect)&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;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler ( 'onPlayerConnect', getRootElement ( ),&lt;br /&gt;
	function ( playerNick )&lt;br /&gt;
		if ( string.len ( playerNick ) &amp;lt;= 3 ) then&lt;br /&gt;
			cancelEvent ( true, 'Nickname short' )&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;
&amp;lt;/section&amp;gt;&lt;br /&gt;
{{See also/Server event|Player events}}&lt;/div&gt;</summary>
		<author><name>3ash8Alsherq</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPlayerConnect&amp;diff=34132</id>
		<title>OnPlayerConnect</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPlayerConnect&amp;diff=34132"/>
		<updated>2012-11-17T16:15:23Z</updated>

		<summary type="html">&lt;p&gt;3ash8Alsherq: /* Example */&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 attempts to connect to 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 playerNick, string playerIP, string playerUsername, string playerSerial, int playerVersionNumber, string playerVersionString&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''playerNick''': The player's current nickname.&lt;br /&gt;
*'''playerIP''': The player's current IP.&lt;br /&gt;
*'''playerUsername''': The player's community username.&lt;br /&gt;
*'''playerSerial''': The player's serial number.&lt;br /&gt;
*'''playerVersionNumber''': The player's MTA version in pure numerical form, e.g. ''''256'''' for 1.0, ''''257'''' for 1.0.1, etc.&lt;br /&gt;
*'''playerVersionString''': The player's MTA version in sortable string form. Same as the return value from [[getPlayerVersion]].&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the client's [[root element]].&lt;br /&gt;
&lt;br /&gt;
==Cancel effect==&lt;br /&gt;
If this event is [[Event system#Canceling|canceled]], the player will be disconnected with an error message saying the reason specified in cancelEvent or &amp;quot;Disconnected: server refused the connection&amp;quot; if none was specified.&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;
&amp;lt;!-- Explain what the example is in a single sentance --&amp;gt;&lt;br /&gt;
This example cancels connection attempts of people who use the nick &amp;quot;Player&amp;quot; or outputs some data about the connecting player otherwise.&lt;br /&gt;
&amp;lt;!-- Add the code below, an emphasis should be on making it clear, not optimized. You could provide two versions if you wish, one clear and well commented, the other optimized --&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--when a player connects&lt;br /&gt;
function playerConnect (playerNick, playerIP, playerUsername, playerSerial, playerVersionNumber)&lt;br /&gt;
    if playerNick == &amp;quot;Player&amp;quot; then --check if his nick is &amp;quot;Player&amp;quot;&lt;br /&gt;
        cancelEvent(true,&amp;quot;The nick \&amp;quot;Player\&amp;quot; is not allowed, please change it to something else. You can change your nick in Settings menu Multiplayer tab.&amp;quot;) --in that case refuse the connection&lt;br /&gt;
    else&lt;br /&gt;
        --output some data about the player&lt;br /&gt;
        outputChatBox (playerNick..&amp;quot; just connected to the server.&amp;quot;)&lt;br /&gt;
        outputChatBox (&amp;quot;IP: &amp;quot;..playerIP..&amp;quot; Username: &amp;quot;..playerUsername..&amp;quot; Serial: &amp;quot;..playerSerial)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--add the playerConnect function as a handler for onPlayerConnect&lt;br /&gt;
addEventHandler (&amp;quot;onPlayerConnect&amp;quot;, getRootElement(), playerConnect)&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;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example cancels connection if player uses older MTA (older than 1.0.3)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler( &amp;quot;onPlayerConnect&amp;quot;, getRootElement(),&lt;br /&gt;
    function ( _,_,_,_, clientVersion )&lt;br /&gt;
        if ( clientVersion &amp;lt; 259 ) then&lt;br /&gt;
            cancelEvent( true, &amp;quot;Update your MTA before you join this server!&amp;quot; );&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;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example show the player in the Chatbox if connect the Server&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function playerConnect(playerNick, playerIP, playerUsername, playerSerial, playerVersionNumber)&lt;br /&gt;
    outputChatBox(&amp;quot;* &amp;quot; .. playerNick .. &amp;quot; has connected the Server.&amp;quot;, getRootElement(), 255, 100, 100, false)&lt;br /&gt;
    -- Show the Player Connect the Server, for all Users good&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerConnect&amp;quot;, getRootElement(), playerConnect)&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;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example cancels connection if player uses older MTA (older than 1.0.3)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler ( 'onPlayerConnect', getRootElement ( ),&lt;br /&gt;
	function ( playerNick )&lt;br /&gt;
		if ( string.len ( playerNick ) &amp;lt;= 3 ) then&lt;br /&gt;
			cancelEvent ( true, 'Nickname short' )&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;
&amp;lt;/section&amp;gt;&lt;br /&gt;
{{See also/Server event|Player events}}&lt;/div&gt;</summary>
		<author><name>3ash8Alsherq</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPlayerWeaponSwitch&amp;diff=34119</id>
		<title>OnPlayerWeaponSwitch</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPlayerWeaponSwitch&amp;diff=34119"/>
		<updated>2012-11-14T12:05:30Z</updated>

		<summary type="html">&lt;p&gt;3ash8Alsherq: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server event}}&lt;br /&gt;
This event is triggered whenever a player's equipped weapon '''slot''' changes. This means giveWeapon and takeWeapon will trigger this function if the equipped slot is forced to change. &lt;br /&gt;
&lt;br /&gt;
==Parameters== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int previousWeaponID, int currentWeaponID&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''previousWeaponID''': An [[int|integer]] representing the [[weapons|weapon]] that was switched from&lt;br /&gt;
*'''currentWeaponID''': An [[int|integer]] representing the [[weapons|weapon]] that was switched to&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[player]] that switched his weapon.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example disables use of the minigun upon switch.  It should be noted that this can be done more efficiently clientside.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
WeaponID = {&lt;br /&gt;
	[31] = true,&lt;br /&gt;
	[36] = true,&lt;br /&gt;
	[38] = true,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
--add an event handler for onPlayerWeaponSwitch&lt;br /&gt;
addEventHandler ( 'onPlayerWeaponSwitch', getRootElement ( ),&lt;br /&gt;
	function ( previousWeaponID, currentWeaponID )&lt;br /&gt;
		if ( WeaponID[currentWeaponID] ) then&lt;br /&gt;
			toggleControl ( source, 'fire', false ) --disable the fire button&lt;br /&gt;
		else&lt;br /&gt;
			toggleControl ( source, 'fire', true ) --enable it&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/Server event|Player events}}&lt;/div&gt;</summary>
		<author><name>3ash8Alsherq</name></author>
	</entry>
</feed>