<?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=506</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=506"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/506"/>
	<updated>2026-05-11T00:16:32Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPlayerWeaponSwitch&amp;diff=76997</id>
		<title>OnPlayerWeaponSwitch</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPlayerWeaponSwitch&amp;diff=76997"/>
		<updated>2023-06-14T15:51:58Z</updated>

		<summary type="html">&lt;p&gt;506: Fix mistake&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server event}}&lt;br /&gt;
This event is triggered whenever a player's equipped weapon '''slot''' changes. This means [[giveWeapon]] and [[takeWeapon]] will trigger this event if the equipped slot is forced to change. &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 previousWeaponID, int currentWeaponID&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''previousWeaponID''': An [[int|integer]] representing the [[weapons|weapon]] that was switched from.&lt;br /&gt;
*'''currentWeaponID''': An [[int|integer]] representing the [[weapons|weapon]] that was switched to.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[player]] that switched his weapon.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example disables use of the minigun upon switch.  It should be noted that this can be done more efficiently clientside.&lt;br /&gt;
&lt;br /&gt;
==Cancel effect==&lt;br /&gt;
If this event is [[Event system#Canceling|canceled]], then the player's weapon won't be switched.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
WeaponID = {&lt;br /&gt;
	[31] = true,&lt;br /&gt;
	[36] = true,&lt;br /&gt;
	[38] = true,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
--add an event handler for onPlayerWeaponSwitch&lt;br /&gt;
addEventHandler ( 'onPlayerWeaponSwitch', getRootElement ( ),&lt;br /&gt;
	function ( previousWeaponID, currentWeaponID )&lt;br /&gt;
		if ( WeaponID[currentWeaponID] ) then&lt;br /&gt;
			toggleControl ( source, 'fire', false ) --disable the fire button&lt;br /&gt;
		else&lt;br /&gt;
			toggleControl ( source, 'fire', true ) --enable it&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Player events}}&lt;/div&gt;</summary>
		<author><name>506</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPlayerWeaponSwitch&amp;diff=76996</id>
		<title>OnPlayerWeaponSwitch</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPlayerWeaponSwitch&amp;diff=76996"/>
		<updated>2023-06-14T15:46:50Z</updated>

		<summary type="html">&lt;p&gt;506: Adding [Cancel Effect]&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server event}}&lt;br /&gt;
This event is triggered whenever a player's equipped weapon '''slot''' changes. This means [[giveWeapon]] and [[takeWeapon]] will trigger this event if the equipped slot is forced to change. &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 previousWeaponID, int currentWeaponID&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''previousWeaponID''': An [[int|integer]] representing the [[weapons|weapon]] that was switched from.&lt;br /&gt;
*'''currentWeaponID''': An [[int|integer]] representing the [[weapons|weapon]] that was switched to.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[player]] that switched his weapon.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example disables use of the minigun upon switch.  It should be noted that this can be done more efficiently clientside.&lt;br /&gt;
&lt;br /&gt;
==Cancel effect==&lt;br /&gt;
If this event is [[Event system#Canceling|canceled]], then the player's weapon won't be switched. If this event has been caused by [[giveWeapon]] or [[takeWeapon]], then the player won't receive/lose the weapon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
WeaponID = {&lt;br /&gt;
	[31] = true,&lt;br /&gt;
	[36] = true,&lt;br /&gt;
	[38] = true,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
--add an event handler for onPlayerWeaponSwitch&lt;br /&gt;
addEventHandler ( 'onPlayerWeaponSwitch', getRootElement ( ),&lt;br /&gt;
	function ( previousWeaponID, currentWeaponID )&lt;br /&gt;
		if ( WeaponID[currentWeaponID] ) then&lt;br /&gt;
			toggleControl ( source, 'fire', false ) --disable the fire button&lt;br /&gt;
		else&lt;br /&gt;
			toggleControl ( source, 'fire', true ) --enable it&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Player events}}&lt;/div&gt;</summary>
		<author><name>506</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetElementVisibleTo&amp;diff=76697</id>
		<title>SetElementVisibleTo</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetElementVisibleTo&amp;diff=76697"/>
		<updated>2023-04-13T02:29:56Z</updated>

		<summary type="html">&lt;p&gt;506: object --&amp;gt; element&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
{{Needs_Checking|Can an element only be visible to one element (and its children) at a time? If so, do we need clearElementVisibleTo? If not, surely we need to remove the root element before using this function?&lt;br /&gt;
&lt;br /&gt;
Does the order of setElementVisibleTo calls really not matter? [[visibility|Visibility]] seems to ''imply'' that the order does matter.&lt;br /&gt;
&lt;br /&gt;
Is this function particularly ''or only'' useful for changing the visibility of markers, radar blips and radar areas?|[[User:EAi|EAi]][[User:Iam2noob4u|Iam2noob4u]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This function can change an [[element]]'s [[visibility]]. This does not work with all entities - [[vehicle]]s, [[player]]s and [[object]]s are exempt. This is because these objects are required for accurate sync (they're physical objects that contribute to the physics engine). This function is particularly useful for changing the visibility of markers, radar blips and radar areas.&lt;br /&gt;
&lt;br /&gt;
Visibility settings of lower elements in the element tree override higher ones - if visibility for root is set to false and for a player is set to true, it will be visible to the player.&lt;br /&gt;
&lt;br /&gt;
If you want to clear all visibility settings of an [[element]], try [[clearElementVisibleTo]]&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setElementVisibleTo ( element theElement, element visibleTo, bool visible )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[element]]:setVisibleTo||isElementVisibleTo}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' The element you want to control the visibility of.&lt;br /&gt;
*'''visibleTo:''' The element you wish the element to be visible or invisible to. Any child elements that are players will also be able to see the element. See [[visibility]].&lt;br /&gt;
*'''visible:''' Whether you are making it visible or invisible to the player.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the element's visibility was changed successfully, ''false'' otherwise, for example if you are trying to change the visibility of a vehicle, player or object.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example creates a marker and makes it only visibile to the player called 'someguy'.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Find the player called someguy&lt;br /&gt;
local someguy = getPlayerFromName ( &amp;quot;someguy&amp;quot; )&lt;br /&gt;
-- If the player was found then&lt;br /&gt;
if ( someguy ) then&lt;br /&gt;
	-- Get the player's position into the variables x, y and z&lt;br /&gt;
	x, y, z = getElementPosition ( someguy )&lt;br /&gt;
	-- Create a marker at the player's position&lt;br /&gt;
	myMarker = createMarker ( x, y, z )&lt;br /&gt;
	&lt;br /&gt;
	-- Then make the marker invisible to the whole dimension (root for the first)&lt;br /&gt;
	setElementVisibleTo ( myMarker, root, false )&lt;br /&gt;
	-- Set marker visibility to true for someguy&lt;br /&gt;
	setElementVisibleTo ( myMarker, someguy, true )&lt;br /&gt;
	&lt;br /&gt;
	-- The order in which you do the visibility changes does not matter, but ideally trues should be set before falses in order to prevent a momentary flicker.&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following example shows how to make the marker visible to everyone except anotherguy&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Find the player called someguy&lt;br /&gt;
local someguy = getPlayerFromName ( &amp;quot;someguy&amp;quot; )&lt;br /&gt;
local anotherguy = getPlayerFromName ( &amp;quot;anotherguy&amp;quot; )&lt;br /&gt;
-- If the player was found then&lt;br /&gt;
if ( someguy ) then&lt;br /&gt;
	-- Get the player's position into the variables x, y and z&lt;br /&gt;
	x, y, z = getElementPosition ( someguy )&lt;br /&gt;
	-- Create a marker at the player's position&lt;br /&gt;
	myMarker = createMarker ( x, y, z )&lt;br /&gt;
	attachElements(myMarker, someguy)&lt;br /&gt;
&lt;br /&gt;
	-- First make sure everyone is able to see the marker, this line is unnecessary in this case as root visibility is set to true by default behaviour&lt;br /&gt;
	setElementVisibleTo ( myMarker, root, true )&lt;br /&gt;
&lt;br /&gt;
	-- Then hide it from anotherguy&lt;br /&gt;
	setElementVisibleTo ( myMarker, anotherguy, false )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Element_functions}}&lt;/div&gt;</summary>
		<author><name>506</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetPedContactElement&amp;diff=75655</id>
		<title>GetPedContactElement</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPedContactElement&amp;diff=75655"/>
		<updated>2022-11-05T15:15:28Z</updated>

		<summary type="html">&lt;p&gt;506: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function detects the element a ped is standing on. This can be a vehicle or an object.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element getPedContactElement ( ped thePed )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[ped]]:getContactElement|contactElement}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePed:''' The [[ped]] of which you want to get the [[element]] he is standing on.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns an [[object]] or a [[vehicle]] if the ped is standing on one, ''false'' if he is touching none or an invalid element was passed.&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 clientside function outputs the name of the vehicle the specified player is standing on, or a message saying he isn't on one.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function outputContactVehicleMessage ( thePlayer )&lt;br /&gt;
    local elementStandingOn = getPedContactElement ( thePlayer )&lt;br /&gt;
    if elementStandingOn and getElementType ( elementStandingOn ) == &amp;quot;vehicle&amp;quot; then&lt;br /&gt;
        local vehicleName = getVehicleName ( elementStandingOn )&lt;br /&gt;
        outputChatBox( &amp;quot;You're standing on a &amp;quot; .. vehicleName .. &amp;quot;.&amp;quot; )&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox( &amp;quot;You're not standing on any vehicle.&amp;quot; )&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Ped functions}}&lt;br /&gt;
&lt;br /&gt;
[[hu:getPedContactElement]]&lt;/div&gt;</summary>
		<author><name>506</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/addCommandHandler&amp;diff=75247</id>
		<title>AR/addCommandHandler</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/addCommandHandler&amp;diff=75247"/>
		<updated>2022-07-10T02:07:24Z</updated>

		<summary type="html">&lt;p&gt;506: Editing my name&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
.تقوم هذه الوظيفة بربط وظيفة معينة وجعلها كوظيفة منفذة لأمر معين, وبذلك عندما يقوم لاعب أو إداري بإستعمال هذا الأمر, سوف يتم تنفيذ الوظيفة المرتبطة بهذا الأمر&lt;br /&gt;
{{Important Note|.'''لا تقم''' بإستعمال نفس إسم الوظيفة المُنفِذة (الفنكشن) كإسم للأمر, قد يقود هذا الشيء الى التسبب في إرتباك إذا أُستِعملَت عدة وظائف مُنفِذة عن طريق أمرٌ واحد. إستخدم إسم يصف غاية الوظيفة المُنفِذة بشكلٍ أدق}}&lt;br /&gt;
&lt;br /&gt;
: يتم إستعمال الإمر في اللعبه بالطريقة الآتية&lt;br /&gt;
'''...إسم الأمر''' '''[الآرجمنت الأول]''' '''[الآرجمنت الثاني]''' '''[إلخ]'''&lt;br /&gt;
&lt;br /&gt;
يمكن إستعمال الأمر لوحة تحكم اللاعب (اف 8) أو مباشرة من مربع الدردشة (الشات) بإضافة الرمز (''/'') في بداية الأمر. بالنسبة للأوامر المدرجة في قسم السيرفر, بإمكان الإداريين الذين يملكون صلاحية للدخول على إستضافة الخادم بإستعمالها عن طريق لوحة التحكم الخادم بنفس الطريقة التي يتم إستعمالها بواسطة لوحة تحكم اللاعب (اف 8).ـ&lt;br /&gt;
{{Note|كإسم للأمر &amp;quot;test&amp;quot; و &amp;quot;list&amp;quot; ,&amp;quot;check&amp;quot; لايمكنك إستعمال}}&lt;br /&gt;
&lt;br /&gt;
==بناء الجملة==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool addCommandHandler ( string commandName, function handlerFunction [, bool restricted = false, bool caseSensitive = true ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===معطيات إجبارية===&lt;br /&gt;
*'''commandName:''' هذا إسم الأمر الذي تريد ربط الوظيفة المُنفِذة بِه. هذا هو إسم الأمر الذي يجب كتابته في لوحة التحكم لتشغيل الوظيفة المُنفِذة&lt;br /&gt;
*'''handlerFunction:''' هذي هي الوظيفة المُنفِذة التي تريد ان يقوم الأمر بتشغيلها, والتي يجب ان تكون مكتوبه أو مُعَرفّه قبل إضافة الأمر. هذا الفنكشن يقوم بأخذ معاملان أساسيان : [اللاعب الذي قام بإستعمال الأمر], [إسم الأمر الذي إستخدمه اللاعب ], مصحوبًا &lt;br /&gt;
. بقدر ماتشاء من المعاملات التي يقوم بإضافتها اللاعب ( أُنظر الى المثال في الأسفل ). وهذه المعاملات '''إختيارية''' وليست إجبارية&lt;br /&gt;
===معطيات إختيارية=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
&lt;br /&gt;
*'''restricted:''' (قائمة التحكم بالوصول) ACL يحدد ما إذا كان يجب تقييد هذا الأمر افتراضيًا أم لا. استخدم هذا في الأوامر التي يجب ألا يكون الوصول إليها متاحًا للجميع, باستثناء المستخدمين الخاصين المُضافين في &lt;br /&gt;
ضمن المجموعة المناسبة لقابلية إستعماله من قبل &amp;quot;ACL&amp;quot; تأكد من إضافة الأمر إلى قائمة التحكم بالوصول .&amp;quot;ACL&amp;quot; متاحًا للجميع إذا نسي مسؤول/مبرمج الخادم تقييدها في &amp;quot;ban&amp;quot; هذا لضمان عدم إستعمال أوامر إدارية من قبل لاعبين عاديين, على سبيل المثال: لن يكون الأمر&lt;br /&gt;
&lt;br /&gt;
-: المستخدمين المُضافين لهذه المجموعة. مثال&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;right name = &amp;quot;command.killEveryone&amp;quot; access = &amp;quot;true&amp;quot;&amp;gt; &amp;lt;/right&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
بشكل إفتراضي &amp;quot;false&amp;quot; اذا لم يتم تحديد هذا الفراغ, فسوف يتم إعتباره كـ&lt;br /&gt;
&lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
*'''caseSensitive:''' (يحدد ما إذا كان معالج الأمر سوف يتجاهل حالة الأحرف ام لا (أحرف كبيرة أو صغيرة&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool addCommandHandler ( string commandName, function handlerFunction [, bool caseSensitive = true ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===معطيات إجبارية===&lt;br /&gt;
*'''commandName:''' هذا إسم الأمر الذي تريد ربط الوظيفة المُنفِذة بِه. هذا هو إسم الأمر الذي يجب كتابته في لوحة التحكم لتشغيل الوظيفة المُنفِذة&lt;br /&gt;
*'''handlerFunction:''' هذي هي الوظيفة المُنفِذة التي تريد ان يقوم الأمر بتشغيلها, والتي يجب ان تكون مكتوبه أو مُعَرفّه قبل إضافة الأمر. هذا الفنكشن يقوم بأخذ معاملان أساسيان : [اللاعب الذي قام بإستعمال الأمر], [إسم الأمر الذي إستخدمه اللاعب ], مصحوبًا &lt;br /&gt;
. بقدر ماتشاء من المعاملات التي يقوم بإضافتها اللاعب ( أُنظر الى المثال في الأسفل ). وهذه المعاملات '''إختيارية''' وليست إجبارية&lt;br /&gt;
===معطيات إختيارية=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
*'''caseSensitive:''' (يحدد ما إذا كان معالج الأمر سوف يتجاهل حالة الأحرف ام لا (أحرف كبيرة أو صغيرة&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====معاملات الوظيفة المُنفِذة====&lt;br /&gt;
هذه هي المعاملات للوظيفة المُنفِذة التي يتم تشغيلها عند إستعمال الأمر&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;player playerSource, string commandName [, string arg1, string arg2, ... ] &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''playerSource:''' الذي قام بإستخدام الأمر سواء كان لاعبًا أو عنصر وحدة تحكم الخادم (element) العنصر&lt;br /&gt;
* '''commandName:''' إسم الأمر الذي تم إستخدامه لتنفيذ هذه الوظيفة, مفيد جدًا اذا كان هناك اكثر من امر مرتبط بوظيفة واحدة&lt;br /&gt;
* '''arg1, arg2, ...:''' .[[nil]] كل كلمة تمت كتابتها بعد إسم الأمر, يتم تمريرها هنا كمتغير منفصل. اذا لم يدخل المُستخدم المعطيات الكافية بعد إسم الأمر, فسوف يحتوي المتغير الذي لم يحظى بأي معطيات بـ&lt;br /&gt;
كما هو معروض في '''مثال 2 قسم السيرفر''' في الأسفل ,'vararg'يمكنك التعامل مع عدد غير محدد من المعطيات بإستخدام تعبير&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;string commandName [, string arg1, string arg2, ... ] &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''commandName:''' .إسم الأمر الذي تم إستخدامه لتنفيذ هذه الوظيفة, مفيد جدًا اذا كان هناك اكثر من امر مرتبط بوظيفة واحدة&lt;br /&gt;
* '''arg1, arg2, ...:''' .[[nil]] كل كلمة تمت كتابتها بعد إسم الأمر, يتم تمريرها هنا كمتغير منفصل. اذا لم يدخل المُستخدم المعطيات الكافية بعد إسم الأمر, فسوف يحتوي المتغير الذي لم يحظى بأي معطيات بـ&lt;br /&gt;
كما هو معروض في '''مثال 2 قسم السيرفر''' في الأسفل ,'vararg'يمكنك التعامل مع عدد غير محدد من المعطيات بإستخدام تعبير&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===العوائد===&lt;br /&gt;
بخلاف ذلك ''false'' إذا تم إضافة معالج الأمر بنجاح, و ''true'' يقوم بإعادة القيمة&lt;br /&gt;
&lt;br /&gt;
==الأمثلة== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
والذي سيقوم بإنشاء بيد (بوت) في نفس موقع اللاعب الذي يقوم بإستعمال الأمر ''createPed'' '''المثال 1''' في هذا المثال نقوم بتعريف معالج الأمر للأمر &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- نقوم بتعريف الوظيفة الخاصة بنا والتي سوف تتعامل مع هذا الأمر&lt;br /&gt;
function createBot( thePlayer, commandName )&lt;br /&gt;
	-- إذا كان العنصر الذي قام بإستعمال الأمر من نوع لاعب وليس وحدة تحكم الخادم&lt;br /&gt;
	if getElementType(thePlayer) == &amp;quot;player&amp;quot; then&lt;br /&gt;
		-- نأخذ إحداثيات اللاعب&lt;br /&gt;
		local position = Vector3 (getElementPosition ( thePlayer) )&lt;br /&gt;
                -- نأخذ إستدارة اللاعب&lt;br /&gt;
                local _, _, rotation = getElementRotation( thePlayer)&lt;br /&gt;
                -- نأخذ الدمنشن الخاص باللاعب&lt;br /&gt;
                local dim = getElementDimension(thePlayer)&lt;br /&gt;
                -- نأخذ الإنتيريور الخاص باللاعب&lt;br /&gt;
                local int = getElementInterior(thePlayer)&lt;br /&gt;
		-- (table) نأخذ كل السكنات الصالحة للإستعمال على شكل مصفوفة&lt;br /&gt;
                local allSkins = getValidPedModels ( )&lt;br /&gt;
                -- نأخذ رقم عشوائي يبدأ من 1 وحتى حجم المصفوفة&lt;br /&gt;
                local randomSkinID = math.random ( #allSkins )&lt;br /&gt;
                -- نقوم بإنشاء البوت بإستخدام السكن الذي تم إختياره عشوائيًا وننشؤه بنفس موقع وإستدارة اللاعب&lt;br /&gt;
		local theBot createPed ( allSkins[randomSkinID], position, rotation )&lt;br /&gt;
                -- نقوم بوضع البوت في نفس الدمنشن الخاص باللاعب&lt;br /&gt;
                setElementDimension(theBot, dim)&lt;br /&gt;
                -- نقوم بوضع البوت في نفس الإنتيريور الخاص باللاعب &lt;br /&gt;
                setElementInterior(theBot, int)&lt;br /&gt;
		-- نقوم بطباعة الكلام في صندوق الدردشة الخاص باللاعب&lt;br /&gt;
		outputChatBox ( &amp;quot;! لقد قمت بإنشاء بوت&amp;quot;, thePlayer)&lt;br /&gt;
        else&lt;br /&gt;
                -- في حال لم يكن هناك لاعب او تم استعمال الامر من خلال وحدة تحكم الخادم, نقوم بإرسال رساله الى وحدة التحكم تتضمن إسم الأمر الذي تم إستعماله&lt;br /&gt;
                outputServerLog ( &amp;quot;من خلال وحدة تحكم الخادم '&amp;quot;..commandName..&amp;quot;' لايمكنك إستعمال الأمر&amp;quot; )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
-- 'makeBot' بالأمر 'createBot' نقوم بربط الوظيفة&lt;br /&gt;
addCommandHandler ( &amp;quot;makeBot&amp;quot;, createBot )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;سيتم إستكماله قريبًا&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' تم إنشاء هذه الصفحة من قبل سلمان التميمي - 506 '''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[ar:addCommandHandler]]&lt;br /&gt;
[[en:addCommandHandler]]&lt;br /&gt;
[[hu:addCommandHandler]]&lt;br /&gt;
[[pt-br:AddCommandHandler]]&lt;/div&gt;</summary>
		<author><name>506</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Call&amp;diff=74067</id>
		<title>Call</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Call&amp;diff=74067"/>
		<updated>2022-02-08T15:13:10Z</updated>

		<summary type="html">&lt;p&gt;506: Coordinate&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
{{Note|Calls may incur a performance overhead - they are not equivalent in performance to calling functions in the same resource.}}&lt;br /&gt;
{{Important Note|The sourceResource and sourceResourceRoot &amp;quot;hidden&amp;quot; variables are available even if you use exports.*:*}}&lt;br /&gt;
&lt;br /&gt;
This function is used to call a function from another resource (which must be running).&lt;br /&gt;
&lt;br /&gt;
The function which you wish to call '''must''' first be exported within the resource's meta.  For example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;meta&amp;gt;&lt;br /&gt;
	&amp;lt;info author=&amp;quot;jbeta&amp;quot; type=&amp;quot;script&amp;quot; description=&amp;quot;Scoreboard resource&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;scoreboard_client.lua&amp;quot; type=&amp;quot;client&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;scoreboard_exports.lua&amp;quot; type=&amp;quot;server&amp;quot;/&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	&amp;lt;script src=&amp;quot;scoreboard_http.lua&amp;quot; type=&amp;quot;server&amp;quot;/&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	&amp;lt;export function=&amp;quot;getScoreboardColumns&amp;quot; http=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;export function=&amp;quot;getScoreboardRows&amp;quot; http=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	&amp;lt;export function=&amp;quot;addScoreboardColumn&amp;quot; type=&amp;quot;server&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;export function=&amp;quot;removeScoreboardColumn&amp;quot; type=&amp;quot;server&amp;quot;/&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	&amp;lt;export function=&amp;quot;setPlayerScoreboardForced&amp;quot; type=&amp;quot;server&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;export function=&amp;quot;setScoreboardForced&amp;quot; type=&amp;quot;client&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This enables other resources to call a function from this resource.&lt;br /&gt;
