<?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=VWOer</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=VWOer"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/VWOer"/>
	<updated>2026-05-11T00:19:11Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CreatePickup&amp;diff=31943</id>
		<title>CreatePickup</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CreatePickup&amp;diff=31943"/>
		<updated>2012-07-20T08:45:31Z</updated>

		<summary type="html">&lt;p&gt;VWOer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function creates a pickup element, which is placed in the GTA world and can be picked up to retrieve a health, armour or a weapon. &lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
pickup createPickup ( float x, float y, float z, int theType, int amount/weapon/model, [ int respawnTime = 30000, int ammo = 50 ] )         &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
* '''x''': A floating point number representing the X coordinate on the map.&lt;br /&gt;
* '''y''': A floating point number representing the Y coordinate on the map.&lt;br /&gt;
* '''z''': A floating point number representing the Z coordinate on the map.&lt;br /&gt;
* '''theType''': This is an integer representing the type of pickup, representing the following types:&lt;br /&gt;
** '''0''': Health Pickup&lt;br /&gt;
** '''1''': Armour Pickup&lt;br /&gt;
** '''2''': Weapon Pickup&lt;br /&gt;
** '''3''': Custom Pickup&lt;br /&gt;
* '''amount''': This is an integer representing the amount of Health points or Armour points a pickup has.&lt;br /&gt;
'''OR'''&lt;br /&gt;
* '''weapon''': If the type is a Weapon pickup, then it represents the [[Weapon|weapon ID]] of the weapon pickup. When used with the weapon pickup type set, the ammo parameter must be filled in as well.&lt;br /&gt;
'''OR'''&lt;br /&gt;
* '''model''': If the pickup is a custom model, this is the model id to use. Many non-pickup models can be used, though some may cause crashes. The following is a list of models designed to be used as pickups.&lt;br /&gt;
** '''370:''' Jetpack&lt;br /&gt;
** '''1212:''' Money (Wad of Cash)&lt;br /&gt;
** '''1240:''' Health (heart)&lt;br /&gt;
** '''1242:''' Armour&lt;br /&gt;
** '''1272:''' House (blue)&lt;br /&gt;
** '''1273:''' House (green)&lt;br /&gt;
** '''1274:''' Money (dollar symbol)&lt;br /&gt;
** '''1277:''' Save (floppy disk)&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
* '''respawnTime''': How long before the pickup respawns in milliseconds&lt;br /&gt;
* '''ammo''': An integer representing the amount of ammo a pickup contains.  This is only valid when the pickup type is a Weapon Pickup, and must be entered.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns [[pickup]] [[element]] if the pickup was created succesfully, otherwise returns ''false''.&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 creates a pickup after a player dies so that he drops his weapon.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createDeathPickup ( totalammo, killer, killerweapon, bodypart ) --when a player dies&lt;br /&gt;
    x, y, z = getElementPosition ( source ) --get the position of the person who died and define it as x, y and z&lt;br /&gt;
    currentweapon = getPlayerWeapon ( source ) --get the current weapon of the dead person&lt;br /&gt;
    createPickup ( x, y, z, 2, currentweapon, 10000, totalammo )&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerWasted&amp;quot;, getRootElement(), createDeathPickup ) --add an event handler for onPlayerWasted&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;
&lt;br /&gt;
{{Pickup functions}}&lt;/div&gt;</summary>
		<author><name>VWOer</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetPedAmmoInClip&amp;diff=28433</id>
		<title>GetPedAmmoInClip</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPedAmmoInClip&amp;diff=28433"/>
		<updated>2011-11-22T16:20:18Z</updated>

		<summary type="html">&lt;p&gt;VWOer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function returns an integer that contains the ammo in a specified [[ped]]'s weapon. See [[weapon|Weapon Info]]&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int getPedAmmoInClip ( ped thePed [, int weaponSlot = current ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''thePed:''' The [[ped]] whose ammo you want to check.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''weaponSlot:''' an integer representing the weapon slot (set to the ped's currently selected slot if not specified).&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns an [[int]] containing the amount of ammo in the specified ped's currently selected or specified clip, or 0 if the ped specified is invalid.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example outputs the amount of ammo the specified player has in his current slot. For example: 'ammo someguy'.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function showAmmo( command, who )&lt;br /&gt;
	local targetPlayer = getPlayerFromName ( who )&lt;br /&gt;
	if ( thePlayer ) then&lt;br /&gt;
		local ammo = getPedAmmoInClip ( targetPlayer )&lt;br /&gt;
		outputChatBox ( who .. &amp;quot; has &amp;quot; .. ammo .. &amp;quot; ammo in his active clip&amp;quot; )&lt;br /&gt;
	else&lt;br /&gt;
		outputChatBox ( &amp;quot;Player '&amp;quot; .. who .. &amp;quot;' not found.&amp;quot; )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler( &amp;quot;ammo&amp;quot;, showAmmo )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_ped_functions}}&lt;/div&gt;</summary>
		<author><name>VWOer</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetBanSerial&amp;diff=28432</id>
		<title>GetBanSerial</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetBanSerial&amp;diff=28432"/>
		<updated>2011-11-22T16:20:06Z</updated>

		<summary type="html">&lt;p&gt;VWOer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function will return the [[serial]] of the specified [[ban]].&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 getBanSerial ( ban theBan )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theBan:''' The [[ban]] you want to retrieve the serial of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''string'' of the serial if everything was successful, ''false'' if invalid arguments are specified or if there was no serial specified for the [[ban]].&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example will show the user who banned a player the serial of that banned player.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function banPlayerCommand ( thisPlayer, commandName, bannedName, reason )&lt;br /&gt;
    if ( hasObjectPermissionTo ( thisPlayer, &amp;quot;function.banPlayer&amp;quot; ) ) then -- If the command user has the rights&lt;br /&gt;
        local bannedPlayer = getPlayerFromName ( bannedName ) -- Get the ID from the player who gets banned&lt;br /&gt;
        if getElementType ( bannedPlayer ) == &amp;quot;player&amp;quot; then -- If it's a player&lt;br /&gt;
            local theBan = banPlayer ( bannedPlayer, thisPlayer, reason ) -- Ban the player&lt;br /&gt;
            outputChatBox ( &amp;quot;ban: &amp;quot; .. bannedName .. &amp;quot; successfully banned&amp;quot;, thisPlayer ) -- Send the banner a succes message&lt;br /&gt;
            outputChatBox ( &amp;quot;At Serial: &amp;quot; ..getBanSerial ( theBan ), thisPlayer ) -- And send him the serial of the banned player&lt;br /&gt;
        end&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox ( &amp;quot;ban: You don't have enough permissions&amp;quot;, thisPlayer ) -- If the command user doesn't have the permissions&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;ban&amp;quot;, banPlayerCommand )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Admin functions}}&lt;br /&gt;
