<?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=Ca11um</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=Ca11um"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Ca11um"/>
	<updated>2026-04-05T12:59:59Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPlayerPickupHit&amp;diff=24377</id>
		<title>OnPlayerPickupHit</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPlayerPickupHit&amp;diff=24377"/>
		<updated>2010-08-19T04:16:37Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server event}}&lt;br /&gt;
This event is triggered when a [[player]] hits a [[pickup]].&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
pickup pickupHit, bool matchingDimension&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''pickupHit''': The pickup the player hit&lt;br /&gt;
*'''matchingDimension''': Whether the player and the pickup he hit are in the same dimension&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[player]] that hit the pickup.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Only include this section below if cancelling the event has any effect. If you don't know if it does, ask a dev! --&amp;gt;&lt;br /&gt;
==Cancel effect==&lt;br /&gt;
If this event is [[Event system#Canceling|canceled]], the player will not be able to pick up this pickup.&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 disables the use of armour pickups.&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 armourBlock(pickup,dimension)&lt;br /&gt;
	if (getPickupType(pickup) == 1) then -- If it's an armour pickup&lt;br /&gt;
		cancelEvent() -- Cancel the event&lt;br /&gt;
		outputChatBox(&amp;quot;Armour pickups are disabled.&amp;quot;,source,255,0,0)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerPickupHit&amp;quot;,getRootElement(),armourBlock)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Player events}}&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPlayerPrivateMessage&amp;diff=24364</id>
		<title>OnPlayerPrivateMessage</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPlayerPrivateMessage&amp;diff=24364"/>
		<updated>2010-08-16T01:19:06Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server event}}&lt;br /&gt;
This event is triggered when a player sends a private message with ''msg'' command.&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 message, player recipient&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
*'''message''': A string representing the private message typed.&lt;br /&gt;
*'''recipient''': The [[player]] to whom the message is being sent.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[player]] who sent the private message.&lt;br /&gt;
&lt;br /&gt;
==Cancel effect==&lt;br /&gt;
If this event is [[Event system#Canceling|canceled]], the game's chat system won't deliver the message. You may use [[outputChatBox]] to send the messages then.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example blocks players sending a PM to a player named &amp;quot;Bob&amp;quot;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function blockPM(msg,r)&lt;br /&gt;
	if (getPlayerName(r) == &amp;quot;Bob&amp;quot;) then -- If they sent a PM to &amp;quot;Bob&amp;quot;&lt;br /&gt;
		cancelEvent() -- Then cancel it&lt;br /&gt;
		outputChatBox(&amp;quot;Bob is not accepting PM's at this time.&amp;quot;,source,255,0,0) -- And output it was cancelled.&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerPrivateMessage&amp;quot;,getRootElement(),blockPM)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{See also/Server event|Player events}}&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleRotation&amp;diff=24173</id>
		<title>SetVehicleRotation</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleRotation&amp;diff=24173"/>
		<updated>2010-08-05T04:09:15Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Deprecated.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Needs Checking|the server side function seems to work counter clockwise meaning setting the rotation to (0 0 90) will make the vehicle face West serverside and East clentside, also serverside 0 rotation is displayed as 360 no biggie though, #2421 --[[User:Norby89|Norby89]] 09:17, 5 August 2007 (CDT)}}&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
{{Deprecated}}&lt;br /&gt;
This function rotates a vehicle around a single point. &lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setVehicleRotation ( vehicle theVehicle, rx, ry, rz )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theVehicle''': The [[vehicle]] that you wish to apply the warp to.&lt;br /&gt;
*'''x''': The x-axis rotation in degrees.&lt;br /&gt;
*'''y''': The y-axis rotation in degrees.&lt;br /&gt;
*'''z''': The z-axis rotation in degrees.&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns a boolean value ''true'' or ''false'' that tells you if it was successful or not.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local newcar = createVehicle ( 520, 1024, 1024, 1024 ) &lt;br /&gt;
if setVehicleRotation ( newcar, 0, 0, 270 ) then&lt;br /&gt;
    outputChatBox ( &amp;quot;Rotation change successful.&amp;quot; )&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetAccountData&amp;diff=24115</id>
		<title>SetAccountData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetAccountData&amp;diff=24115"/>
		<updated>2010-07-28T14:20:01Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: removed false error.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{Note_box|It is strongly recommended that you use the standard ''module.key'' naming for your keys, as shown in the example below. This prevents collisions between different scripts.}}&lt;br /&gt;
This function sets a string to be stored in an account. This can then be retrieved using [[getAccountData]]. Data stored as account data is persistent across user's sessions and maps, unless they are logged into a guest account. Even if logged into a guest account, account data can be useful as a way to store a reference to your own account system, though it's persistence is equivalent to that of using [[setElementData]] on the player's element.&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 setAccountData ( account theAccount, string key, string value )&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 retrieve the data from.&lt;br /&gt;
*'''key:''' The key under which you wish to store the data&lt;br /&gt;
*'''value:''' The value you wish to store&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''true'' if the account data was set, ''false'' if an invalid argument was specified.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
For a pirate roleplaying gametype, the amount of money a player has is made persistent by storing it in his account. Note the code uses &amp;quot;piraterpg.money&amp;quot; as key instead of just &amp;quot;money&amp;quot;, as the player may be participating in other gametypes that also save his money amount to his account. If both gametypes would use &amp;quot;money&amp;quot; as the account key, they'd overwrite each other's data.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function onPlayerQuit ( )&lt;br /&gt;
      -- when a player leaves, store his current money amount in his account data&lt;br /&gt;
      local playeraccount = getPlayerAccount ( source )&lt;br /&gt;
      if ( playeraccount ) then&lt;br /&gt;
            local playermoney = getPlayerMoney ( source )&lt;br /&gt;
            setAccountData ( playeraccount, &amp;quot;piraterpg.money&amp;quot;, playermoney )&lt;br /&gt;
      end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function onPlayerJoin ( )&lt;br /&gt;
      -- when a player joins, retrieve his money amount from his account data and set it&lt;br /&gt;
      local playeraccount = getPlayerAccount ( source )&lt;br /&gt;
      if ( playeraccount ) then&lt;br /&gt;
            local playermoney = getAccountData ( playeraccount, &amp;quot;piraterpg.money&amp;quot; )&lt;br /&gt;
            -- make sure there was actually a value saved under this key (check if playermoney is not false).&lt;br /&gt;
            -- this will for example not be the case when a player plays the gametype for the first time&lt;br /&gt;
            if ( playermoney ) then&lt;br /&gt;
                  setPlayerMoney ( source, playermoney )&lt;br /&gt;
            end&lt;br /&gt;
      end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerQuit&amp;quot;, getRootElement ( ), onPlayerQuit )&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerJoin&amp;quot;, getRootElement ( ), onPlayerJoin )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Account_functions}}&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsElementWithinMarker&amp;diff=23614</id>
		<title>IsElementWithinMarker</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsElementWithinMarker&amp;diff=23614"/>
		<updated>2010-06-05T17:25:32Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Removed from needs example category (it has one).&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function is used to determine if an [[element]] is within a [[marker]].&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isElementWithinMarker ( element theElement, marker theMarker )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theElement:''' The [[element]] you're checking.&lt;br /&gt;
*'''theMarker:''' The [[marker]] you're checking.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the element is within the marker, ''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;
dutymarker = createMarker(126.56,254.98,78.9,'cylinder', 2.0, 255, 0, 0, 150)&lt;br /&gt;
&lt;br /&gt;
function duty(player, matchingDimension)&lt;br /&gt;
 if (isElementWithinMarker(player, dutymarker) == true ) then&lt;br /&gt;
    giveWeapon(player, 22, 100, 1)  &lt;br /&gt;
 else&lt;br /&gt;
    outputChatBox(&amp;quot;You are not at the right place!&amp;quot;, player,255,0,0)&lt;br /&gt;
 end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;duty&amp;quot;, duty)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Marker functions}}&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetBanAdmin&amp;diff=23609</id>
		<title>GetBanAdmin</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetBanAdmin&amp;diff=23609"/>
		<updated>2010-06-05T03:54:22Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Added an example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function will return the responsible admin (nickname of the admin) of the specified [[ban]] pointer.&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 getBanAdmin ( 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 return the admin of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''string'' of the admin if everything was successful, ''false'' if invalid arguments are specified if there was no admin specified for the [[ban]].&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 outputBan(ban)&lt;br /&gt;
	local banned = getBanNick(ban) -- Get the name of the player who was banned&lt;br /&gt;
	local banner = getBanAdmin(ban) -- Get the name of the admin who banned the player&lt;br /&gt;
	local reason = getBanReason(ban) -- Get the reason the player was banned&lt;br /&gt;
	outputChatBox(&amp;quot;-----BAN-----&amp;quot;,getRootElement(),255,0,0)&lt;br /&gt;
	if (banned) then&lt;br /&gt;
		outputChatBox(&amp;quot;Player banned: &amp;quot;..banned,getRootElement(),255,0,0) -- Output the player name who was banned&lt;br /&gt;
	end&lt;br /&gt;
	if (banner) then&lt;br /&gt;
		outputChatBox(&amp;quot;Banner: &amp;quot;..banner,getRootElement(),255,0,0) -- Output the admin name who performed the ban&lt;br /&gt;
	end&lt;br /&gt;
	if (reason) then&lt;br /&gt;
		outputChatBox(&amp;quot;Reason: &amp;quot;..reason,getRootElement(),255,0,0) -- outputt the reason the player was banned&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onBan&amp;quot;,getRootElement(),outputBan) -- When a player is banned trigger the outputBan function&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:getBanAdmin]]&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetBanReason&amp;diff=23608</id>
		<title>GetBanReason</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetBanReason&amp;diff=23608"/>
		<updated>2010-06-05T03:53:59Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Added an example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function will return the ban reason of the specified [[ban]] pointer.&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 getBanReason ( ban theBan )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theBan:''' The [[ban]] in which you want to return the reason of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''string'' of the reason if everything was successful, ''false'' if invalid arguments are specified if there was no reason specified for the [[ban]].&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 outputBan(ban)&lt;br /&gt;
	local banned = getBanNick(ban) -- Get the name of the player who was banned&lt;br /&gt;
	local banner = getBanAdmin(ban) -- Get the name of the admin who banned the player&lt;br /&gt;
	local reason = getBanReason(ban) -- Get the reason the player was banned&lt;br /&gt;
	outputChatBox(&amp;quot;-----BAN-----&amp;quot;,getRootElement(),255,0,0)&lt;br /&gt;
	if (banned) then&lt;br /&gt;
		outputChatBox(&amp;quot;Player banned: &amp;quot;..banned,getRootElement(),255,0,0) -- Output the player name who was banned&lt;br /&gt;
	end&lt;br /&gt;
	if (banner) then&lt;br /&gt;
		outputChatBox(&amp;quot;Banner: &amp;quot;..banner,getRootElement(),255,0,0) -- Output the admin name who performed the ban&lt;br /&gt;
	end&lt;br /&gt;
	if (reason) then&lt;br /&gt;
		outputChatBox(&amp;quot;Reason: &amp;quot;..reason,getRootElement(),255,0,0) -- outputt the reason the player was banned&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onBan&amp;quot;,getRootElement(),outputBan) -- When a player is banned trigger the outputBan function&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:getBanReason]]&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetBanNick&amp;diff=23607</id>
		<title>GetBanNick</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetBanNick&amp;diff=23607"/>
		<updated>2010-06-05T03:53:37Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Added an example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function will return the nickname (nickname that the player had when he was banned) of the specified [[ban]] element.&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 getBanNick ( ban theBan )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theBan:''' The [[ban]] element which nickname you want to return.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''string'' of the nickname if everything was successfull, ''false'' if invalid arguments are specified if there was no nickname specified for the [[ban]] element.&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 outputBan(ban)&lt;br /&gt;
	local banned = getBanNick(ban) -- Get the name of the player who was banned&lt;br /&gt;
	local banner = getBanAdmin(ban) -- Get the name of the admin who banned the player&lt;br /&gt;
	local reason = getBanReason(ban) -- Get the reason the player was banned&lt;br /&gt;
	outputChatBox(&amp;quot;-----BAN-----&amp;quot;,getRootElement(),255,0,0)&lt;br /&gt;
	if (banned) then&lt;br /&gt;
		outputChatBox(&amp;quot;Player banned: &amp;quot;..banned,getRootElement(),255,0,0) -- Output the player name who was banned&lt;br /&gt;
	end&lt;br /&gt;
	if (banner) then&lt;br /&gt;
		outputChatBox(&amp;quot;Banner: &amp;quot;..banner,getRootElement(),255,0,0) -- Output the admin name who performed the ban&lt;br /&gt;
	end&lt;br /&gt;
	if (reason) then&lt;br /&gt;
		outputChatBox(&amp;quot;Reason: &amp;quot;..reason,getRootElement(),255,0,0) -- outputt the reason the player was banned&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onBan&amp;quot;,getRootElement(),outputBan) -- When a player is banned trigger the outputBan function&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Admin functions}}&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPlayerClick&amp;diff=23606</id>
		<title>OnPlayerClick</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPlayerClick&amp;diff=23606"/>
		<updated>2010-06-05T03:44:23Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Added an example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server event}}&lt;br /&gt;
This event is triggered when a player clicks using the mouse cursor.&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 mouseButton, string buttonState, element clickedElement, float worldPosX, float worldPosY, float worldPosZ, float screenPosX, float screenPosY&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''mouseButton''': A string representing the mousebutton that was pressed. Value can be ''left'', ''middle'' or ''right''.&lt;br /&gt;
*'''buttonState''': A string representing the button state. Value can be ''up'' or ''down''.&lt;br /&gt;
*'''clickedElement''': The element the player clicked on. This value is ''nil'' if none.&lt;br /&gt;
*'''worldPosX''': The X position in the world the player clicked on&lt;br /&gt;
*'''worldPosY''': The Y position in the world the player clicked on&lt;br /&gt;
*'''worldPosZ''': The Z position in the world the player clicked on&lt;br /&gt;
*'''screenPosX''': The X position on the screen the player clicked on&lt;br /&gt;
*'''screenPosY''': The Y position on the screen the player clicked on&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[player]] that clicked.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example outputs the state of the button they just pressed.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function outputClick(mouseButton,buttonState)&lt;br /&gt;
	outputChatBox(&amp;quot;Your &amp;quot;..mouseButton..&amp;quot; mouse button is now &amp;quot;..buttonState,source,255,255,0) -- output the state of the button they just pressed.&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerClick&amp;quot;,getRootElement(),outputClick) -- When a player clicks trigger the outputClick function&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Player events}}&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetWeaponAmmo&amp;diff=23605</id>
		<title>SetWeaponAmmo</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetWeaponAmmo&amp;diff=23605"/>
		<updated>2010-06-05T03:35:37Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Added an example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}} &lt;br /&gt;