&lt;br /&gt;
You cannot call a server function from the client or vice versa. See [[triggerServerEvent]] and [[triggerClientEvent]] for possibilities to do that.&lt;br /&gt;
&lt;br /&gt;
There is an easier syntax replacing this function. For example, you can instead of:&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;call ( getResourceFromName ( &amp;quot;resource&amp;quot; ), &amp;quot;exportedFunction&amp;quot;, 1, &amp;quot;2&amp;quot;, &amp;quot;three&amp;quot; )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
do much like a normal call:&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;exports.resource:exportedFunction ( 1, &amp;quot;2&amp;quot;, &amp;quot;three&amp;quot; )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If the resource name contains illegal characters (such as hyphens), you can also do:&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;exports[&amp;quot;resource-name&amp;quot;]:exportedFunction ( 1, &amp;quot;2&amp;quot;, &amp;quot;three&amp;quot; )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Two extra &amp;quot;hidden&amp;quot; variables are passed to the exported function:&lt;br /&gt;
* '''sourceResource''' - The resource that called the exported function&lt;br /&gt;
* '''sourceResourceRoot''' - The resource root element of the resource which called the exported function.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
var... call ( resource theResource, string theFunction, [ arguments... ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[resource]]:call}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theResource:''' This is a resource pointer which refers to the resource you are calling a function from.&lt;br /&gt;
*'''theFunction:''' This is a string with the name of the function which you want to call.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''arguments:''' Any arguments you may want to pass to the function when it is called. Any number of arguments of can be specified, each being passed to the designated function.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns anything that the designated function has returned, if the function has no return, nil is returned. If the function does not exist, is not exported, or the call was not successful it will return false.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
exports[&amp;quot;resource_name&amp;quot;]:exportedFunction([ arguments... ])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
exports.resource_name:exportedFunction([ arguments... ])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''resource_name:''' Resource name&lt;br /&gt;
*'''exportedFunction:''' The name of the function you want to call. Its '''not''' a string.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''arguments:''' Any arguments you may want to pass to the function when it is called. Any number of arguments of can be specified, each being passed to the designated function.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns anything that the designated function has returned, if the function has no return, nil is returned. If the function does not exist, is not exported, or the call was not successful it will return false.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt; &lt;br /&gt;
This extract shows adding of a &amp;quot;kills&amp;quot; column to the scoreboard resource. This then sets the ''gameShowKills'' variable to true(or false), telling the rest of the script to start outputting kills.&lt;br /&gt;
&lt;br /&gt;
'''Main Resource:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function showKills ( option )&lt;br /&gt;
	if not option then&lt;br /&gt;
		-- Remove the &amp;quot;kills&amp;quot; column&lt;br /&gt;
		exports.scoreboard:removeScoreboardColumn(&amp;quot;kills&amp;quot;)&lt;br /&gt;
	else&lt;br /&gt;
		-- Add the &amp;quot;kills&amp;quot; column&lt;br /&gt;
		exports[&amp;quot;scoreboard&amp;quot;]:addScoreboardColumn(&amp;quot;kills&amp;quot;)&lt;br /&gt;
		outputDebugString ( &amp;quot;Showing kills now...&amp;quot; )&lt;br /&gt;
	end&lt;br /&gt;
	gameShowKills = option &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
'''scoreboard Resource:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function removeScoreboardColumn(columnName)&lt;br /&gt;
    -- What ever scripted ...&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function addScoreboardColumn(columnName)&lt;br /&gt;
    -- What ever scripted ...&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;
&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 extract shows adding of a &amp;quot;kills&amp;quot; column to the scoreboard resource. This then sets the ''gameShowKills'' variable to true(or false), telling the rest of the script to start outputting kills.&lt;br /&gt;
&lt;br /&gt;
'''Main Resource:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function showKills ( option )&lt;br /&gt;
	if not option then&lt;br /&gt;
		-- Remove the &amp;quot;kills&amp;quot; column&lt;br /&gt;
		call(getResourceFromName(&amp;quot;scoreboard&amp;quot;), &amp;quot;removeScoreboardColumn&amp;quot;, &amp;quot;kills&amp;quot;)&lt;br /&gt;
	else&lt;br /&gt;
		-- Add the &amp;quot;kills&amp;quot; column&lt;br /&gt;
		call(getResourceFromName(&amp;quot;scoreboard&amp;quot;), &amp;quot;addScoreboardColumn&amp;quot;, &amp;quot;kills&amp;quot;)&lt;br /&gt;
		outputDebugString ( &amp;quot;Showing kills now...&amp;quot; )&lt;br /&gt;
	end&lt;br /&gt;
	gameShowKills = option &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
'''scoreboard Resource:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function removeScoreboardColumn(columnName)&lt;br /&gt;
    -- What ever scripted ...&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function addScoreboardColumn(columnName)&lt;br /&gt;
    -- What ever scripted ...&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;
{{Resource_functions}}&lt;/div&gt;</summary>
		<author><name>506</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Call&amp;diff=74066</id>
		<title>Call</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Call&amp;diff=74066"/>
		<updated>2022-02-08T15:10:35Z</updated>

		<summary type="html">&lt;p&gt;506: Better explaination of the first and second examples&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
{{Note|Calls may incur a performance overhead - they are not equivalent in performance to calling functions in the same resource.}}&lt;br /&gt;
{{Important Note|The sourceResource and sourceResourceRoot &amp;quot;hidden&amp;quot; variables are available even if you use exports.*:*}}&lt;br /&gt;
&lt;br /&gt;
This function is used to call a function from another resource (which must be running).&lt;br /&gt;
&lt;br /&gt;
The function which you wish to call '''must''' first be exported within the resource's meta.  For example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;meta&amp;gt;&lt;br /&gt;
	&amp;lt;info author=&amp;quot;jbeta&amp;quot; type=&amp;quot;script&amp;quot; description=&amp;quot;Scoreboard resource&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;scoreboard_client.lua&amp;quot; type=&amp;quot;client&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;scoreboard_exports.lua&amp;quot; type=&amp;quot;server&amp;quot;/&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	&amp;lt;script src=&amp;quot;scoreboard_http.lua&amp;quot; type=&amp;quot;server&amp;quot;/&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	&amp;lt;export function=&amp;quot;getScoreboardColumns&amp;quot; http=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;export function=&amp;quot;getScoreboardRows&amp;quot; http=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	&amp;lt;export function=&amp;quot;addScoreboardColumn&amp;quot; type=&amp;quot;server&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;export function=&amp;quot;removeScoreboardColumn&amp;quot; type=&amp;quot;server&amp;quot;/&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	&amp;lt;export function=&amp;quot;setPlayerScoreboardForced&amp;quot; type=&amp;quot;server&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;export function=&amp;quot;setScoreboardForced&amp;quot; type=&amp;quot;client&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This enables other resources to call a function from this resource.&lt;br /&gt;
