<?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=GTX</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=GTX"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/GTX"/>
	<updated>2026-05-13T09:48:48Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=EngineLoadIFP&amp;diff=56652</id>
		<title>EngineLoadIFP</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=EngineLoadIFP&amp;diff=56652"/>
		<updated>2018-07-22T15:34:27Z</updated>

		<summary type="html">&lt;p&gt;GTX: Added raw data parameter&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{New feature/item|3.0156|1.5.5|12195|&lt;br /&gt;
This function loads an animation library (IFP) file into GTA with a custom block name. All three IFP formats are supported ANPK, ANP2, and ANP3. Unfortunately, GTA 3 animations are not supported, however, you can load GTA:VC IFP files using this function. You don't have to replace any animation to play a custom one, to play a custom animation, load the IFP file using this function, then use [[SetPedAnimation|setPedAnimation]].&lt;br /&gt;
&lt;br /&gt;
If you wish to replace a GTA internal animation with a custom one, you can use [[EngineReplaceAnimation|engineReplaceAnimation]]. To unload the IFP file, use [[DestroyElement|destroyElement]], restarting or stopping the resource can also unload the IFP file automatically.}}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
ifp engineLoadIFP ( string ifp_file / string raw_data, string CustomBlockName )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''ifp_file / raw_data:''' the [[filepath|filepath]] to the IFP file you want to load or whole data buffer of the IFP file.&lt;br /&gt;
*'''CustomBlockName:''' the new block name for the IFP file. You cannot use the GTA default [[Animations|internal block]] names.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns an [[IFP]] element if the IFP file loaded, ''false'' otherwise.&lt;br /&gt;
{{Tip|If you want to synchronize animations, you can check [[https://drive.google.com/open?id=1L2NkQYuLS0YdoHECvxVRMdPBbEgaYUfH ifp_demo]] resource}}&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example loads a custom IFP file ([https://drive.google.com/file/d/1XZNNCCn7xhBNbhaIbsBubky3BEj06zWp/view?usp=sharing parkour.ifp]), adds a command &amp;quot;animation&amp;quot; that takes 1 parameter as animation name for playing animations within that IFP.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--[[&lt;br /&gt;
credits to Paul_Cortez for the IFP file.&lt;br /&gt;
parkour.ifp has following animations:&lt;br /&gt;
&lt;br /&gt;
BckHndSpingBTuck&lt;br /&gt;
BckHndSping&lt;br /&gt;
CartWheel&lt;br /&gt;
FrntHndSpring&lt;br /&gt;
HandPlant&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
-- you can choose any name you want, do not choose a default GTA:SA block name&lt;br /&gt;
local customBlockName = &amp;quot;myNewBlock&amp;quot;&lt;br /&gt;
&lt;br /&gt;
-- load the IFP file&lt;br /&gt;
local IFP = engineLoadIFP( &amp;quot;parkour.ifp&amp;quot;, customBlockName )&lt;br /&gt;
&lt;br /&gt;
-- let us know if IFP failed to load&lt;br /&gt;
if not IFP then&lt;br /&gt;
    outputChatBox( &amp;quot;Failed to load 'parkour.ifp'&amp;quot; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- execute the command using /animation &amp;lt;NameOfCustomAnimation&amp;gt;&lt;br /&gt;
-- for example, /animation CartWheel&lt;br /&gt;
function setanimation( _, animationName )&lt;br /&gt;
    -- check if IFP file has loaded&lt;br /&gt;
    if IFP then&lt;br /&gt;
        -- now play our custom animation&lt;br /&gt;
        setPedAnimation( localPlayer, customBlockName, animationName )&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler( &amp;quot;animation&amp;quot;, setanimation )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Engine_functions}}&lt;/div&gt;</summary>
		<author><name>GTX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AddDebugHook&amp;diff=51052</id>
		<title>AddDebugHook</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AddDebugHook&amp;diff=51052"/>
		<updated>2017-05-19T21:34:43Z</updated>

		<summary type="html">&lt;p&gt;GTX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
{{New feature/item|3.0136|1.3|5939|&lt;br /&gt;
This function allows tracing of MTA functions and events. It should only be used when debugging scripts as it may degrade script performance.&lt;br /&gt;
&lt;br /&gt;
Debug hooks are not recursive, so functions and events triggered inside the hook callback will not be traced.&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 addDebugHook( string hookType, function callbackFunction[, table nameList ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''hookType:''' The type of hook to add. This can be:&lt;br /&gt;
** preEvent&lt;br /&gt;
** postEvent&lt;br /&gt;
** preFunction&lt;br /&gt;
** postFunction&lt;br /&gt;
*'''callbackFunction :''' The function to call&lt;br /&gt;
{{New feature/item|9.06054|1.5.2|7967|&lt;br /&gt;
* Returning the string &amp;quot;skip&amp;quot; from the callback function will cause the original function/event to be skipped&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''nameList:''' Table of strings for restricting which functions and events the hook will be triggered on&lt;br /&gt;
{{New feature/item|9.06054|1.5.2|7967|&lt;br /&gt;
* addDebugHook and removeDebugHook will only be hooked if they are specified in the name list&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the hook was successfully added, or ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Callback parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string preFunction( resource sourceResource, string functionName, bool isAllowedByACL, string luaFilename, int luaLineNumber, functionArguments )&lt;br /&gt;
       postFunction( resource sourceResource, string functionName, bool isAllowedByACL, string luaFilename, int luaLineNumber, functionArguments )&lt;br /&gt;
string preEvent( resource sourceResource, string eventName, element eventSource, element eventClient, string luaFilename, int luaLineNumber, eventArguments )&lt;br /&gt;
       postEvent( resource sourceResource, string eventName, element eventSource, element eventClient, string luaFilename, int luaLineNumber, eventArguments )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example will dump info about all triggered events:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function onPreEvent( sourceResource, eventName, eventSource, eventClient, luaFilename, luaLineNumber, ... )&lt;br /&gt;
    local args = { ... }&lt;br /&gt;
    local srctype = eventSource and getElementType(eventSource)&lt;br /&gt;
    local resname = sourceResource and getResourceName(sourceResource)&lt;br /&gt;
    local plrname = eventClient and getPlayerName(eventClient)&lt;br /&gt;
    outputDebugString( &amp;quot;preEvent&amp;quot;&lt;br /&gt;
        .. &amp;quot; &amp;quot; .. tostring(resname)&lt;br /&gt;
        .. &amp;quot; &amp;quot; .. tostring(eventName)&lt;br /&gt;
        .. &amp;quot; source:&amp;quot; .. tostring(srctype)&lt;br /&gt;
        .. &amp;quot; player:&amp;quot; .. tostring(plrname)&lt;br /&gt;
        .. &amp;quot; file:&amp;quot; .. tostring(luaFilename)&lt;br /&gt;
        .. &amp;quot;(&amp;quot; .. tostring(luaLineNumber) .. &amp;quot;)&amp;quot;&lt;br /&gt;
        .. &amp;quot; numArgs:&amp;quot; .. tostring(#args)&lt;br /&gt;
        .. &amp;quot; arg1:&amp;quot; .. tostring(args[1])&lt;br /&gt;
        )&lt;br /&gt;
end&lt;br /&gt;
addDebugHook( &amp;quot;preEvent&amp;quot;, onPreEvent )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This example will dump info about all called MTA functions:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function onPreFunction( sourceResource, functionName, isAllowedByACL, luaFilename, luaLineNumber, ... )&lt;br /&gt;
    local args = { ... }&lt;br /&gt;
    local resname = sourceResource and getResourceName(sourceResource)&lt;br /&gt;
    outputDebugString( &amp;quot;preFunction&amp;quot;&lt;br /&gt;
        .. &amp;quot; &amp;quot; .. tostring(resname)&lt;br /&gt;
        .. &amp;quot; &amp;quot; .. tostring(functionName)&lt;br /&gt;
        .. &amp;quot; allowed:&amp;quot; .. tostring(isAllowedByACL)&lt;br /&gt;
        .. &amp;quot; file:&amp;quot; .. tostring(luaFilename)&lt;br /&gt;
        .. &amp;quot;(&amp;quot; .. tostring(luaLineNumber) .. &amp;quot;)&amp;quot;&lt;br /&gt;
        .. &amp;quot; numArgs:&amp;quot; .. tostring(#args)&lt;br /&gt;
        .. &amp;quot; arg1:&amp;quot; .. tostring(args[1])&lt;br /&gt;
        )&lt;br /&gt;
end&lt;br /&gt;
addDebugHook( &amp;quot;preFunction&amp;quot;, onPreFunction)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example adds a hook which will only be triggered for the named functions&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addDebugHook( &amp;quot;preFunction&amp;quot;, onPreFunction, {&amp;quot;setElementPosition&amp;quot;,&amp;quot;loadstring&amp;quot;} )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{New feature/item|9.06054|1.5.2|7967|&lt;br /&gt;
This example shows how to disable addDebugHook&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addDebugHook( &amp;quot;preFunction&amp;quot;, onPreFunction, {&amp;quot;addDebugHook&amp;quot;} )&lt;br /&gt;
function onPreFunction( sourceResource, functionName, isAllowedByACL, luaFilename, luaLineNumber, ... )&lt;br /&gt;
    return &amp;quot;skip&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.5-9.06054|Added clientside}}&lt;br /&gt;
{{ChangelogItem|1.3.5-9.06142|Added option to restrict to specified functions and events }}&lt;br /&gt;
{{ChangelogItem|1.5.2-9.07957|Added option to skip original function/event &amp;lt;br/&amp;gt;Added ability to hook addDebugHook and removeDebugHook }}&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|1.3.4-9.05939|1.3.5-9.06054}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Utility functions}}&lt;/div&gt;</summary>
		<author><name>GTX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetObjectBreakable&amp;diff=49842</id>
		<title>SetObjectBreakable</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetObjectBreakable&amp;diff=49842"/>
		<updated>2016-11-12T00:23:46Z</updated>

		<summary type="html">&lt;p&gt;GTX: Undo revision 49841&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function sets an object to be breakable/unbreakable.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setObjectBreakable ( object theObject, bool breakable )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[object]]:setBreakable|breakable|isObjectBreakable}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''object''' the [[object]] that's being set.&lt;br /&gt;
*'''breakable''' a boolean whether the object is breakable(true) or unbreakable (false).&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
* ''true'' if the object is now breakable.&lt;br /&gt;
* ''false'' if it can't or if invalid arguments are passed. &lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example creates an object when the resource starts and sets it to be breakable.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function toggleObjectVulnerability()&lt;br /&gt;
	local object = createObject(1337, 5540.6654, 1020.55122, 1240.545)&lt;br /&gt;
	if isObjectBreakable(object) then&lt;br /&gt;
		setObjectBreakable(object, false)&lt;br /&gt;
		outputChatBox(&amp;quot;The object is now not breakable.&amp;quot;)&lt;br /&gt;
	else&lt;br /&gt;
		setObjectBreakable(object, true)&lt;br /&gt;
		outputChatBox(&amp;quot;The object is now breakable.&amp;quot;)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, resourceRoot, toggleObjectVulnerability)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3.0-9.03783|}}&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_object_functions}}&lt;/div&gt;</summary>
		<author><name>GTX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Talk:Object_IDs&amp;diff=49818</id>
		<title>Talk:Object IDs</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Talk:Object_IDs&amp;diff=49818"/>
		<updated>2016-11-09T15:02:22Z</updated>

		<summary type="html">&lt;p&gt;GTX: Created page with &amp;quot;http://dev.prineside.com/gtasa_samp_model_id/ This is better. - GTX&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;http://dev.prineside.com/gtasa_samp_model_id/ This is better. - GTX&lt;/div&gt;</summary>
		<author><name>GTX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnChatMessage&amp;diff=49761</id>
		<title>OnChatMessage</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnChatMessage&amp;diff=49761"/>
		<updated>2016-11-04T17:19:40Z</updated>

		<summary type="html">&lt;p&gt;GTX: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server event}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
{{New feature/item|3.0120|1.2|3316|&lt;br /&gt;
}}&lt;br /&gt;
This event is triggered when a player uses say, teamsay, me successfully. Or when any message is output to chat using [[outputChatBox]] on the server side. It can be used to get the resource responsible for specific [[outputChatBox]] call via the second parameter.&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 theMessage, resource / element theElement&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''theMessage:''' The text that was output to the chatbox&lt;br /&gt;
*'''theElement:''' Player element if chatbox output was done via say, teamsay or me. Resource if it was done via [[outputChatBox]].&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the root element.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example outputs all chat messages to debug view.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function onChatMessageHandler(theMessage, thePlayer)&lt;br /&gt;
	outputDebugString(theMessage)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onChatMessage&amp;quot;, root, onChatMessageHandler)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|1.1.1-9.03316|n/a|}}&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Server events}}&lt;/div&gt;</summary>
		<author><name>GTX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=TriggerLatentClientEvent&amp;diff=49729</id>
		<title>TriggerLatentClientEvent</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=TriggerLatentClientEvent&amp;diff=49729"/>
		<updated>2016-10-31T16:36:31Z</updated>

		<summary type="html">&lt;p&gt;GTX: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function is the same as [[triggerClientEvent ]] except the transmission rate of the data contained in the arguments can be limited&lt;br /&gt;
and other network traffic is not blocked while the data is being transferred.&lt;br /&gt;
{{Note|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 | 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;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool triggerLatentClientEvent ( [table/element sendTo=getRootElement(),] string name, [int bandwidth=50000,] [bool persist=false,] element theElement, [arguments...] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''name:''' The name of the event to trigger client side. You should register this event with [[addEvent]] and add at least one event handler using [[addEventHandler]].&lt;br /&gt;
*'''theElement:''' The element that is the [[Event system#Event handlers|source]] of the event. This could be another player, or if this isn't relevant, use the root element.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''sendTo:''' The event will be sent to all [[player]]s that are children of the specified element. By default this is the root element, and hence the event is sent to all players. If you specify a single player it will just be sent to that player. This argument can also be a table of player elements.&lt;br /&gt;
*'''bandwidth:''' The bytes per second rate to send the data contained in the arguments.&lt;br /&gt;
*'''persist:''' A bool indicating whether the transmission should be allowed to continue even after the resource that triggered it has since stopped.&lt;br /&gt;
*'''arguments...:''' A list of arguments to trigger with the event. You can pass any lua data type (except functions). You can also pass [[element]]s. The total amount of data should not exceed 100MB.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the event trigger has been sent, ''false'' if invalid arguments were specified.&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;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEvent(&amp;quot;onClientReadFile&amp;quot;,true)&lt;br /&gt;
addEventHandler(&amp;quot;onClientReadFile&amp;quot;,root,function(data)&lt;br /&gt;
	local file = fileCreate(&amp;quot;text.txt&amp;quot;)					--Save &amp;quot;data&amp;quot; into &amp;quot;text.txt&amp;quot;&lt;br /&gt;
	fileWrite(file,data)&lt;br /&gt;
	fileClose(file)&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section name=&amp;quot;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;
if fileExists(&amp;quot;text.txt&amp;quot;) then&lt;br /&gt;
	file = fileOpen(&amp;quot;test.txt&amp;quot;)						--Open a file (you can create it yourself).&lt;br /&gt;
	local data = fileRead(file,100*1024*1024)				--Max 100 MB&lt;br /&gt;
	fileClose(file)								--Close File&lt;br /&gt;
	triggerLatentClientEvent(&amp;quot;onClientReadFile&amp;quot;,5000,false,root,data)	--trigger - Avoid triggering to root element (Read note above)&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;
==Requirements==&lt;br /&gt;
{{Requirements|1.3.0-9.03772|n/a|}}&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.0-9.04570|Added option to use a list of player elements for the 'sendTo' argument}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Event functions}}&lt;/div&gt;</summary>
		<author><name>GTX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OOP_server&amp;diff=49728</id>
		<title>OOP server</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OOP_server&amp;diff=49728"/>
		<updated>2016-10-31T02:43:44Z</updated>

		<summary type="html">&lt;p&gt;GTX: /* Player */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Needs Checking|This page is partially outdated.}}&lt;br /&gt;
