<?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=Gravestone</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=Gravestone"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Gravestone"/>
	<updated>2026-04-24T00:30:16Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawRectangle&amp;diff=49722</id>
		<title>DxDrawRectangle</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawRectangle&amp;diff=49722"/>
		<updated>2016-10-29T15:53:49Z</updated>

		<summary type="html">&lt;p&gt;Gravestone: Typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}} &lt;br /&gt;
This function draws a 2D rectangle across the screen - rendered for '''one''' frame. This should be used in conjunction with [[onClientRender]] in order to display continuously. &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 dxDrawRectangle ( float startX, float startY, float width, float height [, int color = white, bool postGUI = false, bool subPixelPositioning = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
* '''startX:''' An float representing the '''absolute''' origin X position of the rectangle, represented by pixels on the screen.&lt;br /&gt;
* '''startY:''' An float representing the '''absolute''' origin Y position of the rectangle, represented by pixels on the screen.&lt;br /&gt;
* '''width:''' An float representing the width of the rectangle, drawn in a ''right'' direction from the origin.&lt;br /&gt;
* '''height:''' An float representing the height of the rectangle, drawn in a ''downwards'' direction from the origin.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''color:''' the hex color of the rectangle, produced using [[tocolor]] or 0xAARRGGBB (AA = alpha, RR = red, GG = green, BB = blue).&lt;br /&gt;
* '''postGUI:''' A bool representing whether the line should be drawn on top of or behind any ingame GUI.&lt;br /&gt;
{{New feature/item|9.06931|1.4.0|6931|&lt;br /&gt;
*'''subPixelPositioning:''' A bool representing whether the rectangle can be positioned sub-pixel-ly.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns true if the operation was successful, false otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Example of MOTD (message of the day), made using DxDrawText, -Line and -Rectangle.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local x,y = guiGetScreenSize()  -- Get players resolution.&lt;br /&gt;
local playerName = getPlayerName ( localPlayer )  -- Get players name.&lt;br /&gt;
local MOTDText = &amp;quot;Welcome to our server, this is a test MOTD script for MTA's Wiki.&amp;quot;  -- Example of MOTD message.&lt;br /&gt;
&lt;br /&gt;
function drawStuff()&lt;br /&gt;
	dxDrawRectangle ( x/3.8, y/3.8, x/2.02, y/2, tocolor ( 0, 0, 0, 150 ) ) -- Create our black transparent MOTD background Rectangle.&lt;br /&gt;
	dxDrawText ( &amp;quot;Welcome &amp;quot; .. playerName, x/3.5, y/3.6, x, y, tocolor ( 255, 255, 255, 255 ), 1, &amp;quot;bankgothic&amp;quot; ) -- Create Welcome title.&lt;br /&gt;
        dxDrawText ( &amp;quot;Welcome &amp;quot; .. playerName, x/3.48, y/3.58, x, y, tocolor ( 0, 0, 0, 255 ), 1, &amp;quot;bankgothic&amp;quot; ) -- Create Welcome title shadow.&lt;br /&gt;
	dxDrawLine ( x/3.6, y/3.3, x/1.35, y/3.3, tocolor ( 255, 255, 255, 255 ), 2 ) -- Create underline for title.&lt;br /&gt;
	dxDrawLine ( x/3.59, y/3.275, x/1.348, y/3.275, tocolor ( 0, 0, 0, 255 ), 2 ) -- Create underline shadow.&lt;br /&gt;
	dxDrawText ( MOTDText, x/3.6, y/3, x, y, tocolor ( 255, 255, 255, 255 ), 1, &amp;quot;clear&amp;quot; ) -- Create MOTD text.&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientRender&amp;quot;, root, drawStuff)  -- Keep everything visible with onClientRender.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.4.0-9.06931|Added subPixelPositioning argument}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;/div&gt;</summary>
		<author><name>Gravestone</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPlayerChangeNick&amp;diff=49588</id>
		<title>OnPlayerChangeNick</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPlayerChangeNick&amp;diff=49588"/>
		<updated>2016-10-22T11:44:38Z</updated>

		<summary type="html">&lt;p&gt;Gravestone: /* 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 changes his nickname.&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 oldNick, string newNick, bool changedByUser&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''oldNick:''' the nickname the player had before.&lt;br /&gt;
*'''newNick:''' the new nickname of the player.&lt;br /&gt;
{{New items|3.0160|1.5.3|&lt;br /&gt;
*'''changedByUser:''' whether the name was changed using [[setPlayerName]] or by the user&lt;br /&gt;
|9765}}&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The source of this event is the player that changed his nick&lt;br /&gt;
&lt;br /&gt;
==Cancel effect==&lt;br /&gt;
Cancelling this event depends on how it is called, if it is called by the scripting event then it is NOT cancelable. If it is called from the /nick command it IS cancelable. If this event is cancelled and can be cancelled then the name will not change.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server 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 nickChangeHandler(oldNick, newNick)&lt;br /&gt;
    -- check if there's account with newNick as username&lt;br /&gt;
    if getAccount(newNick) then&lt;br /&gt;
        outputChatBox(&amp;quot;Sorry, there already exists an account with your new nickname as username.&amp;quot;, source, 0, 255, 0)&lt;br /&gt;
        outputChatBox(&amp;quot;Please choose another one.&amp;quot;, source, 0, 255, 0)&lt;br /&gt;
        -- cancel the event to prevent the nick from being changed&lt;br /&gt;
        cancelEvent()&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
-- add an event handler&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerChangeNick&amp;quot;, getRootElement(), nickChangeHandler)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{New items|3.0160|1.5.3|&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server Example 2&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function checks if the nickname of a player was changed by a script, if so, a message is shown in the server logs.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function wasNickChangedByUser(oldNick, newNick, changedByUser)&lt;br /&gt;
	if (changedByUser == false) then -- check if the nickname was not changed by the user&lt;br /&gt;
		outputServerLog(&amp;quot;Player &amp;quot;..oldNick..&amp;quot;'s name was changed to &amp;quot;..newNick..&amp;quot; by a script&amp;quot;) -- output to the server's logs&lt;br /&gt;
	end	&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerChangeNick&amp;quot;, getRootElement(), wasNickChangedByUser) -- add an event handler&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/section&amp;gt;|9765}}&lt;br /&gt;