Sets the ammo to a certain amount for a specified weapon (if they already have it), regardless of current ammo.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setWeaponAmmo ( player thePlayer, int weapon, int totalAmmo, [int ammoInClip = 0] )&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;
*'''weapon:''' A whole number integer that refers to a [[weapon]] ID.&lt;br /&gt;
*'''totalAmmo:''' A whole number integer serving as the total ammo amount for the given weapon (including ammo in clip).&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''ammoInClip:''' The amount of ammo to set in the player's clip.  This will be taken from the main ammo.  If left unspecified or set to 0, the current clip will remain.&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns a boolean value ''true'' or ''false'' that tells you if it was successful or not.&lt;br /&gt;
&lt;br /&gt;
==Example==  &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local randPlayer = getRandomPlayer() -- Get a random player&lt;br /&gt;
giveWeapon(randPlayer,35,100) -- Give them a rocket launcher with 100 rockets.&lt;br /&gt;
setWeaponAmmo(randPlayer,35,50) -- Decide we're only going to give them 50 rockets.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Weapon functions}}&lt;br /&gt;
[[ru:setWeaponAmmo]]&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=MakePedUseGun&amp;diff=23604</id>
		<title>MakePedUseGun</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=MakePedUseGun&amp;diff=23604"/>
		<updated>2010-06-05T03:28:16Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: May not be Deprecated after all.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function is used to force a ped to use a gun.&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 makePedUseGun ( ped thePed, int useType, element target )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''thePed:''' The [[ped]] you wish to force the use of a gun upon.&lt;br /&gt;
*'''useType:''' How the weapon should be used, will accept the following values:&lt;br /&gt;
** '''0:''' Do nothing&lt;br /&gt;
** '''1:''' Aim weapon&lt;br /&gt;
** '''2:''' Fire&lt;br /&gt;
** '''3:''' Burst-fire&lt;br /&gt;
** '''4:''' Reload&lt;br /&gt;
** '''5:''' Pistolwhip (Weapon melee)&lt;br /&gt;
** '''6:''' Cancel use&lt;br /&gt;
** '''7:''' Cancel use immediately&lt;br /&gt;
*'''target:''' An [[element]] referring to the target that the ped will use its weapon against. &lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the command was successful, false otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This page lacks an example&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--add an example here&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_ped_functions}}&lt;br /&gt;
[[Category:Needs_Example]]&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=UsePickup&amp;diff=23603</id>
		<title>UsePickup</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=UsePickup&amp;diff=23603"/>
		<updated>2010-06-05T03:24:21Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Added example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function is used to simulate the player using a pickup&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 usePickup ( pickup thePickup, player thePlayer )    &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
* '''thePickup''': The pickup element to be picked up/used.&lt;br /&gt;
* '''thePlayer''': The player to use the pickup.&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 gives a random player 100% armor by using a pickup.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local pickup = createPickup(3,3,3,1,100) -- Create a pickup for 100% armor&lt;br /&gt;
usePickup(pickup,getRandomPlayer()) -- Make a random player use the pickup (shall recieve 100% armor)&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;
{{Pickup functions}}&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=MakePedUseGun&amp;diff=23602</id>
		<title>MakePedUseGun</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=MakePedUseGun&amp;diff=23602"/>
		<updated>2010-06-05T03:15:27Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Deprecated&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{Deprecated}}&lt;br /&gt;
This function is used to force a ped to use a gun.&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 makePedUseGun ( ped thePed, int useType, element target )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''thePed:''' The [[ped]] you wish to force the use of a gun upon.&lt;br /&gt;
*'''useType:''' How the weapon should be used, will accept the following values:&lt;br /&gt;
** '''0:''' Do nothing&lt;br /&gt;
** '''1:''' Aim weapon&lt;br /&gt;
** '''2:''' Fire&lt;br /&gt;
** '''3:''' Burst-fire&lt;br /&gt;
** '''4:''' Reload&lt;br /&gt;
** '''5:''' Pistolwhip (Weapon melee)&lt;br /&gt;
** '''6:''' Cancel use&lt;br /&gt;
** '''7:''' Cancel use immediately&lt;br /&gt;
*'''target:''' An [[element]] referring to the target that the ped will use its weapon against. &lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the command was successful, false otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This page lacks an example&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--add an example here&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_ped_functions}}&lt;br /&gt;
[[Category:Needs_Example]]&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnClientConsole&amp;diff=23586</id>
		<title>OnClientConsole</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnClientConsole&amp;diff=23586"/>
		<updated>2010-05-31T03:15:14Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: ouputChatBox had a player arg (only required server-side).&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Incomplete Event]]&lt;br /&gt;
{{Client event}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This event is triggered when the local player enters text in the console. Note that, if you want to add custom console commands, it is easier to the [[addCommandHandler]] function.&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 text&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''text:''' the text line that was entered.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example outputs any text you input into the console. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function consoleCheck(text)&lt;br /&gt;
	outputChatBox(&amp;quot;You entered into the console: &amp;quot;..text,255,255,0)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientConsole&amp;quot;,getLocalPlayer(),consoleCheck)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