&lt;br /&gt;
You cannot call a server function from the client or vice versa. See [[triggerServerEvent]] and [[triggerClientEvent]] for possibilities to do that.&lt;br /&gt;
&lt;br /&gt;
There is an easier syntax replacing this function. For example, you can instead of:&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;call ( getResourceFromName ( &amp;quot;resource&amp;quot; ), &amp;quot;exportedFunction&amp;quot;, 1, &amp;quot;2&amp;quot;, &amp;quot;three&amp;quot; )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
do much like a normal call:&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;exports.resource:exportedFunction ( 1, &amp;quot;2&amp;quot;, &amp;quot;three&amp;quot; )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If the resource name contains illegal characters (such as hyphens), you can also do:&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;exports[&amp;quot;resource-name&amp;quot;]:exportedFunction ( 1, &amp;quot;2&amp;quot;, &amp;quot;three&amp;quot; )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Two extra &amp;quot;hidden&amp;quot; variables are passed to the exported function:&lt;br /&gt;
* '''sourceResource''' - The resource that called the exported function&lt;br /&gt;
* '''sourceResourceRoot''' - The resource root element of the resource which called the exported function.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
var... call ( resource theResource, string theFunction, [ arguments... ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[resource]]:call}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theResource:''' This is a resource pointer which refers to the resource you are calling a function from.&lt;br /&gt;
*'''theFunction:''' This is a string with the name of the function which you want to call.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''arguments:''' Any arguments you may want to pass to the function when it is called. Any number of arguments of can be specified, each being passed to the designated function.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns anything that the designated function has returned, if the function has no return, nil is returned. If the function does not exist, is not exported, or the call was not successful it will return false.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
exports[&amp;quot;resource_name&amp;quot;]:exportedFunction([ arguments... ])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
exports.resource_name:exportedFunction([ arguments... ])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''resource_name:''' Resource name&lt;br /&gt;
*'''exportedFunction:''' The name of the function you want to call. Its '''not''' a string.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''arguments:''' Any arguments you may want to pass to the function when it is called. Any number of arguments of can be specified, each being passed to the designated function.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns anything that the designated function has returned, if the function has no return, nil is returned. If the function does not exist, is not exported, or the call was not successful it will return false.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt; &lt;br /&gt;
This extract shows adding of a &amp;quot;kills&amp;quot; column to the scoreboard resource. This then sets the ''gameShowKills'' variable to true(or false), telling the rest of the script to start outputting kills.&lt;br /&gt;
&lt;br /&gt;
'''Main Resource:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function showKills ( option )&lt;br /&gt;
	if not option then&lt;br /&gt;
		-- Remove the &amp;quot;kills&amp;quot; column&lt;br /&gt;
		exports.scoreboard:removeScoreboardColumn(&amp;quot;kills&amp;quot;)&lt;br /&gt;
	else&lt;br /&gt;
		-- Add the &amp;quot;kills&amp;quot; column&lt;br /&gt;
		exports[&amp;quot;scoreboard&amp;quot;]:addScoreboardColumn(&amp;quot;kills&amp;quot;)&lt;br /&gt;
		outputDebugString ( &amp;quot;Showing kills now...&amp;quot; )&lt;br /&gt;
	end&lt;br /&gt;
	gameShowKills = option &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
'''scoreboard Resource:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function removeScoreboardColumn(columnName)&lt;br /&gt;
    -- What ever scripted ...&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function addScoreboardColumn(columnName)&lt;br /&gt;
    -- What ever scripted ...&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt; &lt;br /&gt;