&lt;br /&gt;
==Issues==&lt;br /&gt;
{{Issues|&lt;br /&gt;
{{Issue|7362|onPlayerChangeNick triggered when nick doesn't changed}}&lt;br /&gt;
{{GH_Issue|52|Add 'manuallyChanged' parameter to onPlayerChangeNick}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Player events}}&lt;/div&gt;</summary>
		<author><name>Gravestone</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPlayerChangeNick&amp;diff=49587</id>
		<title>OnPlayerChangeNick</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPlayerChangeNick&amp;diff=49587"/>
		<updated>2016-10-22T11:44:05Z</updated>

		<summary type="html">&lt;p&gt;Gravestone: /* 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 changes his nickname.&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 oldNick, string newNick, bool changedByUser&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''oldNick:''' the nickname the player had before.&lt;br /&gt;
*'''newNick:''' the new nickname of the player.&lt;br /&gt;
{{New items|3.0160|1.5.3|&lt;br /&gt;
*'''changedByUser:''' whether the name was changed using [[setPlayerName]] or by the user&lt;br /&gt;
|9765}}&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The source of this event is the player that changed his nick&lt;br /&gt;
&lt;br /&gt;
==Cancel effect==&lt;br /&gt;
Cancelling this event depends on how it is called, if it is called by the scripting event then it is NOT cancelable. If it is called from the /nick command it IS cancelable. If this event is cancelled and can be cancelled then the name will not change.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server 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 nickChangeHandler(oldNick, newNick)&lt;br /&gt;
    -- check if there's account with newNick as username&lt;br /&gt;
    if getAccount(newNick) then&lt;br /&gt;
        outputChatBox(&amp;quot;Sorry, there already exists an account with your new nickname as username.&amp;quot;, source, 0, 255, 0)&lt;br /&gt;
        outputChatBox(&amp;quot;Please choose another one.&amp;quot;, source, 0, 255, 0)&lt;br /&gt;
        -- cancel the event to prevent the nick from being changed&lt;br /&gt;
        cancelEvent()&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
-- add an event handler&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerChangeNick&amp;quot;, getRootElement(), nickChangeHandler)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/section&amp;gt;&lt;br /&gt;
{{New items|3.0160|1.5.3|&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server Example 2&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function checks if the nickname of a player was changed by a script, if so, a message is shown in the server logs.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function wasNickChangedByUser(oldNick, newNick, changedByUser)&lt;br /&gt;
	if (changedByUser == false) then -- check if the nickname was not changed by the user&lt;br /&gt;
		outputServerLog(&amp;quot;Player &amp;quot;..oldNick..&amp;quot;'s name was changed to &amp;quot;..newNick..&amp;quot; by a script&amp;quot;) -- output to the server's logs&lt;br /&gt;
	end	&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerChangeNick&amp;quot;, getRootElement(), wasNickChangedByUser) -- add an event handler&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/section&amp;gt;|9765}}&lt;br /&gt;
&lt;br /&gt;
==Issues==&lt;br /&gt;
{{Issues|&lt;br /&gt;
{{Issue|7362|onPlayerChangeNick triggered when nick doesn't changed}}&lt;br /&gt;
{{GH_Issue|52|Add 'manuallyChanged' parameter to onPlayerChangeNick}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Player events}}&lt;/div&gt;</summary>
		<author><name>Gravestone</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPlayerChangeNick&amp;diff=49586</id>
		<title>OnPlayerChangeNick</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPlayerChangeNick&amp;diff=49586"/>
		<updated>2016-10-22T11:43:11Z</updated>

		<summary type="html">&lt;p&gt;Gravestone: /* 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 changes his nickname.&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 oldNick, string newNick, bool changedByUser&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''oldNick:''' the nickname the player had before.&lt;br /&gt;
*'''newNick:''' the new nickname of the player.&lt;br /&gt;
{{New items|3.0160|1.5.3|&lt;br /&gt;
*'''changedByUser:''' whether the name was changed using [[setPlayerName]] or by the user&lt;br /&gt;
|9765}}&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The source of this event is the player that changed his nick&lt;br /&gt;
&lt;br /&gt;
==Cancel effect==&lt;br /&gt;
Cancelling this event depends on how it is called, if it is called by the scripting event then it is NOT cancelable. If it is called from the /nick command it IS cancelable. If this event is cancelled and can be cancelled then the name will not change.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server 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 nickChangeHandler(oldNick, newNick)&lt;br /&gt;
    -- check if there's account with newNick as username&lt;br /&gt;
    if getAccount(newNick) then&lt;br /&gt;
        outputChatBox(&amp;quot;Sorry, there already exists an account with your new nickname as username.&amp;quot;, source, 0, 255, 0)&lt;br /&gt;
        outputChatBox(&amp;quot;Please choose another one.&amp;quot;, source, 0, 255, 0)&lt;br /&gt;
        -- cancel the event to prevent the nick from being changed&lt;br /&gt;
        cancelEvent()&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
-- add an event handler&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerChangeNick&amp;quot;, getRootElement(), nickChangeHandler)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;{{New items|3.0160|1.5.3|9765}}&amp;lt;/section&amp;gt;&lt;br /&gt;
This function checks if the nickname of a player was changed by a script, if so, a message is shown in the server logs.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server Example 2&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 wasNickChangedByUser(oldNick, newNick, changedByUser)&lt;br /&gt;
	if (changedByUser == false) then -- check if the nickname was not changed by the user&lt;br /&gt;
		outputServerLog(&amp;quot;Player &amp;quot;..oldNick..&amp;quot;'s name was changed to &amp;quot;..newNick..&amp;quot; by a script&amp;quot;) -- output to the server's logs&lt;br /&gt;
	end	&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerChangeNick&amp;quot;, getRootElement(), wasNickChangedByUser) -- add an event handler&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Issues==&lt;br /&gt;
{{Issues|&lt;br /&gt;
{{Issue|7362|onPlayerChangeNick triggered when nick doesn't changed}}&lt;br /&gt;
{{GH_Issue|52|Add 'manuallyChanged' parameter to onPlayerChangeNick}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Player events}}&lt;/div&gt;</summary>
		<author><name>Gravestone</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPlayerChangeNick&amp;diff=49585</id>
		<title>OnPlayerChangeNick</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPlayerChangeNick&amp;diff=49585"/>
		<updated>2016-10-22T11:42:38Z</updated>

		<summary type="html">&lt;p&gt;Gravestone: /* 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 changes his nickname.&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 oldNick, string newNick, bool changedByUser&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''oldNick:''' the nickname the player had before.&lt;br /&gt;
*'''newNick:''' the new nickname of the player.&lt;br /&gt;
{{New items|3.0160|1.5.3|&lt;br /&gt;
*'''changedByUser:''' whether the name was changed using [[setPlayerName]] or by the user&lt;br /&gt;
|9765}}&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The source of this event is the player that changed his nick&lt;br /&gt;
&lt;br /&gt;
==Cancel effect==&lt;br /&gt;
Cancelling this event depends on how it is called, if it is called by the scripting event then it is NOT cancelable. If it is called from the /nick command it IS cancelable. If this event is cancelled and can be cancelled then the name will not change.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server 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 nickChangeHandler(oldNick, newNick)&lt;br /&gt;
    -- check if there's account with newNick as username&lt;br /&gt;
    if getAccount(newNick) then&lt;br /&gt;
        outputChatBox(&amp;quot;Sorry, there already exists an account with your new nickname as username.&amp;quot;, source, 0, 255, 0)&lt;br /&gt;
        outputChatBox(&amp;quot;Please choose another one.&amp;quot;, source, 0, 255, 0)&lt;br /&gt;
        -- cancel the event to prevent the nick from being changed&lt;br /&gt;
        cancelEvent()&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
-- add an event handler&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerChangeNick&amp;quot;, getRootElement(), nickChangeHandler)&lt;br /&gt;
{{New items|3.0160|1.5.3|9765}}&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/section&amp;gt;&lt;br /&gt;
This function checks if the nickname of a player was changed by a script, if so, a message is shown in the server logs.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server Example 2&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 wasNickChangedByUser(oldNick, newNick, changedByUser)&lt;br /&gt;
	if (changedByUser == false) then -- check if the nickname was not changed by the user&lt;br /&gt;
		outputServerLog(&amp;quot;Player &amp;quot;..oldNick..&amp;quot;'s name was changed to &amp;quot;..newNick..&amp;quot; by a script&amp;quot;) -- output to the server's logs&lt;br /&gt;
	end	&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerChangeNick&amp;quot;, getRootElement(), wasNickChangedByUser) -- add an event handler&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Issues==&lt;br /&gt;
{{Issues|&lt;br /&gt;
{{Issue|7362|onPlayerChangeNick triggered when nick doesn't changed}}&lt;br /&gt;
{{GH_Issue|52|Add 'manuallyChanged' parameter to onPlayerChangeNick}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Player events}}&lt;/div&gt;</summary>
		<author><name>Gravestone</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPlayerChangeNick&amp;diff=49584</id>
		<title>OnPlayerChangeNick</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPlayerChangeNick&amp;diff=49584"/>
		<updated>2016-10-22T11:41:46Z</updated>

		<summary type="html">&lt;p&gt;Gravestone: /* 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 changes his nickname.&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 oldNick, string newNick, bool changedByUser&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''oldNick:''' the nickname the player had before.&lt;br /&gt;
*'''newNick:''' the new nickname of the player.&lt;br /&gt;
{{New items|3.0160|1.5.3|&lt;br /&gt;
*'''changedByUser:''' whether the name was changed using [[setPlayerName]] or by the user&lt;br /&gt;
|9765}}&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The source of this event is the player that changed his nick&lt;br /&gt;
&lt;br /&gt;
==Cancel effect==&lt;br /&gt;
Cancelling this event depends on how it is called, if it is called by the scripting event then it is NOT cancelable. If it is called from the /nick command it IS cancelable. If this event is cancelled and can be cancelled then the name will not change.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server 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 nickChangeHandler(oldNick, newNick)&lt;br /&gt;
    -- check if there's account with newNick as username&lt;br /&gt;
    if getAccount(newNick) then&lt;br /&gt;
        outputChatBox(&amp;quot;Sorry, there already exists an account with your new nickname as username.&amp;quot;, source, 0, 255, 0)&lt;br /&gt;
        outputChatBox(&amp;quot;Please choose another one.&amp;quot;, source, 0, 255, 0)&lt;br /&gt;
        -- cancel the event to prevent the nick from being changed&lt;br /&gt;
        cancelEvent()&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
-- add an event handler&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerChangeNick&amp;quot;, getRootElement(), nickChangeHandler)&lt;br /&gt;
{{New items|3.0160|1.5.3|&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/section&amp;gt;&lt;br /&gt;
This function checks if the nickname of a player was changed by a script, if so, a message is shown in the server logs.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server Example 2&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 wasNickChangedByUser(oldNick, newNick, changedByUser)&lt;br /&gt;
	if (changedByUser == false) then -- check if the nickname was not changed by the user&lt;br /&gt;
		outputServerLog(&amp;quot;Player &amp;quot;..oldNick..&amp;quot;'s name was changed to &amp;quot;..newNick..&amp;quot; by a script&amp;quot;) -- output to the server's logs&lt;br /&gt;
	end	&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerChangeNick&amp;quot;, getRootElement(), wasNickChangedByUser) -- add an event handler&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/section&amp;gt;|9765}}&lt;br /&gt;
&lt;br /&gt;
==Issues==&lt;br /&gt;
{{Issues|&lt;br /&gt;
{{Issue|7362|onPlayerChangeNick triggered when nick doesn't changed}}&lt;br /&gt;
{{GH_Issue|52|Add 'manuallyChanged' parameter to onPlayerChangeNick}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Player events}}&lt;/div&gt;</summary>
		<author><name>Gravestone</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=FileGetPath&amp;diff=49583</id>
		<title>FileGetPath</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FileGetPath&amp;diff=49583"/>
		<updated>2016-10-22T10:25:43Z</updated>

		<summary type="html">&lt;p&gt;Gravestone: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
{{New feature/item|3.0160|1.6|7446|&lt;br /&gt;
This function retrieves the path of the given file.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string fileGetPath ( file theFile )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theFile:''' The file you want to get the path.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''string'' representing the file path, ''false'' if invalid file was provided.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server 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;
local newFile = fileCreate(&amp;quot;test.txt&amp;quot;)                -- attempt to create a new file&lt;br /&gt;
if (newFile) then                                       -- check if the creation succeeded&lt;br /&gt;
    local path = fileGetPath(newFile)&lt;br /&gt;
    outputChatBox(&amp;quot;New file created at: &amp;quot;..path, root, 0, 255, 0)&lt;br /&gt;
    fileClose(newFile)                                -- close the file once you're done with it&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{File functions}}&lt;/div&gt;</summary>
		<author><name>Gravestone</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=FileGetPath&amp;diff=49582</id>
		<title>FileGetPath</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FileGetPath&amp;diff=49582"/>
		<updated>2016-10-22T10:25:24Z</updated>

		<summary type="html">&lt;p&gt;Gravestone: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
{{New feature/item|3.0160|1.6|7446|&lt;br /&gt;
This function retrieves the path of the given file.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string fileGetPath ( file theFile )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theFile:''' The file you want to get the path.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''string'' representing the file path, ''false'' if invalid file was provided.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server 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;
local newFile = fileCreate(&amp;quot;test.txt&amp;quot;)                -- attempt to create a new file&lt;br /&gt;
if (newFile) then                                       -- check if the creation succeeded&lt;br /&gt;
    local path = fileGetPath(newFile)&lt;br /&gt;
    outputChatBox(&amp;quot;New file created at: &amp;quot;..path,root,0,255,0)&lt;br /&gt;
    fileClose(newFile)                                -- close the file once you're done with it&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{File functions}}&lt;/div&gt;</summary>
		<author><name>Gravestone</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=FileGetPath&amp;diff=49581</id>
		<title>FileGetPath</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FileGetPath&amp;diff=49581"/>
		<updated>2016-10-22T10:24:39Z</updated>

		<summary type="html">&lt;p&gt;Gravestone: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
{{New feature/item|3.0160|1.6|7446|&lt;br /&gt;
This function retrieves the path of the given file.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string fileGetPath ( file theFile )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theFile:''' The file you want to get the path.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''string'' representing the file path, ''false'' if invalid file was provided.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Shared 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;
local newFile = fileCreate(&amp;quot;test.txt&amp;quot;)                -- attempt to create a new file&lt;br /&gt;
if (newFile) then                                       -- check if the creation succeeded&lt;br /&gt;
    local path = fileGetPath(newFile)&lt;br /&gt;
    outputChatBox(&amp;quot;New file created at: &amp;quot;..path,root,0,255,0)&lt;br /&gt;
    fileClose(newFile)                                -- close the file once you're done with it&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{File functions}}&lt;/div&gt;</summary>
		<author><name>Gravestone</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=FileGetPath&amp;diff=49580</id>
		<title>FileGetPath</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FileGetPath&amp;diff=49580"/>
		<updated>2016-10-22T10:24:01Z</updated>

		<summary type="html">&lt;p&gt;Gravestone: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
{{New feature/item|3.0160|1.6|7446|&lt;br /&gt;
This function retrieves the path of the given file.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string fileGetPath ( file theFile )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theFile:''' The file you want to get the path.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''string'' representing the file path, ''false'' if invalid file was provided.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Shared example 1&amp;quot; class=&amp;quot;shared&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;
local newFile = fileCreate(&amp;quot;test.txt&amp;quot;)                -- attempt to create a new file&lt;br /&gt;
if (newFile) then                                       -- check if the creation succeeded&lt;br /&gt;
    local path = fileGetPath(newFile)&lt;br /&gt;
    outputChatBox(&amp;quot;New file created at: &amp;quot;..path,root,0,255,0)&lt;br /&gt;
    fileClose(newFile)                                -- close the file once you're done with it&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{File functions}}&lt;/div&gt;</summary>
		<author><name>Gravestone</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetAccount&amp;diff=49579</id>
		<title>GetAccount</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetAccount&amp;diff=49579"/>
		<updated>2016-10-22T10:01:51Z</updated>

		<summary type="html">&lt;p&gt;Gravestone: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function returns an [[account]] for a specific user. &lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
account getAccount ( string username, [ string password ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[Account]]||}}&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''username:''' The username of the account you want to retrieve&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
*'''password:''' The password for the account. If this argument is not specified, you can get the account whatever password it is, otherwise the password must match the account's.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns an [[account]] or ''false'' if an account matching the username specified (and password, if specified) could not be found.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server example 1&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function checks if the account mentioned exists in the internal.db database file.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler(&amp;quot;checkaccount&amp;quot;,&lt;br /&gt;
	function(player, cmd, account)&lt;br /&gt;
		if hasObjectPermissionTo(player, &amp;quot;function.banPlayer&amp;quot; ) then -- if the player typing /checkaccount command has permission to banPlayer&lt;br /&gt;
			if account and account ~= &amp;quot;&amp;quot; then -- if the account name was mentioned&lt;br /&gt;
				if getAccount(account) then -- if the account exists&lt;br /&gt;
					outputChatBox(&amp;quot;Account &amp;quot;..account..&amp;quot; exists in the database!&amp;quot;, player, 0, 255, 0)&lt;br /&gt;
				else -- if the account doesn't exist&lt;br /&gt;
					outputChatBox(&amp;quot;Account &amp;quot;..account..&amp;quot; does not exist in database&amp;quot;, player, 0, 255, 0)&lt;br /&gt;
				end&lt;br /&gt;
			else&lt;br /&gt;
			outputChatBox(&amp;quot;Syntax is /checkaccount [account name]&amp;quot;, player, 255, 0, 0)&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;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;
[[ar:getAccount]]&lt;br /&gt;
[[es:getAccount]]&lt;br /&gt;
[[pl:GetAccount]]&lt;br /&gt;
[[ru:getAccount]]&lt;/div&gt;</summary>
		<author><name>Gravestone</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetAccount&amp;diff=49578</id>
		<title>GetAccount</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetAccount&amp;diff=49578"/>
		<updated>2016-10-22T09:28:51Z</updated>

		<summary type="html">&lt;p&gt;Gravestone: /* Returns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function returns an [[account]] for a specific user. &lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
account getAccount ( string username, [ string password ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[Account]]||}}&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''username:''' The username of the account you want to retrieve&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
*'''password:''' The password for the account. If this argument is not specified, you can get the account whatever password it is, otherwise the password must match the account's.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns an [[account]] or ''false'' if an account matching the username specified (and password, if specified) could not be found.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;addEventHandler(&amp;quot;onPlayerJoin&amp;quot;,root,function()&lt;br /&gt;
    if getAccount(getPlayerName(source)) then&lt;br /&gt;
        outputChatBox(&amp;quot;Please Login!&amp;quot;,source)&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox(&amp;quot;Please Register!&amp;quot;,source)&lt;br /&gt;
    end&lt;br /&gt;
end)&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;
[[ar:getAccount]]&lt;br /&gt;
[[es:getAccount]]&lt;br /&gt;
[[pl:GetAccount]]&lt;br /&gt;
[[ru:getAccount]]&lt;/div&gt;</summary>
		<author><name>Gravestone</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetAccount&amp;diff=49577</id>
		<title>GetAccount</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetAccount&amp;diff=49577"/>
		<updated>2016-10-22T09:28:22Z</updated>

		<summary type="html">&lt;p&gt;Gravestone: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function returns an [[account]] for a specific user. &lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
account getAccount ( string username, [ string password ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[Account]]||}}&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''username:''' The username of the account you want to retrieve&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
*'''password:''' The password for the account. If this argument is not specified, you can get the account whatever password it is, otherwise the password must match the account's.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns an [[account]] or ''false'' if an account matching the username specified (and password, if specified) could not be found.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;addEventHandler(&amp;quot;onPlayerJoin&amp;quot;,root,function()&lt;br /&gt;
    if getAccount(getPlayerName(source)) then&lt;br /&gt;
        outputChatBox(&amp;quot;Please Login!&amp;quot;,source)&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox(&amp;quot;Please Register!&amp;quot;,source)&lt;br /&gt;
    end&lt;br /&gt;
end)&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;
[[ar:getAccount]]&lt;br /&gt;
[[es:getAccount]]&lt;br /&gt;
[[pl:GetAccount]]&lt;br /&gt;
[[ru:getAccount]]&lt;/div&gt;</summary>
		<author><name>Gravestone</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPlayerChangeNick&amp;diff=49576</id>
		<title>OnPlayerChangeNick</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPlayerChangeNick&amp;diff=49576"/>
		<updated>2016-10-22T09:26:56Z</updated>

		<summary type="html">&lt;p&gt;Gravestone: /* Parameters */&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 changes his nickname.&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 oldNick, string newNick, bool changedByUser&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''oldNick:''' the nickname the player had before.&lt;br /&gt;
*'''newNick:''' the new nickname of the player.&lt;br /&gt;
{{New items|3.0160|1.5.3|&lt;br /&gt;
*'''changedByUser:''' whether the name was changed using [[setPlayerName]] or by the user&lt;br /&gt;
|9765}}&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The source of this event is the player that changed his nick&lt;br /&gt;
&lt;br /&gt;
==Cancel effect==&lt;br /&gt;
Cancelling this event depends on how it is called, if it is called by the scripting event then it is NOT cancelable. If it is called from the /nick command it IS cancelable. If this event is cancelled and can be cancelled then the name will not change.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function nickChangeHandler(oldNick, newNick)&lt;br /&gt;
    -- check if there's account with newNick as username&lt;br /&gt;
    if getAccount(newNick) then&lt;br /&gt;
        outputChatBox(&amp;quot;Sorry, there already exists an account with your new nickname as username.&amp;quot;, source, 0, 255, 0)&lt;br /&gt;
        outputChatBox(&amp;quot;Please choose another one.&amp;quot;, source, 0, 255, 0)&lt;br /&gt;
        -- cancel the event to prevent the nick from being changed&lt;br /&gt;
        cancelEvent()&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
-- add an event handler&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerChangeNick&amp;quot;, getRootElement(), nickChangeHandler)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example displays a message to everyone every time player changed his nick&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function nickChangeHandler(oldNick, newNick)&lt;br /&gt;
outputChatBox(oldNick..&amp;quot; is now known as &amp;quot;..newNick, getRootElement(), 255, 100, 100) -- display the message&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerChangeNick&amp;quot;, getRootElement(), nickChangeHandler) -- add an event handler&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Issues==&lt;br /&gt;
{{Issues|&lt;br /&gt;
{{Issue|7362|onPlayerChangeNick triggered when nick doesn't changed}}&lt;br /&gt;
{{GH_Issue|52|Add 'manuallyChanged' parameter to onPlayerChangeNick}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Player events}}&lt;/div&gt;</summary>
		<author><name>Gravestone</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnClientGUIClick&amp;diff=49574</id>
		<title>OnClientGUIClick</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnClientGUIClick&amp;diff=49574"/>
		<updated>2016-10-22T08:39:23Z</updated>

		<summary type="html">&lt;p&gt;Gravestone: /* Source */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client event}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This event happens when any gui-element clicked&lt;br /&gt;
{{Note|The '''player''' who clicked the gui-element is always the [[localPlayer]].}}&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 button, string state, int absoluteX, int absoluteY&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''button:''' the name of the button which will be clicked , it can be ''left'', ''right'', ''middle''&lt;br /&gt;
*'''state:''' the state of the mouse button, will be ''down'' if the mouse button was pushed, or ''up'' if it was released.  '''Please note currently only the ''up'' state is supported.'''&lt;br /&gt;
*'''absoluteX:''' the X position of the mouse cursor, in pixels, measured from the left side of the screen.&lt;br /&gt;
*'''absoluteY:''' the Y position of the mouse cursor, in pixels, measured from the top of the screen.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the GUI element that was clicked.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' If the GUI Element attached to this event has a parent element, this event will be triggered once the parent element of the attached element is clicked too.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example creates an edit box alongside an &amp;quot;Output!&amp;quot; button. When the button is clicked with the left mouse button, it will output the message in the edit box into the chat box.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- When client's resource starts, create the GUI&lt;br /&gt;
function initGUI( )&lt;br /&gt;
    -- Create our button&lt;br /&gt;
    btnOutput = guiCreateButton( 0.7, 0.1, 0.2, 0.1, &amp;quot;Output!&amp;quot;, true )&lt;br /&gt;
&lt;br /&gt;
    -- And attach our button to the outputEditBox function&lt;br /&gt;
    addEventHandler ( &amp;quot;onClientGUIClick&amp;quot;, btnOutput, outputEditBox, false )&lt;br /&gt;
&lt;br /&gt;
    -- Create an edit box and define it as &amp;quot;editBox&amp;quot;.&lt;br /&gt;
    editBox = guiCreateEdit( 0.3, 0.1, 0.4, 0.1, &amp;quot;Type your message here!&amp;quot;, true )&lt;br /&gt;
    guiEditSetMaxLength ( editBox, 128 ) -- The max chatbox text length is 128, so force this&lt;br /&gt;
end&lt;br /&gt;
addEventHandler( &amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement( getThisResource( ) ), initGUI )&lt;br /&gt;
&lt;br /&gt;
-- Setup our function to output the message to the chatbox&lt;br /&gt;
function outputEditBox ( button )&lt;br /&gt;
    if button == &amp;quot;left&amp;quot; then&lt;br /&gt;
        local text = guiGetText ( editBox )-- Get the text from the edit box&lt;br /&gt;
        outputChatBox ( text ) -- Output that text&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[pl:onClientGUIClick]]&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
===GUI events===&lt;br /&gt;
{{GUI_events}}&lt;br /&gt;
===Client event functions===&lt;br /&gt;
{{Client_event_functions}}&lt;/div&gt;</summary>
		<author><name>Gravestone</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsElementWithinAColShape&amp;diff=49466</id>
		<title>IsElementWithinAColShape</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsElementWithinAColShape&amp;diff=49466"/>
		<updated>2016-10-10T02:47:09Z</updated>

		<summary type="html">&lt;p&gt;Gravestone: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle/&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function checks if the [[element]] is in a [[colshape]].&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;&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; colshape / bool isElementWithinAColShape ( element theElement ) &amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/section&amp;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;&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; colshape / bool isElementWithinAColShape ( [ element theElement ] ) &amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required/Optional Arguments===&lt;br /&gt;
* '''theElement''': The element you want to check. (If not entered in client-side function, local player will be checked instead.)&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[colshape]] the [[element]] is in else false if the element isn't in one or no arguments were passed.&lt;br /&gt;
&lt;br /&gt;
===Code===&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;function isElementWithinAColShape(element)&lt;br /&gt;
	if element or isElement(element)then&lt;br /&gt;
		for _,colshape in ipairs(getElementsByType(&amp;quot;colshape&amp;quot;))do&lt;br /&gt;
			if isElementWithinColShape(element,colshape) then&lt;br /&gt;
				return colshape&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	outputDebugString(&amp;quot;isElementWithinAColShape - Invalid arguments or element does not exist&amp;quot;,1)&lt;br /&gt;
	return false&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/section&amp;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;function isElementWithinAColShape(element)&lt;br /&gt;
	element = element or localPlayer or getLocalPlayer()&lt;br /&gt;
	if element or isElement(element)then&lt;br /&gt;
		for _,colshape in ipairs(getElementsByType(&amp;quot;colshape&amp;quot;))do&lt;br /&gt;
			if isElementWithinColShape(element,colshape) then&lt;br /&gt;
				return colshape&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	outputDebugString(&amp;quot;isElementWithinAColShape - Element does not exist&amp;quot;,1)&lt;br /&gt;
	return false&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/section&amp;gt;&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 code will destroy the colshape the player is currently in when he types the command '/deletecol'.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function deleteColShape(thePlayer, command)&lt;br /&gt;
	local colshape = isElementWithinAColShape(thePlayer)&lt;br /&gt;
	if colshape then -- if the player who entered the command is in a colshape&lt;br /&gt;
		outputChatBox(&amp;quot;The colshape you are in has been successfully deleted!&amp;quot;, thePlayer, 0, 255, 0)&lt;br /&gt;
		destroyElement(colshape) -- destroy the col shape he is in&lt;br /&gt;
	else&lt;br /&gt;
		outputChatBox(&amp;quot;You are currently not in a colshape&amp;quot;, thePlayer, 255, 0, 0) -- if he is not in the colshape&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;deletecol&amp;quot;, deleteColShape)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;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>Gravestone</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsElementWithinAColShape&amp;diff=49465</id>
		<title>IsElementWithinAColShape</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsElementWithinAColShape&amp;diff=49465"/>
		<updated>2016-10-10T02:46:31Z</updated>

		<summary type="html">&lt;p&gt;Gravestone: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle/&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function checks if the [[element]] is in a [[colshape]].&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;&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; colshape / bool isElementWithinAColShape ( element theElement ) &amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/section&amp;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;&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; colshape / bool isElementWithinAColShape ( [ element theElement ] ) &amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required/Optional Arguments===&lt;br /&gt;