===Other client events===&lt;br /&gt;
{{Client_other_events}}&lt;br /&gt;
===Client event functions===&lt;br /&gt;
{{Client_event_functions}}&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetCameraInterior&amp;diff=23585</id>
		<title>SetCameraInterior</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetCameraInterior&amp;diff=23585"/>
		<updated>2010-05-31T03:14:14Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Added example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
Sets the interior of the local camera. Only the interior of the camera is changed, the local player stays in the interior he was in.&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 setCameraInterior ( player thePlayer, int interior )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''thePlayer:''' the player whose camera interior will be set.&lt;br /&gt;
*'''interior:''' the interior to place the camera in.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setCameraInterior ( int interior )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''interior:''' the interior to place the camera in.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the camera's interior was changed 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;
&lt;br /&gt;
&amp;lt;strong&amp;gt; This example make a command to change your cam interior to a selected one. &amp;lt;/strong&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function setCamInt( thePlayer, commandName, intID )&lt;br /&gt;
        if( intID )then&lt;br /&gt;
		local seted = setCameraInterior( thePlayer, intID )&lt;br /&gt;
                if( seted )then&lt;br /&gt;
                        outputChatBox( &amp;quot;Your camera's interior has been seted to &amp;quot;..intID, thePlayer )&lt;br /&gt;
                else&lt;br /&gt;
                        outputChatBox( &amp;quot;Can't change your camera's interior...&amp;quot;, thePlayer, 255, 0, 0 )&lt;br /&gt;
                end&lt;br /&gt;
	else&lt;br /&gt;
		outputChatBox( &amp;quot;Syntax: /caminterior [interiorID] &amp;quot;, thePlayer, 255, 0, 0 )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler( &amp;quot;caminterior&amp;quot;, setCamInt )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;strong&amp;gt; This example make a command to change your cam interior to a selected one. &amp;lt;/strong&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function setCam(thePlayer,command,int)&lt;br /&gt;
    if (int) then&lt;br /&gt;
		local setInt = setCameraInterior(thePlayer,int)&lt;br /&gt;
                if (setInt) then&lt;br /&gt;
                        outputChatBox(&amp;quot;Your camera's interior has been set to &amp;quot;..int,255,255,0)&lt;br /&gt;
                else&lt;br /&gt;
                        outputChatBox(&amp;quot;Can't change your camera's interior...&amp;quot;,255,0,0)&lt;br /&gt;
                end&lt;br /&gt;
	else&lt;br /&gt;
		outputChatBox(&amp;quot;Syntax: /camera [interiorID] &amp;quot;,255,0,0)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;camera&amp;quot;,setCam)&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;
{{Client_camera_functions}}&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetTrainDirection&amp;diff=23584</id>
		<title>GetTrainDirection</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetTrainDirection&amp;diff=23584"/>
		<updated>2010-05-31T03:06:52Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Added an example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
Gets the direction in which a train is driving (clockwise or counterclockwise).&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool getTrainDirection ( vehicle train )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''train:''' the train of which to get the driving direction.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the train is driving clockwise on the train track, ''false'' if it is going counterclockwise or a failure occured.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example outputs to the player the direction the train they're driving is travelling.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function trainDir(thePlayer,command)&lt;br /&gt;
	if (isPedInVehicle(thePlayer)) then -- Check if they're even in a vehicle.&lt;br /&gt;
		if (getVehicleType(getPedOccupiedVehicle(thePlayer)) == &amp;quot;Train&amp;quot;) then -- Check if they're in a train.&lt;br /&gt;
			local direction = getTrainDirection(getPedOccupiedVehicle(thePlayer)) -- Get the train's direction.&lt;br /&gt;
				if (direction) then&lt;br /&gt;
					outputChatBox(&amp;quot;You're driving clockwise.&amp;quot;,thePlayer,255,255,0) -- Output that they're driving clockwise.&lt;br /&gt;
				else&lt;br /&gt;
					outputChatBox(&amp;quot;You're driving anti-clockwise.&amp;quot;,thePlayer,255,255,0) -- Output that they're driving anti-clockwise.&lt;br /&gt;
				end&lt;br /&gt;
		else&lt;br /&gt;
			outputChatBox(&amp;quot;You must be in a train to use this command.&amp;quot;,thePlayer,255,0,0) -- Output that they're not in a train.&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		outputChatBox(&amp;quot;You must be in a train to use this command.&amp;quot;,thePlayer,255,0,0) -- Output that they're not in a vehicle.&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;direction&amp;quot;,trainDir)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPlayerMarkerHit&amp;diff=23583</id>
		<title>OnPlayerMarkerHit</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPlayerMarkerHit&amp;diff=23583"/>
		<updated>2010-05-31T02:58:27Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Added an example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server event}}&lt;br /&gt;
This event is triggered when a [[player]] hits a [[marker]].&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
marker markerHit, bool matchingDimension&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''markerHit''': The marker the player hit&lt;br /&gt;
*'''matchingDimension''': Whether the player and the marker he hit are in the same dimension&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[player]] that hit the marker.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example outputs when a player hits a marker.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function markerAlert(markerHit,matchingDimension)&lt;br /&gt;
	if (matchingDimension) then -- Make sure the player is in the same dimension as the marker (so they're actually going into it).&lt;br /&gt;
		outputChatBox(&amp;quot;You have just entered a marker.&amp;quot;,source,255,255,0) -- Output that they are.&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerMarkerHit&amp;quot;,getRootElement(),markerAlert)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Player events}}&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetMarkerCount&amp;diff=23582</id>
		<title>GetMarkerCount</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetMarkerCount&amp;diff=23582"/>
		<updated>2010-05-31T02:50:24Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Added an example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
Returns the number of markers that currently exist 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;
int getMarkerCount ( )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
''None''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the number of markers that currently exist.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example outputs the amount of markers to the player.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function howManyMarkers(thePlayer,command)&lt;br /&gt;
	local ammount = getMarkerCount()&lt;br /&gt;
	outputChatBox(&amp;quot;There are &amp;quot;..ammount..&amp;quot; markers.&amp;quot;,thePlayer,255,255,0)&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;markers&amp;quot;,howManyMarkers)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Marker functions}}&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetCameraInterior&amp;diff=23581</id>
		<title>GetCameraInterior</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetCameraInterior&amp;diff=23581"/>
		<updated>2010-05-31T02:47:22Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Removed page from &amp;quot;Needs example&amp;quot; category.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
Returns the interior of the local camera (independent of the interior of the local player).&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int getCameraInterior ( player thePlayer )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
'''thePlayer''': the player whose camera interior you want to check.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int getCameraInterior ( )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
''None''&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns an ''integer'' indicating the camera's interior, ''false'' if the argument is invalid.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example outputs the interior the player's camera is in.&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;
function camInt(thePlayer,command)&lt;br /&gt;
	local interior = getCameraInterior(thePlayer)&lt;br /&gt;
	outputChatBox(&amp;quot;The camera is in interior &amp;quot;..interior,thePlayer,255,255,0)&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;camera&amp;quot;,camInt)&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;
{{Camera functions}}&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetCameraInterior&amp;diff=23580</id>
		<title>GetCameraInterior</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetCameraInterior&amp;diff=23580"/>
		<updated>2010-05-31T02:46:20Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Added a server-side example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
Returns the interior of the local camera (independent of the interior of the local player).&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int getCameraInterior ( player thePlayer )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
'''thePlayer''': the player whose camera interior you want to check.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int getCameraInterior ( )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
''None''&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns an ''integer'' indicating the camera's interior, ''false'' if the argument is invalid.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example outputs the interior the player's camera is in.&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;
function camInt(thePlayer,command)&lt;br /&gt;
	local interior = getCameraInterior(thePlayer)&lt;br /&gt;
	outputChatBox(&amp;quot;The camera is in interior &amp;quot;..interior,thePlayer,255,255,0)&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;camera&amp;quot;,camInt)&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;
{{Camera functions}}&lt;br /&gt;
[[Category:Needs Example]]&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnClientConsole&amp;diff=23579</id>
		<title>OnClientConsole</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnClientConsole&amp;diff=23579"/>
		<updated>2010-05-31T02:41:00Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Added example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Incomplete Event]]&lt;br /&gt;
{{Client event}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This event is triggered when the local player enters text in the console. Note that, if you want to add custom console commands, it is easier to the [[addCommandHandler]] function.&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 text&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''text:''' the text line that was entered.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example outputs any text you input into the console. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function consoleCheck(text)&lt;br /&gt;
	outputChatBox(&amp;quot;You entered into the console: &amp;quot;..text,getLocalPlayer(),255,255,0)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientConsole&amp;quot;,getLocalPlayer(),consoleCheck)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
===Other client events===&lt;br /&gt;
{{Client_other_events}}&lt;br /&gt;
===Client event functions===&lt;br /&gt;
{{Client_event_functions}}&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsGlitchEnabled&amp;diff=23578</id>
		<title>IsGlitchEnabled</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsGlitchEnabled&amp;diff=23578"/>
		<updated>2010-05-31T02:34:03Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Added example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function retrieves whether San Andreas game glitches are enabled or not, set by using [[setGlitchEnabled]]&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isGlitchEnabled ( string glitchName )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''glitchName:''' the name of the property to set. Possible values are:&lt;br /&gt;
**'''quickreload''' - This is the glitch where switching weapons auto-reloads your weapon, without actually performing the reload animation.&lt;br /&gt;
**'''fastmove''' - This is the glitch that can be achieved by a certain key combinations whilst standing up after crouching, which allows you to move quickly with slow weapons (e.g. deagle).&lt;br /&gt;
**'''fastfire''' - This is the glitch that can be achieved by cancelling the full fire animation, allowing you to shoot with slow-fire weapons (e.g. deagle) much faster.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if if the glitch was enabled, or ''false'' if it is disabled.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example outputs weather the &amp;quot;fastmove&amp;quot; glitch is enabled or not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setGlitchEnabled(&amp;quot;fastmove&amp;quot;,true) -- Enable the fastmove glitch at resource start.&lt;br /&gt;
&lt;br /&gt;
function checkIsEnabled(thePlayer,command)&lt;br /&gt;
	if (isGlitchEnabled(&amp;quot;fastmove&amp;quot;)) then -- Check weather fastmove is enabled or not.&lt;br /&gt;
		outputChatBox(&amp;quot;fastmove is enabled.&amp;quot;,thePlayer,255,255,0) -- If so, output that it's enabled.&lt;br /&gt;
	else&lt;br /&gt;
		outputChatBox(&amp;quot;fastmove is not enabled.&amp;quot;,thePlayer,255,0,0) -- If not, output that it isn't enabled.&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;glitch&amp;quot;,checkIsEnabled)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Server functions}}&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnClientPlayerStuntStart&amp;diff=23497</id>
		<title>OnClientPlayerStuntStart</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnClientPlayerStuntStart&amp;diff=23497"/>
		<updated>2010-05-15T17:39:39Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Typo in the event handler in example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client event}}&lt;br /&gt;