This extract shows adding of a &amp;quot;kills&amp;quot; column to the scoreboard resource. This then sets the ''gameShowKills'' variable to true(or false), telling the rest of the script to start outputting kills.&lt;br /&gt;
&lt;br /&gt;
'''Main Resource:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function showKills ( option )&lt;br /&gt;
	if not option then&lt;br /&gt;
		-- Remove the &amp;quot;kills&amp;quot; column&lt;br /&gt;
		call(getResourceFromName(&amp;quot;scoreboard&amp;quot;), &amp;quot;removeScoreboardColumn&amp;quot;, &amp;quot;kills&amp;quot;)&lt;br /&gt;
	else&lt;br /&gt;
		-- Add the &amp;quot;kills&amp;quot; column&lt;br /&gt;
		call(getResourceFromName(&amp;quot;scoreboard&amp;quot;), &amp;quot;addScoreboardColumn&amp;quot;, &amp;quot;kills&amp;quot;)&lt;br /&gt;
		outputDebugString ( &amp;quot;Showing kills now...&amp;quot; )&lt;br /&gt;
	end&lt;br /&gt;
	gameShowKills = option &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
'''scoreboard Resource:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function removeScoreboardColumn(columnName)&lt;br /&gt;
    -- What ever scripted ...&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function addScoreboardColumn(columnName)&lt;br /&gt;
    -- What ever scripted ...&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;
{{Resource_functions}}&lt;/div&gt;</summary>
		<author><name>506</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnClientResourceFileDownload&amp;diff=72857</id>
		<title>OnClientResourceFileDownload</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnClientResourceFileDownload&amp;diff=72857"/>
		<updated>2021-10-04T18:03:21Z</updated>

		<summary type="html">&lt;p&gt;506: Fix error with code ( the first parameter was used as resource name )&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client event}} &lt;br /&gt;
{{Added feature/item|1.5.9|1.5.8|20788|This event is triggered every time a [[resource]] file download is queued, finished or has failed.}}&lt;br /&gt;
{{Warning|This event is '''NOT''' related to [[downloadFile]] and [[onClientFileDownloadComplete]]!|true}}&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
resource fileResource, string fileName, number fileSize, string state&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''fileResource:''' [[Resource]] the file belongs to.&lt;br /&gt;
*'''fileName:''' Relative [[resource]] file path.&lt;br /&gt;
*'''fileSize:''' Size of the file in bytes.&lt;br /&gt;
*'''state:''' Possible values: &amp;lt;code&amp;gt;&amp;quot;queued&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;finished&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;failed&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the resource's root element.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example will output the file's resource name/file name/size/state when downloading:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function writeMsg (fileResource, fileName, fileSize, state)&lt;br /&gt;
    local resourceName = getResourceName( fileResource )&lt;br /&gt;
    outputChatBox ( &amp;quot;Resource name: &amp;quot; .. resourceName .. &amp;quot;, file name: &amp;quot; .. fileName .. &amp;quot;, size: &amp;quot; .. fileSize .. &amp;quot;, state: &amp;quot; .. state)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler (&amp;quot;onClientResourceFileDownload&amp;quot;, root, writeMsg)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.5.8-9.20788|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
===Client resource events===&lt;br /&gt;
{{Client_resource_events}}&lt;br /&gt;
===Client event functions===&lt;br /&gt;
{{Client_event_functions}}&lt;/div&gt;</summary>
		<author><name>506</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Vehicle_Components&amp;diff=71087</id>
		<title>Vehicle Components</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Vehicle_Components&amp;diff=71087"/>
		<updated>2021-05-21T04:55:41Z</updated>

		<summary type="html">&lt;p&gt;506: /* Code that shows all the components of the vehicle you are inside. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page aims to provide an overview of vehicle components. The list is currently incomplete.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{Note|Changing wheel position on Z axis doesn't work.}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center; margin: 1em auto 1em auto;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! width=&amp;quot;150&amp;quot; scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#8f8f8f;&amp;quot;| Component Name&lt;br /&gt;
! width=&amp;quot;300&amp;quot; scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#8f8f8f;&amp;quot;| Description&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|boot_dummy&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Trunk door&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|ug_nitro&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Nitro (tuning part)&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|wheel_rf_dummy&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Right Front Wheel&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|wheel_lf_dummy&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Left Front Wheel&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|wheel_rb_dummy&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Right Back Wheel&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|wheel_lb_dummy&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Left Back Wheel&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|chassis&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Chassis&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|chassis_vlo&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Chassis (lod)[Can't be hid]&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|ug_roof&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Roof [Can't be hid]&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|door_rf_dummy&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Right Front Door&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|door_lf_dummy&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Left Front Door&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|door_rr_dummy&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Right Back Door&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|door_lr_dummy&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Left Back Door&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|bonnet_dummy&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Hood&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|ug_wing_right &lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Right wing (tuning part) [Can't be hid]&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|bump_front_dummy&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Front bumper&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|bump_rear_dummy&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Back bumper&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|windscreen_dummy&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Windscreen&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|misc_a&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Tow bar position on models: 514, 515, 403, 591, 552, 485, 583, 606, 607, 608.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|ug_wing_left&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Leftwing (tuning part) [Can't be hid]&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|exhaust_ok&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Exhausts&lt;br /&gt;
|}&lt;br /&gt;
==Bike Components==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{Note|Vehicles in the 'bike' category have 8 different components from the others, so a separate table was created..}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Illustrative picture.png|thumb|center|An illustrative image showing the components of the bike.]]&lt;br /&gt;
&lt;br /&gt;
Many different:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center; margin: 1em auto 1em auto;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! width=&amp;quot;150&amp;quot; scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#8f8f8f;&amp;quot;| Component Name&lt;br /&gt;
! width=&amp;quot;300&amp;quot; scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#8f8f8f;&amp;quot;| Description&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|chassis_dummy&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Vehicle chassis&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|plate_rear&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Back plate&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|handlebars&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Handlebars&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|mudguard&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Mudguard&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|wheel_rear&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Rear tire&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|wheel_front&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Front Tire&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|froks_rear&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Froks rear&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|froks_front&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Froks front&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Equals:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center; margin: 1em auto 1em auto;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! width=&amp;quot;150&amp;quot; scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#8f8f8f;&amp;quot;| Component Name&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|chassis&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|chassis_vlo&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Code that shows all the components of the vehicle you are inside.==&lt;br /&gt;
There are more components that are not yet in these tables above, and if you want to know all of them use this code below. This code works as follows: you enter / climb the vehicle and it will show you all the components as in the image above.&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;
addEventHandler ( &amp;quot;onClientRender&amp;quot;, root,&lt;br /&gt;
function()&lt;br /&gt;
	countTest = 0&lt;br /&gt;
	if isPedInVehicle ( localPlayer ) and getPedOccupiedVehicle ( localPlayer ) then&lt;br /&gt;
		local veh = getPedOccupiedVehicle ( localPlayer )&lt;br /&gt;
		for v in pairs ( getVehicleComponents(veh) ) do&lt;br /&gt;
			countTest = countTest + 1&lt;br /&gt;
			local x,y,z = getVehicleComponentPosition ( veh, v, &amp;quot;world&amp;quot; )&lt;br /&gt;
			local sx,sy = getScreenFromWorldPosition ( x, y, z )&lt;br /&gt;
			if sx and sy then&lt;br /&gt;
				dxDrawRectangle(sx,sy, 10, 10)&lt;br /&gt;
				dxDrawLine(sx, sy, sx - (100 + (countTest * 5)), sy-(200+ (countTest * 10)))&lt;br /&gt;
				dxDrawText ( v, (sx-(120 + (countTest * 5))) -1, (sy-(220 + (countTest * 10))) -1, 0 -1, 0 -1, tocolor(0,0,0), 1, &amp;quot;default-bold&amp;quot; )&lt;br /&gt;
				dxDrawText ( v, (sx-(120 + (countTest * 5))) +1, (sy-(220 + (countTest * 10))) -1, 0 +1, 0 -1, tocolor(0,0,0), 1, &amp;quot;default-bold&amp;quot; )&lt;br /&gt;
				dxDrawText ( v, (sx-(120 + (countTest * 5))) -1, (sy-(220 + (countTest * 10))) +1, 0 -1, 0 +1, tocolor(0,0,0), 1, &amp;quot;default-bold&amp;quot; )&lt;br /&gt;
				dxDrawText ( v, (sx-(120 + (countTest * 5))) +1, (sy-(220 + (countTest * 10))) +1, 0 +1, 0 +1, tocolor(0,0,0), 1, &amp;quot;default-bold&amp;quot; )&lt;br /&gt;
				dxDrawText ( v, (sx-(120 + (countTest * 5))), (sy-(220 + (countTest * 10))), 0, 0, tocolor(0,255,255), 1, &amp;quot;default-bold&amp;quot; )&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Related scripting functions==&lt;br /&gt;
*[[setVehicleComponentVisible]]&lt;br /&gt;
*[[setVehicleComponentPosition]]&lt;br /&gt;
*[[setVehicleComponentRotation]]&lt;br /&gt;
*[[setVehicleComponentScale]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*[[resetVehicleComponentPosition]]&lt;br /&gt;
*[[resetVehicleComponentRotation]]&lt;br /&gt;
*[[resetVehicleComponentScale]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*[[getVehicleComponents]]&lt;br /&gt;
*[[getVehicleComponentVisible]]&lt;br /&gt;
*[[getVehicleComponentScale]]&lt;br /&gt;
*[[getVehicleComponentRotation]]&lt;br /&gt;
*[[getVehicleComponentPosition]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Vehicle functions==&lt;br /&gt;
{{Client_vehicle_functions}}&lt;/div&gt;</summary>
		<author><name>506</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/onConsole&amp;diff=67421</id>
		<title>AR/onConsole</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/onConsole&amp;diff=67421"/>
		<updated>2020-09-23T12:05:13Z</updated>

		<summary type="html">&lt;p&gt;506: Created page with &amp;quot;===أنظر أيضا=== {{AR/Client_events}} en:onConsole&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===أنظر أيضا===&lt;br /&gt;
{{AR/Client_events}}&lt;br /&gt;
[[en:onConsole]]&lt;/div&gt;</summary>
		<author><name>506</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:AR/Client_events&amp;diff=67420</id>
		<title>Template:AR/Client events</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:AR/Client_events&amp;diff=67420"/>
		<updated>2020-09-23T12:03:31Z</updated>

		<summary type="html">&lt;p&gt;506: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[AR/onConsole|onConsole]]&lt;/div&gt;</summary>
		<author><name>506</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:AR/Client_events&amp;diff=67419</id>
		<title>Template:AR/Client events</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:AR/Client_events&amp;diff=67419"/>
		<updated>2020-09-23T11:56:52Z</updated>

		<summary type="html">&lt;p&gt;506: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[aR/onConsole]]&lt;/div&gt;</summary>
		<author><name>506</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:AR/Client_events&amp;diff=67418</id>
		<title>Template:AR/Client events</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:AR/Client_events&amp;diff=67418"/>
		<updated>2020-09-23T11:54:52Z</updated>

		<summary type="html">&lt;p&gt;506: Created page with &amp;quot;onConsole&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[onConsole]]&lt;/div&gt;</summary>
		<author><name>506</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:AR/onAccountDataChange&amp;diff=67416</id>
		<title>Template:AR/onAccountDataChange</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:AR/onAccountDataChange&amp;diff=67416"/>
		<updated>2020-09-23T11:31:18Z</updated>

		<summary type="html">&lt;p&gt;506: Created page with &amp;quot;:Account_events:aR/onAccountDataChange&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[:Account_events:aR/onAccountDataChange]]&lt;/div&gt;</summary>
		<author><name>506</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/Server_Scripting_Events&amp;diff=67415</id>
		<title>AR/Server Scripting Events</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/Server_Scripting_Events&amp;diff=67415"/>
		<updated>2020-09-23T11:28:23Z</updated>

		<summary type="html">&lt;p&gt;506: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;server&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
يوجد في هذه الصفحة قائمة بجميع الأحداث الخاصة في ''قسم السيرفر'' التي يمكنك إستعمالها برمجيًا&lt;br /&gt;
{{Note|هو مفيد جدًا عندما تريد عمل شيء معين عند حدوث شيء معين, وفي هذه القائمة يوجد احداث متنوعه تستطيع الإستفاده منها (Event) الحدث أو بالإنجليزية}}&lt;br /&gt;
&lt;br /&gt;
.[[Requested Functions and Events]] لطلب وظيفة معينة أو حدث, إستعمل&lt;br /&gt;
&lt;br /&gt;
''' [[Client Scripting Events]] : يمكنك العثور على الأحداث الخاصة بقسم الكلاينت من هنا&lt;br /&gt;
&lt;br /&gt;
==الأحداث الخاصة بالحسابات==&lt;br /&gt;
{{AR/Account_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث الكلاينت==&lt;br /&gt;
{{AR/Client_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث الأشكال الوهمية==&lt;br /&gt;
{{AR/Colshape_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث العناصر==&lt;br /&gt;
{{AR/Element_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث الماركر==&lt;br /&gt;
{{AR/Marker_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث العلامات الإلتقاطية==&lt;br /&gt;
{{AR/Pickup_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث اللاعب==&lt;br /&gt;
{{AR/Player_events}}&lt;br /&gt;
&lt;br /&gt;
==( أحداث البيد ( البوت==&lt;br /&gt;
{{AR/Ped_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث المودات==&lt;br /&gt;
{{AR/Resource_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث الخادم==&lt;br /&gt;
{{AR/Server_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث المركبات==&lt;br /&gt;
{{AR/Vehicle_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث الأسلحة==&lt;br /&gt;
{{AR/Weapon_events}}&lt;br /&gt;
&lt;br /&gt;
[[en:Server Scripting Events]]&lt;br /&gt;
[[hu:Server Scripting Events]]&lt;br /&gt;
[[tr:Server Scripting Events]]&lt;br /&gt;
[[pt-br:Eventos de Scripting do Servidor]]&lt;br /&gt;
[[ru:Server Scripting Events]]&lt;br /&gt;
[[fr:Server Scripting Events]]&lt;br /&gt;
[[ru:Server Scripting Events]]&lt;/div&gt;</summary>
		<author><name>506</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:AR/Account_events&amp;diff=67414</id>
		<title>Template:AR/Account events</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:AR/Account_events&amp;diff=67414"/>
		<updated>2020-09-23T11:28:02Z</updated>

		<summary type="html">&lt;p&gt;506: Created page with &amp;quot;{{AR/onAccountDataChange}}&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{AR/onAccountDataChange}}&lt;/div&gt;</summary>
		<author><name>506</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/Server_Scripting_Events&amp;diff=67413</id>
		<title>AR/Server Scripting Events</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/Server_Scripting_Events&amp;diff=67413"/>
		<updated>2020-09-23T11:25:01Z</updated>

		<summary type="html">&lt;p&gt;506: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;server&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
يوجد في هذه الصفحة قائمة بجميع الأحداث الخاصة في ''قسم السيرفر'' التي يمكنك إستعمالها برمجيًا&lt;br /&gt;
{{Note|هو مفيد جدًا عندما تريد عمل شيء معين عند حدوث شيء معين, وفي هذه القائمة يوجد احداث متنوعه تستطيع الإستفاده منها (Event) الحدث أو بالإنجليزية}}&lt;br /&gt;
&lt;br /&gt;
.[[Requested Functions and Events]] لطلب وظيفة معينة أو حدث, إستعمل&lt;br /&gt;
&lt;br /&gt;
''' [[Client Scripting Events]] : يمكنك العثور على الأحداث الخاصة بقسم الكلاينت من هنا&lt;br /&gt;
&lt;br /&gt;
==الأحداث الخاصة بالحسابات==&lt;br /&gt;
{{aR/Account_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث الكلاينت==&lt;br /&gt;
{{AR/Client_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث الأشكال الوهمية==&lt;br /&gt;
{{AR/Colshape_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث العناصر==&lt;br /&gt;
{{AR/Element_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث الماركر==&lt;br /&gt;
{{AR/Marker_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث العلامات الإلتقاطية==&lt;br /&gt;
{{AR/Pickup_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث اللاعب==&lt;br /&gt;
{{AR/Player_events}}&lt;br /&gt;
&lt;br /&gt;
==( أحداث البيد ( البوت==&lt;br /&gt;
{{AR/Ped_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث المودات==&lt;br /&gt;
{{AR/Resource_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث الخادم==&lt;br /&gt;
{{AR/Server_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث المركبات==&lt;br /&gt;
{{AR/Vehicle_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث الأسلحة==&lt;br /&gt;
{{AR/Weapon_events}}&lt;br /&gt;
&lt;br /&gt;
[[en:Server Scripting Events]]&lt;br /&gt;
[[hu:Server Scripting Events]]&lt;br /&gt;
[[tr:Server Scripting Events]]&lt;br /&gt;
[[pt-br:Eventos de Scripting do Servidor]]&lt;br /&gt;
[[ru:Server Scripting Events]]&lt;br /&gt;
[[fr:Server Scripting Events]]&lt;br /&gt;
[[ru:Server Scripting Events]]&lt;/div&gt;</summary>
		<author><name>506</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/Server_Scripting_Events&amp;diff=67412</id>
		<title>AR/Server Scripting Events</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/Server_Scripting_Events&amp;diff=67412"/>
		<updated>2020-09-23T11:17:12Z</updated>

		<summary type="html">&lt;p&gt;506: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;server&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
{{AR/Adding_Pages_to_Categories_and_Templates}}&lt;br /&gt;
يوجد في هذه الصفحة قائمة بجميع الأحداث الخاصة في ''قسم السيرفر'' التي يمكنك إستعمالها برمجيًا&lt;br /&gt;
{{Note|هو مفيد جدًا عندما تريد عمل شيء معين عند حدوث شيء معين, وفي هذه القائمة يوجد احداث متنوعه تستطيع الإستفاده منها (Event) الحدث أو بالإنجليزية}}&lt;br /&gt;
&lt;br /&gt;
.[[Requested Functions and Events]] لطلب وظيفة معينة أو حدث, إستعمل&lt;br /&gt;
&lt;br /&gt;
''' [[Client Scripting Events]] : يمكنك العثور على الأحداث الخاصة بقسم الكلاينت من هنا&lt;br /&gt;
&lt;br /&gt;
==الأحداث الخاصة بالحسابات==&lt;br /&gt;
{{AR/Account_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث الكلاينت==&lt;br /&gt;
{{AR/Client_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث الأشكال الوهمية==&lt;br /&gt;
{{AR/Colshape_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث العناصر==&lt;br /&gt;
{{AR/Element_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث الماركر==&lt;br /&gt;
{{AR/Marker_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث العلامات الإلتقاطية==&lt;br /&gt;
{{AR/Pickup_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث اللاعب==&lt;br /&gt;
{{AR/Player_events}}&lt;br /&gt;
&lt;br /&gt;
==( أحداث البيد ( البوت==&lt;br /&gt;
{{AR/Ped_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث المودات==&lt;br /&gt;
{{AR/Resource_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث الخادم==&lt;br /&gt;
{{AR/Server_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث المركبات==&lt;br /&gt;
{{AR/Vehicle_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث الأسلحة==&lt;br /&gt;
{{AR/Weapon_events}}&lt;br /&gt;
&lt;br /&gt;
[[en:Server Scripting Events]]&lt;br /&gt;
[[hu:Server Scripting Events]]&lt;br /&gt;
[[tr:Server Scripting Events]]&lt;br /&gt;
[[pt-br:Eventos de Scripting do Servidor]]&lt;br /&gt;
[[ru:Server Scripting Events]]&lt;br /&gt;
[[fr:Server Scripting Events]]&lt;br /&gt;
[[ru:Server Scripting Events]]&lt;/div&gt;</summary>
		<author><name>506</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/Server_Scripting_Events&amp;diff=67411</id>
		<title>AR/Server Scripting Events</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/Server_Scripting_Events&amp;diff=67411"/>
		<updated>2020-09-23T11:11:04Z</updated>

		<summary type="html">&lt;p&gt;506: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;server&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
يوجد في هذه الصفحة قائمة بجميع الأحداث الخاصة في ''قسم السيرفر'' التي يمكنك إستعمالها برمجيًا&lt;br /&gt;
{{Note|هو مفيد جدًا عندما تريد عمل شيء معين عند حدوث شيء معين, وفي هذه القائمة يوجد احداث متنوعه تستطيع الإستفاده منها (Event) الحدث أو بالإنجليزية}}&lt;br /&gt;
&lt;br /&gt;
.[[Requested Functions and Events]] لطلب وظيفة معينة أو حدث, إستعمل&lt;br /&gt;
&lt;br /&gt;
''' [[Client Scripting Events]] : يمكنك العثور على الأحداث الخاصة بقسم الكلاينت من هنا&lt;br /&gt;
&lt;br /&gt;
==الأحداث الخاصة بالحسابات==&lt;br /&gt;
{{AR/Account_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث الكلاينت==&lt;br /&gt;
{{AR/Client_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث الأشكال الوهمية==&lt;br /&gt;
{{AR/Colshape_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث العناصر==&lt;br /&gt;
{{AR/Element_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث الماركر==&lt;br /&gt;
{{AR/Marker_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث العلامات الإلتقاطية==&lt;br /&gt;
{{AR/Pickup_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث اللاعب==&lt;br /&gt;
{{AR/Player_events}}&lt;br /&gt;
&lt;br /&gt;
==( أحداث البيد ( البوت==&lt;br /&gt;
{{AR/Ped_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث المودات==&lt;br /&gt;
{{AR/Resource_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث الخادم==&lt;br /&gt;
{{AR/Server_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث المركبات==&lt;br /&gt;
{{AR/Vehicle_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث الأسلحة==&lt;br /&gt;
{{AR/Weapon_events}}&lt;br /&gt;
&lt;br /&gt;
[[en:Server Scripting Events]]&lt;br /&gt;
[[hu:Server Scripting Events]]&lt;br /&gt;
[[tr:Server Scripting Events]]&lt;br /&gt;
[[pt-br:Eventos de Scripting do Servidor]]&lt;br /&gt;
[[ru:Server Scripting Events]]&lt;br /&gt;
[[fr:Server Scripting Events]]&lt;br /&gt;
[[ru:Server Scripting Events]]&lt;/div&gt;</summary>
		<author><name>506</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/Server_Scripting_Events&amp;diff=67410</id>
		<title>AR/Server Scripting Events</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/Server_Scripting_Events&amp;diff=67410"/>
		<updated>2020-09-23T11:06:08Z</updated>

		<summary type="html">&lt;p&gt;506: Add Arabic version of Server-side Events&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;server&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
This page lists all '''server-side''' scripting [[event]]s that have been implemented and are available in the Deathmatch mod.&lt;br /&gt;
يوجد في هذه الصفحة قائمة بجميع الأحداث الخاصة في ''قسم السيرفر'' التي يمكنك إستعمالها برمجيًا&lt;br /&gt;
{{Note|هو مفيد جدًا عندما تريد عمل شيء معين عند حدوث شيء معين, وفي هذه القائمة يوجد احداث متنوعه تستطيع الإستفاده منها (Event) الحدث أو بالإنجليزية}}&lt;br /&gt;
&lt;br /&gt;
To request a function or event, use [[Requested Functions and Events]].&lt;br /&gt;
.[[Requested Functions and Events]] لطلب وظيفة معينة أو حدث, إستعمل&lt;br /&gt;
&lt;br /&gt;
'''Client-side scripting events can be found here: [[Client Scripting Events]]&lt;br /&gt;
[[Client Scripting Events]] ''' : يمكنك العثور على الأحداث الخاصة بقسم الكلاينت من هنا&lt;br /&gt;
&lt;br /&gt;
==الأحداث الخاصة بالحسابات==&lt;br /&gt;
{{Account_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث الكلاينت==&lt;br /&gt;
{{Client_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث الأشكال الوهمية==&lt;br /&gt;
{{Colshape_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث العناصر==&lt;br /&gt;
{{Element_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث الماركر==&lt;br /&gt;
{{Marker_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث العلامات الإلتقاطية==&lt;br /&gt;
{{Pickup_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث اللاعب==&lt;br /&gt;
{{Player_events}}&lt;br /&gt;
&lt;br /&gt;
==( أحداث البيد ( البوت==&lt;br /&gt;
{{Ped_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث المودات==&lt;br /&gt;
{{Resource_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث الخادم==&lt;br /&gt;
{{Server_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث المركبات==&lt;br /&gt;
{{Vehicle_events}}&lt;br /&gt;
&lt;br /&gt;
==أحداث الأسلحة==&lt;br /&gt;
{{Weapon_events}}&lt;br /&gt;
&lt;br /&gt;
[[en:Server Scripting Events]]&lt;br /&gt;
[[hu:Server Scripting Events]]&lt;br /&gt;
[[tr:Server Scripting Events]]&lt;br /&gt;
[[pt-br:Eventos de Scripting do Servidor]]&lt;br /&gt;
[[ru:Server Scripting Events]]&lt;br /&gt;
[[fr:Server Scripting Events]]&lt;br /&gt;
[[ru:Server Scripting Events]]&lt;/div&gt;</summary>
		<author><name>506</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/addCommandHandler&amp;diff=67409</id>
		<title>AR/addCommandHandler</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/addCommandHandler&amp;diff=67409"/>
		<updated>2020-09-23T10:41:20Z</updated>

		<summary type="html">&lt;p&gt;506: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
.تقوم هذه الوظيفة بربط وظيفة معينة وجعلها كوظيفة منفذة لأمر معين, وبذلك عندما يقوم لاعب أو إداري بإستعمال هذا الأمر, سوف يتم تنفيذ الوظيفة المرتبطة بهذا الأمر&lt;br /&gt;
{{Important Note|.'''لا تقم''' بإستعمال نفس إسم الوظيفة المُنفِذة (الفنكشن) كإسم للأمر, قد يقود هذا الشيء الى التسبب في إرتباك إذا أُستِعملَت عدة وظائف مُنفِذة عن طريق أمرٌ واحد. إستخدم إسم يصف غاية الوظيفة المُنفِذة بشكلٍ أدق}}&lt;br /&gt;
&lt;br /&gt;
: يتم إستعمال الإمر في اللعبه بالطريقة الآتية&lt;br /&gt;
'''...إسم الأمر''' '''[الآرجمنت الأول]''' '''[الآرجمنت الثاني]''' '''[إلخ]'''&lt;br /&gt;
&lt;br /&gt;
يمكن إستعمال الأمر لوحة تحكم اللاعب (اف 8) أو مباشرة من مربع الدردشة (الشات) بإضافة الرمز (''/'') في بداية الأمر. بالنسبة للأوامر المدرجة في قسم السيرفر, بإمكان الإداريين الذين يملكون صلاحية للدخول على إستضافة الخادم بإستعمالها عن طريق لوحة التحكم الخادم بنفس الطريقة التي يتم إستعمالها بواسطة لوحة تحكم اللاعب (اف 8).ـ&lt;br /&gt;
{{Note|كإسم للأمر &amp;quot;test&amp;quot; و &amp;quot;list&amp;quot; ,&amp;quot;check&amp;quot; لايمكنك إستعمال}}&lt;br /&gt;
&lt;br /&gt;
==بناء الجملة==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool addCommandHandler ( string commandName, function handlerFunction [, bool restricted = false, bool caseSensitive = true ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===معطيات إجبارية===&lt;br /&gt;
*'''commandName:''' هذا إسم الأمر الذي تريد ربط الوظيفة المُنفِذة بِه. هذا هو إسم الأمر الذي يجب كتابته في لوحة التحكم لتشغيل الوظيفة المُنفِذة&lt;br /&gt;
*'''handlerFunction:''' هذي هي الوظيفة المُنفِذة التي تريد ان يقوم الأمر بتشغيلها, والتي يجب ان تكون مكتوبه أو مُعَرفّه قبل إضافة الأمر. هذا الفنكشن يقوم بأخذ معاملان أساسيان : [اللاعب الذي قام بإستعمال الأمر], [إسم الأمر الذي إستخدمه اللاعب ], مصحوبًا &lt;br /&gt;
. بقدر ماتشاء من المعاملات التي يقوم بإضافتها اللاعب ( أُنظر الى المثال في الأسفل ). وهذه المعاملات '''إختيارية''' وليست إجبارية&lt;br /&gt;
===معطيات إختيارية=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
&lt;br /&gt;
*'''restricted:''' (قائمة التحكم بالوصول) ACL يحدد ما إذا كان يجب تقييد هذا الأمر افتراضيًا أم لا. استخدم هذا في الأوامر التي يجب ألا يكون الوصول إليها متاحًا للجميع, باستثناء المستخدمين الخاصين المُضافين في &lt;br /&gt;
ضمن المجموعة المناسبة لقابلية إستعماله من قبل &amp;quot;ACL&amp;quot; تأكد من إضافة الأمر إلى قائمة التحكم بالوصول .&amp;quot;ACL&amp;quot; متاحًا للجميع إذا نسي مسؤول/مبرمج الخادم تقييدها في &amp;quot;ban&amp;quot; هذا لضمان عدم إستعمال أوامر إدارية من قبل لاعبين عاديين, على سبيل المثال: لن يكون الأمر&lt;br /&gt;
&lt;br /&gt;
-: المستخدمين المُضافين لهذه المجموعة. مثال&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;right name = &amp;quot;command.killEveryone&amp;quot; access = &amp;quot;true&amp;quot;&amp;gt; &amp;lt;/right&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
بشكل إفتراضي &amp;quot;false&amp;quot; اذا لم يتم تحديد هذا الفراغ, فسوف يتم إعتباره كـ&lt;br /&gt;
&lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
*'''caseSensitive:''' (يحدد ما إذا كان معالج الأمر سوف يتجاهل حالة الأحرف ام لا (أحرف كبيرة أو صغيرة&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool addCommandHandler ( string commandName, function handlerFunction [, bool caseSensitive = true ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===معطيات إجبارية===&lt;br /&gt;
*'''commandName:''' هذا إسم الأمر الذي تريد ربط الوظيفة المُنفِذة بِه. هذا هو إسم الأمر الذي يجب كتابته في لوحة التحكم لتشغيل الوظيفة المُنفِذة&lt;br /&gt;
*'''handlerFunction:''' هذي هي الوظيفة المُنفِذة التي تريد ان يقوم الأمر بتشغيلها, والتي يجب ان تكون مكتوبه أو مُعَرفّه قبل إضافة الأمر. هذا الفنكشن يقوم بأخذ معاملان أساسيان : [اللاعب الذي قام بإستعمال الأمر], [إسم الأمر الذي إستخدمه اللاعب ], مصحوبًا &lt;br /&gt;
. بقدر ماتشاء من المعاملات التي يقوم بإضافتها اللاعب ( أُنظر الى المثال في الأسفل ). وهذه المعاملات '''إختيارية''' وليست إجبارية&lt;br /&gt;
===معطيات إختيارية=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
*'''caseSensitive:''' (يحدد ما إذا كان معالج الأمر سوف يتجاهل حالة الأحرف ام لا (أحرف كبيرة أو صغيرة&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====معاملات الوظيفة المُنفِذة====&lt;br /&gt;
هذه هي المعاملات للوظيفة المُنفِذة التي يتم تشغيلها عند إستعمال الأمر&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;player playerSource, string commandName [, string arg1, string arg2, ... ] &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''playerSource:''' الذي قام بإستخدام الأمر سواء كان لاعبًا أو عنصر وحدة تحكم الخادم (element) العنصر&lt;br /&gt;
* '''commandName:''' إسم الأمر الذي تم إستخدامه لتنفيذ هذه الوظيفة, مفيد جدًا اذا كان هناك اكثر من امر مرتبط بوظيفة واحدة&lt;br /&gt;
* '''arg1, arg2, ...:''' .[[nil]] كل كلمة تمت كتابتها بعد إسم الأمر, يتم تمريرها هنا كمتغير منفصل. اذا لم يدخل المُستخدم المعطيات الكافية بعد إسم الأمر, فسوف يحتوي المتغير الذي لم يحظى بأي معطيات بـ&lt;br /&gt;
كما هو معروض في '''مثال 2 قسم السيرفر''' في الأسفل ,'vararg'يمكنك التعامل مع عدد غير محدد من المعطيات بإستخدام تعبير&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;string commandName [, string arg1, string arg2, ... ] &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''commandName:''' .إسم الأمر الذي تم إستخدامه لتنفيذ هذه الوظيفة, مفيد جدًا اذا كان هناك اكثر من امر مرتبط بوظيفة واحدة&lt;br /&gt;
* '''arg1, arg2, ...:''' .[[nil]] كل كلمة تمت كتابتها بعد إسم الأمر, يتم تمريرها هنا كمتغير منفصل. اذا لم يدخل المُستخدم المعطيات الكافية بعد إسم الأمر, فسوف يحتوي المتغير الذي لم يحظى بأي معطيات بـ&lt;br /&gt;
كما هو معروض في '''مثال 2 قسم السيرفر''' في الأسفل ,'vararg'يمكنك التعامل مع عدد غير محدد من المعطيات بإستخدام تعبير&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===العوائد===&lt;br /&gt;
بخلاف ذلك ''false'' إذا تم إضافة معالج الأمر بنجاح, و ''true'' يقوم بإعادة القيمة&lt;br /&gt;
&lt;br /&gt;
==الأمثلة== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
والذي سيقوم بإنشاء بيد (بوت) في نفس موقع اللاعب الذي يقوم بإستعمال الأمر ''createPed'' '''المثال 1''' في هذا المثال نقوم بتعريف معالج الأمر للأمر &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- نقوم بتعريف الوظيفة الخاصة بنا والتي سوف تتعامل مع هذا الأمر&lt;br /&gt;
function createBot( thePlayer, commandName )&lt;br /&gt;
	-- إذا كان العنصر الذي قام بإستعمال الأمر من نوع لاعب وليس وحدة تحكم الخادم&lt;br /&gt;
	if getElementType(thePlayer) == &amp;quot;player&amp;quot; then&lt;br /&gt;
		-- نأخذ إحداثيات اللاعب&lt;br /&gt;
		local position = Vector3 (getElementPosition ( thePlayer) )&lt;br /&gt;
                -- نأخذ إستدارة اللاعب&lt;br /&gt;
                local _, _, rotation = getElementRotation( thePlayer)&lt;br /&gt;
                -- نأخذ الدمنشن الخاص باللاعب&lt;br /&gt;
                local dim = getElementDimension(thePlayer)&lt;br /&gt;
                -- نأخذ الإنتيريور الخاص باللاعب&lt;br /&gt;
                local int = getElementInterior(thePlayer)&lt;br /&gt;
		-- (table) نأخذ كل السكنات الصالحة للإستعمال على شكل مصفوفة&lt;br /&gt;
                local allSkins = getValidPedModels ( )&lt;br /&gt;
                -- نأخذ رقم عشوائي يبدأ من 1 وحتى حجم المصفوفة&lt;br /&gt;
                local randomSkinID = math.random ( #allSkins )&lt;br /&gt;
                -- نقوم بإنشاء البوت بإستخدام السكن الذي تم إختياره عشوائيًا وننشؤه بنفس موقع وإستدارة اللاعب&lt;br /&gt;
		local theBot createPed ( allSkins[randomSkinID], position, rotation )&lt;br /&gt;
                -- نقوم بوضع البوت في نفس الدمنشن الخاص باللاعب&lt;br /&gt;
                setElementDimension(theBot, dim)&lt;br /&gt;
                -- نقوم بوضع البوت في نفس الإنتيريور الخاص باللاعب &lt;br /&gt;
                setElementInterior(theBot, int)&lt;br /&gt;
		-- نقوم بطباعة الكلام في صندوق الدردشة الخاص باللاعب&lt;br /&gt;
		outputChatBox ( &amp;quot;! لقد قمت بإنشاء بوت&amp;quot;, thePlayer)&lt;br /&gt;
        else&lt;br /&gt;
                -- في حال لم يكن هناك لاعب او تم استعمال الامر من خلال وحدة تحكم الخادم, نقوم بإرسال رساله الى وحدة التحكم تتضمن إسم الأمر الذي تم إستعماله&lt;br /&gt;
                outputServerLog ( &amp;quot;من خلال وحدة تحكم الخادم '&amp;quot;..commandName..&amp;quot;' لايمكنك إستعمال الأمر&amp;quot; )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
-- 'makeBot' بالأمر 'createBot' نقوم بربط الوظيفة&lt;br /&gt;
addCommandHandler ( &amp;quot;makeBot&amp;quot;, createBot )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;سيتم إستكماله قريبًا&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' تم إنشاء هذه الصفحة من قبل سلمان بن عبدالعزيز - 506 '''&lt;/div&gt;</summary>
		<author><name>506</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/addCommandHandler&amp;diff=67408</id>
		<title>AR/addCommandHandler</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/addCommandHandler&amp;diff=67408"/>
		<updated>2020-09-23T10:35:16Z</updated>

		<summary type="html">&lt;p&gt;506: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
.تقوم هذه الوظيفة بربط وظيفة معينة وجعلها كوظيفة منفذة لأمر معين, وبذلك عندما يقوم لاعب أو إداري بإستعمال هذا الأمر, سوف يتم تنفيذ الوظيفة المرتبطة بهذا الأمر&lt;br /&gt;
{{Important Note|.'''لا تقم''' بإستعمال نفس إسم الوظيفة المُنفِذة (الفنكشن) كإسم للأمر, قد يقود هذا الشيء الى التسبب في إرتباك إذا أُستِعملَت عدة وظائف مُنفِذة عن طريق أمرٌ واحد. إستخدم إسم يصف غاية الوظيفة المُنفِذة بشكلٍ أدق}}&lt;br /&gt;
&lt;br /&gt;
: يتم إستعمال الإمر في اللعبه بالطريقة الآتية&lt;br /&gt;
'''...إسم الأمر''' '''[الآرجمنت الأول]''' '''[الآرجمنت الثاني]''' '''[إلخ]'''&lt;br /&gt;
&lt;br /&gt;
يمكن إستعمال الأمر لوحة تحكم اللاعب (اف 8) أو مباشرة من مربع الدردشة (الشات) بإضافة الرمز (''/'') في بداية الأمر. بالنسبة للأوامر المدرجة في قسم السيرفر, بإمكان الإداريين الذين يملكون صلاحية للدخول على إستضافة الخادم بإستعمالها عن طريق لوحة التحكم الخادم بنفس الطريقة التي يتم إستعمالها بواسطة لوحة تحكم اللاعب (اف 8).ـ&lt;br /&gt;
{{Note|كإسم للأمر &amp;quot;test&amp;quot; و &amp;quot;list&amp;quot; ,&amp;quot;check&amp;quot; لايمكنك إستعمال}}&lt;br /&gt;
&lt;br /&gt;
==بناء الجملة==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool addCommandHandler ( string commandName, function handlerFunction [, bool restricted = false, bool caseSensitive = true ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===معطيات إجبارية===&lt;br /&gt;
*'''commandName:''' هذا إسم الأمر الذي تريد ربط الوظيفة المُنفِذة بِه. هذا هو إسم الأمر الذي يجب كتابته في لوحة التحكم لتشغيل الوظيفة المُنفِذة&lt;br /&gt;
*'''handlerFunction:''' هذي هي الوظيفة المُنفِذة التي تريد ان يقوم الأمر بتشغيلها, والتي يجب ان تكون مكتوبه أو مُعَرفّه قبل إضافة الأمر. هذا الفنكشن يقوم بأخذ معاملان أساسيان : [اللاعب الذي قام بإستعمال الأمر], [إسم الأمر الذي إستخدمه اللاعب ], مصحوبًا &lt;br /&gt;
. بقدر ماتشاء من المعاملات التي يقوم بإضافتها اللاعب ( أُنظر الى المثال في الأسفل ). وهذه المعاملات '''إختيارية''' وليست إجبارية&lt;br /&gt;
===معطيات إختيارية=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
&lt;br /&gt;
*'''restricted:''' (قائمة التحكم بالوصول) ACL يحدد ما إذا كان يجب تقييد هذا الأمر افتراضيًا أم لا. استخدم هذا في الأوامر التي يجب ألا يكون الوصول إليها متاحًا للجميع, باستثناء المستخدمين الخاصين المُضافين في &lt;br /&gt;
ضمن المجموعة المناسبة لقابلية إستعماله من قبل &amp;quot;ACL&amp;quot; تأكد من إضافة الأمر إلى قائمة التحكم بالوصول .&amp;quot;ACL&amp;quot; متاحًا للجميع إذا نسي مسؤول/مبرمج الخادم تقييدها في &amp;quot;ban&amp;quot; هذا لضمان عدم إستعمال أوامر إدارية من قبل لاعبين عاديين, على سبيل المثال: لن يكون الأمر&lt;br /&gt;
&lt;br /&gt;
-: المستخدمين المُضافين لهذه المجموعة. مثال&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;right name = &amp;quot;command.killEveryone&amp;quot; access = &amp;quot;true&amp;quot;&amp;gt; &amp;lt;/right&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
بشكل إفتراضي &amp;quot;false&amp;quot; اذا لم يتم تحديد هذا الفراغ, فسوف يتم إعتباره كـ&lt;br /&gt;
&lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
*'''caseSensitive:''' (يحدد ما إذا كان معالج الأمر سوف يتجاهل حالة الأحرف ام لا (أحرف كبيرة أو صغيرة&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool addCommandHandler ( string commandName, function handlerFunction [, bool caseSensitive = true ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===معطيات إجبارية===&lt;br /&gt;
*'''commandName:''' هذا إسم الأمر الذي تريد ربط الوظيفة المُنفِذة بِه. هذا هو إسم الأمر الذي يجب كتابته في لوحة التحكم لتشغيل الوظيفة المُنفِذة&lt;br /&gt;
*'''handlerFunction:''' هذي هي الوظيفة المُنفِذة التي تريد ان يقوم الأمر بتشغيلها, والتي يجب ان تكون مكتوبه أو مُعَرفّه قبل إضافة الأمر. هذا الفنكشن يقوم بأخذ معاملان أساسيان : [اللاعب الذي قام بإستعمال الأمر], [إسم الأمر الذي إستخدمه اللاعب ], مصحوبًا &lt;br /&gt;
. بقدر ماتشاء من المعاملات التي يقوم بإضافتها اللاعب ( أُنظر الى المثال في الأسفل ). وهذه المعاملات '''إختيارية''' وليست إجبارية&lt;br /&gt;
===معطيات إختيارية=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
*'''caseSensitive:''' (يحدد ما إذا كان معالج الأمر سوف يتجاهل حالة الأحرف ام لا (أحرف كبيرة أو صغيرة&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====معاملات الوظيفة المُنفِذة====&lt;br /&gt;
هذه هي المعاملات للوظيفة المُنفِذة التي يتم تشغيلها عند إستعمال الأمر&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;player playerSource, string commandName [, string arg1, string arg2, ... ] &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''playerSource:''' الذي قام بإستخدام الأمر سواء كان لاعبًا أو عنصر وحدة تحكم الخادم (element) العنصر&lt;br /&gt;
* '''commandName:''' إسم الأمر الذي تم إستخدامه لتنفيذ هذه الوظيفة, مفيد جدًا اذا كان هناك اكثر من امر مرتبط بوظيفة واحدة&lt;br /&gt;
* '''arg1, arg2, ...:''' .[[nil]] كل كلمة تمت كتابتها بعد إسم الأمر, يتم تمريرها هنا كمتغير منفصل. اذا لم يدخل المُستخدم المعطيات الكافية بعد إسم الأمر, فسوف يحتوي المتغير الذي لم يحظى بأي معطيات بـ&lt;br /&gt;
كما هو معروض في '''مثال 2 قسم السيرفر''' في الأسفل ,'vararg'يمكنك التعامل مع عدد غير محدد من المعطيات بإستخدام تعبير&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;string commandName [, string arg1, string arg2, ... ] &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''commandName:''' .إسم الأمر الذي تم إستخدامه لتنفيذ هذه الوظيفة, مفيد جدًا اذا كان هناك اكثر من امر مرتبط بوظيفة واحدة&lt;br /&gt;
* '''arg1, arg2, ...:''' .[[nil]] كل كلمة تمت كتابتها بعد إسم الأمر, يتم تمريرها هنا كمتغير منفصل. اذا لم يدخل المُستخدم المعطيات الكافية بعد إسم الأمر, فسوف يحتوي المتغير الذي لم يحظى بأي معطيات بـ&lt;br /&gt;
كما هو معروض في '''مثال 2 قسم السيرفر''' في الأسفل ,'vararg'يمكنك التعامل مع عدد غير محدد من المعطيات بإستخدام تعبير&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===العوائد===&lt;br /&gt;
بخلاف ذلك ''false'' إذا تم إضافة معالج الأمر بنجاح, و ''true'' يقوم بإعادة القيمة&lt;br /&gt;
&lt;br /&gt;
==الأمثلة== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
والذي سيقوم بإنشاء بيد (بوت) في نفس موقع اللاعب الذي يقوم بإستعمال الأمر ''createPed'' '''المثال 1''' في هذا المثال نقوم بتعريف معالج الأمر للأمر &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- نقوم بتعريف الوظيفة الخاصة بنا والتي سوف تتعامل مع هذا الأمر&lt;br /&gt;
function createBot( thePlayer, commandName )&lt;br /&gt;
	-- إذا كان العنصر الذي قام بإستعمال الأمر من نوع لاعب وليس وحدة تحكم الخادم&lt;br /&gt;
	if getElementType(thePlayer) == &amp;quot;player&amp;quot; then&lt;br /&gt;
		-- نأخذ إحداثيات اللاعب&lt;br /&gt;
		local position = Vector3 (getElementPosition ( thePlayer) )&lt;br /&gt;
                -- نأخذ إستدارة اللاعب&lt;br /&gt;
                local _, _, rotation = getElementRotation( thePlayer)&lt;br /&gt;
		-- (table) نأخذ كل السكنات الصالحة للإستعمال على شكل مصفوفة&lt;br /&gt;
                local allSkins = getValidPedModels ( )&lt;br /&gt;
                -- نأخذ رقم عشوائي يبدأ من 1 وحتى حجم المصفوفة&lt;br /&gt;
                local randomSkinID = math.random ( #allSkins )&lt;br /&gt;
                -- نقوم بإنشاء البوت بإستخدام السكن الذي تم إختياره عشوائيًا&lt;br /&gt;
		createPed ( allSkins[randomSkinID], position, rotation )&lt;br /&gt;
		-- نقوم بطباعة الكلام في صندوق الدردشة الخاص باللاعب&lt;br /&gt;
		outputChatBox ( &amp;quot;! لقد قمت بإنشاء بوت&amp;quot;, thePlayer)&lt;br /&gt;
        else&lt;br /&gt;
                -- في حال لم يكن هناك لاعب او تم استعمال الامر من خلال وحدة تحكم الخادم, نقوم بإرسال رساله الى وحدة التحكم تتضمن إسم الأمر الذي تم إستعماله&lt;br /&gt;
                outputServerLog ( &amp;quot;من خلال وحدة تحكم الخادم '&amp;quot;..commandName..&amp;quot;' لايمكنك إستعمال الأمر&amp;quot; )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
-- 'makeBot' بالأمر 'createBot' نقوم بربط الوظيفة&lt;br /&gt;
addCommandHandler ( &amp;quot;makeBot&amp;quot;, createBot )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;سيتم إستكماله قريبًا&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' تم إنشاء هذه الصفحة من قبل سلمان بن عبدالعزيز - 506 '''&lt;/div&gt;</summary>
		<author><name>506</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/addCommandHandler&amp;diff=67406</id>
		<title>AR/addCommandHandler</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/addCommandHandler&amp;diff=67406"/>
		<updated>2020-09-22T19:27:07Z</updated>

		<summary type="html">&lt;p&gt;506: Support Arabic language to this function&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
.تقوم هذه الوظيفة بربط وظيفة معينة وجعلها كوظيفة منفذة لأمر معين, وبذلك عندما يقوم لاعب أو إداري بإستعمال هذا الأمر, سوف يتم تنفيذ الوظيفة المرتبطة بهذا الأمر&lt;br /&gt;
{{Important Note|.'''لا تقم''' بإستعمال نفس إسم الوظيفة المُنفِذة (الفنكشن) كإسم للأمر, قد يقود هذا الشيء الى التسبب في إرتباك إذا أُستِعملَت عدة وظائف مُنفِذة عن طريق أمرٌ واحد. إستخدم إسم يصف غاية الوظيفة المُنفِذة بشكلٍ أدق}}&lt;br /&gt;
&lt;br /&gt;
: يتم إستعمال الإمر في اللعبه بالطريقة الآتية&lt;br /&gt;
'''...إسم الأمر''' '''[الآرجمنت الأول]''' '''[الآرجمنت الثاني]''' '''[إلخ]'''&lt;br /&gt;
&lt;br /&gt;
يمكن إستعمال الأمر لوحة تحكم اللاعب (اف 8) أو مباشرة من مربع الدردشة (الشات) بإضافة الرمز (''/'') في بداية الأمر. بالنسبة للأوامر المدرجة في قسم السيرفر, بإمكان الإداريين الذين يملكون صلاحية للدخول على إستضافة الخادم بإستعمالها عن طريق لوحة التحكم الخادم بنفس الطريقة التي يتم إستعمالها بواسطة لوحة تحكم اللاعب (اف 8).ـ&lt;br /&gt;
{{Note|كإسم للأمر &amp;quot;test&amp;quot; و &amp;quot;list&amp;quot; ,&amp;quot;check&amp;quot; لايمكنك إستعمال}}&lt;br /&gt;
&lt;br /&gt;
==بناء الجملة==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool addCommandHandler ( string commandName, function handlerFunction [, bool restricted = false, bool caseSensitive = true ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===معطيات إجبارية===&lt;br /&gt;
*'''commandName:''' هذا إسم الأمر الذي تريد ربط الوظيفة المُنفِذة بِه. هذا هو إسم الأمر الذي يجب كتابته في لوحة التحكم لتشغيل الوظيفة المُنفِذة&lt;br /&gt;
*'''handlerFunction:''' هذي هي الوظيفة المُنفِذة التي تريد ان يقوم الأمر بتشغيلها, والتي يجب ان تكون مكتوبه أو مُعَرفّه قبل إضافة الأمر. هذا الفنكشن يقوم بأخذ معاملان أساسيان : [اللاعب الذي قام بإستعمال الأمر], [إسم الأمر الذي إستخدمه اللاعب ], مصحوبًا &lt;br /&gt;
. بقدر ماتشاء من المعاملات التي يقوم بإضافتها اللاعب ( أُنظر الى المثال في الأسفل ). وهذه المعاملات '''إختيارية''' وليست إجبارية&lt;br /&gt;
===معطيات إختيارية=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
&lt;br /&gt;
*'''restricted:''' (قائمة التحكم بالوصول) ACL يحدد ما إذا كان يجب تقييد هذا الأمر افتراضيًا أم لا. استخدم هذا في الأوامر التي يجب ألا يكون الوصول إليها متاحًا للجميع, باستثناء المستخدمين الخاصين المُضافين في &lt;br /&gt;
ضمن المجموعة المناسبة لقابلية إستعماله من قبل &amp;quot;ACL&amp;quot; تأكد من إضافة الأمر إلى قائمة التحكم بالوصول .&amp;quot;ACL&amp;quot; متاحًا للجميع إذا نسي مسؤول/مبرمج الخادم تقييدها في &amp;quot;ban&amp;quot; هذا لضمان عدم إستعمال أوامر إدارية من قبل لاعبين عاديين, على سبيل المثال: لن يكون الأمر&lt;br /&gt;
&lt;br /&gt;
-: المستخدمين المُضافين لهذه المجموعة. مثال&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;right name = &amp;quot;command.killEveryone&amp;quot; access = &amp;quot;true&amp;quot;&amp;gt; &amp;lt;/right&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
بشكل إفتراضي &amp;quot;false&amp;quot; اذا لم يتم تحديد هذا الفراغ, فسوف يتم إعتباره كـ&lt;br /&gt;
&lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
*'''caseSensitive:''' (يحدد ما إذا كان معالج الأمر سوف يتجاهل حالة الأحرف ام لا (أحرف كبيرة أو صغيرة&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool addCommandHandler ( string commandName, function handlerFunction [, bool caseSensitive = true ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===معطيات إجبارية===&lt;br /&gt;
*'''commandName:''' هذا إسم الأمر الذي تريد ربط الوظيفة المُنفِذة بِه. هذا هو إسم الأمر الذي يجب كتابته في لوحة التحكم لتشغيل الوظيفة المُنفِذة&lt;br /&gt;
*'''handlerFunction:''' هذي هي الوظيفة المُنفِذة التي تريد ان يقوم الأمر بتشغيلها, والتي يجب ان تكون مكتوبه أو مُعَرفّه قبل إضافة الأمر. هذا الفنكشن يقوم بأخذ معاملان أساسيان : [اللاعب الذي قام بإستعمال الأمر], [إسم الأمر الذي إستخدمه اللاعب ], مصحوبًا &lt;br /&gt;
. بقدر ماتشاء من المعاملات التي يقوم بإضافتها اللاعب ( أُنظر الى المثال في الأسفل ). وهذه المعاملات '''إختيارية''' وليست إجبارية&lt;br /&gt;
===معطيات إختيارية=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
*'''caseSensitive:''' (يحدد ما إذا كان معالج الأمر سوف يتجاهل حالة الأحرف ام لا (أحرف كبيرة أو صغيرة&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====معاملات الوظيفة المُنفِذة====&lt;br /&gt;
هذه هي المعاملات للوظيفة المُنفِذة التي يتم تشغيلها عند إستعمال الأمر&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;player playerSource, string commandName [, string arg1, string arg2, ... ] &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''playerSource:''' الذي قام بإستخدام الأمر سواء كان لاعبًا أو عنصر وحدة تحكم الخادم (element) العنصر&lt;br /&gt;
* '''commandName:''' إسم الأمر الذي تم إستخدامه لتنفيذ هذه الوظيفة, مفيد جدًا اذا كان هناك اكثر من امر مرتبط بوظيفة واحدة&lt;br /&gt;
* '''arg1, arg2, ...:''' .[[nil]] كل كلمة تمت كتابتها بعد إسم الأمر, يتم تمريرها هنا كمتغير منفصل. اذا لم يدخل المُستخدم المعطيات الكافية بعد إسم الأمر, فسوف يحتوي المتغير الذي لم يحظى بأي معطيات بـ&lt;br /&gt;
كما هو معروض في '''مثال 2 قسم السيرفر''' في الأسفل ,'vararg'يمكنك التعامل مع عدد غير محدد من المعطيات بإستخدام تعبير&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;string commandName [, string arg1, string arg2, ... ] &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''commandName:''' .إسم الأمر الذي تم إستخدامه لتنفيذ هذه الوظيفة, مفيد جدًا اذا كان هناك اكثر من امر مرتبط بوظيفة واحدة&lt;br /&gt;
* '''arg1, arg2, ...:''' .[[nil]] كل كلمة تمت كتابتها بعد إسم الأمر, يتم تمريرها هنا كمتغير منفصل. اذا لم يدخل المُستخدم المعطيات الكافية بعد إسم الأمر, فسوف يحتوي المتغير الذي لم يحظى بأي معطيات بـ&lt;br /&gt;
كما هو معروض في '''مثال 2 قسم السيرفر''' في الأسفل ,'vararg'يمكنك التعامل مع عدد غير محدد من المعطيات بإستخدام تعبير&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===العوائد===&lt;br /&gt;
بخلاف ذلك ''false'' إذا تم إضافة معالج الأمر بنجاح, و ''true'' يقوم بإعادة القيمة&lt;br /&gt;
&lt;br /&gt;
==الأمثلة== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
والذي سيقوم بإنشاء بيد (بوت) في نفس موقع اللاعب الذي يقوم بإستعمال الأمر ''createPed'' '''المثال 1''' في هذا المثال نقوم بتعريف معالج الأمر للأمر &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- نقوم بتعريف الوظيفة الخاصة بنا والتي سوف تتعامل مع هذا الأمر&lt;br /&gt;
function createBot( thePlayer, commandName )&lt;br /&gt;
	-- إذا كان العنصر الذي قام بإستعمال الأمر من نوع لاعب وليس وحدة تحكم الخادم&lt;br /&gt;
	if isElement (thePlayer) then&lt;br /&gt;
		-- نأخذ إحداثيات اللاعب&lt;br /&gt;
		local position = Vector3 (getElementPosition ( thePlayer) )&lt;br /&gt;
                -- نأخذ إستدارة اللاعب&lt;br /&gt;
                local _, _, rotation = getElementRotation( thePlayer)&lt;br /&gt;
		-- (table) نأخذ كل السكنات الصالحة للإستعمال على شكل مصفوفة&lt;br /&gt;
                local allSkins = getValidPedModels ( )&lt;br /&gt;
                -- نأخذ رقم عشوائي يبدأ من 1 وحتى حجم المصفوفة&lt;br /&gt;
                local randomSkinID = math.random ( #allSkins )&lt;br /&gt;
                -- نقوم بإنشاء البوت بإستخدام السكن الذي تم إختياره عشوائيًا&lt;br /&gt;
		createPed ( allSkins[randomSkinID], position, rotation )&lt;br /&gt;
		-- نقوم بطباعة الكلام في صندوق الدردشة الخاص باللاعب&lt;br /&gt;
		outputChatBox ( &amp;quot;! لقد قمت بإنشاء بوت&amp;quot;, thePlayer)&lt;br /&gt;
        else&lt;br /&gt;
                -- في حال لم يكن هناك لاعب او تم استعمال الامر من خلال وحدة تحكم الخادم, نقوم بإرسال رساله الى وحدة التحكم تتضمن إسم الأمر الذي تم إستعماله&lt;br /&gt;
                outputServerLog ( &amp;quot;من خلال وحدة تحكم الخادم '&amp;quot;..commandName..&amp;quot;' لايمكنك إستعمال الأمر&amp;quot; )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
-- 'makeBot' بالأمر 'createBot' نقوم بربط الوظيفة&lt;br /&gt;
addCommandHandler ( &amp;quot;makeBot&amp;quot;, createBot )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;سيتم إستكماله قريبًا&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' تم إنشاء هذه الصفحة من قبل سلمان بن عبدالعزيز - 506 '''&lt;/div&gt;</summary>
		<author><name>506</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules/MTA-MySQL&amp;diff=67405</id>
		<title>Modules/MTA-MySQL</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/MTA-MySQL&amp;diff=67405"/>
		<updated>2020-09-22T16:35:25Z</updated>

		<summary type="html">&lt;p&gt;506: resize warning test&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#AA7592&amp;quot; subcaption=&amp;quot;MTA-MySQL Module&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-size: 2em; line-height: 1em;&amp;quot;&amp;gt;{{Warning|This module is too old, please use [[dbConnect]] instead.}}&amp;lt;/div&amp;gt;&lt;br /&gt;
{{Module_Info|&lt;br /&gt;
  name           = MTA MySQL |&lt;br /&gt;
  version        = 0.5 |&lt;br /&gt;
  author         = [[User:ryden|Alberto Alonso (ryden)]] |&lt;br /&gt;
  author2         = [[User:ryden|Alberto Alonso (ryden)]] |&lt;br /&gt;
  module_website = [http://code.google.com/p/multitheftauto-modules Here] |&lt;br /&gt;
  download_link  = [https://nightly.mtasa.com/files/modules/32/mta_mysql.dll Windows 32 bit]&amp;lt;br/&amp;gt;[https://nightly.mtasa.com/files/modules/64/mta_mysql.dll Windows  64 bit]&lt;br /&gt;
[https://nightly.mtasa.com/files/modules/32/mta_mysql.so Linux 32 bit]&amp;lt;br/&amp;gt;[https://nightly.mtasa.com/files/modules/64/mta_mysql.so Linux 64 bit] |&lt;br /&gt;
  license        = [http://www.opensource.org/licenses/bsd-license.php BSD] |&lt;br /&gt;
  written_in     = C++ |&lt;br /&gt;
  operating_system = Cross-platform |&lt;br /&gt;
  compatible_with = DP2.x &amp;amp; 1.X |&lt;br /&gt;
}}&lt;br /&gt;
MTA MySQL is an alternative to the default [[Modules/MySQL|ml_mysql]] module provided by the MTA team.&lt;br /&gt;
It is available for Windows and GNU/Linux and provides the source code.&lt;br /&gt;
&lt;br /&gt;
''Note: From version 0.4 it supports both DP2.3 and 1.0 servers.''&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
===Windows===&lt;br /&gt;
'''32 bit:''' Copy 32 bit mta_mysql.dll into the '''MTA San Andreas\server\mods\deathmatch\modules\''' directory.&amp;lt;br/&amp;gt;&lt;br /&gt;
''(You might also need to install [https://nightly.mtasa.com/files/vcredist_2013_x86.exe 32 bit VS2013 Runtime Redist])''&lt;br /&gt;
&lt;br /&gt;
'''64 bit:''' Copy 64 bit mta_mysql.dll into the '''MTA San Andreas\server\x64\modules\''' directory.&amp;lt;br/&amp;gt;&lt;br /&gt;
''(You might also need to install [https://nightly.mtasa.com/files/vcredist_2013_x64.exe 64 bit VS2013 Runtime Redist])''&lt;br /&gt;
&lt;br /&gt;
Then, add the following line in mtaserver.conf:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;module src=&amp;quot;mta_mysql.dll&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GNU/Linux===&lt;br /&gt;
'''32 bit:''' Copy 32 bit mta_mysql.so into the '''mods/deathmatch/modules/''' directory.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''64 bit:''' Copy 64 bit mta_mysql.so into the '''x64/modules/''' directory.&lt;br /&gt;
&lt;br /&gt;
Then, add the following line in mtaserver.conf:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;module src=&amp;quot;mta_mysql.so&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To fix '''MODULE: Unable to find modules/mta_mysql.so (libmysqlclient.so.16: cannot open shared object file: No such file or directory)!''' copy ''libmysqlclient.so.16'' into '''/usr/lib''' ([https://nightly.mtasa.com/files/modules/32/libmysqlclient.so.16 32 bit], [https://nightly.mtasa.com/files/modules/64/libmysqlclient.so.16 64 bit])&lt;br /&gt;
&lt;br /&gt;
'''If you experience an error on Unix systems:'''&lt;br /&gt;
Try to add port and socket parameters to your mysql_connect.&lt;br /&gt;
&lt;br /&gt;
==Handler functions==&lt;br /&gt;
{{Modules/MTA-MySQL/Handler_functions}}&lt;br /&gt;
&lt;br /&gt;
==Result managing functions==&lt;br /&gt;
{{Modules/MTA-MySQL/Result_functions}}&lt;br /&gt;
&lt;br /&gt;
==Version 0.5 calling method==&lt;br /&gt;
From version 0.5 onwards you can call all this module functions, except mysql_connect and mysql_null, as if they are methods of an object.&lt;br /&gt;
&lt;br /&gt;
For example, having a valid MySQL handler, you can do handler:query ( &amp;quot;SELECT * FROM table&amp;quot; ) instead of mysql_query ( handler, &amp;quot;SELECT * FROM table&amp;quot; ).&lt;br /&gt;
&lt;br /&gt;
===Function aliases===&lt;br /&gt;
A function alias is a second name for a function, which makes calling any of the original name or the alias have the same result. The new aliases introduced in version 0.5 are:&lt;br /&gt;
* result:num_rows() is the same as result:numrows()&lt;br /&gt;
* result:num_fields() is the same as result:numfields()&lt;br /&gt;
* result:free_result() is the same as result:free()&lt;br /&gt;
&lt;br /&gt;
[[Category:Modules]]&lt;br /&gt;
&lt;br /&gt;
[[ru:Modules/MTA-MySQL]]&lt;/div&gt;</summary>
		<author><name>506</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/createBrowser&amp;diff=67404</id>
		<title>AR/createBrowser</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/createBrowser&amp;diff=67404"/>
		<updated>2020-09-22T12:38:13Z</updated>

		<summary type="html">&lt;p&gt;506: /* الفرغات الاضافية */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
. [[Element/Browser|browser]] هذه الوظيفة تتيح لك إنشاء متصفح الكتروني جديد&lt;br /&gt;
&lt;br /&gt;
{{Note|[[AR/toggleBrowserDevTools]] باستخدام CEF بامكانك أيضا تفعيل أدوات التطوير}}&lt;br /&gt;
&lt;br /&gt;
==تركيب الوظيفة==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;element createBrowser ( int width, int height, bool isLocal [, bool transparent = false ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[Element/Browser|Browser]]}}&lt;br /&gt;
&lt;br /&gt;
===الفرغات المطلوبة===&lt;br /&gt;
*'''العرض:''' عرض المتصفح ويجب أن يكون أكبر من أو يساوي 1&lt;br /&gt;
*'''الارتفاع:''' ارتفاع المتصفح ويجب أن يكون أكبر من أو يساوي 1&lt;br /&gt;
*'''(هل محلي:''' اذا قمت بتعين هذه ستقوم بعرض محتوي محلي فقط حسب البلد الموجود بها الزائر للمتصفح واذا كان العكس ستعرض لك المحتوي العالمي للانترنت (شاهد الأمثلة للفهم أكثر&lt;br /&gt;
&lt;br /&gt;
{{New feature/item|3.0160|1.6||اضافة احجام خاطئة للمتصفح سيكون خطأ كبير.}}&lt;br /&gt;
&lt;br /&gt;
===الفرغات الإختيارية===&lt;br /&gt;
*'''.اذا أردت العكس ''false'' و ''true'' الشفافية:''' اذا أردت أن يكون المتصفح مخفي&lt;br /&gt;
&lt;br /&gt;
===المعطيات===&lt;br /&gt;
اذا كان المستخدم قام بتعطيل الصفحات العالمية ومتصفحك يقوم بتفعيلها ''false'' اذا كان العكس , ويعود أيضا ب ''false'' اذا كان قد تم انشاءه بنجاح , و [[browser]] الخاص بالمتصفح [[texture]] يعود بالتكستشر&lt;br /&gt;
&lt;br /&gt;
==مثال الصفحات المحلية==&lt;br /&gt;
{{Warning|للمعرفة المزيد [[Local_Scheme_Handler|Local Scheme Handler]] تم تغيير نظام الملفات المحلية يرجى قراءة|true}}&lt;br /&gt;
.بدون معالجة المدخلات (محلي html) هذا المثال يظهر لك كيفية انشاء متصفح بحجم الشاشة يظهر لك ملف&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- لكي نقوم بعرض المتصفح في حجم الشاشة يجم أن نوجد الاحداثيات الخاصة بشاشة اللاعب&lt;br /&gt;
local screenWidth, screenHeight = guiGetScreenSize()&lt;br /&gt;
&lt;br /&gt;
-- (نقوم بعمل متصفح جديد يشمل الصفحات المحلية وفي هذه الحالة لن نتمكن من وضع رابط خارجي : (خارج دولة زائر المتصفح&lt;br /&gt;
local webBrowser = createBrowser(screenWidth, screenHeight, true, false)&lt;br /&gt;
	&lt;br /&gt;
-- هذه الوظيفة لعرض المتصفح&lt;br /&gt;
function webBrowserRender()&lt;br /&gt;
-- عرض المتصفح في حجم الشاشة&lt;br /&gt;
	dxDrawImage(0, 0, screenWidth, screenHeight, webBrowser, 0, 0, 0, tocolor(255,255,255,255), true)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- بعد تهيئة المتصفح onClientBrowserCreated سيتم تشغيل الحدث&lt;br /&gt;
-- بعد تشغيل هذا الحدث سنكون مأهلين لعرض الرابط الخاص بنا وبدأ رسم المتصفح&lt;br /&gt;
addEventHandler(&amp;quot;onClientBrowserCreated&amp;quot;, webBrowser, &lt;br /&gt;
	function()&lt;br /&gt;
-- بعد تهيئة المتصفح سنتمكن من عرض الرابط او الملف الخاص بنا&lt;br /&gt;
		loadBrowserURL(webBrowser, &amp;quot;http://mta/local/html/site.html&amp;quot;)&lt;br /&gt;
-- والآن يمكننا بدأ عرض المتصفح&lt;br /&gt;
		addEventHandler(&amp;quot;onClientRender&amp;quot;, root, webBrowserRender)&lt;br /&gt;
	end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==مثال الصفحات العالمية==&lt;br /&gt;
بدون الحاجة الي تأهيل الموقع (youtube.com) هذا المثال يظهر لك كيفية انشاء متصفح في حجم شاشة اللاعب ويعرض موقع&amp;lt;br&amp;gt;&lt;br /&gt;
. [[requestBrowserDomains|requestBrowserDomains]] هو رابط من القائمة البيضاء فاذا أردت ان تقوم بعرض صفحة ليست في القائمة البيضاء يجب عليك اقتراحها باستخدام youtube.com تذكر أن&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- لكي نقوم بعرض المتصفح في حجم الشاشة يجم أن نوجد الاحداثيات الخاصة بشاشة اللاعب&lt;br /&gt;
local screenWidth, screenHeight = guiGetScreenSize()&lt;br /&gt;
&lt;br /&gt;
-- نقوم بعمل متصفح جديد يشمل الصفحات العالمية&lt;br /&gt;
local webBrowser = createBrowser(screenWidth, screenHeight, false, false)&lt;br /&gt;
	&lt;br /&gt;
-- هذه الوظيفة لعرض المتصفح&lt;br /&gt;
function webBrowserRender()&lt;br /&gt;
	-- عرض المتصفح في حجم الشاشة&lt;br /&gt;
	dxDrawImage(0, 0, screenWidth, screenHeight, webBrowser, 0, 0, 0, tocolor(255,255,255,255), true)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- بعد تهيئة المتصفح onClientBrowserCreated سيتم تشغيل الحدث&lt;br /&gt;
-- بعد تشغيل هذا الحدث سنكون مأهلين لعرض الرابط الخاص بنا وبدأ رسم المتصفح&lt;br /&gt;
addEventHandler(&amp;quot;onClientBrowserCreated&amp;quot;, webBrowser, &lt;br /&gt;
	function()&lt;br /&gt;
		-- youtube.com بعد تهيئة المتصفح سنتمكن من عرض&lt;br /&gt;
		loadBrowserURL(webBrowser, &amp;quot;http://www.youtube.com&amp;quot;)&lt;br /&gt;
		-- والآن يمكننا بدأ عرض المتصفح&lt;br /&gt;
		addEventHandler(&amp;quot;onClientRender&amp;quot;, root, webBrowserRender)&lt;br /&gt;
	end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
MrKAREEM تمت الترجمة من قبل&lt;br /&gt;
&lt;br /&gt;
==أنظر أيضاً==&lt;br /&gt;
{{AR/Browser_functions}}&lt;/div&gt;</summary>
		<author><name>506</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CEF_Tutorial&amp;diff=67403</id>
		<title>CEF Tutorial</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CEF_Tutorial&amp;diff=67403"/>
		<updated>2020-09-22T10:40:19Z</updated>

		<summary type="html">&lt;p&gt;506: /* How to load local resources in local HTML files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page gives you a brief introduction to CEF.&lt;br /&gt;
&lt;br /&gt;
=What is CEF?=&lt;br /&gt;
CEF stands for '''C'''hromium '''E'''mbedded '''F'''ramework and is a framework for embedding Chromium-based browsers in other applications - in our case MTA. CEF is based on Google's Chromium project so it is also a fast, secure and stable web engine.&lt;br /&gt;
&lt;br /&gt;
You can find more information about CEF on CEF's GoogleCode project page: https://bitbucket.org/chromiumembedded/cef&lt;br /&gt;
&lt;br /&gt;
=The basics=&lt;br /&gt;
Creating a new browser is really simple. Let's open YouTube for example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Create a new remote browser (size is 800*600px) with transparency enabled&lt;br /&gt;
local browser = createBrowser(800, 600, true, true)&lt;br /&gt;
&lt;br /&gt;
-- &amp;quot;Wait&amp;quot; for the browser (this is necessary because CEF runs in a secondary thread and hence requires the 'asynchronous' event mechanism)&lt;br /&gt;
addEventHandler(&amp;quot;onClientBrowserCreated&amp;quot;, browser,&lt;br /&gt;
    function()&lt;br /&gt;
        -- We're ready to load the URL now (the source of this event is the browser that has been created)&lt;br /&gt;
        loadBrowserURL(source, &amp;quot;https://youtube.com/&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This example does not require any domain requests as YouTube is whitelisted by default. More about domain requests below.&lt;br /&gt;
&lt;br /&gt;
=Domain request system=&lt;br /&gt;
In order to prevent people from abusing the possibilities CEF offers, we decided to introduce a request system.&lt;br /&gt;
This means the domain you want to load has to meet at least one of the following requirements:&lt;br /&gt;
*it is whitelisted globally by the MTA team (you can create a post in [this topic] to suggest a new domain to be whitelisted) - '''**TODO: Add forum URL here**'''&lt;br /&gt;
*the domain was requested via requestBrowserDomains/Browser.requestDomains and accepted by the player '''before'''&lt;br /&gt;
*the domain is on the user's whitelist (MTA settings =&amp;gt; Tab: Browser =&amp;gt; Whitelist)&lt;br /&gt;
&lt;br /&gt;
Apart from these options, a domain might be blacklisted due to malicious content. Such domains cannot be requested.&lt;br /&gt;
&lt;br /&gt;
=Local vs remote mode=&lt;br /&gt;
There are two modes CEF can run in:&lt;br /&gt;
&lt;br /&gt;
Characteristics of local mode:&lt;br /&gt;
*you '''can''' execute Javascript code without any restriction (See: [[executeBrowserJavascript]])&lt;br /&gt;
*you '''can''' only load websites stored in the resource folder&lt;br /&gt;
*you '''cannot''' load remote content&lt;br /&gt;
&lt;br /&gt;
Characteristics of remote mode:&lt;br /&gt;
*you '''cannot''' execute Javascript code&lt;br /&gt;
*you '''can''' only load remote content&lt;br /&gt;
*keep in mind that either loading remote websites or Javascript on remote websites can be disabled in the MTA settings&lt;br /&gt;
&lt;br /&gt;
Changing the mode after the browser was created is not possible due to technical reasons.&lt;br /&gt;
&lt;br /&gt;
=Resource management=&lt;br /&gt;
==How to load local HTML files==&lt;br /&gt;
Loading local HTML files works similar to loading images.&lt;br /&gt;
&lt;br /&gt;
Add your HTML files to your meta.xml through the file tag:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;file src=&amp;quot;html/myAwesomeUI.html&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How to load local resources in local HTML files==&lt;br /&gt;
Imagine you want to load an image or play a video from your MTA resource. This is possible via a custom URI scheme named '''''&amp;quot;http://mta/&amp;quot;'''''&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
This examples shows how to play a video. Note that you have to enable OOP.&lt;br /&gt;
====Lua====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Create a browser (local mode is also required to access local data)&lt;br /&gt;
local webView = Browser(640, 480, true, true)&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientBrowserCreated&amp;quot;, webView,&lt;br /&gt;
     function()&lt;br /&gt;
    &lt;br /&gt;
          -- Load HTML UI&lt;br /&gt;
          webView:loadURL(&amp;quot;http://mta/local/html/myVideo.html&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
     end&lt;br /&gt;
)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
====meta.xml====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;file src=&amp;quot;html/myVideo.html&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;file src=&amp;quot;media/myVideo.webm&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
====HTML====&lt;br /&gt;
This is the most interesting part:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE HTML&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
    &amp;lt;video width=&amp;quot;640&amp;quot; height=&amp;quot;480&amp;quot; controls&amp;gt;&lt;br /&gt;
         &amp;lt;source src=&amp;quot;http://mta/local/myVideo.webm&amp;quot; type=&amp;quot;video/webm&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/video&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Lua &amp;lt;==&amp;gt; Javascript communication=&lt;br /&gt;
First of all, communication between Lua and Javascript is only available in local mode due to security reasons.&lt;br /&gt;
&lt;br /&gt;
==Lua to Javascript==&lt;br /&gt;
Lua to javascript is pretty easy as you can execute Javascript code from Lua using [[executeBrowserJavascript]].&lt;br /&gt;
&lt;br /&gt;
So, a bit Lua code around it and you have got the first direction:&lt;br /&gt;
* https://github.com/Jusonex/mtasa_cef_tools/blob/master/webui/src/WebWindow.lua#L180-189&lt;br /&gt;
* https://github.com/Jusonex/mtasa_cef_tools/blob/master/webui/src/mtaevents.js#L9-L15&lt;br /&gt;
&lt;br /&gt;
==Javascript to Lua==&lt;br /&gt;
You are able to trigger a client event via the Javascript method ''triggerEvent'' which is part of the static class/namespace ''mta''.&lt;br /&gt;
The syntax is as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
mta.triggerEvent(string event, var parameter1, var parameter2, var parameter3, ...)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The source of this event is always the browser element that triggered the event.&lt;br /&gt;
&lt;br /&gt;
An example is available here:&lt;br /&gt;
* https://github.com/Jusonex/mtasa_cef_tools/blob/master/webui/examples/html/ui2.html#L66&lt;br /&gt;
* https://github.com/Jusonex/mtasa_cef_tools/blob/master/webui/examples/Main.lua#L35-L40&lt;br /&gt;
&lt;br /&gt;
=Debugging=&lt;br /&gt;
The ''web development mode'' can be enabled as follows (type it in the client's F8 console):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;start runcode&lt;br /&gt;
crun setDevelopmentMode(true, true)&lt;br /&gt;
debugscript 3&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Now, you should be able to see web errors and blocked domains/URLs in the debug window at the bottom.&lt;br /&gt;
&lt;br /&gt;
=Things you should keep in mind while working with CEF=&lt;br /&gt;
You should always keep in mind that some modern browser features are not available on some computers.&lt;br /&gt;
This is for example true for '''WebGL'''.&lt;br /&gt;
&lt;br /&gt;
Another problematic feature is '''Adobe Flash'''. Adobe Flash is enabled by default, but you should avoid using it due to the fact that plugins can be disabled in the settings on the one hand (Java is disabled completely by the way) and Flash is very restrictive on the other hand. Restrictive means it runs in a separate process uses a very old interface and offers therefore just a few ways to control it.&lt;br /&gt;
As a consequence, you cannot control the volume of flash objects. Fortunately, HTML5 is an even better replacement and provides very good audio and video interface (http://www.w3schools.com/tags/ref_av_dom.asp) which even supports 3D sound (@all bored people among us: Feel free to write a 3D sound 'wrapper' that maps the GTA onto HTML5 coordinates :P).&lt;br /&gt;
&lt;br /&gt;
=Advanced usage=&lt;br /&gt;
Since our CEF implementation does not do z-ordering by default, you have to provide your own z-ordering mechanism.&lt;br /&gt;
You can find a basic implementation of such a mechanism here: https://github.com/Jusonex/mtasa_cef_tools&lt;br /&gt;
There are also a few utility functions that allow you to integrate these classes easily into your own object-oriented UI system.&lt;br /&gt;
I'll provide some code to use CEF along with CEGUI soon too.&lt;br /&gt;
&lt;br /&gt;
=Performance=&lt;br /&gt;
Creating lots of browsers does not influence MTA directly (except the fact MTA has to copy the texture data in the main/GTA thread due to technical restrictions), because one part of CEF runs in another process and the other part in a secondary thread.&lt;br /&gt;
So if you do not want to show the browser, it is definitely the best to destroy the browser. If you cannot destroy the browser (imagine you have to save the website's state for some reason), you can save a lot of resources by disabling rendering via [[setBrowserRenderingPaused]]. This will stop CEF from rendering new frames/processing input and MTA from copying the texture data.&lt;br /&gt;
&lt;br /&gt;
=Troubleshooting=&lt;br /&gt;
===google.com doesn't work (even though I requested google.com)===&lt;br /&gt;
Google redirects to a country-specific website by default. If you want to prevent Google from doing this, load the following URL: https://www.google.com/ncr&lt;br /&gt;
&lt;br /&gt;
=Scripting functions=&lt;br /&gt;
{{CEF_functions}}&lt;br /&gt;
=Scripting events=&lt;br /&gt;
{{CEF_events}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>506</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CEF_Tutorial&amp;diff=67402</id>
		<title>CEF Tutorial</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CEF_Tutorial&amp;diff=67402"/>
		<updated>2020-09-22T10:37:38Z</updated>

		<summary type="html">&lt;p&gt;506: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page gives you a brief introduction to CEF.&lt;br /&gt;
&lt;br /&gt;
=What is CEF?=&lt;br /&gt;
CEF stands for '''C'''hromium '''E'''mbedded '''F'''ramework and is a framework for embedding Chromium-based browsers in other applications - in our case MTA. CEF is based on Google's Chromium project so it is also a fast, secure and stable web engine.&lt;br /&gt;
&lt;br /&gt;
You can find more information about CEF on CEF's GoogleCode project page: https://bitbucket.org/chromiumembedded/cef&lt;br /&gt;
&lt;br /&gt;
=The basics=&lt;br /&gt;
Creating a new browser is really simple. Let's open YouTube for example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Create a new remote browser (size is 800*600px) with transparency enabled&lt;br /&gt;
local browser = createBrowser(800, 600, true, true)&lt;br /&gt;
&lt;br /&gt;
-- &amp;quot;Wait&amp;quot; for the browser (this is necessary because CEF runs in a secondary thread and hence requires the 'asynchronous' event mechanism)&lt;br /&gt;
addEventHandler(&amp;quot;onClientBrowserCreated&amp;quot;, browser,&lt;br /&gt;
    function()&lt;br /&gt;
        -- We're ready to load the URL now (the source of this event is the browser that has been created)&lt;br /&gt;
        loadBrowserURL(source, &amp;quot;https://youtube.com/&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This example does not require any domain requests as YouTube is whitelisted by default. More about domain requests below.&lt;br /&gt;
&lt;br /&gt;
=Domain request system=&lt;br /&gt;
In order to prevent people from abusing the possibilities CEF offers, we decided to introduce a request system.&lt;br /&gt;
This means the domain you want to load has to meet at least one of the following requirements:&lt;br /&gt;
*it is whitelisted globally by the MTA team (you can create a post in [this topic] to suggest a new domain to be whitelisted) - '''**TODO: Add forum URL here**'''&lt;br /&gt;
*the domain was requested via requestBrowserDomains/Browser.requestDomains and accepted by the player '''before'''&lt;br /&gt;
*the domain is on the user's whitelist (MTA settings =&amp;gt; Tab: Browser =&amp;gt; Whitelist)&lt;br /&gt;
&lt;br /&gt;
Apart from these options, a domain might be blacklisted due to malicious content. Such domains cannot be requested.&lt;br /&gt;
&lt;br /&gt;
=Local vs remote mode=&lt;br /&gt;
There are two modes CEF can run in:&lt;br /&gt;
&lt;br /&gt;
Characteristics of local mode:&lt;br /&gt;
*you '''can''' execute Javascript code without any restriction (See: [[executeBrowserJavascript]])&lt;br /&gt;
*you '''can''' only load websites stored in the resource folder&lt;br /&gt;
*you '''cannot''' load remote content&lt;br /&gt;
&lt;br /&gt;
Characteristics of remote mode:&lt;br /&gt;
*you '''cannot''' execute Javascript code&lt;br /&gt;
*you '''can''' only load remote content&lt;br /&gt;
*keep in mind that either loading remote websites or Javascript on remote websites can be disabled in the MTA settings&lt;br /&gt;
&lt;br /&gt;
Changing the mode after the browser was created is not possible due to technical reasons.&lt;br /&gt;
&lt;br /&gt;
=Resource management=&lt;br /&gt;
==How to load local HTML files==&lt;br /&gt;
Loading local HTML files works similar to loading images.&lt;br /&gt;
&lt;br /&gt;
Add your HTML files to your meta.xml through the file tag:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;file src=&amp;quot;html/myAwesomeUI.html&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How to load local resources in local HTML files==&lt;br /&gt;
Imagine you want to load an image or play a video from your MTA resource. This is possible via a custom URI scheme named '''''http://mta/'''''&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
This examples shows how to play a video. Note that you have to enable OOP.&lt;br /&gt;
====Lua====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Create a browser (local mode is also required to access local data)&lt;br /&gt;
local webView = Browser(640, 480, true, true)&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientBrowserCreated&amp;quot;, webView,&lt;br /&gt;
     function()&lt;br /&gt;
    &lt;br /&gt;
          -- Load HTML UI&lt;br /&gt;
          webView:loadURL(&amp;quot;http://mta/local/html/myVideo.html&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
     end&lt;br /&gt;
)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
====meta.xml====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;file src=&amp;quot;html/myVideo.html&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;file src=&amp;quot;media/myVideo.webm&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
====HTML====&lt;br /&gt;
This is the most interesting part:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE HTML&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
    &amp;lt;video width=&amp;quot;640&amp;quot; height=&amp;quot;480&amp;quot; controls&amp;gt;&lt;br /&gt;
         &amp;lt;source src=&amp;quot;http://mta/local/myVideo.webm&amp;quot; type=&amp;quot;video/webm&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/video&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Lua &amp;lt;==&amp;gt; Javascript communication=&lt;br /&gt;
First of all, communication between Lua and Javascript is only available in local mode due to security reasons.&lt;br /&gt;
&lt;br /&gt;
==Lua to Javascript==&lt;br /&gt;
Lua to javascript is pretty easy as you can execute Javascript code from Lua using [[executeBrowserJavascript]].&lt;br /&gt;
&lt;br /&gt;
So, a bit Lua code around it and you have got the first direction:&lt;br /&gt;
* https://github.com/Jusonex/mtasa_cef_tools/blob/master/webui/src/WebWindow.lua#L180-189&lt;br /&gt;
* https://github.com/Jusonex/mtasa_cef_tools/blob/master/webui/src/mtaevents.js#L9-L15&lt;br /&gt;
&lt;br /&gt;
==Javascript to Lua==&lt;br /&gt;
You are able to trigger a client event via the Javascript method ''triggerEvent'' which is part of the static class/namespace ''mta''.&lt;br /&gt;
The syntax is as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
mta.triggerEvent(string event, var parameter1, var parameter2, var parameter3, ...)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The source of this event is always the browser element that triggered the event.&lt;br /&gt;
&lt;br /&gt;
An example is available here:&lt;br /&gt;
* https://github.com/Jusonex/mtasa_cef_tools/blob/master/webui/examples/html/ui2.html#L66&lt;br /&gt;
* https://github.com/Jusonex/mtasa_cef_tools/blob/master/webui/examples/Main.lua#L35-L40&lt;br /&gt;
&lt;br /&gt;
=Debugging=&lt;br /&gt;
The ''web development mode'' can be enabled as follows (type it in the client's F8 console):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;start runcode&lt;br /&gt;
crun setDevelopmentMode(true, true)&lt;br /&gt;
debugscript 3&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Now, you should be able to see web errors and blocked domains/URLs in the debug window at the bottom.&lt;br /&gt;
&lt;br /&gt;
=Things you should keep in mind while working with CEF=&lt;br /&gt;
You should always keep in mind that some modern browser features are not available on some computers.&lt;br /&gt;
This is for example true for '''WebGL'''.&lt;br /&gt;
&lt;br /&gt;
Another problematic feature is '''Adobe Flash'''. Adobe Flash is enabled by default, but you should avoid using it due to the fact that plugins can be disabled in the settings on the one hand (Java is disabled completely by the way) and Flash is very restrictive on the other hand. Restrictive means it runs in a separate process uses a very old interface and offers therefore just a few ways to control it.&lt;br /&gt;
As a consequence, you cannot control the volume of flash objects. Fortunately, HTML5 is an even better replacement and provides very good audio and video interface (http://www.w3schools.com/tags/ref_av_dom.asp) which even supports 3D sound (@all bored people among us: Feel free to write a 3D sound 'wrapper' that maps the GTA onto HTML5 coordinates :P).&lt;br /&gt;
&lt;br /&gt;
=Advanced usage=&lt;br /&gt;
Since our CEF implementation does not do z-ordering by default, you have to provide your own z-ordering mechanism.&lt;br /&gt;
You can find a basic implementation of such a mechanism here: https://github.com/Jusonex/mtasa_cef_tools&lt;br /&gt;
There are also a few utility functions that allow you to integrate these classes easily into your own object-oriented UI system.&lt;br /&gt;
I'll provide some code to use CEF along with CEGUI soon too.&lt;br /&gt;
&lt;br /&gt;
=Performance=&lt;br /&gt;
Creating lots of browsers does not influence MTA directly (except the fact MTA has to copy the texture data in the main/GTA thread due to technical restrictions), because one part of CEF runs in another process and the other part in a secondary thread.&lt;br /&gt;
So if you do not want to show the browser, it is definitely the best to destroy the browser. If you cannot destroy the browser (imagine you have to save the website's state for some reason), you can save a lot of resources by disabling rendering via [[setBrowserRenderingPaused]]. This will stop CEF from rendering new frames/processing input and MTA from copying the texture data.&lt;br /&gt;
&lt;br /&gt;
=Troubleshooting=&lt;br /&gt;
===google.com doesn't work (even though I requested google.com)===&lt;br /&gt;
Google redirects to a country-specific website by default. If you want to prevent Google from doing this, load the following URL: https://www.google.com/ncr&lt;br /&gt;
&lt;br /&gt;
=Scripting functions=&lt;br /&gt;
{{CEF_functions}}&lt;br /&gt;
=Scripting events=&lt;br /&gt;
{{CEF_events}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>506</name></author>
	</entry>
</feed>