* '''theElement''': The element you want to check. (If not entered in client-side function, local player will be checked instead.)&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[colshape]] the [[element]] is in else false if the element isn't in one or no arguments were passed.&lt;br /&gt;
&lt;br /&gt;
===Code===&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;function isElementWithinAColShape(element)&lt;br /&gt;
	if element or isElement(element)then&lt;br /&gt;
		for _,colshape in ipairs(getElementsByType(&amp;quot;colshape&amp;quot;))do&lt;br /&gt;
			if isElementWithinColShape(element,colshape) then&lt;br /&gt;
				return colshape&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	outputDebugString(&amp;quot;isElementWithinAColShape - Invalid arguments or element does not exist&amp;quot;,1)&lt;br /&gt;
	return false&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/section&amp;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;function isElementWithinAColShape(element)&lt;br /&gt;
	element = element or localPlayer or getLocalPlayer()&lt;br /&gt;
	if element or isElement(element)then&lt;br /&gt;
		for _,colshape in ipairs(getElementsByType(&amp;quot;colshape&amp;quot;))do&lt;br /&gt;
			if isElementWithinColShape(element,colshape) then&lt;br /&gt;
				return colshape&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	outputDebugString(&amp;quot;isElementWithinAColShape - Element does not exist&amp;quot;,1)&lt;br /&gt;
	return false&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/section&amp;gt;&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;&lt;br /&gt;