This event is triggered whenever the local player starts doing a vehicle stunt.&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 stuntType&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''stuntType''': the type of stunt the player is starting to perform. Valid types are:&lt;br /&gt;
{{StuntTypes}}&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the local [[player]].&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This is a simple stunt script which tells player what stunt he/she started and finished, time the stunt taken to perform and distance travelled while stunting.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler( &amp;quot;onClientPlayerStuntStart&amp;quot;, getRootElement( ),&lt;br /&gt;
    function ( stuntType )&lt;br /&gt;
        outputChatBox( &amp;quot;You started stunt: &amp;quot; .. stuntType );&lt;br /&gt;
    end&lt;br /&gt;
);&lt;br /&gt;
&lt;br /&gt;
addEventHandler( &amp;quot;onClientPlayerStuntFinish&amp;quot;, getRootElement( ),&lt;br /&gt;
    function ( stuntType, stuntTime, distance )&lt;br /&gt;
        outputChatBox( &amp;quot;You finished stunt: &amp;quot; .. stuntType ..&amp;quot;, Time: &amp;quot; .. tostring( stuntTime ).. &amp;quot;, Distance: &amp;quot; .. tostring( distance ) );&lt;br /&gt;
    end&lt;br /&gt;
);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
===Client player events===&lt;br /&gt;
{{Client_player_events}}&lt;br /&gt;
===Client event functions===&lt;br /&gt;
{{Client_event_functions}}&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetElementVisibleTo&amp;diff=22937</id>
		<title>SetElementVisibleTo</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetElementVisibleTo&amp;diff=22937"/>
		<updated>2010-04-20T18:22:57Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Forgot about 2nd example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
{{Needs_Checking|Can an element only be visible to one element (and its children) at a time? If so, do we need clearElementVisibleTo? If not, surely we need to remove the root element before using this function?|[[User:EAi|EAi]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This function can change an [[element]]'s [[visibility]]. This does not work with all entities - [[vehicle]]s, [[player]]s and [[object]]s are exempt. This is because these objects are required for accurate sync (they're physical objects). This function is particularily useful for changing the visibility of markers, radar blips and radar areas.&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 setElementVisibleTo ( element theElement, element visibleTo, bool visible )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' The element you want to control the visibility of.&lt;br /&gt;
*'''visibleTo:''' The element you wish the element to be visible or invisible to. Any child elements that are players will also be able to see the element. See [[visibility]].&lt;br /&gt;
*'''visible:''' Whether you are making it visible or invisible to the player.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the element's visibility was changed successfully, ''false'' otherwise, for example if you are trying to change the visibility of a vehicle, player or object.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example creates a marker and makes it only visibile to the player called 'someguy'.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Find the player called someguy&lt;br /&gt;
local someguy = getPlayerFromName ( &amp;quot;someguy&amp;quot; )&lt;br /&gt;
-- If the player was found then&lt;br /&gt;
if ( someguy ) then&lt;br /&gt;
	-- Get the player's position into the variables x, y and z&lt;br /&gt;
	x, y, z = getElementPosition ( someguy )&lt;br /&gt;
	-- Create a marker at the player's position&lt;br /&gt;
	myMarker = createMarker ( x, y, z )&lt;br /&gt;
	-- First off make the marker invisible to the whole dimension&lt;br /&gt;
	setElementVisibleTo ( myMarker, getRootElement ( ), false )&lt;br /&gt;
	-- Then make the marker visible again, but only to someguy&lt;br /&gt;
	setElementVisibleTo ( myMarker, someguy, true )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following example shows how to hide the marker on 'someguy' from 'anotherguy'&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Find the player called someguy&lt;br /&gt;
local someguy = getPlayerFromName ( &amp;quot;someguy&amp;quot; )&lt;br /&gt;
local anotherguy = getPlayerFromNick ( &amp;quot;anotherguy&amp;quot; )&lt;br /&gt;
-- If the player was found then&lt;br /&gt;
if ( someguy ) then&lt;br /&gt;
	-- Get the player's position into the variables x, y and z&lt;br /&gt;
	x, y, z = getElementPosition ( someguy )&lt;br /&gt;
	-- Create a marker at the player's position&lt;br /&gt;
	myMarker = createMarker ( x, y, z )&lt;br /&gt;
	-- First off make the marker visible especially to 'anotherguy'&lt;br /&gt;
	setElementVisibleTo ( myMarker, anotherguy, true )&lt;br /&gt;
	-- Then hide it&lt;br /&gt;
	setElementVisibleTo ( myMarker, anotherguy, false )&lt;br /&gt;
end&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>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetElementVisibleTo&amp;diff=22936</id>
		<title>SetElementVisibleTo</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetElementVisibleTo&amp;diff=22936"/>
		<updated>2010-04-20T18:21:24Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Example: getPlayerFromNick -&amp;gt; getPlayerFromName (Deprecated)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
{{Needs_Checking|Can an element only be visible to one element (and its children) at a time? If so, do we need clearElementVisibleTo? If not, surely we need to remove the root element before using this function?|[[User:EAi|EAi]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This function can change an [[element]]'s [[visibility]]. This does not work with all entities - [[vehicle]]s, [[player]]s and [[object]]s are exempt. This is because these objects are required for accurate sync (they're physical objects). This function is particularily useful for changing the visibility of markers, radar blips and radar areas.&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 setElementVisibleTo ( element theElement, element visibleTo, bool visible )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' The element you want to control the visibility of.&lt;br /&gt;
*'''visibleTo:''' The element you wish the element to be visible or invisible to. Any child elements that are players will also be able to see the element. See [[visibility]].&lt;br /&gt;
*'''visible:''' Whether you are making it visible or invisible to the player.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the element's visibility was changed successfully, ''false'' otherwise, for example if you are trying to change the visibility of a vehicle, player or object.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example creates a marker and makes it only visibile to the player called 'someguy'.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Find the player called someguy&lt;br /&gt;
local someguy = getPlayerFromName ( &amp;quot;someguy&amp;quot; )&lt;br /&gt;
-- If the player was found then&lt;br /&gt;
if ( someguy ) then&lt;br /&gt;
	-- Get the player's position into the variables x, y and z&lt;br /&gt;
	x, y, z = getElementPosition ( someguy )&lt;br /&gt;
	-- Create a marker at the player's position&lt;br /&gt;
	myMarker = createMarker ( x, y, z )&lt;br /&gt;
	-- First off make the marker invisible to the whole dimension&lt;br /&gt;
	setElementVisibleTo ( myMarker, getRootElement ( ), false )&lt;br /&gt;
	-- Then make the marker visible again, but only to someguy&lt;br /&gt;
	setElementVisibleTo ( myMarker, someguy, true )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following example shows how to hide the marker on 'someguy' from 'anotherguy'&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Find the player called someguy&lt;br /&gt;
local someguy = getPlayerFromNick ( &amp;quot;someguy&amp;quot; )&lt;br /&gt;
local anotherguy = getPlayerFromNick ( &amp;quot;anotherguy&amp;quot; )&lt;br /&gt;
-- If the player was found then&lt;br /&gt;
if ( someguy ) then&lt;br /&gt;
	-- Get the player's position into the variables x, y and z&lt;br /&gt;
	x, y, z = getElementPosition ( someguy )&lt;br /&gt;
	-- Create a marker at the player's position&lt;br /&gt;
	myMarker = createMarker ( x, y, z )&lt;br /&gt;
	-- First off make the marker visible especially to 'anotherguy'&lt;br /&gt;
	setElementVisibleTo ( myMarker, anotherguy, true )&lt;br /&gt;
	-- Then hide it&lt;br /&gt;
	setElementVisibleTo ( myMarker, anotherguy, false )&lt;br /&gt;
end&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>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetBans&amp;diff=22482</id>
		<title>GetBans</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetBans&amp;diff=22482"/>
		<updated>2010-02-24T19:52:49Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Added an example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function will return a table over all the [[ban]] values in 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;
table getBans ()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[table]] over all the [[ban]] pointers.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example lists every ban when somebody types &amp;quot;/bans&amp;quot;. WARNING: This will spam chat (for the player that executed the command) if the server has a lot of bans.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function listBans ()&lt;br /&gt;
	local bansList = getBans() -- Return a table of all the bans.&lt;br /&gt;
	local banID = 0 -- Set &amp;quot;banID&amp;quot; to 0.&lt;br /&gt;
		for k, ban in ipairs ( banList ) do -- For every ban do the following...&lt;br /&gt;
			banID = banID + 1 -- Each ban has a uniuqe ID.&lt;br /&gt;
			outputChatBox ( &amp;quot;Ban #&amp;quot; .. banID .. &amp;quot;: &amp;quot; .. ban .. &amp;quot;&amp;quot;, source, 255, 0, 0 ) -- Output the ban.&lt;br /&gt;
		end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;bans&amp;quot;, listBans ) -- Add &amp;quot;/bans&amp;quot; as the trigger for the function.&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:getBans]]&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPickupSpawn&amp;diff=22481</id>
		<title>OnPickupSpawn</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPickupSpawn&amp;diff=22481"/>
		<updated>2010-02-24T16:25:12Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Added an example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server event}}&lt;br /&gt;
This event is triggered when a pickup is spawned or respawned.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
This event has no arguments&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Add the event's source in the section below --&amp;gt;&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[pickup]] that just spawned or respawned.&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 get's the area and city name when a pickup spawns and outputs it to all the players.&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 outputSpawn ()&lt;br /&gt;
	local area = getElementZoneName ( source ) -- Get the area name where the pickup spawned.&lt;br /&gt;
	local city = getElementZoneName ( source, true ) -- Get the city name where the pickup spawned.&lt;br /&gt;
	outputChatBox ( &amp;quot;A pickup has spawned in &amp;quot; .. area .. &amp;quot; ( &amp;quot; .. city .. &amp;quot; )&amp;quot;, getRootElement(), 255, 0, 0 ) -- Output the pickup spawn.&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onPickupSpawn&amp;quot;, getRootElement(), outputSpawn ) -- Trigger the function when a pickup spawns.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Pickup events}}&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPlayerBan&amp;diff=22480</id>
		<title>OnPlayerBan</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPlayerBan&amp;diff=22480"/>
		<updated>2010-02-24T16:14:54Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Added an example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server event}}&lt;br /&gt;
This event is triggered when a player added a ban (like onBan).&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
ban banPointer, player responsibleElement&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''banPointer''': The ban pointer which was added.&lt;br /&gt;
*'''responsibleElement''': The player who added the ban&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[element]] that was responsible for the banning. If no responsible was specified, the source is the global root element.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example outputs the responcible element and the ban pointer when a ban takes place.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function outputBan ( banPointer, responcibleElement ) -- Define the banner and the ban pointer in the function.&lt;br /&gt;
outputChatBox ( getPlayerName(responcibleElement )..&amp;quot; has banned &amp;quot;.. banPointer ..&amp;quot;.&amp;quot;, getRootElement(), 255, 0, 0 ) -- Output the ban.&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerBan&amp;quot;, getRootElement(), outputBan ) -- Trigger the function when there is a ban.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Player events}}&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetPedSkin&amp;diff=22475</id>
		<title>SetPedSkin</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetPedSkin&amp;diff=22475"/>
		<updated>2010-02-23T20:59:04Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Removed duplicate Deprecated status (me and MCvarial edited both at once)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
{{Deprecated}}&lt;br /&gt;
This function changes the skin of a ped.&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 setPedSkin ( ped thePed, int skinID )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePed:''' The [[ped]] whose model will be changed.&lt;br /&gt;
*'''skinID:''' A GTASA player model (skin) ID. See [[Character Skins]].&lt;br /&gt;
&lt;br /&gt;
==Example== &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;
This example sets a players skin to the cop skin when they spawn.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function setCopSkin ()&lt;br /&gt;
	setPedSkin ( source, 280 )&lt;br /&gt;
	outputChatBox ( &amp;quot;You are now a cop.&amp;quot;, source, 255, 0, 0 )&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerSpawn&amp;quot;, getRootElement(), setCopSkin )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_ped_functions}}&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetPedSkin&amp;diff=22474</id>
		<title>SetPedSkin</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetPedSkin&amp;diff=22474"/>
		<updated>2010-02-23T20:57:30Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Added example and added to Deprecated category.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Deprecated}}&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
{{Deprecated}}&lt;br /&gt;
This function changes the skin of a ped.&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 setPedSkin ( ped thePed, int skinID )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePed:''' The [[ped]] whose model will be changed.&lt;br /&gt;
*'''skinID:''' A GTASA player model (skin) ID. See [[Character Skins]].&lt;br /&gt;
&lt;br /&gt;
==Example== &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;
This example sets a players skin to the cop skin when they spawn.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function setCopSkin ()&lt;br /&gt;
	setPedSkin ( source, 280 )&lt;br /&gt;
	outputChatBox ( &amp;quot;You are now a cop.&amp;quot;, source, 255, 0, 0 )&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerSpawn&amp;quot;, getRootElement(), setCopSkin )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_ped_functions}}&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetTrainSpeed&amp;diff=22472</id>
		<title>GetTrainSpeed</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetTrainSpeed&amp;diff=22472"/>
		<updated>2010-02-23T20:44:35Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Added an example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