[[ru:getBanSerial]]&lt;/div&gt;</summary>
		<author><name>VWOer</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetPlayerName&amp;diff=28431</id>
		<title>SetPlayerName</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetPlayerName&amp;diff=28431"/>
		<updated>2011-11-22T16:19:58Z</updated>

		<summary type="html">&lt;p&gt;VWOer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server function}} &lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function changes the specified [[player]]'s name.&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 setPlayerName ( player thePlayer, string newName )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePlayer:''' the [[player]] that will have its name set.&lt;br /&gt;
*'''newName:''' the new name to set for the player.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the player name was changed succesfully, ''false'' if invalid arguments are specified.&lt;br /&gt;
&lt;br /&gt;
===Limits===&lt;br /&gt;
* Only ASCII characters between 33 and 126 are allowed (basic latin):  &lt;br /&gt;
    &amp;lt;nowiki&amp;gt;!&amp;quot;#$%&amp;amp;'()*+,-./0123456789:;&amp;lt;=&amp;gt;?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
* Minimal player name length is 1 character. &lt;br /&gt;
* Maximum player name length is 22 characters.&lt;br /&gt;
* Player names are case-insensitive. It is not possible to have two clients with same name but different character case.&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 adds a tag before a player's nickname via a /changetag command&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-- Define the function for this command (/changetag, as defined below)&lt;br /&gt;
-- source = the player that triggered this command&lt;br /&gt;
-- command = the command passed into the function (changetag)&lt;br /&gt;
-- thePlayer = the player that you wish to add a tag to&lt;br /&gt;
-- tag = the tag to add to the players nickname&lt;br /&gt;
function tagPlayer ( source, command, thePlayer, tag )&lt;br /&gt;
	-- Attempt to grab the element id for the player from the parsed name.&lt;br /&gt;
	local sPlayerElement = getPlayerFromName ( thePlayer )&lt;br /&gt;
	-- Check to see if the player were changing the tag for exists.&lt;br /&gt;
	if ( sPlayerElement ) then&lt;br /&gt;
		-- make sure that the element type of thePlayer is acctually pointing to a player element&lt;br /&gt;
		if getElementType ( sPlayerElement ) == &amp;quot;player&amp;quot; then&lt;br /&gt;
			-- we store the player's current name,&lt;br /&gt;
			local oldName = getPlayerName ( sPlayerElement )&lt;br /&gt;
			-- append the tag passed to this function before it&lt;br /&gt;
			local taggedName = tag .. oldName&lt;br /&gt;
			-- then set it as his new name&lt;br /&gt;
			setPlayerName ( sPlayerElement, taggedName )&lt;br /&gt;
			-- Tell the player who triggerd the command that the tag has been applied&lt;br /&gt;
			outputChatBox ( &amp;quot;Player &amp;quot; .. thePlayer .. &amp;quot;'s tag changed to &amp;quot; .. taggedName, source )&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		-- Tell the player who triggerd the command that the player could not be found&lt;br /&gt;
		outputChatBox ( &amp;quot;Unable to change player tag: Player &amp;quot; .. thePlayer .. &amp;quot; not found&amp;quot;, source )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
-- Add a command handler for either the console or / chat commands&lt;br /&gt;
-- Example: /changetag &amp;lt;playername&amp;gt; &amp;lt;tag&amp;gt;&lt;br /&gt;
addCommandHandler ( &amp;quot;changetag&amp;quot;, tagPlayer )&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;
{{Player functions}}&lt;br /&gt;
[[ru:setPlayerName]]&lt;/div&gt;</summary>
		<author><name>VWOer</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsPlayerNametagShowing&amp;diff=28430</id>
		<title>IsPlayerNametagShowing</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsPlayerNametagShowing&amp;diff=28430"/>
		<updated>2011-11-22T16:19:20Z</updated>

		<summary type="html">&lt;p&gt;VWOer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
{{Deprecated feature|3|1.0|Serverside only in DP2.x}}&lt;br /&gt;
&amp;lt;!-- Describe in plain english what this function does. Don't go into details, just give an overview --&amp;gt;&lt;br /&gt;
This function will allow you to determine if a player's name tag is currently showing.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;!-- NOTE: don't use 'special' names for variable names, e.g. you shouldn't be writing things like 'player player, vehicle vehicle', instead write something like 'player thePlayer, vehicle vehicleToGetInto'. This is less confusing and prevents the syntax highlighting being odd --&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool isPlayerNametagShowing ( player thePlayer )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
&amp;lt;!-- List each argument one per line. This should be the argument's name as in the argument list above, NOT the argument's data type --&amp;gt;&lt;br /&gt;
*'''thePlayer:''' The player whose current name tag condition you want to check&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
&amp;lt;!-- Make this descriptive. Explain what cases will return false. If you're unsure, add a tag to it so we can check --&amp;gt;&lt;br /&gt;
Returns ''true'' if the player's name tag is being shown, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;!-- Explain what the example is in a single sentance --&amp;gt;&lt;br /&gt;
This example toggles a player's nametag. If no playername is given, it toggles the nametag of the player who entered the command.&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;
function toggleNametag ( sourcePlayer, command, who )&lt;br /&gt;
	local tplayer = sourcePlayer                   -- by default, toggle the name tag of the player who issued the command&lt;br /&gt;
	if ( who ) then                                -- if there was a nick entered in the command&lt;br /&gt;
		tplayer = getPlayerFromName ( who )    -- search for the player&lt;br /&gt;
	else&lt;br /&gt;
		whoNick = getPlayerName(sourcePlayer)&lt;br /&gt;
	end&lt;br /&gt;
	if ( tplayer ~= false ) then                                -- if the player was found (or no playername was entered)&lt;br /&gt;
		if isPlayerNametagShowing ( tplayer ) then          -- if the nametag is shown&lt;br /&gt;
			setPlayerNametagShowing ( tplayer, false )  -- hide it&lt;br /&gt;
			outputChatBox ( who .. &amp;quot;'s nametag is now hidden&amp;quot;, sourcePlayer )  -- output a message to the player who entered the command&lt;br /&gt;
		else                                                -- if the nametag is not shown&lt;br /&gt;
			setPlayerNametagShowing ( tplayer, true )   -- show it&lt;br /&gt;
			outputChatBox ( who .. &amp;quot;'s nametag is now showing&amp;quot;, sourcePlayer ) -- output a message to the player who entered the command&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		outputChatBox ( &amp;quot;Player not found.&amp;quot;, sourcePlayer )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;toggleNametag&amp;quot;, toggleNametag )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc --&amp;gt;&lt;br /&gt;
{{Player_functions}}&lt;/div&gt;</summary>
		<author><name>VWOer</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsPlayerNametagShowing&amp;diff=28429</id>
		<title>IsPlayerNametagShowing</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsPlayerNametagShowing&amp;diff=28429"/>
		<updated>2011-11-22T16:19:10Z</updated>

		<summary type="html">&lt;p&gt;VWOer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
{{Deprecated feature|3|1.0|Serverside only in DP2.x}}&lt;br /&gt;
&amp;lt;!-- Describe in plain english what this function does. Don't go into details, just give an overview --&amp;gt;&lt;br /&gt;
This function will allow you to determine if a player's name tag is currently showing.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;!-- NOTE: don't use 'special' names for variable names, e.g. you shouldn't be writing things like 'player player, vehicle vehicle', instead write something like 'player thePlayer, vehicle vehicleToGetInto'. This is less confusing and prevents the syntax highlighting being odd --&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool isPlayerNametagShowing ( player thePlayer )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
&amp;lt;!-- List each argument one per line. This should be the argument's name as in the argument list above, NOT the argument's data type --&amp;gt;&lt;br /&gt;
*'''thePlayer:''' The player whose current name tag condition you want to check&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
&amp;lt;!-- Make this descriptive. Explain what cases will return false. If you're unsure, add a tag to it so we can check --&amp;gt;&lt;br /&gt;
Returns ''true'' if the player's name tag is being shown, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;!-- Explain what the example is in a single sentance --&amp;gt;&lt;br /&gt;
This example toggles a player's nametag. If no playername is given, it toggles the nametag of the player who entered the command.&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;
function toggleNametag ( sourcePlayer, command, who )&lt;br /&gt;
	local tplayer = sourcePlayer                   -- by default, toggle the name tag of the player who issued the command&lt;br /&gt;
	if ( who ) then                                -- if there was a nick entered in the command&lt;br /&gt;
		tplayer = getPlayerFromName ( who )    -- search for the player&lt;br /&gt;
	else&lt;br /&gt;
		whoNick = getPlayerName(sourcePlayer)&lt;br /&gt;
	end&lt;br /&gt;
	if ( tplayer ~= false ) then                                -- if the player was found (or no playername was entered)&lt;br /&gt;
		if isPlayerNametagShowing ( tplayer ) then          -- if the nametag is shown&lt;br /&gt;
			setPlayerNametagShowing ( tplayer, false )  -- hide it&lt;br /&gt;
			outputChatBox ( who .. &amp;quot;'s nametag is now hidden&amp;quot;, sourcePlayer )  -- output a message to the player who entered the command&lt;br /&gt;
		else                                             -- if the nametag is not shown&lt;br /&gt;
			setPlayerNametagShowing ( tplayer, true )   -- show it&lt;br /&gt;
			outputChatBox ( who .. &amp;quot;'s nametag is now showing&amp;quot;, sourcePlayer ) -- output a message to the player who entered the command&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		outputChatBox ( &amp;quot;Player not found.&amp;quot;, sourcePlayer )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;toggleNametag&amp;quot;, toggleNametag )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc --&amp;gt;&lt;br /&gt;
{{Player_functions}}&lt;/div&gt;</summary>
		<author><name>VWOer</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetWaterLevel&amp;diff=28428</id>
		<title>GetWaterLevel</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetWaterLevel&amp;diff=28428"/>
		<updated>2011-11-22T16:17:57Z</updated>

		<summary type="html">&lt;p&gt;VWOer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}} &lt;br /&gt;
This function allows you to retrieve the water level from a certain location. The water level is 0 in most places though it can vary (e.g. it's higher near the dam).&lt;br /&gt;
&lt;br /&gt;
''Note: Some small water areas within parts of the city do not count as water to be used with this function. For example, the shallow water area in Northwest San Fierro.''&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
float getWaterLevel ( float posX, float posY, float posZ [ , bool bCheckWaves = false ] )&lt;br /&gt;
float getWaterLevel ( water theWater )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''x:''' The X axis position&lt;br /&gt;
*'''y:''' The Y axis position&lt;br /&gt;
*'''z:''' The Z axis position&lt;br /&gt;
&lt;br /&gt;
''or:''&lt;br /&gt;
*'''theWater:''' the water element&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''bCheckWaves''' ask arc_&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''false'' if there's no water in that location or the water level as an ''integer'' if you're near the water (-3 to 20 on the Z coordinate).&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example will tell you what's the water level where the specified player is located.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function scriptGetLevel ( command, playername ) --when getlevel is called&lt;br /&gt;
  local thePlayer = getPlayerFromName ( playername ) --get the player from nickname&lt;br /&gt;
  if ( thePlayer ~= false ) then --if there is a player from the nickname&lt;br /&gt;
    local x, y, z = getElementPosition ( thePlayer ) -- get his position&lt;br /&gt;
    local level = getWaterLevel ( x, y, z )&lt;br /&gt;
	  if level then -- if it's not false&lt;br /&gt;
        level = z - level -- calculate how far away is he from the water&lt;br /&gt;
        outputChatBox( &amp;quot;You are &amp;quot; .. level .. &amp;quot; units away from the water!&amp;quot;, source )&lt;br /&gt;
	  else outputChatBox ( &amp;quot;There's no sign of water&amp;quot; )&lt;br /&gt;
	  end&lt;br /&gt;
  else outputChatBox ( &amp;quot;Player does not exist&amp;quot; )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler( &amp;quot;getlevel&amp;quot;, scriptGetLevel ) -- add a command &amp;quot;getloc&amp;quot; which&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client water functions}}&lt;/div&gt;</summary>
		<author><name>VWOer</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=BanPlayer&amp;diff=28427</id>
		<title>BanPlayer</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=BanPlayer&amp;diff=28427"/>
		<updated>2011-11-22T16:17:12Z</updated>

		<summary type="html">&lt;p&gt;VWOer: &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;
==See Also==&lt;br /&gt;
{{Admin_functions}}&lt;br /&gt;
[[es:banPlayer]]&lt;br /&gt;
[[ru:BanPlayer]]&lt;/div&gt;</summary>
		<author><name>VWOer</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=KickPlayer&amp;diff=28426</id>
		<title>KickPlayer</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=KickPlayer&amp;diff=28426"/>
		<updated>2011-11-22T16:17:04Z</updated>

		<summary type="html">&lt;p&gt;VWOer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function will kick the specified player from the server.&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 kickPlayer ( player kickedPlayer, [ player responsiblePlayer, string reason = &amp;quot;&amp;quot; ] )         &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
''or''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool kickPlayer ( player kickedPlayer, [ string reason = &amp;quot;&amp;quot; ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''kickedPlayer:''' The player that will be kicked from the server&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''responsiblePlayer:''' The player that is responsible for the event. '''Note''': If left out as in the second syntax, responsible player for the kick will be &amp;quot;Console&amp;quot; (Maximum 30 characters if using a string).&lt;br /&gt;
*'''reason:''' The reason for the kick.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the player was kicked succesfully, ''false'' if invalid arguments are specified.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example lets a player kick anyone who has a lower level.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function kickPlayerHandler ( sourcePlayer, commandname, kickedname, reason )&lt;br /&gt;
	-- Get player element from the name&lt;br /&gt;
	local kicked = getPlayerFromName ( kickedname )&lt;br /&gt;
	-- If the client who sent the command has a higher level&lt;br /&gt;
	if ( hasObjectPermissionTo ( sourcePlayer, &amp;quot;function.kickPlayer&amp;quot; ) ) then&lt;br /&gt;
		-- Kick the player&lt;br /&gt;
		kickPlayer ( kicked, sourcePlayer, reason )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
-- Add the &amp;quot;kick&amp;quot; command handler&lt;br /&gt;
addCommandHandler ( &amp;quot;kick&amp;quot;, kickPlayerHandler )&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:kickPlayer]]&lt;br /&gt;
[[ru:kickPlayer]]&lt;/div&gt;</summary>
		<author><name>VWOer</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetZoneName&amp;diff=28425</id>
		<title>GetZoneName</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetZoneName&amp;diff=28425"/>
		<updated>2011-11-22T16:16:56Z</updated>

		<summary type="html">&lt;p&gt;VWOer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function allows you to retrieve the zone name of a certain location.&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 getZoneName ( float x, float y, float z, [bool citiesonly=false] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''x:''' The X axis position&lt;br /&gt;
*'''y:''' The Y axis position&lt;br /&gt;
*'''z:''' The Z axis position&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
* '''citiesonly''': An optional argument to choose if you want to return the city name (eg Las Venturas)&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the string of the zone name&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;
'''Example 1:''' This example shows you how to return a zone name by doing /loc x y z in the chatbox or just loc x y z in console ( replace x, y and z with the co-ords you wanna check, eg /loc 1200 523 12.3 )&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function playerLoc ( source, command, x, y, z )&lt;br /&gt;
  local location = getZoneName ( x, y, z )&lt;br /&gt;
  outputChatBox ( &amp;quot;* Location: &amp;quot; .. location, getRootElement(), 0, 255, 255 ) -- Output the zone name&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler( &amp;quot;loc&amp;quot;, playerLoc )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 2:''' This example will tell you what zone a specified player is in when the &amp;quot;getloc&amp;quot; console command is used.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function scriptGetLoc ( source, command, playername ) --when getloc is called&lt;br /&gt;
  local thePlayer = getPlayerFromName ( playername ) --get the player from nickname&lt;br /&gt;
  if ( thePlayer ~= false ) then --if there is a player from the nickname&lt;br /&gt;
    local x, y, z = getElementPosition ( player )&lt;br /&gt;
    local location = getZoneName ( x, y, z )&lt;br /&gt;
	local city = getZoneName ( x, y, z, true )&lt;br /&gt;
    outputChatBox ( playername .. &amp;quot; is at &amp;quot; .. location .. &amp;quot; (&amp;quot; .. city .. &amp;quot;)&amp;quot;, source ) --announce his zone&lt;br /&gt;
  else outputChatBox ( &amp;quot;Player does not exist&amp;quot; )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler( &amp;quot;getloc&amp;quot;, scriptGetLoc ) -- add a command &amp;quot;getloc&amp;quot; which initiates &amp;quot;scriptGetloc&amp;quot; function&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:getZoneName]]&lt;/div&gt;</summary>
		<author><name>VWOer</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=RemoveAccount&amp;diff=28424</id>
		<title>RemoveAccount</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=RemoveAccount&amp;diff=28424"/>
		<updated>2011-11-22T16:16:48Z</updated>

		<summary type="html">&lt;p&gt;VWOer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function is used to delete existing player accounts.&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 removeAccount ( 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 remove&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if account was successfully removed, ''false'' if the account does not exist.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example does...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function onCmdRemove ( playerSource, commandName, playerName )&lt;br /&gt;
	-- Lets make sure they didn't put nothing for the playername&lt;br /&gt;
	if playerName ~= nil then&lt;br /&gt;
		-- Lets get the player from the nick provided&lt;br /&gt;
		local targetPlayer = getPlayerFromName ( playerName )&lt;br /&gt;
		-- Checking if the player actually exists&lt;br /&gt;
		if targetPlayer ~= nil then&lt;br /&gt;
			-- grab the accounts&lt;br /&gt;
			local sourceAccount = getPlayerAccount ( playerSource )&lt;br /&gt;
			local targetAccount = getPlayerAccount ( targetPlayer )&lt;br /&gt;
			-- Now check to see if the player has greater priviledges (or levels)&lt;br /&gt;
			if getAccountLevel ( sourceAccount ) &amp;gt; getAccountLevel ( targetAccount ) then&lt;br /&gt;
				removeAccount ( targetAccount )&lt;br /&gt;
				outputChatBox ( getPlayerName ( playerSource ) .. &amp;quot; removed &amp;quot; .. playerName .. &amp;quot;'s account&amp;quot; )&lt;br /&gt;
			else &lt;br /&gt;
				outputChatBox ( &amp;quot;You don't have authority to remove &amp;quot; .. playerName .. &amp;quot;'s account&amp;quot;, playerSource )&lt;br /&gt;
			end&lt;br /&gt;
		else&lt;br /&gt;
			outputChatBox ( &amp;quot;There is no player by the name of &amp;quot; .. playerName, playerSource )&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		outputChatBox ( &amp;quot;USAGE: /remove [playername]&amp;quot;, playerSource )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addCommandHandler(&amp;quot;remove&amp;quot;,onCmdRemove)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc --&amp;gt;&lt;br /&gt;
{{Account_functions}}&lt;/div&gt;</summary>
		<author><name>VWOer</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=ShowCursor&amp;diff=28423</id>
		<title>ShowCursor</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=ShowCursor&amp;diff=28423"/>
		<updated>2011-11-22T16:16:40Z</updated>

		<summary type="html">&lt;p&gt;VWOer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function is used to show or hide a [[player]]'s cursor.&lt;br /&gt;
&lt;br /&gt;
Note that, regardless of the cursor state you set using this function, the cursor will always be visible while the menu, the chatbox input line or the console are active, or if another resource has called this function.&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;
bool showCursor ( player thePlayer, bool show, [ bool toggleControls = true ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePlayer:''' The [[player]] you want to show or hide the cursor of.&lt;br /&gt;
*'''show:''' A boolean value determining whether to show (''true'') or hide (''false'') the cursor.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
*'''toggleControls:''' A boolean value determining whether to disable controls whilst the cursor is showing.  ''true'' implies controls are disabled, ''false'' implies controls remain enabled.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
bool showCursor ( bool show, [ bool toggleControls = true ]  )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''show:''' A boolean value determining whether to show (''true'') or hide (''false'') the cursor.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
*'''toggleControls:''' A boolean value determining whether to disable controls whilst the cursor is showing.  ''true'' implies controls are disabled, ''false'' implies controls remain enabled.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the player's cursor was shown or hidden successfully, ''false'' otherwise.&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 shows the cursor for a player named &amp;quot;Dave&amp;quot;, then outputs a message if it was shown successfully.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local thePlayer = getPlayerFromName ( &amp;quot;Dave&amp;quot; )              -- get the player named Dave&lt;br /&gt;
if thePlayer then                                           -- if we got him&lt;br /&gt;
    showCursor ( thePlayer, true )                          -- make his cursor show&lt;br /&gt;
    if isCursorShowing ( thePlayer ) then                   -- did it show?&lt;br /&gt;
        outputChatBox ( &amp;quot;Cursor is now showing for Dave.&amp;quot; ) -- print a message to the chat box&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;
&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;
This example shows the cursor all the time&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
showCursor ( true ) -- Shows cursor&lt;br /&gt;
showCursor ( false ) -- Doesnt Show Cursor&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;
==See Also==&lt;br /&gt;
{{Cursor_functions}}&lt;/div&gt;</summary>
		<author><name>VWOer</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsPlayerMapForced&amp;diff=28422</id>
		<title>IsPlayerMapForced</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsPlayerMapForced&amp;diff=28422"/>
		<updated>2011-11-22T16:16:30Z</updated>

		<summary type="html">&lt;p&gt;VWOer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function checks if the specified player's radar map has been forced on or not.&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;bool isPlayerMapForced ( player thePlayer )&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;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the player's radar map is forced on, ''false'' otherwise.&lt;br /&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;bool isPlayerMapForced ()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the local player's radar map is forced on, ''false'' otherwise.&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 forces a players radar map on for 10 seconds if it hasn't been already.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function forceMapForPlayer ( callingPlayer, command, whoNick )&lt;br /&gt;
	local who = getPlayerFromName ( whoNick )                                   -- Look up the specified player&lt;br /&gt;
	if ( who ) then&lt;br /&gt;
		if ( not isPlayerMapForced ( who ) ) then                           -- if his radar map isn't already forced on&lt;br /&gt;
			forcePlayerMap ( who, true )                                -- force it on&lt;br /&gt;
			setTimer ( forcePlayerMap, 10000, 1, who, false )           -- force it off in 10secs&lt;br /&gt;
			outputChatBox ( &amp;quot;Forcing Map for &amp;quot; .. whoNick, callingPlayer ) -- output a message to the one who entered the command&lt;br /&gt;
		else&lt;br /&gt;
			outputChatBox ( &amp;quot;Map already forced for &amp;quot; .. whoNick, callingPlayer ) -- if the map is already forced, output a message&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		outputChatBox ( &amp;quot;Couldn't find &amp;quot; .. whoNick, callingPlayer )        -- if the player wasn't found, output a message&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;forcemap&amp;quot;, forceMapForPlayer ) -- add a command handler&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;
{{Player functions}}&lt;/div&gt;</summary>
		<author><name>VWOer</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetElementVelocity&amp;diff=28421</id>
		<title>SetElementVelocity</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetElementVelocity&amp;diff=28421"/>
		<updated>2011-11-22T16:15:58Z</updated>

		<summary type="html">&lt;p&gt;VWOer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function sets the velocity (movement speeds) along each axis, for an element.&lt;br /&gt;
&lt;br /&gt;
This is not compatible with all elements. The following elements are compatible:&lt;br /&gt;
* [[Ped]]s&lt;br /&gt;
* [[Vehicle]]s&lt;br /&gt;
* [[Object]]s (Clientside only)&lt;br /&gt;
* [[Projectile]]s (Clientside only)&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setElementVelocity ( element theElement, float speedX, float speedY, float speedZ )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theElement:''' The [[element]] you wish to set the velocity of.&lt;br /&gt;
*'''speedX:''' A floating point value determining the speed along the X axis.&lt;br /&gt;
*'''speedY:''' A floating point value determining the speed along the Y axis.&lt;br /&gt;
*'''speedZ:''' A floating point value determining the speed along the Z axis.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the speed was set successfully, ''false'' if a bad element was specified or other bad arguments.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example 'copies' the speed of a specific player (called ''someguy'' in this example) to another player (called ''Ted'' in this example).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
speedx, speedy, speedz = getElementVelocity ( getPlayerFromName ( &amp;quot;someguy&amp;quot; ) ) -- get the velocity of the player named &amp;quot;someguy&amp;quot;&lt;br /&gt;
setElementVelocity ( getPlayerFromName ( &amp;quot;Ted&amp;quot; ), speedx, speedy, speedz )      -- copy the velocity to a player named &amp;quot;Ted&amp;quot;&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>VWOer</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetElementData&amp;diff=28420</id>
		<title>GetElementData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetElementData&amp;diff=28420"/>
		<updated>2011-11-22T16:15:42Z</updated>

		<summary type="html">&lt;p&gt;VWOer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function retrieves [[element data]] attached to an element under a certain key.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;var getElementData ( element theElement, string key [, inherit = true] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theElement:''' This is the element with data you want to retrieve.&lt;br /&gt;
*'''key:''' The name of the element data entry you want to retrieve. (Maximum 31 characters.)&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''inherit:''' - toggles whether or not the function should go up the hierarchy to find the requested key in case the specified element doesn't have it.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
This function returns a ''variable'' containing the requested element data, or ''false'' if the element or the element data does not exist. When getting data corresponding to a XML attribute, this is always a ''string''.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example stores the tick count when a player joins and then allows players to see how long they are connected using a console function 'joinTime'.&lt;br /&gt;
&amp;lt;section show=&amp;quot;true&amp;quot; name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function joinTime ( )&lt;br /&gt;
    setElementData ( source, &amp;quot;joinTime&amp;quot;, getTickCount() ) -- Store the current tick count in the player's data with the key 'joinTime'&lt;br /&gt;
end&lt;br /&gt;
-- Make our 'joinTime' function be called when a player joins&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerJoin&amp;quot;, getRootElement(), joinTime )&lt;br /&gt;
&lt;br /&gt;
function showJoinTime ( source, commandName, playerName )&lt;br /&gt;
	if ( playerName ) then -- see if a player was specified&lt;br /&gt;
		thePlayer = getPlayerFromName ( playerName ) -- get the player element for the specified player&lt;br /&gt;
		if ( thePlayer ) then -- if one was found...&lt;br /&gt;
			local timeOnline = (getTickCount() - getElementData ( thePlayer, &amp;quot;joinTime&amp;quot; )) / 1000 -- calculates the time since join&lt;br /&gt;
			outputChatBox ( getPlayerName ( thePlayer )..&amp;quot; joined &amp;quot;..timeOnline..&amp;quot; seconds ago&amp;quot;, source ) -- output the player's join time&lt;br /&gt;
		else&lt;br /&gt;
			outputChatBox ( &amp;quot;Couldn't find '&amp;quot; .. playerName .. &amp;quot;'&amp;quot;, source ) -- display an error&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		-- display when the player who used the function joined and inform how to see other people's join time&lt;br /&gt;
		local timeOnline = (getTickCount() - getElementData ( source, &amp;quot;joinTime&amp;quot; )) / 1000 -- calculate the time since join&lt;br /&gt;
		outputChatBox ( &amp;quot;You joined &amp;quot; ..timeOnline..&amp;quot; seconds ago&amp;quot;, source )&lt;br /&gt;
		outputChatBox ( &amp;quot;Use 'join_time &amp;lt;player name&amp;gt;' to see other people's join time&amp;quot;, source )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
-- Add a console command joinTime, that takes an optional parameter of a player's name&lt;br /&gt;
addCommandHandler ( &amp;quot;joinTime&amp;quot;, showJoinTime )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Element functions}}&lt;/div&gt;</summary>
		<author><name>VWOer</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=MoveObject&amp;diff=28419</id>
		<title>MoveObject</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=MoveObject&amp;diff=28419"/>
		<updated>2011-11-22T16:15:28Z</updated>

		<summary type="html">&lt;p&gt;VWOer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function will smoothly move an object from its current position to a specified rotation and position.&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 moveObject ( object theObject, int time,&lt;br /&gt;
                  float targetx, float targety, float targetz, &lt;br /&gt;
                [ float moverx, float movery, float moverz,&lt;br /&gt;
                  string strEasingType, float fEasingPeriod, float fEasingAmplitude, float fEasingOvershoot ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theObject:''' The object that will be moved.&lt;br /&gt;
* '''time:''' The time in milliseconds the object will arrive at the destination.&lt;br /&gt;
* '''targetx:''' The X value of the target position&lt;br /&gt;
* '''targety:''' The Y value of the target position&lt;br /&gt;
* '''targetz:''' The Z value of the target position&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
* '''moverx:''' The rotation along the X axis '''relative''' to its current rotation, which is its starting angle.&lt;br /&gt;
* '''movery:''' The rotation along the Y axis '''relative''' to its current rotation, which is its starting angle.&lt;br /&gt;
* '''moverz:''' The rotation along the Z axis '''relative''' to its current rotation, which is its starting angle.&lt;br /&gt;
*'''strEasingType:''' the [[Easing|easing function]] to use for the interpolation (default is &amp;quot;Linear&amp;quot;)&lt;br /&gt;
*'''fEasingPeriod:''' the period of the [[Easing|easing function]] (only some easing functions use this parameter)&lt;br /&gt;
*'''fEasingAmplitude:''' the amplitude of the [[Easing|easing function]] (only some easing functions use this parameter)&lt;br /&gt;
*'''fEasingOvershoot:''' the overshoot of the [[Easing|easing function]] (only some easing functions use this parameter)&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the function moved the object succesfully, and returns ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Examples ==&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;
'''Example 1:''' This example moves every object in the game up 100 units in ten seconds.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
allObjects = getElementsByType ( &amp;quot;object&amp;quot; )&lt;br /&gt;
for key, theObject in ipairs ( allObjects ) do&lt;br /&gt;
	local origX, origY, origZ = getElementPosition ( theObject ) --get the origanal position&lt;br /&gt;
	local newZ = origZ + 100 -- make a new z position&lt;br /&gt;
	moveObject ( theObject, 10000, origX, origY, newZ ) --move the object to this position in 10 seconds.&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;
&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;
'''Example 2:''' This example created a model (of a bed) near a player called ''someguy'', if they exist in the game. It will then move the model towards the player over 3 seconds.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Find a player called 'someguy'&lt;br /&gt;
someGuy = getPlayerFromName ( &amp;quot;someguy&amp;quot; )&lt;br /&gt;
-- If a player called someguy was found then&lt;br /&gt;
if ( someGuy ) then&lt;br /&gt;
	-- Get the player's position&lt;br /&gt;
	x, y, z = getElementPosition ( someGuy )&lt;br /&gt;
	-- Create a bed (1700) object near to the player&lt;br /&gt;
	bed = createObject ( 1700, x + 5, y, z )&lt;br /&gt;
	-- Move the bed towards the player over 3 seconds (3000 milliseconds)&lt;br /&gt;
	moveObject ( bed, 3000, x, y, z )&lt;br /&gt;
	-- Tell the player in the chat box&lt;br /&gt;
	outputChatBox ( &amp;quot;Moving a bed towards you!&amp;quot;, someGuy )&lt;br /&gt;
else&lt;br /&gt;
	-- Tell everyone that a player called 'someguy' could not be found&lt;br /&gt;
	outputChatBox ( &amp;quot;Player someguy doesn't exist&amp;quot; )&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;
&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;
'''Example 3:''' This example creates a ball moving (in front of CJ's house in Grove Street) using easing functions. Test command is &amp;quot;/smove&amp;quot; for instance &amp;quot;/smove OutBounce&amp;quot;. This example is a serverside code but the same could be done clientside (adapting the command handler)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local START_POS = {2497.203125, -1672.4864501953, 12.640947341919}&lt;br /&gt;
local STOP_POS = {2480.2595214844, -1666.521484375, 12.640114784241}&lt;br /&gt;
local MOTION_DURATION = 5000&lt;br /&gt;
local WAIT_DURATION = 1000&lt;br /&gt;
&lt;br /&gt;
addCommandHandler(&amp;quot;smove&amp;quot;,&lt;br /&gt;
function (player, cmd, strEasingType, period, amplitude, overshoot)&lt;br /&gt;
	local x, y, z = unpack(START_POS)&lt;br /&gt;
	local object = createObject(1598, x, y, z)&lt;br /&gt;
	x, y, z = unpack(STOP_POS)&lt;br /&gt;
	&lt;br /&gt;
	period = period or 0.3&lt;br /&gt;
	amplitude = amplitude or 1.0&lt;br /&gt;
	overshoot = overshoot or 1.70158&lt;br /&gt;
	&lt;br /&gt;
	outputChatBox(string.format(&amp;quot;Server Easing %s %s %s %s&amp;quot;, strEasingType, tostring(period), tostring(amplitude), tostring(overshoot)))&lt;br /&gt;
	moveObject(object, MOTION_DURATION, x, y, z, 0, 0, 360, strEasingType, period, amplitude, overshoot)&lt;br /&gt;
	setTimer(destroyElement, MOTION_DURATION+WAIT_DURATION, 1, object)&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Object functions}}&lt;/div&gt;</summary>
		<author><name>VWOer</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsPlayerMuted&amp;diff=28418</id>
		<title>IsPlayerMuted</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsPlayerMuted&amp;diff=28418"/>
		<updated>2011-11-22T16:14:38Z</updated>

		<summary type="html">&lt;p&gt;VWOer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
Use this function to check if a player has been muted.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
 &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isPlayerMuted ( player thePlayer )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''thePlayer:''' The [[player]] you are checking.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the player is muted and ''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;
someguy = getPlayerFromName ( &amp;quot;someGuy&amp;quot; )&lt;br /&gt;
if isPlayerMuted ( someguy ) then&lt;br /&gt;
   outputChatBox ( &amp;quot;It seems Someguy can't speak.&amp;quot; )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Player functions}}&lt;/div&gt;</summary>
		<author><name>VWOer</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetTimer&amp;diff=26939</id>
		<title>SetTimer</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetTimer&amp;diff=26939"/>
		<updated>2011-08-30T14:50:28Z</updated>

		<summary type="html">&lt;p&gt;VWOer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function allows you to trigger a function after a number of milliseconds have elapsed. You can call one of your own functions or a built-in function. For example, you could set a timer to spawn a player after a number of seconds have elapsed.&lt;br /&gt;
&lt;br /&gt;
Once a timer has finished repeating, it no longer exists.&lt;br /&gt;
&lt;br /&gt;
'''The minimum accepted interval is 50ms.'''&lt;br /&gt;
&lt;br /&gt;
Multi Theft Auto guarantees that the timer will be triggered after ''at least'' the interval you specify. The resolution of the timer is tied to the frame rate (server side and client-side). All the overdue timers are triggered at a single point each frame. This means that if, for example, the player is running at 30 frames per second, then two timers specified to occur after 100ms and 110ms would more than likely occur during the same frame, as the difference in time between the two timers (10ms) is less than half the length of the frame (33ms). As with most timers provided by other languages, you shouldn't rely on the timer triggering at an exact point in the future. &lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
timer setTimer ( function theFunction, int timeInterval, int timesToExecute, [ var arguments... ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theFunction:''' The function you wish the timer to call. (Notice: Do not use a 'local' function, it must be global!)&lt;br /&gt;
*'''timeInterval:''' The number of milliseconds that should elapse before the function is called. (the minimum is 50)(1000 milliseconds = 1 second)&lt;br /&gt;
*'''timesToExecute:''' The number of times you want the timer to execute, or 0 for infinite repetitions.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''arguments:''' Any arguments you wish to pass to the function can be listed after the ''timesToExecute'' argument. Note that any tables you want to pass will get cloned, whereas metatables will get lost. Also changes you make in the original table before the function gets called won't get transferred.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[timer]] pointer if the timer was set successfully, ''false'' if the arguments are invalid or the timer could not be set.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example will output some text after a small delay.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- define function to be called&lt;br /&gt;
function delayedChat ( text )&lt;br /&gt;
	outputChatBox ( &amp;quot;Delayed text: &amp;quot; .. text )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- set a timer so the function is called after 1 second&lt;br /&gt;
setTimer ( delayedChat, 1000, 1, &amp;quot;Hello, World!&amp;quot; )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 second after the line above has been executed, the text ''Delayed text: Hello, World!'' will be displayed in the chat box.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Utility functions}}&lt;/div&gt;</summary>
		<author><name>VWOer</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CreateColTube&amp;diff=26930</id>
		<title>CreateColTube</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CreateColTube&amp;diff=26930"/>
		<updated>2011-08-29T09:44:09Z</updated>

		<summary type="html">&lt;p&gt;VWOer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function creates a collision tube. This is a shape that has a position and a 2D (X/Y) radius and a height. See [http://en.wikipedia.org/wiki/Cylinder_(geometry) Cylinder] for a definition of a tube. A tube is similar to a colcircle, except that it has a limited height, this means you can limit the distance above the position defined by (fX, fY, fZ) that the collision is detected.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
colshape createColTube ( float fX, float fY, float fZ, float fRadius, float fHeight)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''fX:''' The position of the base of the tube's center on the X axis&lt;br /&gt;
*'''fY:''' The position of the base of the tube's center on the Y axis&lt;br /&gt;
*'''fZ:''' The position of the base of the tube's center on the Z axis&lt;br /&gt;
*'''fRadius:''' The collision tube's radius&lt;br /&gt;
*'''fHeight:''' The collision tube's height&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[colshape]] element if successful, ''false'' if invalid arguments were passed to the function.&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 displays a chat message when a player enters the colshape and allows the colshape to be created using a console function ''set_zone''.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
theZone = false&lt;br /&gt;
&lt;br /&gt;
function shapeHit ( thePlayer ) &lt;br /&gt;
    outputChatBox ( getPlayerName ( thePlayer ) .. &amp;quot; is in the zone!&amp;quot; ) -- display a message in everyone's chat box&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function setZone ( playerSource, commandName, fX, fY, fZ )&lt;br /&gt;
    if ( fZ and fY and fX ) then -- check we've got all 3 args we need&lt;br /&gt;
        local tempCol = createColTube ( fX, fY, fZ, 10.0, 10.0 ) -- create a col&lt;br /&gt;
        if ( tempCol == false ) then -- did the col get created successfully?&lt;br /&gt;
            outputConsole ( &amp;quot;Syntax is: set_zone &amp;lt;X&amp;gt; &amp;lt;Y&amp;gt; &amp;lt;Z&amp;gt;&amp;quot; ) -- inform the user what the valid syntax is&lt;br /&gt;
        else&lt;br /&gt;
            if ( theZone ~= false ) then -- did we already have a zone?&lt;br /&gt;
                destroyElement ( theZone ) -- if so, destroy it&lt;br /&gt;
            else&lt;br /&gt;
                   addEventHandler ( &amp;quot;onColShapeHit&amp;quot;, theZone, shapeHit ) -- add a handler for the onColShapeHit event&lt;br /&gt;
            end&lt;br /&gt;
            theZone = tempCol -- and store the new zone we've made&lt;br /&gt;
            outputChatBox ( &amp;quot;Zone has moved!&amp;quot; ) -- and tell everyone&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;set_zone&amp;quot;, setZone ) -- add a console function called set_zone that will trigger the function setZone&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;
{{Collision shape functions}}&lt;/div&gt;</summary>
		<author><name>VWOer</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsGarageOpen&amp;diff=26929</id>
		<title>IsGarageOpen</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsGarageOpen&amp;diff=26929"/>
		<updated>2011-08-29T09:37:25Z</updated>

		<summary type="html">&lt;p&gt;VWOer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function checks whether or not a specific garage door is open.&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 isGarageOpen ( int garageID )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''garageID:''' The [[Garage|garage ID]] that represents the garage door that is being checked.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the garage is open, ''false'' if it is closed or an invalid garage ID was given.&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 opens a garage door when a player enters a collision shape near it, and closes it when they leave:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
GARAGE_ID = 25&lt;br /&gt;
&lt;br /&gt;
-- create a collision shape and attach event handlers to it when the resource starts&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;, getResourceRootElement(getThisResource()),&lt;br /&gt;
function (resource)&lt;br /&gt;
	local garageCube = createColCuboid(1337, 194, 28, 6, 10, 4)&lt;br /&gt;
	addEventHandler(&amp;quot;onColShapeHit&amp;quot;, garageCube, onGarageCubeHit)&lt;br /&gt;
	addEventHandler(&amp;quot;onColShapeLeave&amp;quot;, garageCube, onGarageCubeLeave)&lt;br /&gt;
end)&lt;br /&gt;
&lt;br /&gt;
-- open the door when someone enters the garage's collision shape&lt;br /&gt;
function onGarageCubeHit(hitElement, matchingDimension)&lt;br /&gt;
	if (getElementType(hitElement) == &amp;quot;player&amp;quot;) then&lt;br /&gt;
		-- check to make sure the door is closed&lt;br /&gt;
		if (not isGarageOpen(GARAGE_ID)) then&lt;br /&gt;
			-- open the door&lt;br /&gt;
			setGarageOpen(GARAGE_ID, true)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- close the door when someone leaves the garage's collision shape&lt;br /&gt;
function onGarageCubeLeave(leaveElement, matchingDimension)&lt;br /&gt;
	if (getElementType(leaveElement) == &amp;quot;player&amp;quot;) then&lt;br /&gt;
		-- check to make sure the door is open&lt;br /&gt;
		if (isGarageOpen(GARAGE_ID)) then&lt;br /&gt;
			-- close the door&lt;br /&gt;
			setGarageOpen(GARAGE_ID, false)&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;
==See Also==&lt;br /&gt;
{{World functions}}&lt;br /&gt;
&lt;br /&gt;
[[ru:isGarageOpen]]&lt;/div&gt;</summary>
		<author><name>VWOer</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Element/Marker&amp;diff=26909</id>
		<title>Element/Marker</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Element/Marker&amp;diff=26909"/>
		<updated>2011-08-27T15:08:31Z</updated>

		<summary type="html">&lt;p&gt;VWOer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
The marker class represents colored, 3D shapes in the GTA world. There are several types of markers, including cylinders and checkpoints. In scripts, markers are often used to mark spots and trigger some sort of action when a player goes into them.&lt;br /&gt;
&lt;br /&gt;
The element type of this class is '''&amp;quot;marker&amp;quot;'''.&lt;br /&gt;
&lt;br /&gt;
The size of the marker cannot be specified from XML and defaults to 4.0.&lt;br /&gt;
&lt;br /&gt;
==XML syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;marker posX=&amp;quot;&amp;quot; posY=&amp;quot;&amp;quot; posZ=&amp;quot;&amp;quot; type=&amp;quot;&amp;quot; .../&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Attributes===&lt;br /&gt;
* '''posX''': A float representing the X position of the pickup.&lt;br /&gt;
* '''posY''': A float representing the Y position of the pickup.&lt;br /&gt;
* '''posZ''': A float representing the Z position of the pickup.&lt;br /&gt;
&lt;br /&gt;
===Optional Attributes===&lt;br /&gt;
* '''type:''' The visual type of the marker to be created. Possible values:&lt;br /&gt;
{{Marker types}}&lt;br /&gt;
* '''color:''' The color of the marker in HTML style format #RRGGBB, defaults to red if not specified.&lt;br /&gt;
&lt;br /&gt;
==Related scripting functions==&lt;br /&gt;
{{Marker functions}}&lt;br /&gt;
[[Category:Element Types]]&lt;br /&gt;
&lt;br /&gt;
[[it:Elemento/Marker]]&lt;br /&gt;
[[ru:Элемент/Маркер]]&lt;/div&gt;</summary>
		<author><name>VWOer</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GivePedJetPack&amp;diff=26903</id>
		<title>GivePedJetPack</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GivePedJetPack&amp;diff=26903"/>
		<updated>2011-08-27T11:08:43Z</updated>

		<summary type="html">&lt;p&gt;VWOer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function is used to give a ped a jetpack, it won't work if the ped is in a vehicle.&lt;br /&gt;
&lt;br /&gt;
As such, you should either expect it to fail sometimes, or repeatedly try to give a jetpack every second or so until [[doesPlayerHaveJetPack]] returns true. Alternatively, you can force the ped into a 'safe' position (e.g. standing on the ground) before giving the jetpack, or use a [[pickup]] to handle it.  &lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool givePedJetPack ( ped thePed )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''thePed:''' The [[ped]] you want to give a jetpack to.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if a jetpack was successfully given to the ped, ''false'' if it could not be given.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This examples adds a &amp;quot;jetpack&amp;quot; console command, which gives or removes a jetpack from the player.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Checks whether or not the player has a jetpack, and gives or removes it from the player&lt;br /&gt;
function consoleJetPack ( thePlayer, commandName )&lt;br /&gt;
   if not doesPedHaveJetPack ( thePlayer ) then                   -- if the player doesn't have a jetpack&lt;br /&gt;
      local status = givePedJetPack ( thePlayer )                 -- give him one&lt;br /&gt;
      if not status then&lt;br /&gt;
         outputConsole ( &amp;quot;Failed to give jetpack.&amp;quot;, thePlayer )   -- tell him if it failed&lt;br /&gt;
      end&lt;br /&gt;
   else&lt;br /&gt;
      local status = removePedJetPack ( thePlayer )               -- remove his jetpack&lt;br /&gt;
      if ( not status ) then&lt;br /&gt;
         outputConsole ( &amp;quot;Failed to remove jetpack.&amp;quot;, thePlayer ) -- tell him if it failed&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- add the function above to handle the &amp;quot;jetpack&amp;quot; command&lt;br /&gt;
addCommandHandler ( &amp;quot;jetpack&amp;quot;, consoleJetPack )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Ped functions}}&lt;br /&gt;
[[ru:givePedJetPack]]&lt;/div&gt;</summary>
		<author><name>VWOer</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetGarageOpen&amp;diff=26761</id>
		<title>SetGarageOpen</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetGarageOpen&amp;diff=26761"/>
		<updated>2011-08-19T15:17:44Z</updated>

		<summary type="html">&lt;p&gt;VWOer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function opens or closes the specified garage door in the world.&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 setGarageOpen ( int garageID, bool open )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''garageID:''' The [[Garage|garage ID]] that represents the garage door being opened or closed.&lt;br /&gt;
*'''isOpen:''' A boolean indicating whether or not to open the door.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' if an invalid garage id was given.&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 opens a garage door when a player enters a collision shape near it, and closes it when they leave:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
GARAGE_ID = 25&lt;br /&gt;
&lt;br /&gt;
-- create a collision shape and attach event handlers to it when the resource starts&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;, getResourceRootElement(getThisResource()),&lt;br /&gt;
function (resource)&lt;br /&gt;
	local garageCube = createColCuboid(1337, 194, 28, 6, 10, 4)&lt;br /&gt;
	addEventHandler(&amp;quot;onColShapeHit&amp;quot;, garageCube, onGarageCubeHit)&lt;br /&gt;
	addEventHandler(&amp;quot;onColShapeLeave&amp;quot;, garageCube, onGarageCubeLeave)&lt;br /&gt;
end)&lt;br /&gt;
&lt;br /&gt;
-- open the door when someone enters the garage's collision shape&lt;br /&gt;
function onGarageCubeHit(hitElement, matchingDimension)&lt;br /&gt;
	if (getElementType(hitElement) == &amp;quot;player&amp;quot;) then&lt;br /&gt;
		-- check to make sure the door is closed&lt;br /&gt;
		if (not isGarageOpen(GARAGE_ID)) then&lt;br /&gt;
			-- open the door&lt;br /&gt;
			setGarageOpen(GARAGE_ID, true)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- close the door when someone leaves the garage's collision shape&lt;br /&gt;
function onGarageCubeLeave(leaveElement, matchingDimension)&lt;br /&gt;
	if (getElementType(leaveElement) == &amp;quot;player&amp;quot;) then&lt;br /&gt;
		-- check to make sure the door is open&lt;br /&gt;
		if (isGarageOpen(GARAGE_ID)) then&lt;br /&gt;
			-- close the door&lt;br /&gt;
			setGarageOpen(GARAGE_ID, false)&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;
==See Also==&lt;br /&gt;
{{World functions}}&lt;br /&gt;
&lt;br /&gt;
[[ru:setGarageOpen]]&lt;/div&gt;</summary>
		<author><name>VWOer</name></author>
	</entry>
</feed>