This code will destroy the colshape the player is currently in when he types the command '/deletecol'.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function deleteColShape(thePlayer, command)&lt;br /&gt;
	local colshape = isElementWithinAColShape(thePlayer)&lt;br /&gt;
	if colshape then -- if the player who entered the command is in a colshape&lt;br /&gt;
		outputChatBox(&amp;quot;The colshape you are in has been successfully deleted!&amp;quot;, thePlayer, 0, 255, 0)&lt;br /&gt;
		destroyElement(colshape) -- destroy the col shape he is in&lt;br /&gt;
	else&lt;br /&gt;
		outputChatBox(&amp;quot;You are currently not in a colshape&amp;quot;, thePlayer, 255, 0, 0) -- if he is not in the colshape&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;deletecol&amp;quot;, deleteColShape)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;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>Gravestone</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsPlayerMapVisible&amp;diff=49452</id>
		<title>IsPlayerMapVisible</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsPlayerMapVisible&amp;diff=49452"/>
		<updated>2016-10-09T14:36:00Z</updated>

		<summary type="html">&lt;p&gt;Gravestone: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{Needs_Example}}&lt;br /&gt;
This function checks if the local player has their map showing&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isPlayerMapVisible ()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the player has the map visible, ''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;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function checkMap()&lt;br /&gt;
	if isPlayerMapVisible() then -- check if the player has his map visible&lt;br /&gt;
		outputChatBox(&amp;quot;You are currently viewing your map!&amp;quot;, 255, 255, 0) -- output text if it's visible&lt;br /&gt;
	else&lt;br /&gt;
		outputChatBox(&amp;quot;Your map is not visible!&amp;quot;, 255, 255, 0) -- output text if it's not visible&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;map&amp;quot;, checkMap) -- add '/map' command to the check&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;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;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function showMap()&lt;br /&gt;
	if isPlayerMapVisible() then&lt;br /&gt;
		outputChatBox(&amp;quot;Radar closed&amp;quot;, 0, 255, 0)&lt;br /&gt;
		forcePlayerMap(false)&lt;br /&gt;
	else&lt;br /&gt;
		outputChatBox(&amp;quot;Viewing radar&amp;quot;, 0, 255, 0)&lt;br /&gt;
		forcePlayerMap(true)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;showmap&amp;quot;, showMap)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client player functions}}&lt;/div&gt;</summary>
		<author><name>Gravestone</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsPlayerMapVisible&amp;diff=49451</id>
		<title>IsPlayerMapVisible</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsPlayerMapVisible&amp;diff=49451"/>
		<updated>2016-10-09T14:34:56Z</updated>

		<summary type="html">&lt;p&gt;Gravestone: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{Needs_Example}}&lt;br /&gt;