&lt;br /&gt;
Gets the speed at which a train is traveling on the rails.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;float getTrainSpeed ( vehicle train )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''train:''' the train of which to retrieve the speed.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the train's speed if successful, ''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 outputs how fast a player is going if they're in a train. The command is &amp;quot;/speed&amp;quot;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function getPlayersTrainSpeed ( source, command ) -- Define source in the function header.&lt;br /&gt;
	if ( isPedInVehicle ( source ) ) -- Check if they're in a vehicle.&lt;br /&gt;
	local veh = getPedOccupiedVehicle ( source ) -- Get the vehicle they're in.&lt;br /&gt;
		if ( getVehicleType ( veh ) == &amp;quot;Train&amp;quot; ) then -- Check if the vehicle they're in is a train.&lt;br /&gt;
			local speed = getTrainSpeed ( veh ) -- Get the trains speed.&lt;br /&gt;
			outputChatBox ( &amp;quot;You are travelling at a speed of &amp;quot; .. speed, source, 255, 0, 0 ) -- Output their speed.&lt;br /&gt;
		else&lt;br /&gt;
			outputChatBox ( &amp;quot;You must be in a train to use this command.&amp;quot;, source, 255, 0, 0 ) -- Tell them they're not in a train.&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		outputChatBox ( &amp;quot;You must be in a train to use this command.&amp;quot;, source, 255, 0, 0 ) -- Tell them they're not in a train.&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;speed&amp;quot;, getPlayersTrainSpeed ) -- Make the function trigger when a player types &amp;quot;/speed&amp;quot;.&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;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CreateResource&amp;diff=22471</id>
		<title>CreateResource</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CreateResource&amp;diff=22471"/>
		<updated>2010-02-23T20:33:21Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Added an example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function creates an empty resource.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
resource createResource ( string resourceName )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''resourceName:''' The name of the new resource.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the resource has been created successfully, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example creates a new resource named what the player specified. The command is &amp;quot;/new-resource &amp;lt;name&amp;gt;&amp;quot;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createNewResource ( source, command, resourceName ) -- Define the source and add a resourceName argument.&lt;br /&gt;
	if ( resourceName ) then -- Check if they entered a resource name, and if they did...&lt;br /&gt;
		local resourceName = tostring ( resourceName ) -- Convert the name into a string.&lt;br /&gt;
		local newResource = createResource ( resourceName ) -- Create the new resource.&lt;br /&gt;
			if ( newResource ) then -- Check if the resource has been created, if so then...&lt;br /&gt;
				outputChatBox ( &amp;quot;New resource created succcessfully.&amp;quot;, source, 255, 0, 0 ) -- Output it's done.&lt;br /&gt;
			else -- If the resource wasn't made successfully then...&lt;br /&gt;
				outputChatBox ( &amp;quot;An un-expected error occured.&amp;quot;, source, 255, 0, 0 ) -- Output it failed.&lt;br /&gt;
			end&lt;br /&gt;
	else -- If they didn't enter a resource name...&lt;br /&gt;
		outputChatBox ( &amp;quot;Please specify a name for your new resource.&amp;quot;, source, 255, 0, 0 ) -- Tell them to specify a name.&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;new-resource&amp;quot;, createNewResource ) -- Make it trigger when somebody types &amp;quot;/new-resource &amp;lt;name&amp;gt;&amp;quot;.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Resource_functions}}&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=ResetVehicleExplosionTime&amp;diff=22470</id>
		<title>ResetVehicleExplosionTime</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=ResetVehicleExplosionTime&amp;diff=22470"/>
		<updated>2010-02-23T20:18:31Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Added an example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
Resets the vehicle explosion time. This is the point in time at which the vehicle last exploded: at this time plus the vehicle's respawn delay, the vehicle is respawned. You can use this function to prevent the vehicle from respawning.&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 resetVehicleExplosionTime ( vehicle theVehicle )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theVehicle:''' The vehicle you wish to reset the explosion time from.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the vehicle explosion time has been reset, ''false'' if it failed to reset the explosion time.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example resets every vehicle's explosion time when the resource is stopped.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function resetVehiclesExplosionTime ()&lt;br /&gt;
	local vehicles = getElementsByType ( &amp;quot;vehicle&amp;quot; ) -- Return all the vehicles in a table&lt;br /&gt;
		for k, vehicle in ipairs ( vehicles ) do -- For every vehicle do the following...&lt;br /&gt;
			resetVehicleExplosionTime ( vehicle ) -- Reset the vehicle's explosion time&lt;br /&gt;
		end&lt;br /&gt;
end&lt;br /&gt;
-- When this resource is stopped, trigger the resetVehiclesExplosionTime function (above).&lt;br /&gt;
addEventHandler ( &amp;quot;onResourceStop&amp;quot;, getResourceRootElement(getThisResource()), resetVehiclesExplosionTime )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=ResetVehicleIdleTime&amp;diff=22469</id>
		<title>ResetVehicleIdleTime</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=ResetVehicleIdleTime&amp;diff=22469"/>
		<updated>2010-02-23T20:12:34Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Added an example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
