<?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=Callum</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=Callum"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Callum"/>
	<updated>2026-04-28T07:31:25Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnClientGUISize&amp;diff=33655</id>
		<title>OnClientGUISize</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnClientGUISize&amp;diff=33655"/>
		<updated>2012-09-29T20:59:19Z</updated>

		<summary type="html">&lt;p&gt;Callum: Minor improvements.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client event}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This event is triggered when the local client resizes a GUI element.&lt;br /&gt;
&lt;br /&gt;
==Parameters== &lt;br /&gt;
''None''&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the GUI element that was resized.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example will output the type of GUI element that the client has resized, to the chatbox.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;addEventHandler(&amp;quot;onClientGUISize&amp;quot;,guiRoot,function()&lt;br /&gt;
	outputChatBox(&amp;quot;You have resized a &amp;quot;..getElementType(source)..&amp;quot;.&amp;quot;,255,255,0)&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
===GUI events===&lt;br /&gt;
{{GUI_events}}&lt;br /&gt;
===Client event functions===&lt;br /&gt;
{{Client_event_functions}}&lt;/div&gt;</summary>
		<author><name>Callum</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsPedDoingGangDriveby&amp;diff=33654</id>
		<title>IsPedDoingGangDriveby</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsPedDoingGangDriveby&amp;diff=33654"/>
		<updated>2012-09-29T20:53:15Z</updated>

		<summary type="html">&lt;p&gt;Callum: Modernized the example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function checks if the ped is in the driveby state.&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 isPedDoingGangDriveby ( ped thePed )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePed:''' The [[ped]] element whose state is to be checked.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns '''true''' if the driveby state is enabled, '''false''' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example turns on driveby mode when the local player types ''driveby'' in the console.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function setDoingDriveby ( )&lt;br /&gt;
        -- we check if local player isn't currently doing a gang driveby&lt;br /&gt;
        if not isPedDoingGangDriveby ( localPlayer ) then&lt;br /&gt;
                -- if he got driveby mode off, turn it on&lt;br /&gt;
                setPedWeaponSlot ( localPlayer, 4 )&lt;br /&gt;
                setPedDoingGangDriveby ( localPlayer, true )&lt;br /&gt;
        else&lt;br /&gt;
                -- otherwise, turn it off&lt;br /&gt;
                setPedWeaponSlot ( localPlayer, 0 )&lt;br /&gt;
                setPedDoingGangDriveby ( localPlayer, false )&lt;br /&gt;
        end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;driveby&amp;quot;, setDoingDriveby )&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>Callum</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules&amp;diff=33653</id>
		<title>Modules</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules&amp;diff=33653"/>
		<updated>2012-09-29T20:49:48Z</updated>

		<summary type="html">&lt;p&gt;Callum: Updated the links structure.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Modules are extensions for Multi Theft Auto's Lua core, allowing the integration and use of custom Lua functions that have been written in C++, and compiled as a DLL or SO file. Modules are commonly used to create functions for such purposes that Multi Theft Auto lacks, such as sockets. All modules listed hereof are not distributed with Multi Theft Auto, and must be manually installed.&lt;br /&gt;
&lt;br /&gt;
==Modules list==&lt;br /&gt;
You can view a list of all the documented modules in this wiki [[:Category:Modules|here]].&lt;br /&gt;
&lt;br /&gt;
==Modules SDK==&lt;br /&gt;
To be able to create your own modules, you must use the Modules SDK. You can download it from one of the links below - choose a link in accordance with your server's operating system.&lt;br /&gt;
&lt;br /&gt;
* Linux&lt;br /&gt;
** [http://files.mtasa.com/apps/1.0/dm/ml_devkit.tar.gz Official]&lt;br /&gt;
* Microsoft Windows&lt;br /&gt;
** [http://wobzip.org/file/TANPP Mirror (wobzip.org)]&lt;br /&gt;
** [http://www.mediafire.com/?b8b3asgegn0xkm4 Mirror (Mediafire)]&lt;br /&gt;
&lt;br /&gt;
===SDK functions===&lt;br /&gt;
*Currently in there:&lt;br /&gt;
**Base:&lt;br /&gt;
***HelloWorld&lt;br /&gt;
**MySQL&lt;br /&gt;
***MySQLCreate&lt;br /&gt;
***MySQLOpen&lt;br /&gt;
***MySQLDestroy&lt;br /&gt;
***MySQLQuery&lt;br /&gt;
***MySQLSafeString&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting Concepts]]&lt;br /&gt;
[[Category:Incomplete]]&lt;br /&gt;
[[Category:Modules]]&lt;br /&gt;
&lt;br /&gt;
[[ru:Modules]]&lt;/div&gt;</summary>
		<author><name>Callum</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules&amp;diff=33652</id>
		<title>Modules</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules&amp;diff=33652"/>
		<updated>2012-09-29T20:47:14Z</updated>

		<summary type="html">&lt;p&gt;Callum: Rewritten some of the poor sentance structures.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Modules are extensions for Multi Theft Auto's Lua core, allowing the integration and use of custom Lua functions that have been written in C++, and compiled as a DLL or SO file. Modules are commonly used to create functions for such purposes that Multi Theft Auto lacks, such as sockets. All modules listed hereof are not distributed with Multi Theft Auto, and must be manually installed.&lt;br /&gt;
&lt;br /&gt;
==Modules list==&lt;br /&gt;
You can view a list of all the documented modules in this wiki [[:Category:Modules|here]].&lt;br /&gt;
&lt;br /&gt;
==Modules SDK==&lt;br /&gt;
To be able to create your own modules, you must use the Modules SDK. You can download it from one of the links below - chose the appropriate one in accordance with your server's operating system.&lt;br /&gt;
&lt;br /&gt;
*[http://files.mtasa.com/apps/1.0/dm/ml_devkit.tar.gz Linux]&lt;br /&gt;
*[http://wobzip.org/file/TANPP here] or [http://www.mediafire.com/?b8b3asgegn0xkm4 Microsoft Windows]&lt;br /&gt;
&lt;br /&gt;
===SDK functions===&lt;br /&gt;
*Currently in there:&lt;br /&gt;
**Base:&lt;br /&gt;
***HelloWorld&lt;br /&gt;
**MySQL&lt;br /&gt;
***MySQLCreate&lt;br /&gt;
***MySQLOpen&lt;br /&gt;
***MySQLDestroy&lt;br /&gt;
***MySQLQuery&lt;br /&gt;
***MySQLSafeString&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting Concepts]]&lt;br /&gt;
[[Category:Incomplete]]&lt;br /&gt;
[[Category:Modules]]&lt;br /&gt;
&lt;br /&gt;
[[ru:Modules]]&lt;/div&gt;</summary>
		<author><name>Callum</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnElementModelChange&amp;diff=33651</id>
		<title>OnElementModelChange</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnElementModelChange&amp;diff=33651"/>
		<updated>2012-09-29T20:24:24Z</updated>

		<summary type="html">&lt;p&gt;Callum: Grammatical changes.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server event}}&lt;br /&gt;
{{New feature|3.0120|1.2|&lt;br /&gt;
'''Available only in MTA SA 1.2 and onwards'''&lt;br /&gt;
}}&lt;br /&gt;
This event is triggered when the model of an [[element]] is changed using [[setElementModel]].&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int oldModel, int newModel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* '''oldModel:''' The model of the element beforehand.&lt;br /&gt;
* '''newModel:''' The new model of the element.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The source of this event is the element that changed its model&lt;br /&gt;
&lt;br /&gt;
==Cancel Effect==&lt;br /&gt;
This event doesn't support [[Event system#Canceling|cancellation]].&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example sends a message to players when their model changes telling them what the model ID is and was.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function informPlayerOnModelChange(oldModel, newModel)&lt;br /&gt;
    if ( getElementType(source) == &amp;quot;player&amp;quot; ) then -- Make sure the element is a player&lt;br /&gt;
        outputChatBox(&amp;quot;Model ID changing from: &amp;quot;..oldModel..&amp;quot; to: &amp;quot;..newModel, source, 0, 255, 0) -- Message for player&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onElementModelChange&amp;quot;, root, informPlayerOnModelChange) -- Bind the event to every element&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
===Element events===&lt;br /&gt;
{{Element_events}}&lt;br /&gt;
===Event functions===&lt;br /&gt;
{{Event_functions}}&lt;/div&gt;</summary>
		<author><name>Callum</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CreateWater&amp;diff=33620</id>
		<title>CreateWater</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CreateWater&amp;diff=33620"/>
		<updated>2012-09-27T20:13:41Z</updated>

		<summary type="html">&lt;p&gt;Callum: Updated example to use resourceRoot.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
&lt;br /&gt;
{{Needs_Checking|Use of bShallow is unknown. There was a stupid note pointing to arc_ and assuming it meant if the water is visible which is not true.}}&lt;br /&gt;
&lt;br /&gt;
Creates an area of [[water]].&lt;br /&gt;
&lt;br /&gt;
The largest possible size of a water area is 5996&amp;amp;#0215;5996. Also be aware that the function will change all x and y coordinates you specify into even integer numbers if necessary: this is because of a limitation of San Andreas.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;water createWater ( float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3 [, float x4, float y4, float z4 ] [, bool bShallow = false ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[Image:WaterAreas.jpg|thumb|Example of water quadrant.|284x230px]]&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''x1, y1, z1:''' position of bottom left (south-west) corner.&lt;br /&gt;
*'''x2, y2, z2:''' position of bottom right (south-east) corner.&lt;br /&gt;
*'''x3, y3, z3:''' position of top left (north-west) corner.&lt;br /&gt;
''Note: Only 3 coords creates a triangle''&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''x4, y4, z4:''' position of top right (north-east) corner.&lt;br /&gt;
*'''bShallow:''' Need documentation...&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a water element if successful, ''false'' otherwise. The water element can be repositioned with [[setElementPosition]] and destroyed with [[destroyElement]].&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Example code for creating a water area to cover the entire San Andreas Map (flood the cities). Also, [[setWaterLevel]] is used to raise the existing rivers and lakes.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Setting water properties.&lt;br /&gt;
height = 40&lt;br /&gt;
SizeVal = 2998&lt;br /&gt;
-- Defining variables.&lt;br /&gt;
southWest_X = -SizeVal&lt;br /&gt;
southWest_Y = -SizeVal&lt;br /&gt;
southEast_X = SizeVal&lt;br /&gt;
southEast_Y = -SizeVal&lt;br /&gt;
northWest_X = -SizeVal&lt;br /&gt;
northWest_Y = SizeVal&lt;br /&gt;
northEast_X = SizeVal&lt;br /&gt;
northEast_Y = SizeVal&lt;br /&gt;
&lt;br /&gt;
-- OnClientResourceStart function that creates the water.&lt;br /&gt;
function thaResourceStarting( )&lt;br /&gt;
    water = createWater ( southWest_X, southWest_Y, height, southEast_X, southEast_Y, height, northWest_X, northWest_Y, height, northEast_X, northEast_Y, height )&lt;br /&gt;
    setWaterLevel ( height )&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, resourceRoot, thaResourceStarting)&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 water functions}}&lt;/div&gt;</summary>
		<author><name>Callum</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Ped_move_states&amp;diff=33619</id>
		<title>Template:Ped move states</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Ped_move_states&amp;diff=33619"/>
		<updated>2012-09-27T20:12:08Z</updated>

		<summary type="html">&lt;p&gt;Callum: Updated list of Ped move states.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;border:3px solid red;margin-bottom:3px;padding-left:5px;&amp;quot;&amp;gt;&amp;lt;div style=&amp;quot;float:right;padding-right:5px;font-weight:bold;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
* '''stand''': The ped is standing still.&lt;br /&gt;
* '''walk''': The ped is walking.&lt;br /&gt;
* '''powerwalk''': The ped is walking quickly.&lt;br /&gt;
* '''jog''': The ped is jogging.&lt;br /&gt;
* '''sprint''': The ped is sprinting.&lt;br /&gt;
* '''crouch''': The ped is crouching still.&lt;br /&gt;
* '''jump''': The ped is jumping into the air.&lt;br /&gt;
* '''fall''': The ped is falling to the ground.&lt;br /&gt;
* '''climb''': The ped is climbing onto an object.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Callum</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnClientVehicleDrown&amp;diff=33618</id>
		<title>OnClientVehicleDrown</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnClientVehicleDrown&amp;diff=33618"/>
		<updated>2012-09-27T20:07:14Z</updated>

		<summary type="html">&lt;p&gt;Callum: Fixed a typo and added additional information.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client event}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This event is triggered when a vehicle starts to drown in water. This event is even triggered when vehicles merely come into contact with water, so not every trigger is an indication of actual drowning.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
This event has no parameters.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The source of this event is the [[vehicle]] that is drowning.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;addEventHandler(&amp;quot;onClientVehicleDrown&amp;quot;,root,function()&lt;br /&gt;
     outputChatBox(&amp;quot;* A &amp;quot;..getVehicleName(source)..&amp;quot; is drowning!&amp;quot;)&lt;br /&gt;
end)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
===Client vehicle events===&lt;br /&gt;
{{Client_vehicle_events}}&lt;br /&gt;
===Client event functions===&lt;br /&gt;
{{Client_event_functions}}&lt;/div&gt;</summary>
		<author><name>Callum</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:Callum&amp;diff=31916</id>
		<title>User:Callum</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:Callum&amp;diff=31916"/>
		<updated>2012-07-15T23:20:10Z</updated>

		<summary type="html">&lt;p&gt;Callum: Created page with &amp;quot;&amp;lt;div style=&amp;quot;border:solid #CCCCCC 1px;margin:1px;width:438px;&amp;quot;&amp;gt; {| cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;width:438px;background:#EEEEEE;&amp;quot; | style=&amp;quot;width:45px;height:45px;background:#CCCCCC;text-...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;border:solid #CCCCCC 1px;margin:1px;width:438px;&amp;quot;&amp;gt;&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;width:438px;background:#EEEEEE;&amp;quot;&lt;br /&gt;
| style=&amp;quot;width:45px;height:45px;background:#CCCCCC;text-align:center;font-size:14pt;&amp;quot; | '''[[Image:Coder.gif]]'''&lt;br /&gt;
| style=&amp;quot;font-size:8pt;padding:4pt;line-height:1.25em;text-align:center;font-weight:bold&amp;quot; | This user is a [http://forum.mtasa.com/viewtopic.php?f=136&amp;amp;t=45236 Project Redivivus] Developer.&lt;br /&gt;
|}&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Lua expert.&lt;br /&gt;
* C++ newbie.&lt;br /&gt;
* MTA Patch Contributor.&lt;br /&gt;
* GTANet IRC Operator.&lt;/div&gt;</summary>
		<author><name>Callum</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetPedLookAt&amp;diff=31760</id>
		<title>SetPedLookAt</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetPedLookAt&amp;diff=31760"/>
		<updated>2012-07-03T21:11:43Z</updated>

		<summary type="html">&lt;p&gt;Callum: Added 'Needs Example' category.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
&lt;br /&gt;
Makes a ped turn his head and look at a specific world position or 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 setPedLookAt ( ped thePed, float x, float y, float z [, int time = 3000, element target ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''thePed:''' the ped to change the lookat of.&lt;br /&gt;
*'''x:''' the x coordinate of the world position to look at.&lt;br /&gt;
*'''y:''' the y coordinate of the world position to look at.&lt;br /&gt;
*'''z:''' the z coordinate of the world position to look at.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''time:''' the time, in milliseconds, during which the ped will look at the target. Once this time has elapsed, he will look ahead again like before the function was applied. A time of 0 will immediately stop any lookat. A negative time will make the ped look at the target indefinitely.&lt;br /&gt;
*'''target:''' if this argument is specified, the position arguments will be ignored and the ped's gaze will follow the specified element instead. Can be a player, a vehicle, another ped etc.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client ped functions}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Needs Example]]&lt;/div&gt;</summary>
		<author><name>Callum</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnClientHUDRender&amp;diff=31623</id>
		<title>OnClientHUDRender</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnClientHUDRender&amp;diff=31623"/>
		<updated>2012-06-25T11:10:16Z</updated>

		<summary type="html">&lt;p&gt;Callum: Incorrectly categorized as 'Needs Example'.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client event}} &lt;br /&gt;
This event is triggered before GTA renders the HUD. This is particularly useful if you want to use [[dxUpdateScreenSource]] to capture the screen onto a texture without capturing the HUD, or to alter HUD textures using [[Element/Shader|shaders]] before they are drawn onto the screen.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
''None''&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the client's [[root element]].&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local render_count = 0&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientHUDRender&amp;quot;, root, function()&lt;br /&gt;
	render_count = render_count + 1&lt;br /&gt;
end)&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientRender&amp;quot;, root, function()&lt;br /&gt;
	render_count = render_count - 1&lt;br /&gt;
end)&lt;br /&gt;
&lt;br /&gt;
addCommandHandler(&amp;quot;getLossFrames&amp;quot;, function()&lt;br /&gt;
	outputChatBox(&amp;quot;Loss: &amp;quot;..render_count)&lt;br /&gt;
	outputDebugString(&amp;quot;Loss: &amp;quot;..render_count, 3, 255, 0, 0)&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
===[[Game_Processing_Order|Game Processing Order]]===&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>Callum</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GuiGridListSetItemData&amp;diff=31622</id>
		<title>GuiGridListSetItemData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GuiGridListSetItemData&amp;diff=31622"/>
		<updated>2012-06-25T11:08:14Z</updated>

		<summary type="html">&lt;p&gt;Callum: Incorrectly categorized as 'Needs Example'.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function sets a Item Data associated to a grid list item.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Note:''' This function will only work '''after''' you set the item's text using [[guiGridListSetItemText]]!&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 guiGridListSetItemData ( element gridList, int rowIndex, int columnIndex, string data )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''gridList:''' A gridlist element of the data you wish to set to&lt;br /&gt;
*'''rowIndex:''' The row of the item you wish to set to&lt;br /&gt;
*'''columnIndex:''' The column of the item you wish to set to&lt;br /&gt;
*'''data:''' The data you wish to set to the item.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the data was set successfully, false otherwise&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
In this example, the gridlist shows the list of players without their color codes and outputs their names with color-codes at the chatbox when player is selected.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function showPlayers()&lt;br /&gt;
    local window = guiCreateWindow(0,0,500,400,&amp;quot;Window example - Title&amp;quot;,false) -- Create the window&lt;br /&gt;
    grid = guiCreateGridList(0,0,100,300,false,window) -- Create the gridlist&lt;br /&gt;
    local column = guiGridListAddColumn(grid, &amp;quot;Players online&amp;quot;, 0.9) -- Create a column&lt;br /&gt;
    showCursor(true)--show cursor&lt;br /&gt;
    for index,player in ipairs(getElementsByType(&amp;quot;player&amp;quot;)) do -- Loop through all players&lt;br /&gt;
        local row = guiGridListAddRow(grid) -- Add a row&lt;br /&gt;
        guiGridListSetItemText ( grid, row, column, (string.gsub ( getPlayerName(player), '#%x%x%x%x%x%x', '' ) or getPlayerName(player)), false, false) -- Set it's text to the player's name excluding colorcodes&lt;br /&gt;
        guiGridListSetItemData ( grid, row, column, getPlayerName(player)) -- Set it's data to the player's name with colorcodes&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
function outputPlayerName()&lt;br /&gt;
    if source == grid then -- If the player clicked something in the grid&lt;br /&gt;
        local selectedRow, selectedColumn = guiGridListGetSelectedItem(grid) -- See which player he selected&lt;br /&gt;
        local playerName = guiGridListGetItemData(grid, selectedRow, selectedColumn) -- Get the selected player's name with color codes   local playerNameWithoutColorCodes = guiGridListGetItemText(grid, selectedRow, selectedColumn) -- Get the selected player's name without color codes&lt;br /&gt;
        local playerNameWithoutColorCodes = guiGridListGetItemText(grid, selectedRow, selectedColumn) -- Get the selected player's name without color codes&lt;br /&gt;
        if playerName and playerNameWithoutColorCodes then -- If he really selected something&lt;br /&gt;
            outputChatBox(&amp;quot;The selected player's name without color codes : &amp;quot;..playerNameWithoutColorCodes, 255,255,255,false) -- output without color codes&lt;br /&gt;
            outputChatBox(&amp;quot;The selected player's name with color codes : &amp;quot;..playerName, 255,255,255,false) -- output with color codes&lt;br /&gt;
            outputChatBox(&amp;quot;The selected player's name with colors : &amp;quot;..playerName, 255,255,255,true) -- output with colors&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
addEventHandler(&amp;quot;onClientGUIClick&amp;quot;, getRootElement(), outputPlayerName)&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement(getThisResource()), showPlayers)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{GUI functions}}&lt;/div&gt;</summary>
		<author><name>Callum</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GuiMemoSetCaratIndex&amp;diff=31621</id>
		<title>GuiMemoSetCaratIndex</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GuiMemoSetCaratIndex&amp;diff=31621"/>
		<updated>2012-06-25T11:05:05Z</updated>

		<summary type="html">&lt;p&gt;Callum: Shouldn't need an example now deprecated.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{deprecated}}&lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function sets the current position of the caret (the text cursor) within the memo.&lt;br /&gt;
&lt;br /&gt;
Please use [[guiMemoSetCaretIndex]]&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 guiMemoSetCaratIndex ( gui-memo theMemo, int index )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theMemo:''' The memo edit box where the caret position is to be changed.&lt;br /&gt;
*'''index:''' An integer referring to the desired position within the box.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the caret was successfully moved, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{GUI_functions}}&lt;/div&gt;</summary>
		<author><name>Callum</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=FxAddGunshot&amp;diff=31620</id>
		<title>FxAddGunshot</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FxAddGunshot&amp;diff=31620"/>
		<updated>2012-06-25T11:03:08Z</updated>

		<summary type="html">&lt;p&gt;Callum: Incorrectly categorized as 'Needs Example'.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
[[Image:Fxgunshot.png|thumb|200px|Gunshot]]&lt;br /&gt;
This function creates a gunshot particle effect.&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 fxAddGunshot ( float posX, float posY, float posZ, float dirX, float dirY, float dirZ, [bool includeSparks=true] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''posX, posY, posZ:''' the world coordinates where the effect originates.&lt;br /&gt;
*'''dirX, dirY, dirZ:''' a direction vector indicating where the bullet is fired.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
* '''includeSparks:''' A bool representing whether the particle effect will generate sparks.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a true if the operation was successful, false otherwise. &lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example adds a sparks in front of your face.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler(&amp;quot;sshot&amp;quot;, function()&lt;br /&gt;
    local x, y, z = getElementPosition(localPlayer)&lt;br /&gt;
    fxAddGunshot(x, y+0.5, z+0.5, 0, 0, 0, true)&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client Effects functions}}&lt;/div&gt;</summary>
		<author><name>Callum</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetSoundEffectEnabled&amp;diff=31619</id>
		<title>SetSoundEffectEnabled</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetSoundEffectEnabled&amp;diff=31619"/>
		<updated>2012-06-25T11:01:52Z</updated>

		<summary type="html">&lt;p&gt;Callum: Incorrectly categorized as 'Needs Example'.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
Used to enable or disable specific sound effects.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setSoundEffectEnabled ( element sound, string effectName, bool bEnable )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''sound:''' a [[sound]] element.&lt;br /&gt;
*'''effectName:''' the effect you want to enable or disable&lt;br /&gt;
{{Sound_Effects}}&lt;br /&gt;
*'''bEnable:''' ''true'' if you want to enable the effect, ''false'' if you want to disable it.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the effect was set successfully, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example creates a sound and set's the flanger sound effect enabled.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;addCommandHandler(&amp;quot;flanger&amp;quot;,function(cmd,enabled)&lt;br /&gt;
	if(isElement(waterSplashes))then&lt;br /&gt;
		setSoundEffectEnabled(waterSplashes,cmd,enabled)&lt;br /&gt;
	else&lt;br /&gt;
		waterSplashes = playSound(&amp;quot;splashes.mp3&amp;quot;,true)&lt;br /&gt;
		setSoundEffectEnabled(waterSplashes,cmd,enabled)&lt;br /&gt;
	end&lt;br /&gt;
end,true) --set it case sensitive as we are going to get the command name and use it in the setSoundEffectEnabled&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;/div&gt;</summary>
		<author><name>Callum</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=TriggerEvent&amp;diff=31618</id>
		<title>TriggerEvent</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=TriggerEvent&amp;diff=31618"/>
		<updated>2012-06-25T10:56:11Z</updated>

		<summary type="html">&lt;p&gt;Callum: Removed useless rootElement variable from example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function will trigger a named [[event]] on a specific [[element]] in the [[element tree]]. See [[event system]] for more information on how the event system works.&lt;br /&gt;
&lt;br /&gt;
You should avoid triggering events on the [[root element]] unless you really need to. Doing this triggers the event on every element in the element tree, which is potentially very CPU intensive. Use as specific (i.e. low down the tree) element as you can.&lt;br /&gt;
&lt;br /&gt;
You can use the value returned from this function to determine if the event was cancelled by one of the event handlers. You should determine what your response (if any) to this should be based on the event's purpose. Generally, cancelling an event should prevent any further code being run that is dependent on whatever triggered that event. For example, if you have an ''onFlagCapture'' event, cancelling it would be expected to prevent the flag being able to be captured. Similarly, if you have ''onPlayerKill'' as an event you trigger, canceling it would either be expected to prevent the player being killed from dying or at least prevent the player from getting a score for it.&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 triggerEvent ( string eventName, element baseElement, [ var argument1, ... ] )    &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''eventName:''' The name of the event you wish to trigger&lt;br /&gt;
*'''baseElement:''' The element you wish to trigger the event on. See [[event system]] for information on how this works.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''argument1:''' The first argument that the event handler expects should be added after the ''baseElement'' variable.&lt;br /&gt;
**''NOTE:'' This function can have more than one of these arguments specified, once for each argument the event handler is expecting.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
* Returns '''nil''' if the arguments are invalid or the event could not be found.  &lt;br /&gt;
* Returns '''true''' if the event was triggered successfully, and ''was not'' cancelled using [[cancelEvent]].&lt;br /&gt;
* Returns '''false''' if the event was triggered successfully, and ''was'' cancelled using [[cancelEvent]].&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
If you define a new custom event as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Add a new event called onSpecialEvent&lt;br /&gt;
addEvent ( &amp;quot;onSpecialEvent&amp;quot;, true )&lt;br /&gt;
-- Define our handler function&lt;br /&gt;
function specialEventHandler ( text )&lt;br /&gt;
	outputChatBox ( text )&lt;br /&gt;
end&lt;br /&gt;
-- Add the event handler&lt;br /&gt;
addEventHandler ( &amp;quot;onSpecialEvent&amp;quot;, root, specialEventHandler )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can then trigger this event later on using:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
triggerEvent ( &amp;quot;onSpecialEvent&amp;quot;, root, &amp;quot;test&amp;quot; )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Event_functions}}&lt;br /&gt;
[[ru:triggerEvent]]&lt;/div&gt;</summary>
		<author><name>Callum</name></author>
	</entry>
</feed>