The new OOP in MTA allows for better code organization and readability. This is a list of [[Server_Scripting_Functions|server-side functions]].&lt;br /&gt;
&lt;br /&gt;
''See also: [[OOP]]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Element==&lt;br /&gt;
 areCollisionsEnabled (function: [[getElementCollisionsEnabled]])&lt;br /&gt;
 attach (function: [[attachElements]])&lt;br /&gt;
 clearVisibility (function: [[clearElementVisibleTo]])&lt;br /&gt;
 clone (function: [[cloneElement]])&lt;br /&gt;
 create (function: [[createElement]])&lt;br /&gt;
 destroy (function: [[destroyElement]])&lt;br /&gt;
 detach (function: [[detachElements]])&lt;br /&gt;
 getAllByType (function: [[getElementsByType]])&lt;br /&gt;
 getAllData (function: [[getAllElementData]])&lt;br /&gt;
 getAlpha (function: [[getElementAlpha]])&lt;br /&gt;
 getAttachedElements (function: [[getAttachedElements]])&lt;br /&gt;
 getAttachedOffsets (function: [[getElementAttachedOffsets]])&lt;br /&gt;
 getAttachedTo (function: [[getElementAttachedTo]])&lt;br /&gt;
 getByID (function: [[getElementByID]])&lt;br /&gt;
 getByIndex (function: [[getElementByIndex]])&lt;br /&gt;
 getChild (function: [[getElementChild]])&lt;br /&gt;
 getChildren (function: [[getElementChildren]])&lt;br /&gt;
 getChildrenCount (function: [[getElementChildrenCount]])&lt;br /&gt;
 getColShape (function: [[getElementColShape]])&lt;br /&gt;
 getData (function: [[getElementData]])&lt;br /&gt;
 getDimension (function: [[getElementDimension]])&lt;br /&gt;
 getHealth (function: [[getElementHealth]])&lt;br /&gt;
 getID (function: [[getElementID]])&lt;br /&gt;
 getInterior (function: [[getElementInterior]])&lt;br /&gt;
 getLowLOD (function: [[getLowLODElement]])&lt;br /&gt;
 getModel (function: [[getElementModel]])&lt;br /&gt;
 getParent (function: [[getElementParent]])&lt;br /&gt;
 getPosition (function: [[getElementPosition]])&lt;br /&gt;
 getRotation (function: [[getElementRotation]])&lt;br /&gt;
 getSyncer (function: [[getElementSyncer]])&lt;br /&gt;
 getType (function: [[getElementType]])&lt;br /&gt;
 getVelocity (function: [[getElementVelocity]])&lt;br /&gt;
 getZoneName (function: [[getElementZoneName]])&lt;br /&gt;
 isAttached (function: [[isElementAttached]])&lt;br /&gt;
 isCallPropagationEnabled (function: [[isElementCallPropagationEnabled]])&lt;br /&gt;
 isDoubleSided (function: [[isElementDoubleSided]])&lt;br /&gt;
 isFrozen (function: [[isElementFrozen]])&lt;br /&gt;
 isInWater (function: [[isElementInWater]])&lt;br /&gt;
 isLowLOD (function: [[isElementLowLOD]])&lt;br /&gt;
 isVisibleTo (function: [[isElementVisibleTo]])&lt;br /&gt;
 isWithinColShape (function: [[isElementWithinColShape]])&lt;br /&gt;
 isWithinMarker (function: [[isElementWithinMarker]])&lt;br /&gt;
 removeData (function: [[removeElementData]])&lt;br /&gt;
 setAlpha (function: [[setElementAlpha]])&lt;br /&gt;
 setAttachedOffsets (function: [[setElementAttachedOffsets]])&lt;br /&gt;
 setCallPropagationEnabled (function: [[setElementCallPropagationEnabled]])&lt;br /&gt;
 setCollisionsEnabled (function: [[setElementCollisionsEnabled]])&lt;br /&gt;
 setData (function: [[setElementData]])&lt;br /&gt;
 setDimension (function: [[setElementDimension]])&lt;br /&gt;
 setDoubleSided (function: [[setElementDoubleSided]])&lt;br /&gt;
 setFrozen (function: [[setElementFrozen]])&lt;br /&gt;
 setHealth (function: [[setElementHealth]])&lt;br /&gt;
 setID (function: [[setElementID]])&lt;br /&gt;
 setInterior (function: [[setElementInterior]])&lt;br /&gt;
 setMatrix (function: [[setElementMatrix]])&lt;br /&gt;
 setModel (function: [[setElementModel]])&lt;br /&gt;
 setParent (function: [[setElementParent]])&lt;br /&gt;
 setPosition (function: [[setElementPosition]])&lt;br /&gt;
 setRotation (function: [[setElementRotation]])&lt;br /&gt;
 setSyncer (function: [[setElementSyncer]])&lt;br /&gt;
 setVelocity (function: [[setElementVelocity]])&lt;br /&gt;