Resets the vehicle idle time&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool resetVehicleIdleTime ( vehicle theVehicle )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theVehicle:''' The vehicle you wish to reset the idle time from.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the vehicle idle time has been reset, ''false'' if it failed to reset the idle time.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example resets every vehicle's idle time when the resource is stopped.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function resetVehiclesIdleTime ()&lt;br /&gt;
	local vehicles = getElementsByType ( &amp;quot;vehicle&amp;quot; ) -- Return all the vehicles in a table&lt;br /&gt;
		for k, vehicle in ipairs ( vehicles ) do -- For every vehicle do the following...&lt;br /&gt;
			resetVehicleIdleTime ( vehicle ) -- Reset the vehicle's idle time&lt;br /&gt;
		end&lt;br /&gt;
end&lt;br /&gt;
-- When this resource is stopped, trigger the resetVehiclesIdleTime function (above).&lt;br /&gt;
addEventHandler ( &amp;quot;onResourceStop&amp;quot;, getResourceRootElement(getThisResource()), resetVehiclesIdleTime )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AddBan&amp;diff=22468</id>
		<title>AddBan</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AddBan&amp;diff=22468"/>
		<updated>2010-02-23T19:58:32Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Removed &amp;lt;section&amp;gt; (function is server-side only (not needed))&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function will add a ban for the specified IP/username/serial to 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;
ban addBan ( [ string IP, string Username, string Serial, player responsibleElement, string reason, int seconds = 0 ] )         &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
'''Note:''' One of the three: IP, Username or Serial have to be specified.&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''IP:''' The IP to be banned. If you don't want to ban by IP, set this to ''nil''.&lt;br /&gt;
'''or'''&lt;br /&gt;
*'''Username:''' The username to be banned. If you don't want to ban by username, set this to ''nil''.&lt;br /&gt;
'''or'''&lt;br /&gt;
*'''Serial:''' The serial to be banned. If you don't want to ban by serial, set this to ''nil''.&lt;br /&gt;
''' or any combination.'''&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''responsibleElement:''' The element that is responsible for banning the IP/username/serial. This can be a player or the root ([[getRootElement]]()).&lt;br /&gt;
*'''reason:''' The reason the IP/username/serial 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;
Returns ''true'' if the IP/username/serial was banned succesfully, ''false'' if invalid arguments are specified.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example bans a player's IP with the reason &amp;quot;Requested&amp;quot; when they type &amp;quot;/ban-me&amp;quot;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function banMe ( source, command ) -- The function header and where source is defined&lt;br /&gt;
	local ipToBan = getPlayerIP ( source ) -- Get the player's IP&lt;br /&gt;
	addBan ( ipToBan, source, &amp;quot;Requested&amp;quot; ) -- Ban him with the reason; Requested&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;ban-me&amp;quot;, banMe ) -- Make it trigger when a player types &amp;quot;/ban-me&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Admin functions}}&lt;br /&gt;
[[ru:addBan]]&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AclSave&amp;diff=22467</id>
		<title>AclSave</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AclSave&amp;diff=22467"/>
		<updated>2010-02-23T19:57:31Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Added an example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}} &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 saves the ACL from the memory back to the XML file. That must be done after changing the ACL so your changes are remembered for the next server restart. This does not need to be done after every change, but after you're done changing it.&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 aclSave ()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &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 ACL was successfully changed, ''false'' or ''nil'' if it could not be saved for some reason, ie. file in use.&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 saves the ACL when somebody types &amp;quot;/save-acl&amp;quot;.&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 saveACL ( thePlayer, command ) -- Function header. Also where thePlayer is defined.&lt;br /&gt;
	local saved = aclSave() -- Save the ACL&lt;br /&gt;
		if ( saved ) then -- If it was successfully saved then...&lt;br /&gt;
			outputChatBox ( &amp;quot;ACL was successfully saved.&amp;quot;, source, 255, 0, 0 ) -- Output it saved&lt;br /&gt;
		else -- If it wasn't saved for whatever reason then...&lt;br /&gt;
			outputChatBox ( &amp;quot;An unexpected error occured.&amp;quot;, source, 255, 0, 0 ) -- Output it didn't save&lt;br /&gt;
		end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;save-acl&amp;quot;, saveACL ) -- Make it trigger for &amp;quot;/save-acl&amp;quot;.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;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;
{{ACL_functions}}&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AddBan&amp;diff=22466</id>
		<title>AddBan</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AddBan&amp;diff=22466"/>
		<updated>2010-02-23T19:49:23Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Added an example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function will add a ban for the specified IP/username/serial to 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;
ban addBan ( [ string IP, string Username, string Serial, player responsibleElement, string reason, int seconds = 0 ] )         &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
'''Note:''' One of the three: IP, Username or Serial have to be specified.&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''IP:''' The IP to be banned. If you don't want to ban by IP, set this to ''nil''.&lt;br /&gt;
'''or'''&lt;br /&gt;
*'''Username:''' The username to be banned. If you don't want to ban by username, set this to ''nil''.&lt;br /&gt;
'''or'''&lt;br /&gt;
*'''Serial:''' The serial to be banned. If you don't want to ban by serial, set this to ''nil''.&lt;br /&gt;
''' or any combination.'''&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''responsibleElement:''' The element that is responsible for banning the IP/username/serial. This can be a player or the root ([[getRootElement]]()).&lt;br /&gt;
*'''reason:''' The reason the IP/username/serial 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;
Returns ''true'' if the IP/username/serial was banned succesfully, ''false'' if invalid arguments are specified.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Serverside example&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example bans a player's IP with the reason &amp;quot;Requested&amp;quot; when they type &amp;quot;/ban-me&amp;quot;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function banMe ( source, command ) -- The function header and where source is defined&lt;br /&gt;
	local ipToBan = getPlayerIP ( source ) -- Get the player's IP&lt;br /&gt;
	addBan ( ipToBan, source, &amp;quot;Requested&amp;quot; ) -- Ban him with the reason; Requested&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;ban-me&amp;quot;, banMe ) -- Make it trigger when a player types &amp;quot;/ban-me&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Admin functions}}&lt;br /&gt;
[[ru:addBan]]&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsVehicleBlown&amp;diff=22461</id>
		<title>IsVehicleBlown</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsVehicleBlown&amp;diff=22461"/>
		<updated>2010-02-22T19:03:36Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Doesn't &amp;quot;Need example&amp;quot;.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function allows you to determine whether a vehicle is blown or still intact.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isVehicleBlown ( vehicle theVehicle )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theVehicle:''' The [[vehicle]] that you want to obtain the blown status of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the vehicle specified has blown up, ''false'' if it is still intact or the vehicle specified is invalid.&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 taxi and checks whether the taxi has blown up or not every time somebody types &amp;quot;/taxi&amp;quot;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
theTaxi = createVehicle ( 420, 1, 1, 17 ) -- Add a taxi in the middle of SA&lt;br /&gt;
&lt;br /&gt;
function checkTaxi ( thePlayer, command )&lt;br /&gt;
	if ( isVehicleBlown ( theTaxi ) ) then -- Check whether it's blown or not&lt;br /&gt;
		outputChatBox ( &amp;quot;The taxi has blown up.&amp;quot;, thePlayer, 255, 0, 0 ) -- If so, we'll output it&lt;br /&gt;
	else -- Anything else (if it's not)&lt;br /&gt;
		outputChatBox ( &amp;quot;The taxi has not blown.&amp;quot;, thePlayer, 255, 0, 0 ) -- If not, we'll output that instead&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;taxi&amp;quot;, checkTaxi ) -- Make it check when somebody types &amp;quot;/taxi&amp;quot;&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;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=LogIn&amp;diff=22457</id>
		<title>LogIn</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=LogIn&amp;diff=22457"/>
		<updated>2010-02-22T07:33:56Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Added an example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}}&lt;br /&gt;