This function checks if the local player has their map showing&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isPlayerMapVisible ()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the player has the map visible, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function checkMap()&lt;br /&gt;
	if isPlayerMapVisible() then -- check if the player has his map visible&lt;br /&gt;
		outputChatBox(&amp;quot;You are currently viewing your map!&amp;quot;, 255, 255, 0) -- output text if it's visible&lt;br /&gt;
	else&lt;br /&gt;
		outputChatBox(&amp;quot;Your map is not visible!&amp;quot;, 255, 255, 0) -- output text if it's not visible&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;map&amp;quot;, checkMap) -- add '/map' command to the check&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function showMap()&lt;br /&gt;
	if isPlayerMapVisible() then&lt;br /&gt;
		outputChatBox(&amp;quot;Radar closed&amp;quot;, 0, 255, 0)&lt;br /&gt;
		forcePlayerMap(false)&lt;br /&gt;
	else&lt;br /&gt;
		outputChatBox(&amp;quot;Viewing radar&amp;quot;, 0, 255, 0)&lt;br /&gt;
		forcePlayerMap(true)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;showmap&amp;quot;, showMap)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client player functions}}&lt;/div&gt;</summary>
		<author><name>Gravestone</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsPlayerMapVisible&amp;diff=49450</id>
		<title>IsPlayerMapVisible</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsPlayerMapVisible&amp;diff=49450"/>
		<updated>2016-10-09T14:33:47Z</updated>

		<summary type="html">&lt;p&gt;Gravestone: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{Needs_Example}}&lt;br /&gt;