&lt;br /&gt;
==ACL==&lt;br /&gt;
 &lt;br /&gt;
 create (function: [[aclCreate]])&lt;br /&gt;
 destroy (function: [[aclDestroy]])&lt;br /&gt;
 get (function: [[aclGet]])&lt;br /&gt;
 getName (function: [[aclGetName]])&lt;br /&gt;
 getRight (function: [[aclGetRight]])&lt;br /&gt;
 hasObjectPermissionTo (function: [[hasObjectPermissionTo]])&lt;br /&gt;
 list (function: [[aclList]])&lt;br /&gt;
 listRights (function: [[aclListRights]])&lt;br /&gt;
 reload (function: [[aclReload]])&lt;br /&gt;
 removeRight (function: [[aclRemoveRight]])&lt;br /&gt;
 save (function: [[aclSave]])&lt;br /&gt;
 setRight (function: [[aclSetRight]])&lt;br /&gt;
&lt;br /&gt;
==ACLGroup==&lt;br /&gt;
 &lt;br /&gt;
 addACL (function: [[aclGroupAddACL]])&lt;br /&gt;
 addObject (function: [[aclGroupAddObject]])&lt;br /&gt;
 addToGroup (function: [[aclGroupAddACL]])&lt;br /&gt;
 create (function: [[aclCreateGroup]])&lt;br /&gt;
 destroy (function: [[aclDestroyGroup]])&lt;br /&gt;
 doesContainObject (function: [[isObjectInACLGroup]])&lt;br /&gt;
 get (function: [[aclGetGroup]])&lt;br /&gt;
 getName (function: [[aclGroupGetName]])&lt;br /&gt;
 list (function: [[aclGroupList]])&lt;br /&gt;
 listACL (function: [[aclGroupListACL]])&lt;br /&gt;
 listObjects (function: [[aclGroupListObjects]])&lt;br /&gt;
 removeACL (function: [[aclGroupRemoveACL]])&lt;br /&gt;
 removeFromGroup (function: [[aclGroupRemoveACL]])&lt;br /&gt;
 removeObject (function: [[aclGroupRemoveObject]])&lt;br /&gt;
&lt;br /&gt;
==Account==&lt;br /&gt;
 &lt;br /&gt;
 add (function: [[addAccount]])&lt;br /&gt;
 copyDataFrom (function: [[copyAccountData]])&lt;br /&gt;
 copyDataTo (function: [[copyAccountData]])&lt;br /&gt;
 create (function: [[getAccount]])&lt;br /&gt;
 getAll (function: [[getAccounts]])&lt;br /&gt;
 getAllBySerial (function: [[getAccountsBySerial]])&lt;br /&gt;
 getAllData (function: [[getAllAccountData]])&lt;br /&gt;
 getData (function: [[getAccountData]])&lt;br /&gt;
 getFromPlayer (function: [[getPlayerAccount]])&lt;br /&gt;
 getName (function: [[getAccountName]])&lt;br /&gt;
 getPlayer (function: [[getAccountPlayer]])&lt;br /&gt;
 getSerial (function: [[getAccountSerial]])&lt;br /&gt;
 isGuest (function: [[isGuestAccount]])&lt;br /&gt;
 logIn (function: [[logIn]])&lt;br /&gt;
 logPlayerOut (function: [[logOut]])&lt;br /&gt;
 remove (function: [[removeAccount]])&lt;br /&gt;
 setData (function: [[setAccountData]])&lt;br /&gt;
 setPassword (function: [[setAccountPassword]])&lt;br /&gt;
&lt;br /&gt;
==Ban==&lt;br /&gt;
 &lt;br /&gt;
 create (function: [[addBan]])&lt;br /&gt;
 getAdmin (function: [[getBanAdmin]])&lt;br /&gt;
 getIP (function: [[getBanIP]])&lt;br /&gt;
 getList (function: [[getBans]])&lt;br /&gt;
 getNick (function: [[getBanNick]])&lt;br /&gt;
 getReason (function: [[getBanReason]])&lt;br /&gt;
 getSerial (function: [[getBanSerial]])&lt;br /&gt;
 getTime (function: [[getBanTime]])&lt;br /&gt;
 getUnbanTime (function: [[getUnbanTime]])&lt;br /&gt;
 remove (function: [[removeBan]])&lt;br /&gt;