This functions logs the given player in to the given account. You need to provide the password needed to log into that account.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool logIn ( player thePlayer, account theAccount, string thePassword )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePlayer:''' The player to log into an account&lt;br /&gt;
*'''theAccount:''' The account to log the player into&lt;br /&gt;
*'''thePassword:''' The password needed to sign into this account&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the player was successfully logged into the given account. Returns ''false'' or ''nil'' if the log in failed for some reason, ie. the player was already logged in to some account (use [[logOut]] first), if the account was already in use or if it failed for some other reason.&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 loginPlayer ( thePlayer, command, username, password )&lt;br /&gt;
	local account = getAccount ( username, password ) -- Return the account&lt;br /&gt;
		if ( account ~= false ) then -- If the account exists.&lt;br /&gt;
			logIn ( thePlayer, account, password ) -- Log them in.&lt;br /&gt;
		else&lt;br /&gt;
			outputChatBox ( &amp;quot;Wrong username or password!&amp;quot;, thePlayer, 255, 255, 0 ) -- Output they got the details wrong.&lt;br /&gt;
		end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;log-in&amp;quot;, loginPlayer ) -- Make it trigger for &amp;quot;/log-in&amp;quot;, NOTE: /login is hardcored and cannot be used.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Account_functions}}&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=StartResource&amp;diff=22456</id>
		<title>StartResource</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=StartResource&amp;diff=22456"/>
		<updated>2010-02-22T07:26:27Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Removed from &amp;quot;Needs example&amp;quot;.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function starts a resource either persistently or as a dependency of the current resource. If you start the resource persistently, the resource will run until stopped either using [[stopResource]] or by the server admin. A resource started as a dependency will stop when your resource stops, if no other resources have it as a depdendency. This is the same effect as using an ''include'' in your [[meta.xml]] file.&lt;br /&gt;
&lt;br /&gt;
The function also allows you to specify a number of boolean options. These allow you to disable the loading of various aspects of the resource. This is generally useful for editors rather than for actual gamemodes. It could also be used as a way to preview a resource before enabling the scripting aspects, though this could produce unreliable results. There is no way for a resource to tell if it is being run with any of these booleans set.&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 startResource ( resource resourceToStart, [bool persistent = false, bool startIncludedResources = true, bool loadServerConfigs = true, bool loadMaps = true, bool loadServerScripts = true, bool loadHTML = true, bool loadClientConfigs = true, bool loadClientScripts = true, bool loadFiles = true] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''resourceToStart:''' The resource that should be started.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''persistent:''' A boolean specifying if the resource should continue to run even after this resource has been stopped or not. If this is ''true'' then the resource will run until another resource or user terminates it or the server shuts down.&lt;br /&gt;
*'''startIncludedResources:''' A boolean specifying if the resource's included/dependant resources will be started.&lt;br /&gt;
*'''loadServerConfigs:''' A boolean specifying if server side config (XML) files should be loaded with the resource.  &lt;br /&gt;
*'''loadMaps:''' A boolean specifying if any .map files will be started with the resource.&lt;br /&gt;
*'''loadServerScripts:''' A boolean specifying if server side script files should be started alongside the resource.&lt;br /&gt;
*'''loadHTML:''' A boolean specifying if HTML files should be started alongside the resource.&lt;br /&gt;
*'''loadClientConfigs:''' A boolean specifying if client configs should be loaded alongside the resource.&lt;br /&gt;
*'''loadClientScripts:''' A boolean specifying if client scripts should be loaded and started alongside the resource.&lt;br /&gt;
*'''loadFiles:''' A boolean specifying if client-side files should be loaded alongside the resource.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the resource has been started successfully, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example starts a specified resource with the command; &amp;quot;/resource-start&amp;quot;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function startTheResource ( thePlayer, command, resource )&lt;br /&gt;
	if ( resource ) then -- Check if they specified a resource name&lt;br /&gt;
		local resource = tostring ( resource ) -- This prevents &amp;quot;a userdata value&amp;quot; error&lt;br /&gt;
		local start = startResource ( resource ) -- Start the resource&lt;br /&gt;
			if ( start ) then -- If it was successfully started...&lt;br /&gt;
				outputChatBox ( resource .. &amp;quot; was started successfully.&amp;quot;, thePlayer, 255, 0, 0 )&lt;br /&gt;
			else -- If it wasn't successfully started...&lt;br /&gt;
				outputChatBox ( &amp;quot;An unexpected error occured.&amp;quot;, thePlayer, 255, 0, 0 )&lt;br /&gt;
			end&lt;br /&gt;
	else -- If they didn't put a resource name...&lt;br /&gt;
		outputChatBox ( &amp;quot;Please specify a resource to start.&amp;quot;, thePlayer, 255, 0, 0 )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;resource-start&amp;quot;, startTheResource ) -- Make it trigger when somebody types &amp;quot;/resource-start&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Resource_functions}}&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=StartResource&amp;diff=22455</id>
		<title>StartResource</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=StartResource&amp;diff=22455"/>
		<updated>2010-02-22T07:25:35Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Added an example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function starts a resource either persistently or as a dependency of the current resource. If you start the resource persistently, the resource will run until stopped either using [[stopResource]] or by the server admin. A resource started as a dependency will stop when your resource stops, if no other resources have it as a depdendency. This is the same effect as using an ''include'' in your [[meta.xml]] file.&lt;br /&gt;
&lt;br /&gt;
The function also allows you to specify a number of boolean options. These allow you to disable the loading of various aspects of the resource. This is generally useful for editors rather than for actual gamemodes. It could also be used as a way to preview a resource before enabling the scripting aspects, though this could produce unreliable results. There is no way for a resource to tell if it is being run with any of these booleans set.&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 startResource ( resource resourceToStart, [bool persistent = false, bool startIncludedResources = true, bool loadServerConfigs = true, bool loadMaps = true, bool loadServerScripts = true, bool loadHTML = true, bool loadClientConfigs = true, bool loadClientScripts = true, bool loadFiles = true] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''resourceToStart:''' The resource that should be started.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''persistent:''' A boolean specifying if the resource should continue to run even after this resource has been stopped or not. If this is ''true'' then the resource will run until another resource or user terminates it or the server shuts down.&lt;br /&gt;
*'''startIncludedResources:''' A boolean specifying if the resource's included/dependant resources will be started.&lt;br /&gt;
*'''loadServerConfigs:''' A boolean specifying if server side config (XML) files should be loaded with the resource.  &lt;br /&gt;
*'''loadMaps:''' A boolean specifying if any .map files will be started with the resource.&lt;br /&gt;
*'''loadServerScripts:''' A boolean specifying if server side script files should be started alongside the resource.&lt;br /&gt;
*'''loadHTML:''' A boolean specifying if HTML files should be started alongside the resource.&lt;br /&gt;
*'''loadClientConfigs:''' A boolean specifying if client configs should be loaded alongside the resource.&lt;br /&gt;
*'''loadClientScripts:''' A boolean specifying if client scripts should be loaded and started alongside the resource.&lt;br /&gt;
*'''loadFiles:''' A boolean specifying if client-side files should be loaded alongside the resource.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the resource has been started successfully, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example starts a specified resource with the command; &amp;quot;/resource-start&amp;quot;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function startTheResource ( thePlayer, command, resource )&lt;br /&gt;
	if ( resource ) then -- Check if they specified a resource name&lt;br /&gt;
		local resource = tostring ( resource ) -- This prevents &amp;quot;a userdata value&amp;quot; error&lt;br /&gt;
		local start = startResource ( resource ) -- Start the resource&lt;br /&gt;
			if ( start ) then -- If it was successfully started...&lt;br /&gt;
				outputChatBox ( resource .. &amp;quot; was started successfully.&amp;quot;, thePlayer, 255, 0, 0 )&lt;br /&gt;
			else -- If it wasn't successfully started...&lt;br /&gt;
				outputChatBox ( &amp;quot;An unexpected error occured.&amp;quot;, thePlayer, 255, 0, 0 )&lt;br /&gt;
			end&lt;br /&gt;
	else -- If they didn't put a resource name...&lt;br /&gt;
		outputChatBox ( &amp;quot;Please specify a resource to start.&amp;quot;, thePlayer, 255, 0, 0 )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;resource-start&amp;quot;, startTheResource ) -- Make it trigger when somebody types &amp;quot;/resource-start&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Resource_functions}}&lt;br /&gt;
[[Category:Needs_Example]]&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetPedHeadless&amp;diff=22454</id>
		<title>SetPedHeadless</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetPedHeadless&amp;diff=22454"/>
		<updated>2010-02-21T22:33:20Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Doesn't need example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
With this function, you can set if a ped has a head or not.&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setPedHeadless  ( ped thePed, bool headState )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''thePed''': The [[ped]] to check.&lt;br /&gt;
*'''headState''': head state, use true if you want the ped be headless, use false to give back the head.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''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 enables a player to behead themselves, and give them their head back.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function removeMyHead(thePlayer)&lt;br /&gt;
	setPedHeadless(thePlayer, true) -- Removes the players head&lt;br /&gt;
	outputChatBox(&amp;quot;You have been beheaded!&amp;quot;, thePlayer, 255, 0, 0) -- A confirmation message for the player&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;beheadme&amp;quot;, removeMyHead)&lt;br /&gt;