This function checks if the local player has their map showing&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isPlayerMapVisible ()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the player has the map visible, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function checkMap()&lt;br /&gt;
	if isPlayerMapVisible() then -- check if the player has his map visible&lt;br /&gt;
		outputChatBox(&amp;quot;You are currently viewing your map!&amp;quot;, 255, 255, 0) -- output text if it's visible&lt;br /&gt;
	else&lt;br /&gt;
		outputChatBox(&amp;quot;Your map is not visible!&amp;quot;, 255, 255, 0) -- output text if it's not visible&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;map&amp;quot;, checkMap) -- add '/map' command to the check&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client player functions}}&lt;/div&gt;</summary>
		<author><name>Gravestone</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsTextInGridList&amp;diff=49439</id>
		<title>IsTextInGridList</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsTextInGridList&amp;diff=49439"/>
		<updated>2016-10-09T13:11:38Z</updated>

		<summary type="html">&lt;p&gt;Gravestone: /* Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle/&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
As the tile says, this function checks if some text exist or not in the GridList.&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isTextInGridList (element gridList,string text)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* '''gridList''': The grid list element.&lt;br /&gt;
* '''text''': The text that you are looking for.&lt;br /&gt;
&lt;br /&gt;
===Return===&lt;br /&gt;
Returns true if the text exist in the GridList, false if otherwise.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
    function isTextInGridList(gridlist, text)&lt;br /&gt;
      for i=0, guiGridListGetRowCount(gridlist)-1 do&lt;br /&gt;
	local t = guiGridListGetItemText(gridlist, i, 1)&lt;br /&gt;
	  if (t) then&lt;br /&gt;
	    if (t == text) then&lt;br /&gt;
	      return true&lt;br /&gt;
		end&lt;br /&gt;
	    end&lt;br /&gt;
	end&lt;br /&gt;
    return false&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;Example&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;
    addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, resourceRoot,&lt;br /&gt;
function ()&lt;br /&gt;
    playerList = guiCreateGridList(0.80, 0.10, 0.15, 0.60, true)&lt;br /&gt;
    local column = guiGridListAddColumn(playerList, &amp;quot;Player&amp;quot;, 0.85)&lt;br /&gt;
    if (column) then&lt;br /&gt;
        for id, players in ipairs(getElementsByType(&amp;quot;player&amp;quot;)) do&lt;br /&gt;
            local row = guiGridListAddRow(playerList)&lt;br /&gt;
            guiGridListSetItemText(playerList, row, column, getPlayerName(players), false, false)&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end)&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
function findText(cmd,text)&lt;br /&gt;
  if not tostring(text) then return end &lt;br /&gt;
    if isTextInGridList(playerList, tostring(text)) then&lt;br /&gt;
      outputChatBox(&amp;quot;Text exist!&amp;quot;,0,255,0) &lt;br /&gt;
   end &lt;br /&gt;
end &lt;br /&gt;
addCommandHandler(&amp;quot;check&amp;quot;,findText)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Author: Walid&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Gravestone</name></author>
	</entry>
</feed>