&lt;br /&gt;
==Blip==&lt;br /&gt;
''Inherited from [[#Element|Element]]''&lt;br /&gt;
 &lt;br /&gt;
 create (function: [[createBlip]])&lt;br /&gt;
 createAttachedTo (function: [[createBlipAttachedTo]])&lt;br /&gt;
 getColor (function: [[getBlipColor]])&lt;br /&gt;
 getIcon (function: [[getBlipIcon]])&lt;br /&gt;
 getOrdering (function: [[getBlipOrdering]])&lt;br /&gt;
 getSize (function: [[getBlipSize]])&lt;br /&gt;
 getVisibleDistance (function: [[getBlipVisibleDistance]])&lt;br /&gt;
 setColor (function: [[setBlipColor]])&lt;br /&gt;
 setIcon (function: [[setBlipIcon]])&lt;br /&gt;
 setOrdering (function: [[setBlipOrdering]])&lt;br /&gt;
 setSize (function: [[setBlipSize]])&lt;br /&gt;
 setVisibleDistance (function: [[setBlipVisibleDistance]])&lt;br /&gt;
&lt;br /&gt;
==ColShape==&lt;br /&gt;
''Inherited from [[#Element|Element]]''&lt;br /&gt;
 &lt;br /&gt;
 Circle (function: [[createColCircle]])&lt;br /&gt;
 Cuboid (function: [[createColCuboid]])&lt;br /&gt;
 getElementsWithin (function: [[getElementsWithinColShape]])&lt;br /&gt;
 isElementWithin (function: [[isElementWithinColShape]])&lt;br /&gt;
 Polygon (function: [[createColPolygon]])&lt;br /&gt;
 Rectangle (function: [[createColRectangle]])&lt;br /&gt;
 Sphere (function: [[createColSphere]])&lt;br /&gt;
 Tube (function: [[createColTube]])&lt;br /&gt;
&lt;br /&gt;
==File==&lt;br /&gt;
 &lt;br /&gt;
 close (function: [[fileClose]])&lt;br /&gt;
 copy (function: [[fileCopy]])&lt;br /&gt;
 create (function: [[fileOpen]])&lt;br /&gt;
 delete (function: [[fileDelete]])&lt;br /&gt;
 destroy (function: [[fileClose]])&lt;br /&gt;
 exists (function: [[fileExists]])&lt;br /&gt;
 flush (function: [[fileFlush]])&lt;br /&gt;
 getPos (function: [[fileGetPos]])&lt;br /&gt;
 getSize (function: [[fileGetSize]])&lt;br /&gt;
 isEOF (function: [[fileIsEOF]])&lt;br /&gt;
 new (function: [[fileCreate]])&lt;br /&gt;
 read (function: [[fileRead]])&lt;br /&gt;
 rename (function: [[fileRename]])&lt;br /&gt;
 setPos (function: [[fileSetPos]])&lt;br /&gt;
 write (function: [[fileWrite]])&lt;br /&gt;
&lt;br /&gt;
==Marker==&lt;br /&gt;
''Inherited from [[#Element|Element]]''&lt;br /&gt;
 &lt;br /&gt;
 create (function: [[createMarker]])&lt;br /&gt;
 getColor (function: [[getMarkerColor]])&lt;br /&gt;
 getCount (function: [[getMarkerCount]])&lt;br /&gt;
 getIcon (function: [[getMarkerIcon]])&lt;br /&gt;
 getSize (function: [[getMarkerSize]])&lt;br /&gt;
 getTarget (function: [[getMarkerTarget]])&lt;br /&gt;
 getType (function: [[getMarkerType]])&lt;br /&gt;
 setColor (function: [[setMarkerColor]])&lt;br /&gt;
 setIcon (function: [[setMarkerIcon]])&lt;br /&gt;
 setSize (function: [[setMarkerSize]])&lt;br /&gt;
 setTarget (function: [[setMarkerTarget]])&lt;br /&gt;
 setType (function: [[setMarkerType]])&lt;br /&gt;
&lt;br /&gt;
==Object==&lt;br /&gt;
''Inherited from [[#Element|Element]]''&lt;br /&gt;
&lt;br /&gt;
 create (function: [[createObject]])&lt;br /&gt;
 getScale (function: [[getObjectScale]])&lt;br /&gt;
 move (function: [[moveObject]])&lt;br /&gt;
 setScale (function: [[setObjectScale]])&lt;br /&gt;
 stop (function: [[stopObject]])&lt;br /&gt;
&lt;br /&gt;
==Ped==&lt;br /&gt;
''Inherited from [[#Element|Element]]''&lt;br /&gt;
 &lt;br /&gt;
 addClothes (function: [[addPedClothes]])&lt;br /&gt;
 create (function: [[createPed]])&lt;br /&gt;
 doesHaveJetpack (function: [[doesPedHaveJetPack]])&lt;br /&gt;
 getAmmoInClip (function: [[getPedAmmoInClip]])&lt;br /&gt;
 getAnalogControlState (function: [[getPedAnalogControlState]])&lt;br /&gt;
 getArmor (function: [[getPedArmor]])&lt;br /&gt;
 getClothes (function: [[getPedClothes]])&lt;br /&gt;
 getContactElement (function: [[getPedContactElement]])&lt;br /&gt;
 getFightingStyle (function: [[getPedFightingStyle]])&lt;br /&gt;
 getGravity (function: [[getPedGravity]])&lt;br /&gt;
 getOccupiedVehicle (function: [[getPedOccupiedVehicle]])&lt;br /&gt;
 getOccupiedVehicleSeat (function: [[getPedOccupiedVehicleSeat]])&lt;br /&gt;
 getStat (function: [[getPedStat]])&lt;br /&gt;
 getTarget (function: [[getPedTarget]])&lt;br /&gt;
 getTotalAmmo (function: [[getPedTotalAmmo]])&lt;br /&gt;
 getValidModels (function: [[getValidPedModels]])&lt;br /&gt;
 getWalkingStyle (function: [[getPedWalkingStyle]])&lt;br /&gt;
 getWeapon (function: [[getPedWeapon]])&lt;br /&gt;
 getWeaponSlot (function: [[getPedWeaponSlot]])&lt;br /&gt;
 giveJetPack (function: [[givePedJetPack]])&lt;br /&gt;
 isChoking (function: [[isPedChoking]])&lt;br /&gt;
 isDead (function: [[isPedDead]])&lt;br /&gt;
 isDoingGangDriveby (function: [[isPedDoingGangDriveby]])&lt;br /&gt;
 isDucked (function: [[isPedDucked]])&lt;br /&gt;
 isFrozen (function: [[isPedFrozen]])&lt;br /&gt;
 isHeadless (function: [[isPedHeadless]])&lt;br /&gt;
 isInVehicle (function: [[isPedInVehicle]])&lt;br /&gt;
 isInWater (function: [[isPedInWater]])&lt;br /&gt;
 isOnFire (function: [[isPedOnFire]])&lt;br /&gt;
 isOnGround (function: [[isPedOnGround]])&lt;br /&gt;
 kill (function: [[killPed]])&lt;br /&gt;
 reloadWeapon (function: [[reloadPedWeapon]])&lt;br /&gt;
 removeClothes (function: [[removePedClothes]])&lt;br /&gt;
 removeFromVehicle (function: [[removePedFromVehicle]])&lt;br /&gt;
 removeJetPack (function: [[removePedJetPack]])&lt;br /&gt;
 setAnalogControlState (function: [[setPedAnalogControlState]])&lt;br /&gt;
 setAnimation (function: [[setPedAnimation]])&lt;br /&gt;
 setAnimationProgress (function: [[setPedAnimationProgress]])&lt;br /&gt;
 setArmor (function: [[setPedArmor]])&lt;br /&gt;
 setChoking (function: [[setPedChoking]])&lt;br /&gt;
 setDoingGangDriveBy (function: [[setPedDoingGangDriveby]])&lt;br /&gt;
 setFightingStyle (function: [[setPedFightingStyle]])&lt;br /&gt;
 setFrozen (function: [[setPedFrozen]])&lt;br /&gt;
 setGravity (function: [[setPedGravity]])&lt;br /&gt;
 setHeadless (function: [[setPedHeadless]])&lt;br /&gt;
 setOnFire (function: [[setPedOnFire]])&lt;br /&gt;
 setStat (function: [[setPedStat]])&lt;br /&gt;
 setWalkingStyle (function: [[setPedWalkingStyle]])&lt;br /&gt;
 setWeaponSlot (function: [[setPedWeaponSlot]])&lt;br /&gt;
 warpIntoVehicle (function: [[warpPedIntoVehicle]])&lt;br /&gt;
&lt;br /&gt;
==Pickup==&lt;br /&gt;
''Inherited from [[#Element|Element]]''&lt;br /&gt;
 &lt;br /&gt;
 create (function: [[createPickup]])&lt;br /&gt;
 getAmmo (function: [[getPickupAmmo]])&lt;br /&gt;
 getAmount (function: [[getPickupAmount]])&lt;br /&gt;
 getRespawnInterval (function: [[getPickupRespawnInterval]])&lt;br /&gt;
 getType (function: [[getPickupType]])&lt;br /&gt;
 getWeapon (function: [[getPickupWeapon]])&lt;br /&gt;
 setRespawnInterval (function: [[setPickupRespawnInterval]])&lt;br /&gt;
 setType (function: [[setPickupType]])&lt;br /&gt;
 use (function: [[usePickup]])&lt;br /&gt;
&lt;br /&gt;
==Player==&lt;br /&gt;
''Inherited from [[#Ped|Ped]]''&lt;br /&gt;
&lt;br /&gt;
 ban (function: [[banPlayer]])&lt;br /&gt;
 create (function: [[getPlayerFromName]])&lt;br /&gt;
 forceMap (function: [[forcePlayerMap]])&lt;br /&gt;
 getAccount (function: [[getPlayerAccount]])&lt;br /&gt;
 getACInfo (function: [[getPlayerACInfo]])&lt;br /&gt;
 getAllAlive (function: [[getAlivePlayers]])&lt;br /&gt;
 getAllDead (function: [[getDeadPlayers]])&lt;br /&gt;
 getAnnounceValue (function: [[getPlayerAnnounceValue]])&lt;br /&gt;
 getBlurLevel (function: [[getPlayerBlurLevel]])&lt;br /&gt;
 getCount (function: [[getPlayerCount]])&lt;br /&gt;
 getIdleTime (function: [[getPlayerIdleTime]])&lt;br /&gt;
 getIP (function: [[getPlayerIP]])&lt;br /&gt;
 getMoney (function: [[getPlayerMoney]])&lt;br /&gt;
 getName (function: [[getPlayerName]])&lt;br /&gt;
 getNametagColor (function: [[getPlayerNametagColor]])&lt;br /&gt;
 getNametagText (function: [[getPlayerNametagText]])&lt;br /&gt;
 getPing (function: [[getPlayerPing]])&lt;br /&gt;
 getRandom (function: [[getRandomPlayer]])&lt;br /&gt;
 getSerial (function: [[getPlayerSerial]])&lt;br /&gt;
 getTeam (function: [[getPlayerTeam]])&lt;br /&gt;
 getVersion (function: [[getPlayerVersion]])&lt;br /&gt;
 getWantedLevel (function: [[getPlayerWantedLevel]])&lt;br /&gt;
 giveMoney (function: [[givePlayerMoney]])&lt;br /&gt;
 isMapForced (function: [[isPlayerMapForced]])&lt;br /&gt;
 isMuted (function: [[isPlayerMuted]])&lt;br /&gt;
 isNametagShowing (function: [[isPlayerNametagShowing]])&lt;br /&gt;
 isObservingDisplay (function: [[textDisplayIsObserver]])&lt;br /&gt;
 isVoiceEnabled (function: [[isVoiceEnabled]])&lt;br /&gt;
 kick (function: [[kickPlayer]])&lt;br /&gt;
 logOut (function: [[logOut]])&lt;br /&gt;
 observeDisplay (function: [[textDisplayAddObserver]])&lt;br /&gt;
 redirect (function: [[redirectPlayer]])&lt;br /&gt;
 resendModInfo (function: [[resendPlayerModInfo]])&lt;br /&gt;
 setAnnounceValue (function: [[setPlayerAnnounceValue]])&lt;br /&gt;
 setBlurLevel (function: [[setPlayerBlurLevel]])&lt;br /&gt;
 setHudComponentVisible (function: [[setPlayerHudComponentVisible]])&lt;br /&gt;
 setMoney (function: [[setPlayerMoney]])&lt;br /&gt;
 setMuted (function: [[setPlayerMuted]])&lt;br /&gt;
 setName (function: [[setPlayerName]])&lt;br /&gt;
 setNametagColor (function: [[setPlayerNametagColor]])&lt;br /&gt;
 setNametagShowing (function: [[setPlayerNametagShowing]])&lt;br /&gt;
 setNametagText (function: [[setPlayerNametagText]])&lt;br /&gt;
 setTeam (function: [[setPlayerTeam]])&lt;br /&gt;
 setVoiceBroadcastTo (function: [[setPlayerVoiceBroadcastTo]])&lt;br /&gt;
 setVoiceIgnoreFrom (function: [[setPlayerVoiceIgnoreFrom]])&lt;br /&gt;
 setWantedLevel (function: [[setPlayerWantedLevel]])&lt;br /&gt;
 showHudComponent (function: [[showPlayerHudComponent]])&lt;br /&gt;
 spawn (function: [[spawnPlayer]])&lt;br /&gt;
 stopObservingDisplay (function: [[textDisplayRemoveObserver]])&lt;br /&gt;
 takeMoney (function: [[takePlayerMoney]])&lt;br /&gt;
 takeScreenshot (function: [[takePlayerScreenShot]])&lt;br /&gt;
 triggerEvent (function: [[triggerClientEvent]])&lt;br /&gt;
&lt;br /&gt;
==RadarArea==&lt;br /&gt;
''Inherited from [[#Element|Element]]''&lt;br /&gt;
 &lt;br /&gt;
 create (function: [[createRadarArea]])&lt;br /&gt;
 getColor (function: [[getRadarAreaColor]])&lt;br /&gt;
 getSize (function: [[getRadarAreaSize]])&lt;br /&gt;
 isFlashing (function: [[isRadarAreaFlashing]])&lt;br /&gt;
 isInside (function: [[isInsideRadarArea]])&lt;br /&gt;
 setColor (function: [[setRadarAreaColor]])&lt;br /&gt;
 setFlashing (function: [[setRadarAreaFlashing]])&lt;br /&gt;
 setSize (function: [[setRadarAreaSize]])&lt;br /&gt;
&lt;br /&gt;
==Resource==&lt;br /&gt;
==Connection==&lt;br /&gt;
''Inherited from [[#Element|Element]]''&lt;br /&gt;
 &lt;br /&gt;
 create (function: [[dbConnect]])&lt;br /&gt;
 exec (function: [[dbExec]])&lt;br /&gt;
 query (function: [[dbQuery]])&lt;br /&gt;
&lt;br /&gt;
==QueryHandle==&lt;br /&gt;
 &lt;br /&gt;
 free (function: [[dbFree]])&lt;br /&gt;
 poll (function: [[dbPoll]])&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
''Inherited from [[#Element|Element]]''&lt;br /&gt;
 &lt;br /&gt;
 countPlayers (function: [[countPlayersInTeam]])&lt;br /&gt;
 create (function: [[createTeam]])&lt;br /&gt;
 getColor (function: [[getTeamColor]])&lt;br /&gt;
 getFriendlyFire (function: [[getTeamFriendlyFire]])&lt;br /&gt;
 getFromName (function: [[getTeamFromName]])&lt;br /&gt;
 getName (function: [[getTeamName]])&lt;br /&gt;
 getPlayers (function: [[getPlayersInTeam]])&lt;br /&gt;
 setColor (function: [[setTeamColor]])&lt;br /&gt;
 setFriendlyFire (function: [[setTeamFriendlyFire]])&lt;br /&gt;
 setName (function: [[setTeamName]])&lt;br /&gt;
&lt;br /&gt;
==TextDisplay==&lt;br /&gt;
 &lt;br /&gt;
 addObserver (function: [[textDisplayAddObserver]])&lt;br /&gt;
 addText (function: [[textDisplayAddText]])&lt;br /&gt;
 create (function: [[textCreateDisplay]])&lt;br /&gt;
 destroy (function: [[textDestroyDisplay]])&lt;br /&gt;
 getObservers (function: [[textDisplayGetObservers]])&lt;br /&gt;
 isObserver (function: [[textDisplayIsObserver]])&lt;br /&gt;
 removeObserver (function: [[textDisplayRemoveObserver]])&lt;br /&gt;
 removeText (function: [[textDisplayRemoveText]])&lt;br /&gt;
&lt;br /&gt;
==TextItem==&lt;br /&gt;
 &lt;br /&gt;
 create (function: [[textCreateTextItem]])&lt;br /&gt;
 destroy (function: [[textDestroyTextItem]])&lt;br /&gt;
 getColor (function: [[textItemGetColor]])&lt;br /&gt;
 getPosition (function: [[textItemGetPosition]])&lt;br /&gt;
 getPriority (function: [[textItemGetPriority]])&lt;br /&gt;
 getScale (function: [[textItemGetScale]])&lt;br /&gt;
 getText (function: [[textItemGetText]])&lt;br /&gt;
 setColor (function: [[textItemSetColor]])&lt;br /&gt;
 setPosition (function: [[textItemSetPosition]])&lt;br /&gt;
 setPriority (function: [[textItemSetPriority]])&lt;br /&gt;
 setScale (function: [[textItemSetScale]])&lt;br /&gt;
 setText (function: [[textItemSetText]])&lt;br /&gt;
&lt;br /&gt;
==Vehicle==&lt;br /&gt;
''Inherited from [[#Element|Element]]''&lt;br /&gt;
 &lt;br /&gt;
 addSirens (function: [[addVehicleSirens]])&lt;br /&gt;
 addUpgrade (function: [[addVehicleUpgrade]])&lt;br /&gt;
 areSirensOn (function: [[getVehicleSirensOn]])&lt;br /&gt;
 attachTrailer (function: [[attachTrailerToVehicle]])&lt;br /&gt;
 blow (function: [[blowVehicle]])&lt;br /&gt;
 create (function: [[createVehicle]])&lt;br /&gt;
 detachTrailer (function: [[detachTrailerFromVehicle]])&lt;br /&gt;
 fix (function: [[fixVehicle]])&lt;br /&gt;
 getAllOfType (function: [[getVehiclesOfType]])&lt;br /&gt;
 getColor (function: [[getVehicleColor]])&lt;br /&gt;
 getCompatibleUpgrades (function: [[getVehicleCompatibleUpgrades]])&lt;br /&gt;
 getController (function: [[getVehicleController]])&lt;br /&gt;
 getDirection (function: [[getTrainDirection]])&lt;br /&gt;
 getDoorOpenRatio (function: [[getVehicleDoorOpenRatio]])&lt;br /&gt;
 getDoorState (function: [[getVehicleDoorState]])&lt;br /&gt;
 getEngineState (function: [[getVehicleEngineState]])&lt;br /&gt;
 getHandling (function: [[getVehicleHandling]])&lt;br /&gt;
 getHeadLightColor (function: [[getVehicleHeadLightColor]])&lt;br /&gt;
 getLandingGearDown (function: [[getVehicleLandingGearDown]])&lt;br /&gt;
 getLightState (function: [[getVehicleLightState]])&lt;br /&gt;
 getMaxPassenger (function: [[getVehicleMaxPassengers]])&lt;br /&gt;
 getModelFromName (function: [[getVehicleModelFromName]])&lt;br /&gt;
 getModelHandling (function: [[getModelHandling]])&lt;br /&gt;
 getName (function: [[getVehicleName]])&lt;br /&gt;
 getNameFromModel (function: [[getVehicleNameFromModel]])&lt;br /&gt;
 getOccupant (function: [[getVehicleOccupant]])&lt;br /&gt;
 getOccupants (function: [[getVehicleOccupants]])&lt;br /&gt;
 getOriginalHandling (function: [[getOriginalHandling]])&lt;br /&gt;
 getOverrideLights (function: [[getVehicleOverrideLights]])&lt;br /&gt;
 getPaintjob (function: [[getVehiclePaintjob]])&lt;br /&gt;
 getPanelState (function: [[getVehiclePanelState]])&lt;br /&gt;
 getPlateText (function: [[getVehiclePlateText]])&lt;br /&gt;
 getSirenParams (function: [[getVehicleSirenParams]])&lt;br /&gt;
 getSirens (function: [[getVehicleSirens]])&lt;br /&gt;
 getSpeed (function: [[getTrainSpeed]])&lt;br /&gt;
 getTowedByVehicle (function: [[getVehicleTowedByVehicle]])&lt;br /&gt;
 getTowingVehicle (function: [[getVehicleTowingVehicle]])&lt;br /&gt;
 getTurnVelocity (function: [[getVehicleTurnVelocity]])&lt;br /&gt;
 getTurretPosition (function: [[getVehicleTurretPosition]])&lt;br /&gt;
 getUpgradeOnSlot (function: [[getVehicleUpgradeOnSlot]])&lt;br /&gt;
 getUpgrades (function: [[getVehicleUpgrades]])&lt;br /&gt;
 getUpgradeSlotName (function: [[getVehicleUpgradeSlotName]])&lt;br /&gt;
 getVariant (function: [[getVehicleVariant]])&lt;br /&gt;
 getVehicleType (function: [[getVehicleType]])&lt;br /&gt;
 getWheelStates (function: [[getVehicleWheelStates]])&lt;br /&gt;
 isBlown (function: [[isVehicleBlown]])&lt;br /&gt;
 isDamageProof (function: [[isVehicleDamageProof]])&lt;br /&gt;
 isDerailable (function: [[isTrainDerailable]])&lt;br /&gt;
 isDerailed (function: [[isTrainDerailed]])&lt;br /&gt;
 isFuelTankExplodable (function: [[isVehicleFuelTankExplodable]])&lt;br /&gt;
 isLocked (function: [[isVehicleLocked]])&lt;br /&gt;
 isOnGround (function: [[isVehicleOnGround]])&lt;br /&gt;
 isTaxiLightOn (function: [[isVehicleTaxiLightOn]])&lt;br /&gt;
 removeSirens (function: [[removeVehicleSirens]])&lt;br /&gt;
 removeUpgrade (function: [[removeVehicleUpgrade]])&lt;br /&gt;
 resetExplosionTime (function: [[resetVehicleExplosionTime]])&lt;br /&gt;
 resetIdleTime (function: [[resetVehicleIdleTime]])&lt;br /&gt;
 respawn (function: [[respawnVehicle]])&lt;br /&gt;
 setColor (function: [[setVehicleColor]])&lt;br /&gt;
 setDamageProof (function: [[setVehicleDamageProof]])&lt;br /&gt;
 setDerailable (function: [[setTrainDerailable]])&lt;br /&gt;
 setDerailed (function: [[setTrainDerailed]])&lt;br /&gt;
 setDirection (function: [[setTrainDirection]])&lt;br /&gt;
 setDoorOpenRatio (function: [[setVehicleDoorOpenRatio]])&lt;br /&gt;
 setDoorState (function: [[setVehicleDoorState]])&lt;br /&gt;
 setDoorsUndamageable (function: [[setVehicleDoorsUndamageable]])&lt;br /&gt;
 setEngineState (function: [[setVehicleEngineState]])&lt;br /&gt;
 setFuelTankExplodable (function: [[setVehicleFuelTankExplodable]])&lt;br /&gt;
 setHandling (function: [[setVehicleHandling]])&lt;br /&gt;
 setHeadLightColor (function: [[setVehicleHeadLightColor]])&lt;br /&gt;
 setIdleRespawnDelay (function: [[setVehicleIdleRespawnDelay]])&lt;br /&gt;
 setLandingGearDown (function: [[setVehicleLandingGearDown]])&lt;br /&gt;
 setLightState (function: [[setVehicleLightState]])&lt;br /&gt;
 setLocked (function: [[setVehicleLocked]])&lt;br /&gt;
 setModelHandling (function: [[setModelHandling]])&lt;br /&gt;
 setOverrideLights (function: [[setVehicleOverrideLights]])&lt;br /&gt;
 setPaintJob (function: [[setVehiclePaintjob]])&lt;br /&gt;
 setPanelState (function: [[setVehiclePanelState]])&lt;br /&gt;
 setPlateText (function: [[setVehiclePlateText]])&lt;br /&gt;
 setRespawnDelay (function: [[setVehicleRespawnDelay]])&lt;br /&gt;
 setRespawnPosition (function: [[setVehicleRespawnPosition]])&lt;br /&gt;
 setSirens (function: [[setVehicleSirens]])&lt;br /&gt;
 setSirensOn (function: [[setVehicleSirensOn]])&lt;br /&gt;
 setSpeed (function: [[setTrainSpeed]])&lt;br /&gt;
 setTaxiLightOn (function: [[setVehicleTaxiLightOn]])&lt;br /&gt;
 setTurnVelocity (function: [[setVehicleTurnVelocity]])&lt;br /&gt;
 setTurretPosition (function: [[setVehicleTurretPosition]])&lt;br /&gt;
 setVariant (function: [[setVehicleVariant]])&lt;br /&gt;
 setWheelStates (function: [[setVehicleWheelStates]])&lt;br /&gt;
 spawn (function: [[spawnVehicle]])&lt;br /&gt;
 toggleRespawn (function: [[toggleVehicleRespawn]])&lt;br /&gt;
&lt;br /&gt;
==Water==&lt;br /&gt;
''Inherited from [[#Element|Element]]''&lt;br /&gt;
 &lt;br /&gt;
 create (function: [[createWater]])&lt;br /&gt;
 getColor (function: [[getWaterColor]])&lt;br /&gt;
 getVertexPosition (function: [[getWaterVertexPosition]])&lt;br /&gt;
 getWaveHeight (function: [[getWaveHeight]])&lt;br /&gt;
 resetColor (function: [[resetWaterColor]])&lt;br /&gt;
 resetLevel (function: [[resetWaterLevel]])&lt;br /&gt;
 setColor (function: [[setWaterColor]])&lt;br /&gt;
 setLevel (function: [[setWaterLevel]])&lt;br /&gt;
 setVertexPosition (function: [[setWaterVertexPosition]])&lt;br /&gt;
 setWaveHeight (function: [[setWaveHeight]])&lt;br /&gt;
&lt;br /&gt;
==XML==&lt;br /&gt;
 &lt;br /&gt;
 copy (function: [[xmlCopyFile]])&lt;br /&gt;
 create (function: [[xmlCreateFile]])&lt;br /&gt;
 createChild (function: [[xmlCreateChild]])&lt;br /&gt;
 destroy (function: [[xmlDestroyNode]])&lt;br /&gt;
 findChild (function: [[xmlFindChild]])&lt;br /&gt;
 getAttribute (function: [[xmlNodeGetAttribute]])&lt;br /&gt;
 getAttributes (function: [[xmlNodeGetAttributes]])&lt;br /&gt;
 getChildren (function: [[xmlNodeGetChildren]])&lt;br /&gt;
 getName (function: [[xmlNodeGetName]])&lt;br /&gt;
 getParent (function: [[xmlNodeGetParent]])&lt;br /&gt;
 load (function: [[xmlLoadFile]])&lt;br /&gt;
 loadMapData (function: [[loadMapData]])&lt;br /&gt;
 saveFile (function: [[xmlSaveFile]])&lt;br /&gt;
 saveMapData (function: [[saveMapData]])&lt;br /&gt;
 setAttribute (function: [[xmlNodeSetAttribute]])&lt;br /&gt;
 setName (function: [[xmlNodeSetName]])&lt;br /&gt;
 setValue (function: [[xmlNodeGetValue]])&lt;br /&gt;
 setValue (function: [[xmlNodeSetValue]])&lt;br /&gt;
 unload (function: [[xmlUnloadFile]])&lt;br /&gt;
&lt;br /&gt;
==Timer==&lt;br /&gt;
 &lt;br /&gt;
 create (function: [[setTimer]])&lt;br /&gt;
 destroy (function: [[killTimer]])&lt;br /&gt;
 getDetails (function: [[getTimerDetails]])&lt;br /&gt;
 isValid (function: [[isTimer]])&lt;br /&gt;
 reset (function: [[resetTimer]])&lt;br /&gt;
&lt;br /&gt;
[[Category:OOP]]&lt;/div&gt;</summary>
		<author><name>GTX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnVehicleWeaponFire&amp;diff=49727</id>
		<title>OnVehicleWeaponFire</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnVehicleWeaponFire&amp;diff=49727"/>
		<updated>2016-10-31T02:34:01Z</updated>

		<summary type="html">&lt;p&gt;GTX: Fixed syntax highlight&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This code implements an '''event''' that is triggered when a player in a vehicle fires a vehicles weapon. A list of vehicles that have weapons are listed below:&lt;br /&gt;
&lt;br /&gt;
* Hydra - Fighter Jet (ID: 520)&lt;br /&gt;
* Hunter - Assault Helicopter (ID: 425)&lt;br /&gt;
* Rustler - World War 2 style fighter (ID: 476)&lt;br /&gt;
* Predator - Police Boat with side guns (ID: 430)&lt;br /&gt;
* Rhino - Heavily armoured tank (ID: 432)&lt;br /&gt;
* Firetruck - Firetruck with sprayable hose (ID: 407)&lt;br /&gt;
* S.W.A.T. - Police tank with sprayable hose (ID: 601)&lt;br /&gt;
* RC Baron - A mini fighter (ID: 464)&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;string vehicleFireType, int vehicleModel&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* vehicleFireType: this will be &amp;quot;primary&amp;quot; or &amp;quot;secondary&amp;quot; depending on which player the button pressed.&lt;br /&gt;
* vehicleModel: the model number the player is in when they triggered the event.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The source of this event is the player who fired the vehicles gun(s).&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Clientside Script&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;
armedVehicles = {[425]=true, [520]=true, [476]=true, [447]=true, [430]=true, [432]=true, [464]=true, [407]=true, [601]=true}&lt;br /&gt;
function vehicleWeaponFire(key, keyState, vehicleFireType)&lt;br /&gt;
	local vehModel = getElementModel(getPedOccupiedVehicle(localPlayer))&lt;br /&gt;
	if (armedVehicles[vehModel]) then&lt;br /&gt;
		triggerEvent(&amp;quot;onClientVehicleWeaponFire&amp;quot;, localPlayer, vehicleFireType, vehModel)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
bindKey(&amp;quot;vehicle_fire&amp;quot;, &amp;quot;down&amp;quot;, vehicleWeaponFire, &amp;quot;primary&amp;quot;)&lt;br /&gt;
bindKey(&amp;quot;vehicle_secondary_fire&amp;quot;, &amp;quot;down&amp;quot;, vehicleWeaponFire, &amp;quot;secondary&amp;quot;)&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;Serverside Script&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
armedVehicles = {[425]=true, [520]=true, [476]=true, [447]=true, [430]=true, [432]=true, [464]=true, [407]=true, [601]=true}&lt;br /&gt;
function vehicleWeaponFire(thePresser, key, keyState, vehicleFireType)&lt;br /&gt;
	local vehModel = getElementModel(getPedOccupiedVehicle(thePresser))&lt;br /&gt;
	if (armedVehicles[vehModel]) then&lt;br /&gt;
		triggerEvent(&amp;quot;onVehicleWeaponFire&amp;quot;, thePresser, vehicleFireType, vehModel)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function bindOnJoin()&lt;br /&gt;
	bindKey(source, &amp;quot;vehicle_fire&amp;quot;, &amp;quot;down&amp;quot;, vehicleWeaponFire, &amp;quot;primary&amp;quot;)&lt;br /&gt;
	bindKey(source, &amp;quot;vehicle_secondary_fire&amp;quot;, &amp;quot;down&amp;quot;, vehicleWeaponFire, &amp;quot;secondary&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerJoin&amp;quot;, root, bindOnJoin)&lt;br /&gt;
&lt;br /&gt;
function bindOnStart()&lt;br /&gt;
	for index, thePlayer in pairs(getElementsByType(&amp;quot;player&amp;quot;)) do&lt;br /&gt;
		bindKey(thePlayer, &amp;quot;vehicle_fire&amp;quot;, &amp;quot;down&amp;quot;, vehicleWeaponFire, &amp;quot;primary&amp;quot;)&lt;br /&gt;
		bindKey(thePlayer, &amp;quot;vehicle_secondary_fire&amp;quot;, &amp;quot;down&amp;quot;, vehicleWeaponFire, &amp;quot;secondary&amp;quot;)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;, getResourceRootElement(), bindOnStart)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Clientside Example&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function eventVehicleFire(typeOfFire, theModel)&lt;br /&gt;
	outputChatBox(getPlayerName(source)..&amp;quot; fired his &amp;quot;..getVehicleNameFromModel(theModel)..&amp;quot;'s weapon (&amp;quot;..typeOfFire..&amp;quot;)&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addEvent(&amp;quot;onClientVehicleWeaponFire&amp;quot;, false)&lt;br /&gt;
addEventHandler(&amp;quot;onClientVehicleWeaponFire&amp;quot;, getLocalPlayer(), eventVehicleFire)&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;Serverside Example&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 eventVehicleFire(typeOfFire, theModel)&lt;br /&gt;
	outputChatBox(getPlayerName(source)..&amp;quot; fired his &amp;quot;..getVehicleNameFromModel(theModel)..&amp;quot;'s weapon (&amp;quot;..typeOfFire..&amp;quot;)&amp;quot;, root, 0, 255, 0)&lt;br /&gt;
end&lt;br /&gt;
addEvent(&amp;quot;onVehicleWeaponFire&amp;quot;, false)&lt;br /&gt;
addEventHandler(&amp;quot;onVehicleWeaponFire&amp;quot;, root, eventVehicleFire)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Author: Tuna'''&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>GTX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsSoundPaused&amp;diff=49724</id>
		<title>IsSoundPaused</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsSoundPaused&amp;diff=49724"/>
		<updated>2016-10-30T00:20:06Z</updated>

		<summary type="html">&lt;p&gt;GTX: Reversed (This is English section of wiki...)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function is used to return the current pause state of the specified [[sound]] [[element]].&lt;br /&gt;
&lt;br /&gt;
{{New feature/item|3.0132|1.3.2||&lt;br /&gt;
If the element is a [[player]], this function will use the players voice.&lt;br /&gt;
}}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isSoundPaused ( element theSound )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[sound]]:isPaused|paused|setSoundPaused}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theSound:''' the [[sound]] [[element]] which pause state you want to return.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the [[sound]] [[element]] is paused, ''false'' if unpaused or invalid arguments were passed.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example will check and see if the sound is paused or not, and tell the player.&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;
theSound = playSound(&amp;quot;music/song.mp3&amp;quot;)&lt;br /&gt;
function checkSongPause()&lt;br /&gt;
    local pause = isSoundPaused(theSound)&lt;br /&gt;
    if(pause == true) then&lt;br /&gt;
        outputChatBox(&amp;quot;The sound is paused!&amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox(&amp;quot;The sound is not paused!&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;checkpause&amp;quot;, checkSongPause)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.2|Added player element to use a players voice}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
&lt;br /&gt;
[[ar:isSoundPaused]]&lt;/div&gt;</summary>
		<author><name>GTX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnClientChatMessage&amp;diff=49673</id>
		<title>OnClientChatMessage</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnClientChatMessage&amp;diff=49673"/>
		<updated>2016-10-28T12:25:53Z</updated>

		<summary type="html">&lt;p&gt;GTX: Typo in example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client event}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This event is triggered when any text is output to chatbox, including MTA's hardcoded messages.&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, int r, int g, int b&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''text:''' The text that was output to chatbox&lt;br /&gt;
*'''r:''' The amount of red in the color of the text.&lt;br /&gt;
*'''g:''' The amount of green in the color of the text.&lt;br /&gt;
*'''b:''' The amount of blue in the color of the text.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the root element.&lt;br /&gt;
==Cancel effect==&lt;br /&gt;
AS OF 1.3.2&lt;br /&gt;
If this event is [[Event system#Canceling|canceled]], the game's chat system won't deliver the posts. You may use [[outputChatBox]] to send the messages then.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example doesn't output anything to chatbox if it consists only of numbers&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function onClientChatMessageHandler(text)&lt;br /&gt;
	if string.match(text,&amp;quot;%d+&amp;quot;) --[[string.match searches for pattern &amp;quot;%d+&amp;quot;, means decimals]] == text then -- if string.match and text itself are the same&lt;br /&gt;
		cancelEvent() -- don't output it&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientChatMessage&amp;quot;, getRootElement(), onClientChatMessageHandler)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
===Client other 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>GTX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetResourceFromName&amp;diff=49665</id>
		<title>GetResourceFromName</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetResourceFromName&amp;diff=49665"/>
		<updated>2016-10-27T15:56:08Z</updated>

		<summary type="html">&lt;p&gt;GTX: Added link to resource wiki page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function is used to retrieve a resource from its name. A resource's name is the same as its folder or file archive name on the server (without the extension).&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 getResourceFromName ( string resourceName )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP|This function is a static function underneath the Resource class. {{New feature/item|3.0141|1.4.1|7005|OOP function available client side}}|[[Resource]].getFromName}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''resourceName:''' the name of the resource you wish to get.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the [[resource]] with the specified name, or ''false'' if no resource of that name exists.&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 prints out a message to the chatbox when a resource named ''playerblips'' is started.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function onStart( theResource )&lt;br /&gt;
     local blipsResource = getResourceFromName ( &amp;quot;playerblips&amp;quot; ) -- get the resource of name &amp;quot;playerblips&amp;quot;&lt;br /&gt;
     if ( blipsResource and theResource == blipsResource ) then -- check if the resource started was it&lt;br /&gt;
          outputChatBox ( &amp;quot;Blips resource started!&amp;quot; )&lt;br /&gt;
     end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onResourceStart&amp;quot;, getRootElement(), onStart )&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;
{{Resource_functions}}&lt;/div&gt;</summary>
		<author><name>GTX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=TriggerClientEvent&amp;diff=49664</id>
		<title>TriggerClientEvent</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=TriggerClientEvent&amp;diff=49664"/>
		<updated>2016-10-27T10:31:42Z</updated>

		<summary type="html">&lt;p&gt;GTX: Added OOP syntax (I added &amp;quot;table/element&amp;quot;, not sure if that's how it should be added)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!--{{Needs_Checking|Something needs to be said about the steps required to help keep an event inside a resource. i.e. Setting 'theElement' to resourceRoot here, and setting the matching event handler's 'attachedTo' also to resourceRoot.}}&lt;br /&gt;
--&amp;gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function triggers an event previously registered on a client. This is the primary means of passing information between the server and the client. Clients have a similar [[triggerServerEvent]] function that can do the reverse. You can treat this function as if it was an asynchronous function call, using [[triggerServerEvent]] to pass back any returned information if necessary.&lt;br /&gt;
&lt;br /&gt;
Almost any data types can be passed as expected, including [[element]]s and complex nested [[table]]s. Non-element MTA data types like xmlNodes or resource pointers will not be able to be passed as they do not necessarily have a valid representation on the client.&lt;br /&gt;
&lt;br /&gt;
Events are sent reliably, so clients will receive them, but there may be (but shouldn't be) a significant delay before they are received. You should take this into account when using them.&lt;br /&gt;
&lt;br /&gt;
Keep in mind the bandwidth issues when using events - don't pass a large list of arguments unless you really need to. It is marginally more efficient to pass one large event than two smaller ones.&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool triggerClientEvent ( [table/element sendTo=getRootElement()], string name, element sourceElement, [arguments...] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[table]]/[[element]]:triggerEvent||}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''name:''' The name of the event to trigger client side. You should register this event with [[addEvent]] and add at least one event handler using [[addEventHandler]].&lt;br /&gt;
*'''sourceElement:''' The element that is the [[Event system#Event handlers|source]] of the event.&lt;br /&gt;
{{Note|To save client CPU, you should avoid setting '''sourceElement''' to the [[root element]] where possible. Using [[GetThisResource|resourceRoot]] is usually sufficient if the event is handled by the same resource on the client.}}&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''sendTo:''' The event will be sent to all [[player]]s that are children of the specified element. By default this is the root element, and hence the event is sent to all players. If you specify a single player it will just be sent to that player. This argument can also be a table of player elements.&lt;br /&gt;
*'''arguments...:''' A list of arguments to trigger with the event. You can pass any lua data type (except functions). You can also pass [[element]]s.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the event trigger has been sent, ''false'' if invalid arguments were specified.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
===Example 1===&lt;br /&gt;
This example shows how you can pass a simple &amp;quot;Hello World&amp;quot; message from the server to the all the clients using an event.&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;
function greetingHandler ( message )&lt;br /&gt;
    outputChatBox ( &amp;quot;The server says: &amp;quot; .. message )&lt;br /&gt;
end&lt;br /&gt;
addEvent( &amp;quot;onGreeting&amp;quot;, true )&lt;br /&gt;
addEventHandler( &amp;quot;onGreeting&amp;quot;, localPlayer, greetingHandler )&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;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 greetingCommand ( playerSource, commandName )&lt;br /&gt;
    triggerClientEvent ( playerSource, &amp;quot;onGreeting&amp;quot;, playerSource, &amp;quot;Hello World!&amp;quot; )&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;greet&amp;quot;, greetingCommand )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the command &amp;quot;greet&amp;quot; is executed (by typing it in the server console or the player's console), the server's ''greetingCommand'' function is called. This triggers the client side event ''onGreeting'' with the string ''&amp;quot;Hello World!&amp;quot;''. This event is then handled by the ''greetingHandler'' function client side which then displays the message.&lt;br /&gt;
&lt;br /&gt;
===Example 2===&lt;br /&gt;
This example shows how you can pass a simple &amp;quot;Hello World&amp;quot; message from the server to '''a single''' client using an event.&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;
function greetingHandler ( message )&lt;br /&gt;
    outputChatBox ( &amp;quot;The server says: &amp;quot; .. message )&lt;br /&gt;
end&lt;br /&gt;
addEvent( &amp;quot;onGreeting&amp;quot;, true )&lt;br /&gt;
addEventHandler( &amp;quot;onGreeting&amp;quot;, localPlayer, greetingHandler )&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;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 greetingCommandOne ( playerSource, commandName, playerName )&lt;br /&gt;
    if playerName then&lt;br /&gt;
        local thePlayer = getPlayerFromName ( playerName )&lt;br /&gt;
        if thePlayer then&lt;br /&gt;
            triggerClientEvent ( thePlayer, &amp;quot;onGreeting&amp;quot;, thePlayer, &amp;quot;Hello World!&amp;quot; )&lt;br /&gt;
        else&lt;br /&gt;
            -- invalid player name specified&lt;br /&gt;
        end&lt;br /&gt;
    else&lt;br /&gt;
        -- No player name specified&lt;br /&gt;
    end &lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;greet_one&amp;quot;, greetingCommandOne )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This works like the first example except an extra ''thePlayer'' argument is specified for triggerClientEvent.&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.0-9.04570|Added option to use a list of player elements for the 'sendTo' argument}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Event functions}}&lt;br /&gt;
[[ru:triggerClientEvent]]&lt;/div&gt;</summary>
		<author><name>GTX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=FileClose&amp;diff=49589</id>
		<title>FileClose</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FileClose&amp;diff=49589"/>
		<updated>2016-10-22T11:55:34Z</updated>

		<summary type="html">&lt;p&gt;GTX: Destroy method doesn't work anymore in 1.5.3.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
Closes a file handle obtained by [[fileCreate]] or [[fileOpen]].&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 fileClose ( file theFile )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[file]]:close}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theFile:''' The file handle to close.&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;
This example creates a text file and writes a string to it.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local newFile = fileCreate(&amp;quot;test.txt&amp;quot;)                -- attempt to create a new file&lt;br /&gt;
if newFile then                                       -- check if the creation succeeded&lt;br /&gt;
    fileWrite(newFile, &amp;quot;This is a test file!&amp;quot;)        -- write a text line&lt;br /&gt;
    fileClose(newFile)                                -- close the file once you're done with it&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to remember to close a file after you've finished all your operations on it, especially if you've been writing to the file. If you don't close a file and your resource crashes, all changes to the file may be lost.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{File functions}}&lt;/div&gt;</summary>
		<author><name>GTX</name></author>
	</entry>
</feed>