&lt;br /&gt;
function giveBackHead(thePlayer)&lt;br /&gt;
	setPedHeadless(thePlayer, false) -- Gives the player a head&lt;br /&gt;
	outputChatBox(&amp;quot;You have been given a head!&amp;quot;, thePlayer, 255, 0, 0) -- A confirmation message for the player&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;headmeup&amp;quot;, giveBackHead)&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;
{{Ped functions}}&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=LogOut&amp;diff=22449</id>
		<title>LogOut</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=LogOut&amp;diff=22449"/>
		<updated>2010-02-21T18:59:14Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Added comments.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function logs the given player out of his current account.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool logOut ( player thePlayer )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePlayer:''' The player to log out of his current account&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the player was successfully logged out, ''false'' or ''nil'' if it failed for some reason, ie. the player was never logged in.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example logs every player out of their account when the resource is (re)started. This would be handy for resources that show a login scren onClientResourceStart.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function logoutAll ()&lt;br /&gt;
	local players = getElementsByType ( &amp;quot;player&amp;quot; ) -- Get every player&lt;br /&gt;
		for k, player in ipairs ( players ) do -- For every player do the follwing...&lt;br /&gt;
			account = getPlayerAccount ( player ) -- Get every player's account&lt;br /&gt;
				if ( not isGuestAccount ( account ) ) then -- For every player that's logged in....&lt;br /&gt;
					logOut ( player ) -- Log them out.&lt;br /&gt;
				end&lt;br /&gt;
		end&lt;br /&gt;
end&lt;br /&gt;
 -- Trigger it when the resource (re)starts&lt;br /&gt;
addEventHandler ( &amp;quot;onResourceStart&amp;quot;, getResourceRootElement(getThisResource()), logoutAll )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Account_functions}}&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=LogOut&amp;diff=22448</id>
		<title>LogOut</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=LogOut&amp;diff=22448"/>
		<updated>2010-02-21T18:56:57Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Removed &amp;quot;Needs example&amp;quot; category.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function logs the given player out of his current account.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool logOut ( player thePlayer )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePlayer:''' The player to log out of his current account&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the player was successfully logged out, ''false'' or ''nil'' if it failed for some reason, ie. the player was never logged in.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example logs every player out of their account when the resource is (re)started. This would be handy for resources that show a login scren onClientResourceStart.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function logoutAll ()&lt;br /&gt;
	local players = getElementsByType ( &amp;quot;player&amp;quot; )&lt;br /&gt;
		for k, player in ipairs ( players ) do&lt;br /&gt;
			account = getPlayerAccount ( player )&lt;br /&gt;
				if ( not isGuestAccount ( account ) ) then&lt;br /&gt;
					logOut ( player )&lt;br /&gt;
				end&lt;br /&gt;
		end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onResourceStart&amp;quot;, getResourceRootElement(getThisResource()), logoutAll )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Account_functions}}&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=LogOut&amp;diff=22447</id>
		<title>LogOut</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=LogOut&amp;diff=22447"/>
		<updated>2010-02-21T18:56:26Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Added an example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function logs the given player out of his current account.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool logOut ( player thePlayer )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePlayer:''' The player to log out of his current account&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the player was successfully logged out, ''false'' or ''nil'' if it failed for some reason, ie. the player was never logged in.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example logs every player out of their account when the resource is (re)started. This would be handy for resources that show a login scren onClientResourceStart.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function logoutAll ()&lt;br /&gt;
	local players = getElementsByType ( &amp;quot;player&amp;quot; )&lt;br /&gt;
		for k, player in ipairs ( players ) do&lt;br /&gt;
			account = getPlayerAccount ( player )&lt;br /&gt;
				if ( not isGuestAccount ( account ) ) then&lt;br /&gt;
					logOut ( player )&lt;br /&gt;
				end&lt;br /&gt;
		end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onResourceStart&amp;quot;, getResourceRootElement(getThisResource()), logoutAll )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Account_functions}}&lt;br /&gt;
[[Category:Needs Example]]&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AclReload&amp;diff=22446</id>
		<title>AclReload</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AclReload&amp;diff=22446"/>
		<updated>2010-02-21T18:46:28Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Removed from &amp;quot;Needs Example&amp;quot; category.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}} &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 reloads the ACL's and the ACL groups from the ACL XML file. All ACL and ACL group elements are invalid after a call to this and should not be used anymore.&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 aclReload ()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &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 XML was successfully reloaded from the file, ''false'' or ''nil'' if the XML was invalid, didn't exist or could not be loaded for some other reason.&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 allows an admin to reload the ACL by typing &amp;quot;/reloadACL&amp;quot;.&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 reloadACL ( source, command )&lt;br /&gt;
-- Check if they're an admin...&lt;br /&gt;
	if ( isObjectInACLGroup ( &amp;quot;user.&amp;quot; .. getAccountName ( getPlayerAccount ( source )), aclGetGroup ( &amp;quot;Admin&amp;quot; ) ) ) then&lt;br /&gt;
		local reload = aclReload() -- Reload the ACL&lt;br /&gt;
			if ( reload ) then -- Check it was reloaded successfully&lt;br /&gt;
				outputChatBox ( &amp;quot;ACL was successfully reloaded.&amp;quot;, source, 255, 0, 0 ) -- If so, output it&lt;br /&gt;
			else -- If not, output it (line below)&lt;br /&gt;
				outputChatBox ( &amp;quot;An unknown error occured. Please check the ACL file exists.&amp;quot;, source, 255, 0, 0 )&lt;br /&gt;
			end&lt;br /&gt;
	else -- If they're not an admin, output it (below)&lt;br /&gt;
		outputChatBox ( &amp;quot;You must be an admin to use this command!&amp;quot;, source, 255, 0, 0 )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;reloadACL&amp;quot;, reloadACL )&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;
{{ACL_functions}}&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AclReload&amp;diff=22445</id>
		<title>AclReload</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AclReload&amp;diff=22445"/>
		<updated>2010-02-21T18:45:32Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Example added.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}} &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 reloads the ACL's and the ACL groups from the ACL XML file. All ACL and ACL group elements are invalid after a call to this and should not be used anymore.&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 aclReload ()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &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 XML was successfully reloaded from the file, ''false'' or ''nil'' if the XML was invalid, didn't exist or could not be loaded for some other reason.&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 allows an admin to reload the ACL by typing &amp;quot;/reloadACL&amp;quot;.&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 reloadACL ( source, command )&lt;br /&gt;
-- Check if they're an admin...&lt;br /&gt;
	if ( isObjectInACLGroup ( &amp;quot;user.&amp;quot; .. getAccountName ( getPlayerAccount ( source )), aclGetGroup ( &amp;quot;Admin&amp;quot; ) ) ) then&lt;br /&gt;
		local reload = aclReload() -- Reload the ACL&lt;br /&gt;
			if ( reload ) then -- Check it was reloaded successfully&lt;br /&gt;
				outputChatBox ( &amp;quot;ACL was successfully reloaded.&amp;quot;, source, 255, 0, 0 ) -- If so, output it&lt;br /&gt;
			else -- If not, output it (line below)&lt;br /&gt;
				outputChatBox ( &amp;quot;An unknown error occured. Please check the ACL file exists.&amp;quot;, source, 255, 0, 0 )&lt;br /&gt;
			end&lt;br /&gt;
	else -- If they're not an admin, output it (below)&lt;br /&gt;
		outputChatBox ( &amp;quot;You must be an admin to use this command!&amp;quot;, source, 255, 0, 0 )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;reloadACL&amp;quot;, reloadACL )&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;
{{ACL_functions}}&lt;br /&gt;
[[Category:Needs_Example]]&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AclDestroyGroup&amp;diff=22444</id>
		<title>AclDestroyGroup</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AclDestroyGroup&amp;diff=22444"/>
		<updated>2010-02-21T18:33:39Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Removed &amp;quot;Needs example&amp;quot; category.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}} &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 destroys the given ACL group. The destroyed ACL group will no longer be valid.&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 aclDestroyGroup ( string aclGroupName )&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;
*'''aclGroupName:''' The name of ACL group to destroy&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 ACL group was successfully deleted, ''false'' if it could not be deleted for some reason (ie. invalid argument).&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 allows admins to remove an ACL group they specify.&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 removeACLGroup ( source, command, groupName )&lt;br /&gt;
-- Check if they're an admin...&lt;br /&gt;
	if ( isObjectInACLGroup ( &amp;quot;user.&amp;quot; .. getAccountName ( getPlayerAccount ( source )), aclGetGroup ( &amp;quot;Admin&amp;quot; ) ) ) then&lt;br /&gt;
		if ( groupName ) then -- Check if they specified the group name&lt;br /&gt;
			local group = aclGetGroup ( groupName ) -- Return any groups matching the name&lt;br /&gt;
				if ( group ) then -- If any were returned then...&lt;br /&gt;
					aclDestroyGroup ( group ) -- Destroy that group&lt;br /&gt;
				else&lt;br /&gt;
					-- Tell them if no groups with that name were found...&lt;br /&gt;
					outputChatBox ( &amp;quot;No group with that name was found.&amp;quot;, source, 255, 0, 0 )&lt;br /&gt;
				end&lt;br /&gt;
	&lt;br /&gt;
		else -- If they didn't specify the group&lt;br /&gt;
			outputChatBox ( &amp;quot;Please specify the group name.&amp;quot;, source, 255, 0, 0 ) -- Tell them that they must&lt;br /&gt;
		end&lt;br /&gt;
	else -- If they're not an admin....&lt;br /&gt;
		outputChatBox ( &amp;quot;You must be an admin to use this command&amp;quot;, source, 255, 0, 0 ) -- Tell them it's restricted&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;removeACL&amp;quot;, removeACLGroup ) -- Make it happen when somebody types &amp;quot;/removeACL&amp;quot;&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;
{{ACL_functions}}&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AclDestroyGroup&amp;diff=22443</id>
		<title>AclDestroyGroup</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AclDestroyGroup&amp;diff=22443"/>
		<updated>2010-02-21T18:32:46Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Added example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}} &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 destroys the given ACL group. The destroyed ACL group will no longer be valid.&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 aclDestroyGroup ( string aclGroupName )&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;
*'''aclGroupName:''' The name of ACL group to destroy&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 ACL group was successfully deleted, ''false'' if it could not be deleted for some reason (ie. invalid argument).&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 allows admins to remove an ACL group they specify.&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 removeACLGroup ( source, command, groupName )&lt;br /&gt;
-- Check if they're an admin...&lt;br /&gt;
	if ( isObjectInACLGroup ( &amp;quot;user.&amp;quot; .. getAccountName ( getPlayerAccount ( source )), aclGetGroup ( &amp;quot;Admin&amp;quot; ) ) ) then&lt;br /&gt;
		if ( groupName ) then -- Check if they specified the group name&lt;br /&gt;
			local group = aclGetGroup ( groupName ) -- Return any groups matching the name&lt;br /&gt;
				if ( group ) then -- If any were returned then...&lt;br /&gt;
					aclDestroyGroup ( group ) -- Destroy that group&lt;br /&gt;
				else&lt;br /&gt;
					-- Tell them if no groups with that name were found...&lt;br /&gt;
					outputChatBox ( &amp;quot;No group with that name was found.&amp;quot;, source, 255, 0, 0 )&lt;br /&gt;
				end&lt;br /&gt;
	&lt;br /&gt;
		else -- If they didn't specify the group&lt;br /&gt;
			outputChatBox ( &amp;quot;Please specify the group name.&amp;quot;, source, 255, 0, 0 ) -- Tell them that they must&lt;br /&gt;
		end&lt;br /&gt;
	else -- If they're not an admin....&lt;br /&gt;
		outputChatBox ( &amp;quot;You must be an admin to use this command&amp;quot;, source, 255, 0, 0 ) -- Tell them it's restricted&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;removeACL&amp;quot;, removeACLGroup ) -- Make it happen when somebody types &amp;quot;/removeACL&amp;quot;&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;
{{ACL_functions}}&lt;br /&gt;
[[Category:Needs_Example]]&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsVehicleBlown&amp;diff=22442</id>
		<title>IsVehicleBlown</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsVehicleBlown&amp;diff=22442"/>
		<updated>2010-02-21T17:48:02Z</updated>

		<summary type="html">&lt;p&gt;Ca11um: Added an example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function allows you to determine whether a vehicle is blown or still intact.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isVehicleBlown ( vehicle theVehicle )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theVehicle:''' The [[vehicle]] that you want to obtain the blown status of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the vehicle specified has blown up, ''false'' if it is still intact or the vehicle specified is invalid.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example creates a taxi and checks weather the taxi has blown up or not every time somebody types &amp;quot;/taxi&amp;quot;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
theTaxi = createVehicle ( 420, 1, 1, 17 ) -- Add a taxi in the middle of SA&lt;br /&gt;
&lt;br /&gt;
function checkTaxi ( source, command )&lt;br /&gt;
	if ( isVehicleBlown ( theTaxi ) ) then -- Check weather it's blown or not&lt;br /&gt;
		outputChatBox ( &amp;quot;The taxi has blown up.&amp;quot;, source, 255, 0, 0 ) -- If so, we'll output it&lt;br /&gt;
	else -- Anything else (if it's not)&lt;br /&gt;
		outputChatBox ( &amp;quot;The taxi has not blown.&amp;quot;, source, 255, 0, 0 ) -- If not, we'll output that instead&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;taxi&amp;quot;, checkTaxi ) -- Make it check when somebody types &amp;quot;/taxi&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Vehicle functions}}&lt;br /&gt;
[[Category:Needs Example]]&lt;/div&gt;</summary>
		<author><name>Ca11um</name></author>
	</entry>
</feed>