<?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=Tete</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=Tete"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Tete"/>
	<updated>2026-04-28T05:18:28Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Table.copy&amp;diff=38649</id>
		<title>Table.copy</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Table.copy&amp;diff=38649"/>
		<updated>2014-01-28T05:11:57Z</updated>

		<summary type="html">&lt;p&gt;Tete: /* Required Arguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function copies a whole table and all the tables in that table instead of just linking to it.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table table.copy( table tab, bool recursive=false )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''tab''': The table to copy.&lt;br /&gt;
* '''recursive''': Whether sub-tables should be copied as well&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a new table with the same content as tab has.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server- and/or clientside Script&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function table.copy(tab, recursive)&lt;br /&gt;
    local ret = {}&lt;br /&gt;
    for key, value in pairs(tab) do&lt;br /&gt;
        if (type(value) == &amp;quot;table&amp;quot;) and recursive then ret[key] = table.copy(value)&lt;br /&gt;
        else ret[key] = value end&lt;br /&gt;
    end&lt;br /&gt;
    return ret&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;
Author: NeonBlack&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/banPlayer&amp;diff=37611</id>
		<title>AR/banPlayer</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/banPlayer&amp;diff=37611"/>
		<updated>2013-11-16T09:49:34Z</updated>

		<summary type="html">&lt;p&gt;Tete: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}}&lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
هذه الوظيفة سـ تبند الاعب المحدد عن طريق كل من الاي بي او السيريال او اسم الاعب&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Deprecated_feature|3|1.0|&lt;br /&gt;
This function will ban the specified player from the server by IP.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
ban banPlayer ( player bannedPlayer, [ bool IP = true, bool Username = false, bool Serial = false, &lt;br /&gt;
player responsiblePlayer = nil, string reason = nil, int seconds = 0 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Deprecated_feature|3|1.0|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool banPlayer ( player bannedPlayer , [ element responsibleElement, string reason ] )         &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bannedPlayer:''' الاعب الذي سيتم تحظر دخوله من السيرفر.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
*'''IP:''' هل سيكون الحظر عن طريق الاي بي ؟&lt;br /&gt;
*'''Username:''' هل سيكون الحظر عن طريق الاسم ؟&lt;br /&gt;
*'''Serial:''' هل سيكون الحظر عن طريق السيريال&lt;br /&gt;
&lt;br /&gt;
:'''ملاحظة:''' t للتبنيد عن طريق الاسم او السيريال&lt;br /&gt;
&lt;br /&gt;
''verifyserials''&lt;br /&gt;
&lt;br /&gt;
يجب ان تكون مفتوحة في ملف ترتيب السيرفر&lt;br /&gt;
}}&lt;br /&gt;
*'''responsibleElement:''' الشيء الذي سيكون مسؤل عن الحظر , يمكنه ان يكون لاعب , ويمكنه ان يكون&lt;br /&gt;
getRootElement()&lt;br /&gt;
&lt;br /&gt;
*'''reason:''' ( الحد الاقصى 30 حرف )t سبب حظر اللاعب من السيرفر&lt;br /&gt;
*'''seconds:''' عدد الثواني الذي سيتم بها الحظر الاعب , 0 اذا كان الباند دائم&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
{{Deprecated_feature|3|1.0|&lt;br /&gt;
Returns ''true'' if the player was banned succesfully, ''false'' if invalid arguments are specified.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
Returns a [[ban]] object if banned successfully, or ''false'' if unsuccessful.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==مثال==&lt;br /&gt;
المثال يدع الاعبين يبندون كما يشاؤن اذا كان لهم صلاحية الادمن في ملف اي اس ال&lt;br /&gt;
&lt;br /&gt;
ACL&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; -- السبب, اسم الباند ,اسم الكلمة التي سيتم بها تبنيد الاعب , الاعب&lt;br /&gt;
function banPlayerCommand ( theClient, commandName, bannedName, reason )&lt;br /&gt;
	-- يعطي الاعب خطاء اذا لم يكن له الصلاحية لفعل ذلك&lt;br /&gt;
	if ( hasObjectPermissionTo ( theClient, &amp;quot;function.banPlayer&amp;quot; ) ) then&lt;br /&gt;
		-- يتحقق من اسم الاعب الذي سيتم تبنيده من قبل الادمن الذي سيكتب الكلمة واسمه&lt;br /&gt;
		local bannedPlayer = getPlayerFromName ( bannedName )&lt;br /&gt;
		-- تبنيد الاعب&lt;br /&gt;
		banPlayer ( bannedPlayer, theClient, reason )&lt;br /&gt;
                -- يخبر بالشات بآنه تم تبنيد هذا الاعب بنجاح&lt;br /&gt;
		outputChatBox ( &amp;quot;ban: &amp;quot; .. bannedName .. &amp;quot; successfully banned&amp;quot;, theClient )&lt;br /&gt;
                -- اذا ليس كذلك&lt;br /&gt;
	else&lt;br /&gt;
                -- يخرج بالشات بآن الاعب الذي كتب الكلمة ليس معه الصلاحية الكافية للتبنيد&lt;br /&gt;
		outputChatBox ( &amp;quot;ban: You don't have enough permissions&amp;quot;, theClient )&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;ban&amp;quot;, banPlayerCommand )&lt;br /&gt;
--[[ لقد جعلنا كلمة&lt;br /&gt;
ban&lt;br /&gt;
تفعل كل ما كتبناه فوق&lt;br /&gt;
]]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==انظر أيضاً==&lt;br /&gt;
{{AR/Admin_functions}}&lt;br /&gt;
[[es:banPlayer]]&lt;br /&gt;
[[ru:BanPlayer]]&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Ban&amp;diff=37610</id>
		<title>Ban</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Ban&amp;diff=37610"/>
		<updated>2013-11-16T09:46:38Z</updated>

		<summary type="html">&lt;p&gt;Tete: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A [[ban]] is a pointer that represents a banned player arbitrarily.  The following functions allow interaction with a [[ban]]:&lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
*[[addBan]]&lt;br /&gt;
*[[getBans]]&lt;br /&gt;
*[[getBanAdmin]]&lt;br /&gt;
*[[getBanIP]]&lt;br /&gt;
*[[getBanReason]]&lt;br /&gt;
*[[getBanSerial]]&lt;br /&gt;
*[[getBanTime]]&lt;br /&gt;
*[[getBanUsername]]&lt;br /&gt;
*[[removeBan]]&lt;br /&gt;
}}&lt;br /&gt;
*[[banPlayer]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting Concepts]]&lt;br /&gt;
&lt;br /&gt;
[[de:Bann]]&lt;br /&gt;
[[ar:الباند]]&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/%D8%A7%D9%84%D8%A8%D8%A7%D9%86%D8%AF&amp;diff=37609</id>
		<title>AR/الباند</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/%D8%A7%D9%84%D8%A8%D8%A7%D9%86%D8%AF&amp;diff=37609"/>
		<updated>2013-11-16T09:37:44Z</updated>

		<summary type="html">&lt;p&gt;Tete: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;هو حظر لاعب من السيرفر مؤقتاً او دائماً. الوظائف التالية تتيح التعامل مع الباند ([[Ban]]) الباند&lt;br /&gt;
{{AR/Admin_functions}}&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/%D8%A7%D9%84%D8%A8%D8%A7%D9%86%D8%AF&amp;diff=37608</id>
		<title>AR/الباند</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/%D8%A7%D9%84%D8%A8%D8%A7%D9%86%D8%AF&amp;diff=37608"/>
		<updated>2013-11-16T09:27:36Z</updated>

		<summary type="html">&lt;p&gt;Tete: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{AR/Admin_functions}}&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/%D8%A7%D9%84%D8%A8%D8%A7%D9%86%D8%AF&amp;diff=37607</id>
		<title>AR/الباند</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/%D8%A7%D9%84%D8%A8%D8%A7%D9%86%D8%AF&amp;diff=37607"/>
		<updated>2013-11-16T09:21:46Z</updated>

		<summary type="html">&lt;p&gt;Tete: Created page with &amp;quot;في الانتظار ....&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;في الانتظار ....&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/ban&amp;diff=37606</id>
		<title>AR/ban</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/ban&amp;diff=37606"/>
		<updated>2013-11-16T09:17:37Z</updated>

		<summary type="html">&lt;p&gt;Tete: Created page with &amp;quot;A ban is a pointer that represents a banned player arbitrarily.  The following functions allow interaction with a ban: {{New feature|3|1.0| *addBan *getBans *[[ge...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A [[ban]] is a pointer that represents a banned player arbitrarily.  The following functions allow interaction with a [[ban]]:&lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
*[[addBan]]&lt;br /&gt;
*[[getBans]]&lt;br /&gt;
*[[getBanAdmin]]&lt;br /&gt;
*[[getBanIP]]&lt;br /&gt;
*[[getBanReason]]&lt;br /&gt;
*[[getBanSerial]]&lt;br /&gt;
*[[getBanTime]]&lt;br /&gt;
*[[getBanUsername]]&lt;br /&gt;
*[[removeBan]]&lt;br /&gt;
}}&lt;br /&gt;
*[[banPlayer]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting Concepts]]&lt;br /&gt;
&lt;br /&gt;
[[ar:ban]]&lt;br /&gt;
[[de:Bann]]&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/Ban&amp;diff=37605</id>
		<title>AR/Ban</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/Ban&amp;diff=37605"/>
		<updated>2013-11-16T09:16:01Z</updated>

		<summary type="html">&lt;p&gt;Tete: Created page with &amp;quot;A ban is a pointer that represents a banned player arbitrarily.  The following functions allow interaction with a ban: {{New feature|3|1.0| *addBan *getBans *[[ge...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A [[ban]] is a pointer that represents a banned player arbitrarily.  The following functions allow interaction with a [[ban]]:&lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
*[[addBan]]&lt;br /&gt;
*[[getBans]]&lt;br /&gt;
*[[getBanAdmin]]&lt;br /&gt;
*[[getBanIP]]&lt;br /&gt;
*[[getBanReason]]&lt;br /&gt;
*[[getBanSerial]]&lt;br /&gt;
*[[getBanTime]]&lt;br /&gt;
*[[getBanUsername]]&lt;br /&gt;
*[[removeBan]]&lt;br /&gt;
}}&lt;br /&gt;
*[[banPlayer]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting Concepts]]&lt;br /&gt;
&lt;br /&gt;
[[ar:ban]]&lt;br /&gt;
[[de:Bann]]&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/playSound&amp;diff=37509</id>
		<title>AR/playSound</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/playSound&amp;diff=37509"/>
		<updated>2013-11-06T01:45:09Z</updated>

		<summary type="html">&lt;p&gt;Tete: /* العناصر المطلوبة */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
.هذه الوظيفة تصنع صوتاً وتشغله فوراً بعد الصنع&lt;br /&gt;
&lt;br /&gt;
MP3 و WAV و OGG و RIFF و MOD و XM و IT و S3M :الصيغات المدعومة هي التالي :t'''ملاحظة'''&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;element playSound ( string soundPath, [ bool looped = false ] )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===العناصر المطلوبة=== &lt;br /&gt;
*'''soundPath:''' ايضاً يمكنك وضع رابط صوت بدلاً من مسار الملف .&amp;lt;file /&amp;gt; بشعار [[meta.xml]] ملف الصوت يجب ان يكون معرف في ملف) t.مسار ملف الصوت الذي تريد تشغيله&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''looped:''' ([[Boolean]]) false او true هذه الخاصية تتمثل في سواء اكان الصوت متكرر او لا باستخدام&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
اذا لم يتم صنع الصوت بنجاح false تنتج صوتاً اذا تم صنع الصوت بنجاح, أو تنتج&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;
function wasted (killer, weapon, bodypart) &lt;br /&gt;
	local sound = playSound(&amp;quot;sounds/wasted.mp3&amp;quot;) -- wasted.mp3 نشغل الصوت - sounds من مجلد اسمه	&lt;br /&gt;
        setSoundVolume(sound, 0.5) -- 50% نجعل حجم الصوت&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientPlayerWasted&amp;quot;, getLocalPlayer(), wasted) -- نضع الايفنت الى هذه الوظيفه عند موت الاعب&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;
{{AR/Audio_functions}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[EN:playSound]]&lt;br /&gt;
[[DE:playSound]]&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/playSound&amp;diff=37508</id>
		<title>AR/playSound</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/playSound&amp;diff=37508"/>
		<updated>2013-11-06T01:44:16Z</updated>

		<summary type="html">&lt;p&gt;Tete: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
.هذه الوظيفة تصنع صوتاً وتشغله فوراً بعد الصنع&lt;br /&gt;
&lt;br /&gt;
MP3 و WAV و OGG و RIFF و MOD و XM و IT و S3M :الصيغات المدعومة هي التالي :t'''ملاحظة'''&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;element playSound ( string soundPath, [ bool looped = false ] )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===العناصر المطلوبة=== &lt;br /&gt;
*'''soundPath: هو ملف الصوت المراد تشغيله [[filepath]]  / ( &amp;lt;file /&amp;gt; مع علامة [[meta.xml]] و يجب ان يكون ملف الصوت معرفا في )&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''looped:''' ([[Boolean]]) false او true هذه الخاصية تتمثل في سواء اكان الصوت متكرر او لا باستخدام&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
اذا لم يتم صنع الصوت بنجاح false تنتج صوتاً اذا تم صنع الصوت بنجاح, أو تنتج&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;
function wasted (killer, weapon, bodypart) &lt;br /&gt;
	local sound = playSound(&amp;quot;sounds/wasted.mp3&amp;quot;) -- wasted.mp3 نشغل الصوت - sounds من مجلد اسمه	&lt;br /&gt;
        setSoundVolume(sound, 0.5) -- 50% نجعل حجم الصوت&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientPlayerWasted&amp;quot;, getLocalPlayer(), wasted) -- نضع الايفنت الى هذه الوظيفه عند موت الاعب&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;
{{AR/Audio_functions}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[EN:playSound]]&lt;br /&gt;
[[DE:playSound]]&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/playSound3D&amp;diff=37507</id>
		<title>AR/playSound3D</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/playSound3D&amp;diff=37507"/>
		<updated>2013-11-06T01:43:40Z</updated>

		<summary type="html">&lt;p&gt;Tete: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
.3D بحيث ان يكون ملائم لعالم ال GTA تصنع صوت في عالم&lt;br /&gt;
&lt;br /&gt;
.بعد ان يتم تكوين الصوت باستخدام الوظيفة GTA لتحريك الصوت في اي مكان في عالم [[setElementPosition]] يمكن استخدام&lt;br /&gt;
&lt;br /&gt;
.بعد ان يتم تكوين الصوت لتشغيله في عالم وهمي [[setElementDimension]] تذكر ان تستخدم&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
MP3 و WAV و OGG و RIFF و MOD و XM و IT و S3M :الصيغات المدعومة هي التالي :t'''ملاحظة'''&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;element playSound3D ( string soundPath, float x, float y, float z, [ bool looped = false ] )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''soundPath:''' ايضاً يمكنك وضع رابط صوت بدلاً من مسار الملف .&amp;lt;file /&amp;gt; بشعار [[meta.xml]] ملف الصوت يجب ان يكون معرف في ملف) t.مسار ملف الصوت الذي تريد تشغيله&lt;br /&gt;
*'''x:''' لمكان الصوت في اللعبة xاحداثيات الـ&lt;br /&gt;
*'''y:''' لمكان الصوت في اللعبة yاحداثيات الـ&lt;br /&gt;
*'''z:''' لمكان الصوت في اللعبة zاحداثيات الـ&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''looped:''' ([[Boolean]]) false او true هذه الخاصية تتمثل في سواء اكان الصوت متكرر او لا باستخدام&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
اذا لم يتم صنع الصوت بنجاح false تنتج صوتاً اذا تم صنع الصوت بنجاح, أو تنتج&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
San fierro هذا المثال يصنع صوت متكرر في محل بيتزا, محل البيتزا في&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function onResourceStart()&lt;br /&gt;
	local sound = playSound3D(&amp;quot;sounds/song.mp3&amp;quot;, 373.14, -125.21, 1001, true) &lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement(getThisResource()), onResourceStart)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
This example play internet radio in groove street.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 2&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( 'onClientResourceStart', resourceRoot,&lt;br /&gt;
	function( )&lt;br /&gt;
		local uSound = playSound3D( 'http://78.31.74.220:8000/BadRadio', 2498, -1659, 12 ) &lt;br /&gt;
		setSoundMaxDistance( uSound, 100 )&lt;br /&gt;
	end&lt;br /&gt;
)&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;
{{AR/Audio_functions}}&lt;br /&gt;
&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[EN:playSound3D]]&lt;br /&gt;
[[DE:playSound3D]]&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/playSound3D&amp;diff=37506</id>
		<title>AR/playSound3D</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/playSound3D&amp;diff=37506"/>
		<updated>2013-11-06T01:38:35Z</updated>

		<summary type="html">&lt;p&gt;Tete: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
.3D بحيث ان يكون ملائم لعالم ال GTA تصنع صوت في عالم&lt;br /&gt;
&lt;br /&gt;
.بعد ان يتم تكوين الصوت باستخدام الوظيفة GTA لتحريك الصوت في اي مكان في عالم [[setElementPosition]] يمكن استخدام&lt;br /&gt;
&lt;br /&gt;
.بعد ان يتم تكوين الصوت لتشغيله في عالم وهمي [[setElementDimension]] تذكر ان تستخدم&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
MP3 و WAV و OGG و RIFF و MOD و XM و IT و S3M :الصيغات المدعومة هي التالي :t'''ملاحظة'''&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;element playSound3D ( string soundPath, float x, float y, float z, [ bool looped = false ] )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''soundPath:''' ايضاً يمكنك وضع رابط صوت بدلاً من مسار الملف .&amp;lt;file /&amp;gt; بشعار [[meta.xml]] ملف الصوت يجب ان يكون معرف في ملف) t.مسار ملف الصوت الذي تريد تشغيله&lt;br /&gt;
*'''x:''' لمكان الصوت في اللعبة xاحداثيات الـ&lt;br /&gt;
*'''y:''' لمكان الصوت في اللعبة yاحداثيات الـ&lt;br /&gt;
*'''z:''' لمكان الصوت في اللعبة zاحداثيات الـ&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''looped:''' ([[Boolean]]) false او true هذه الخاصية تتمثل في سواء اكان الصوت متكرر او لا باستخدام&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
اذا لم يتم صنع الصوت بنجاح false تنتج المنت صوت اذا تم صنع الصوت بنجاح, أو تنتج&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
San fierro هذا المثال يصنع صوت متكرر في محل بيتزا, محل البيتزا في&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function onResourceStart()&lt;br /&gt;
	local sound = playSound3D(&amp;quot;sounds/song.mp3&amp;quot;, 373.14, -125.21, 1001, true) &lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement(getThisResource()), onResourceStart)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
This example play internet radio in groove street.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 2&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( 'onClientResourceStart', resourceRoot,&lt;br /&gt;
	function( )&lt;br /&gt;
		local uSound = playSound3D( 'http://78.31.74.220:8000/BadRadio', 2498, -1659, 12 ) &lt;br /&gt;
		setSoundMaxDistance( uSound, 100 )&lt;br /&gt;
	end&lt;br /&gt;
)&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;
{{AR/Audio_functions}}&lt;br /&gt;
&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[EN:playSound3D]]&lt;br /&gt;
[[DE:playSound3D]]&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/playSound3D&amp;diff=37505</id>
		<title>AR/playSound3D</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/playSound3D&amp;diff=37505"/>
		<updated>2013-11-06T01:37:55Z</updated>

		<summary type="html">&lt;p&gt;Tete: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
.3D بحيث ان يكون ملائم لعالم ال GTA تصنع صوت في عالم&lt;br /&gt;
&lt;br /&gt;
.بعد ان يتم تكوين الصوت باستخدام الوظيفة GTA لتحريك الصوت في اي مكان في عالم [[setElementPosition]] يمكن استخدام&lt;br /&gt;
&lt;br /&gt;
.بعد ان يتم تكوين الصوت لتشغيله في عالم وهمي [[setElementDimension]] تذكر ان تستخدم&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
MP3, WAV, OGG, RIFF, MOD, XM, IT, S3M :الصيغات المدعومة هي التالي :t'''ملاحظة'''&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;element playSound3D ( string soundPath, float x, float y, float z, [ bool looped = false ] )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''soundPath:''' ايضاً يمكنك وضع رابط صوت بدلاً من مسار الملف .&amp;lt;file /&amp;gt; بشعار [[meta.xml]] ملف الصوت يجب ان يكون معرف في ملف) t.مسار ملف الصوت الذي تريد تشغيله&lt;br /&gt;
*'''x:''' لمكان الصوت في اللعبة xاحداثيات الـ&lt;br /&gt;
*'''y:''' لمكان الصوت في اللعبة yاحداثيات الـ&lt;br /&gt;
*'''z:''' لمكان الصوت في اللعبة zاحداثيات الـ&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''looped:''' ([[Boolean]]) false او true هذه الخاصية تتمثل في سواء اكان الصوت متكرر او لا باستخدام&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
اذا لم يتم صنع الصوت بنجاح false تنتج المنت صوت اذا تم صنع الصوت بنجاح, أو تنتج&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
San fierro هذا المثال يصنع صوت متكرر في محل بيتزا, محل البيتزا في&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function onResourceStart()&lt;br /&gt;
	local sound = playSound3D(&amp;quot;sounds/song.mp3&amp;quot;, 373.14, -125.21, 1001, true) &lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement(getThisResource()), onResourceStart)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
This example play internet radio in groove street.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 2&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( 'onClientResourceStart', resourceRoot,&lt;br /&gt;
	function( )&lt;br /&gt;
		local uSound = playSound3D( 'http://78.31.74.220:8000/BadRadio', 2498, -1659, 12 ) &lt;br /&gt;
		setSoundMaxDistance( uSound, 100 )&lt;br /&gt;
	end&lt;br /&gt;
)&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;
{{AR/Audio_functions}}&lt;br /&gt;
&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[EN:playSound3D]]&lt;br /&gt;
[[DE:playSound3D]]&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/playSound3D&amp;diff=37504</id>
		<title>AR/playSound3D</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/playSound3D&amp;diff=37504"/>
		<updated>2013-11-06T01:37:08Z</updated>

		<summary type="html">&lt;p&gt;Tete: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
.3D بحيث ان يكون ملائم لعالم ال GTA تصنع صوت في عالم&lt;br /&gt;
&lt;br /&gt;
.بعد ان يتم تكوين الصوت باستخدام الوظيفة GTA لتحريك الصوت في اي مكان في عالم [[setElementPosition]] يمكن استخدام&lt;br /&gt;
&lt;br /&gt;
.بعد ان يتم تكوين الصوت لتشغيله في عالم وهمي [[setElementDimension]] تذكر ان تستخدم&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
MP3, WAV, OGG, RIFF, MOD, XM, IT and S3M :الصيغات المدعومة هي التالي :t'''ملاحظة'''&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;element playSound3D ( string soundPath, float x, float y, float z, [ bool looped = false ] )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''soundPath:''' ايضاً يمكنك وضع رابط صوت بدلاً من مسار الملف .&amp;lt;file /&amp;gt; بشعار [[meta.xml]] ملف الصوت يجب ان يكون معرف في ملف) t.مسار ملف الصوت الذي تريد تشغيله&lt;br /&gt;
*'''x:''' لمكان الصوت في اللعبة xاحداثيات الـ&lt;br /&gt;
*'''y:''' لمكان الصوت في اللعبة yاحداثيات الـ&lt;br /&gt;
*'''z:''' لمكان الصوت في اللعبة zاحداثيات الـ&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''looped:''' ([[Boolean]]) false او true هذه الخاصية تتمثل في سواء اكان الصوت متكرر او لا باستخدام&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
اذا لم يتم صنع الصوت بنجاح false تنتج المنت صوت اذا تم صنع الصوت بنجاح, أو تنتج&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
San fierro هذا المثال يصنع صوت متكرر في محل بيتزا, محل البيتزا في&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function onResourceStart()&lt;br /&gt;
	local sound = playSound3D(&amp;quot;sounds/song.mp3&amp;quot;, 373.14, -125.21, 1001, true) &lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement(getThisResource()), onResourceStart)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
This example play internet radio in groove street.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 2&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( 'onClientResourceStart', resourceRoot,&lt;br /&gt;
	function( )&lt;br /&gt;
		local uSound = playSound3D( 'http://78.31.74.220:8000/BadRadio', 2498, -1659, 12 ) &lt;br /&gt;
		setSoundMaxDistance( uSound, 100 )&lt;br /&gt;
	end&lt;br /&gt;
)&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;
{{AR/Audio_functions}}&lt;br /&gt;
&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[EN:playSound3D]]&lt;br /&gt;
[[DE:playSound3D]]&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/getSoundLength&amp;diff=37503</id>
		<title>AR/getSoundLength</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/getSoundLength&amp;diff=37503"/>
		<updated>2013-11-06T01:03:48Z</updated>

		<summary type="html">&lt;p&gt;Tete: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function is used to return the playback length of the specified [[sound]] element.&lt;br /&gt;
&lt;br /&gt;
{{New_feature|3.0139|1.3.2|&lt;br /&gt;
اذا الالمنت لاعب, هذه الوظيفة ستستخدم صوت اللاعب&lt;br /&gt;
}}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;float getSoundLength ( element theSound )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theSound:''' The [[sound]] element which length you want to return.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns an [[float]] value indicating the playback length of the [[sound]] element in seconds.&lt;br /&gt;
&lt;br /&gt;
==مثال== &lt;br /&gt;
Plays a sound then outputs the sound length.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local sound = playSound(&amp;quot;money.mp3&amp;quot;,false) --Play a sound&lt;br /&gt;
local soundLength = getSoundLength(sound) --Get the length of the sound&lt;br /&gt;
outputChatBox(&amp;quot;This sound is :&amp;quot; ..soundLength.. &amp;quot; long!&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==التغيير:==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.2|تمت اضافة المنت اللاعب لاستخدام صوت اللاعب}}&lt;br /&gt;
&lt;br /&gt;
==أنظر أيضاً==&lt;br /&gt;
{{AR/Audio_functions}}&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/getSoundLength&amp;diff=37502</id>
		<title>AR/getSoundLength</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/getSoundLength&amp;diff=37502"/>
		<updated>2013-11-06T01:03:20Z</updated>

		<summary type="html">&lt;p&gt;Tete: /* Changelog */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function is used to return the playback length of the specified [[sound]] element.&lt;br /&gt;
&lt;br /&gt;
{{New_feature|3.0139|1.3.2|&lt;br /&gt;
اذا الالمنت لاعب, هذه الوظيفة ستستخدم صوت اللاعب&lt;br /&gt;
}}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;float getSoundLength ( element theSound )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theSound:''' The [[sound]] element which length you want to return.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns an [[float]] value indicating the playback length of the [[sound]] element in seconds.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
Plays a sound then outputs the sound length.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local sound = playSound(&amp;quot;money.mp3&amp;quot;,false) --Play a sound&lt;br /&gt;
local soundLength = getSoundLength(sound) --Get the length of the sound&lt;br /&gt;
outputChatBox(&amp;quot;This sound is :&amp;quot; ..soundLength.. &amp;quot; long!&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==التغيير:==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.2|تمت اضافة المنت اللاعب لاستخدام صوت اللاعب}}&lt;br /&gt;
&lt;br /&gt;
==أنظر أيضاً==&lt;br /&gt;
{{AR/Audio_functions}}&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/getSoundLength&amp;diff=37501</id>
		<title>AR/getSoundLength</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/getSoundLength&amp;diff=37501"/>
		<updated>2013-11-06T01:00:19Z</updated>

		<summary type="html">&lt;p&gt;Tete: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function is used to return the playback length of the specified [[sound]] element.&lt;br /&gt;
&lt;br /&gt;
{{New_feature|3.0139|1.3.2|&lt;br /&gt;
اذا الالمنت لاعب, هذه الوظيفة ستستخدم صوت اللاعب&lt;br /&gt;
}}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;float getSoundLength ( element theSound )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theSound:''' The [[sound]] element which length you want to return.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns an [[float]] value indicating the playback length of the [[sound]] element in seconds.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
Plays a sound then outputs the sound length.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local sound = playSound(&amp;quot;money.mp3&amp;quot;,false) --Play a sound&lt;br /&gt;
local soundLength = getSoundLength(sound) --Get the length of the sound&lt;br /&gt;
outputChatBox(&amp;quot;This sound is :&amp;quot; ..soundLength.. &amp;quot; long!&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.2|Added player element to use a players voice}}&lt;br /&gt;
&lt;br /&gt;
==أنظر أيضاً==&lt;br /&gt;
{{AR/Audio_functions}}&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/getSoundEffects&amp;diff=37500</id>
		<title>AR/getSoundEffects</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/getSoundEffects&amp;diff=37500"/>
		<updated>2013-11-06T00:56:05Z</updated>

		<summary type="html">&lt;p&gt;Tete: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
هذه الوظيفة تجلب حالات تأثيرات الصوت في جدول&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table getSoundEffects ( element sound )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''sound:''' a [[sound]] element.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
تنتج جدول فيه اسماء الحالات كمفاتيح للقيم&lt;br /&gt;
&lt;br /&gt;
'''مثال:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    gargle = false,&lt;br /&gt;
    compressor = false,&lt;br /&gt;
    echo = true,&lt;br /&gt;
    i3dl2reverb = true,&lt;br /&gt;
    distortion = false,&lt;br /&gt;
    chorus = false,&lt;br /&gt;
    parameq = false,&lt;br /&gt;
    reverb = false,&lt;br /&gt;
    flanger = false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===أسماء تأثيرات الصوت:===&lt;br /&gt;
{{Sound_Effects}}&lt;br /&gt;
&lt;br /&gt;
==مثال:== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function switchEffects(sound)&lt;br /&gt;
	for _,v in ipairs(getSoundEffects(sound)) do -- Go through the whole list of sound effects for the sound&lt;br /&gt;
		if v == &amp;quot;gargle&amp;quot; then -- If the sound effect is 'gargle', proceed&lt;br /&gt;
			setSoundEffectEnabled(sound, &amp;quot;gargle&amp;quot;, false) -- Disable the 'gargle' -effect&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==أنظر أيضاً==&lt;br /&gt;
{{AR/Audio_functions}}&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/getSoundEffects&amp;diff=37499</id>
		<title>AR/getSoundEffects</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/getSoundEffects&amp;diff=37499"/>
		<updated>2013-11-06T00:55:43Z</updated>

		<summary type="html">&lt;p&gt;Tete: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
هذه الوظيفة تجلب حالات تأثيرات الصوت في جدول&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table getSoundEffects ( element sound )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''sound:''' a [[sound]] element.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
تنتج جدول فيه اسماء الحالات كمفاتيح للقيم&lt;br /&gt;
&lt;br /&gt;
'''مثال:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    gargle = false,&lt;br /&gt;
    compressor = false,&lt;br /&gt;
    echo = true,&lt;br /&gt;
    i3dl2reverb = true,&lt;br /&gt;
    distortion = false,&lt;br /&gt;
    chorus = false,&lt;br /&gt;
    parameq = false,&lt;br /&gt;
    reverb = false,&lt;br /&gt;
    flanger = false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===أسماء تأثيرات الصوت:===&lt;br /&gt;
{{Sound_Effects}}&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function switchEffects(sound)&lt;br /&gt;
	for _,v in ipairs(getSoundEffects(sound)) do -- Go through the whole list of sound effects for the sound&lt;br /&gt;
		if v == &amp;quot;gargle&amp;quot; then -- If the sound effect is 'gargle', proceed&lt;br /&gt;
			setSoundEffectEnabled(sound, &amp;quot;gargle&amp;quot;, false) -- Disable the 'gargle' -effect&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==أنظر أيضاً==&lt;br /&gt;
{{AR/Audio_functions}}&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/getSoundEffects&amp;diff=37498</id>
		<title>AR/getSoundEffects</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/getSoundEffects&amp;diff=37498"/>
		<updated>2013-11-06T00:54:42Z</updated>

		<summary type="html">&lt;p&gt;Tete: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
هذه الوظيفة تجلب حالات تأثيرات الصوت في جدول&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table getSoundEffects ( element sound )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''sound:''' a [[sound]] element.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
تنتج جدول فيه اسماء الحالات كمفاتيح للقيم&lt;br /&gt;
&lt;br /&gt;
'''مثال:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    gargle = false,&lt;br /&gt;
    compressor = false,&lt;br /&gt;
    echo = true,&lt;br /&gt;
    i3dl2reverb = true,&lt;br /&gt;
    distortion = false,&lt;br /&gt;
    chorus = false,&lt;br /&gt;
    parameq = false,&lt;br /&gt;
    reverb = false,&lt;br /&gt;
    flanger = false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''أسماء تأثيرات الصوت:'''&lt;br /&gt;
{{Sound_Effects}}&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function switchEffects(sound)&lt;br /&gt;
	for _,v in ipairs(getSoundEffects(sound)) do -- Go through the whole list of sound effects for the sound&lt;br /&gt;
		if v == &amp;quot;gargle&amp;quot; then -- If the sound effect is 'gargle', proceed&lt;br /&gt;
			setSoundEffectEnabled(sound, &amp;quot;gargle&amp;quot;, false) -- Disable the 'gargle' -effect&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==أنظر أيضاً==&lt;br /&gt;
{{AR/Audio_functions}}&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/playSoundFrontEnd&amp;diff=37497</id>
		<title>AR/playSoundFrontEnd</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/playSoundFrontEnd&amp;diff=37497"/>
		<updated>2013-11-06T00:42:24Z</updated>

		<summary type="html">&lt;p&gt;Tete: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
هذه الوظيفة تقوم بتشغيل صوت من اصوات اللعبة الافتراضية مثل صوت الرصاص والخ..&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool playSoundFrontEnd ( player thePlayer, int sound )   &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===الارقومنتات المطلوبه=== &lt;br /&gt;
*'''thePlayer:''' [[player]] انت تريد الصوت يشتغل الى ؟.&lt;br /&gt;
*'''sound:''' [[int]]  تحديد ايدي الصوت للتشغيل :&lt;br /&gt;
{{Sounds}}&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;false&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool playSoundFrontEnd ( int sound )   &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===الارقومنتات المطلوبه=== &lt;br /&gt;
*'''sound:''' [[int]]  تحديد الاي دي الصوت للتشغيل :&lt;br /&gt;
{{Sounds}}&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' = اذا تم تشغيل الصوت بنجاح, ''false'' = اذا لم يتم تشغيله.&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;
هذا المثال يشغل الصوت عند السباون &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function onPlayerSpawn ( theSpawnpoint, theTeam )&lt;br /&gt;
    playSoundFrontEnd ( source, 16 )&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerSpawn&amp;quot;, getRootElement(), onPlayerSpawn ) --- الحدث عند السباون&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section name=&amp;quot;client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
'/sound'  هذا المثال عندما الاعب يكتب في الشات&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function onSoundEvent ( )&lt;br /&gt;
    playSoundFrontEnd ( 16 )&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;sound&amp;quot;, onSoundEvent)&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;
{{AR/Audio_functions}}&lt;br /&gt;
&lt;br /&gt;
[[de:playSoundFrontEnd]]&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/createBlip&amp;diff=37334</id>
		<title>AR/createBlip</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/createBlip&amp;diff=37334"/>
		<updated>2013-10-18T03:52:48Z</updated>

		<summary type="html">&lt;p&gt;Tete: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
هذه الوظيفة تقوم بعمل أيقونة في الخريطة تراها في الرادار مثل الأيقونات الموجوده على الاعبين&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
blip createBlip ( float x, float y, float z, [int icon=0, int size=2, int r=255, int g=0, int b=0, int a=255, &lt;br /&gt;
int ordering=0, float visibleDistance=99999.0, visibleTo = getRootElement()] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''x:''' للأيقونة x احداثيات الـ&lt;br /&gt;
*'''y:''' للأيقونة y احداثيات الـ&lt;br /&gt;
*'''z:''' للأيقونة z احداثيات الـ&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''icon:''' شكل الأيقونة اختارها من الارقام التالية&lt;br /&gt;
{{Blip_Icons}}&lt;br /&gt;
*'''size:''' حجم العلامة و الحجم الافتراضي 2&lt;br /&gt;
*'''r:''' مقدار لون العلامة الاحمر من 0 الى 255. المقدار الافتراضي هو 255&lt;br /&gt;
*'''g:''' مقدار لون العلامة الاخضر من 0 الى 255. المقدار الافتراضي هو 0&lt;br /&gt;
*'''b:''' مقدار لون العلامة الازرق من 0 الى 255. المقدار الافتراضي هو 0&lt;br /&gt;
*'''a:''' مقدار الوضوح للعلامة من 0 الى 255. المقدار البدائي هو 255&lt;br /&gt;
{{New feature/item|3|1.0||&lt;br /&gt;
*'''ordering:''' This defines the blip's Z-level ordering (-32768 - 32767). Default is 0.&lt;br /&gt;
*'''visibleDistance:''' The maximum distance from the camera at which the blip is still visible&lt;br /&gt;
}}&lt;br /&gt;
*'''visibleTo:''' What elements can see the blip. Defaults to visible to everyone. See [[visibility]].&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
blip createBlip ( float x, float y, float z, [int icon=0, int size=2, int r=255, int g=0, int b=0, int a=255, &lt;br /&gt;
int ordering=0, float visibleDistance ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''x:''' للأيقونة x احداثيات الـ&lt;br /&gt;
*'''y:''' للأيقونة y احداثيات الـ&lt;br /&gt;
*'''z:''' للأيقونة z احداثيات الـ&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''icon:''' شكل الأيقونة اختارها من الارقام التالية&lt;br /&gt;
{{Blip_Icons}}&lt;br /&gt;
*'''size:''' حجم العلامة و الحجم الافتراضي هو 2&lt;br /&gt;
*'''r:''' مقدار لون العلامة الاحمر من 0 الى 255. المقدار الافتراضي هو 255&lt;br /&gt;
*'''g:''' مقدار لون العلامة الاخضر من 0 الى 255. المقدار الافتراضي هو 0&lt;br /&gt;
*'''b:''' مقدار لون العلامة الازرق من 0 الى 255. المقدار الافتراضي هو 0&lt;br /&gt;
*'''a:''' مقدار الوضوح للعلامة من 0 الى 255. المقدار البدائي هو 255&lt;br /&gt;
{{New feature/item|3|1.0||&lt;br /&gt;
*'''ordering:''' This defines the blip's Z-level ordering (-32768 - 32767). Default is 0.&lt;br /&gt;
*'''visibleDistance:''' The maximum distance from the camera at which the blip is still visible&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns an [[element]] of the [[blip]] if it was created successfully, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
'''Example 1:''' هذا المثال تقوم بصنع علامة على لاعب عشوائي يتظهر العلامة للاعب فقط&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
myPlayer = getRandomPlayer () -- احضار لاعب عشوائي&lt;br /&gt;
x,y,z = getElementPosition ( myPlayer ) -- حضار احداثيات الاعب&lt;br /&gt;
myBlip = createBlip ( x, y, z, 52, 0, 0, 0, 255, myPlayer ) -- صنع علامة نقود على احداثيات الاعب&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 2:''' This example attaches a blip to a player. You can attach a blip to an element by just setting the blip's parent to that element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Pick a random player&lt;br /&gt;
myPlayer = getRandomPlayer ()&lt;br /&gt;
-- Create a radar blip in the middle of the map&lt;br /&gt;
myBlip = createBlip ( 0, 0, 0 )&lt;br /&gt;
-- Make the player the parent of the blip, so that the blip follows the player around&lt;br /&gt;
setElementParent ( myBlip, myPlayer )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 3:''' هذا المثال يقول بصنع علامة في احداثيات 0,0,0&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
createBlip ( 0 , 0 , 0 , 37 ) -- صنع علامة في احداثيات 0,0,0&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;
{{AR/Blip_functions}}&lt;br /&gt;
&lt;br /&gt;
[[en:CreateBlip]]&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/createBlip&amp;diff=37333</id>
		<title>AR/createBlip</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/createBlip&amp;diff=37333"/>
		<updated>2013-10-18T03:51:13Z</updated>

		<summary type="html">&lt;p&gt;Tete: Title&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
هذه الوظيفة تقوم بعمل ايقونة في الخريطة تراها في الرادار مثل الايقونات الموجوده على الاعبين&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
blip createBlip ( float x, float y, float z, [int icon=0, int size=2, int r=255, int g=0, int b=0, int a=255, &lt;br /&gt;
int ordering=0, float visibleDistance=99999.0, visibleTo = getRootElement()] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''x:''' للايقونة x احداثيات الـ&lt;br /&gt;
*'''y:''' للايقونة y احداثيات الـ&lt;br /&gt;
*'''z:''' للايقونة z احداثيات الـ&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''icon:''' شكل الايقونة اختارها من الارقام التالية&lt;br /&gt;
{{Blip_Icons}}&lt;br /&gt;
*'''size:''' حجم العلامة و الحجم الافتراضي 2&lt;br /&gt;
*'''r:''' مقدار لون العلامة الاحمر من 0 الى 255. المقدار الافتراضي هو 255&lt;br /&gt;
*'''g:''' مقدار لون العلامة الاخضر من 0 الى 255. المقدار الافتراضي هو 0&lt;br /&gt;
*'''b:''' مقدار لون العلامة الازرق من 0 الى 255. المقدار الافتراضي هو 0&lt;br /&gt;
*'''a:''' مقدار الوضوح للعلامة من 0 الى 255. المقدار البدائي هو 255&lt;br /&gt;
{{New feature/item|3|1.0||&lt;br /&gt;
*'''ordering:''' This defines the blip's Z-level ordering (-32768 - 32767). Default is 0.&lt;br /&gt;
*'''visibleDistance:''' The maximum distance from the camera at which the blip is still visible&lt;br /&gt;
}}&lt;br /&gt;
*'''visibleTo:''' What elements can see the blip. Defaults to visible to everyone. See [[visibility]].&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
blip createBlip ( float x, float y, float z, [int icon=0, int size=2, int r=255, int g=0, int b=0, int a=255, &lt;br /&gt;
int ordering=0, float visibleDistance ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''x:''' للايقونة x احداثيات الـ&lt;br /&gt;
*'''y:''' للايقونة y احداثيات الـ&lt;br /&gt;
*'''z:''' للايقونة z احداثيات الـ&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''icon:''' شكل الايقونة اختارها من الارقام التالية&lt;br /&gt;
{{Blip_Icons}}&lt;br /&gt;
*'''size:''' حجم العلامة و الحجم الافتراضي هو 2&lt;br /&gt;
*'''r:''' مقدار لون العلامة الاحمر من 0 الى 255. المقدار الافتراضي هو 255&lt;br /&gt;
*'''g:''' مقدار لون العلامة الاخضر من 0 الى 255. المقدار الافتراضي هو 0&lt;br /&gt;
*'''b:''' مقدار لون العلامة الازرق من 0 الى 255. المقدار الافتراضي هو 0&lt;br /&gt;
*'''a:''' مقدار الوضوح للعلامة من 0 الى 255. المقدار البدائي هو 255&lt;br /&gt;
{{New feature/item|3|1.0||&lt;br /&gt;
*'''ordering:''' This defines the blip's Z-level ordering (-32768 - 32767). Default is 0.&lt;br /&gt;
*'''visibleDistance:''' The maximum distance from the camera at which the blip is still visible&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns an [[element]] of the [[blip]] if it was created successfully, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
'''Example 1:''' هذا المثال تقوم بصنع علامة على لاعب عشوائي يتظهر العلامة للاعب فقط&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
myPlayer = getRandomPlayer () -- احضار لاعب عشوائي&lt;br /&gt;
x,y,z = getElementPosition ( myPlayer ) -- حضار احداثيات الاعب&lt;br /&gt;
myBlip = createBlip ( x, y, z, 52, 0, 0, 0, 255, myPlayer ) -- صنع علامة نقود على احداثيات الاعب&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 2:''' This example attaches a blip to a player. You can attach a blip to an element by just setting the blip's parent to that element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Pick a random player&lt;br /&gt;
myPlayer = getRandomPlayer ()&lt;br /&gt;
-- Create a radar blip in the middle of the map&lt;br /&gt;
myBlip = createBlip ( 0, 0, 0 )&lt;br /&gt;
-- Make the player the parent of the blip, so that the blip follows the player around&lt;br /&gt;
setElementParent ( myBlip, myPlayer )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 3:''' هذا المثال يقول بصنع علامة في احداثيات 0,0,0&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
createBlip ( 0 , 0 , 0 , 37 ) -- صنع علامة في احداثيات 0,0,0&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;
{{AR/Blip_functions}}&lt;br /&gt;
&lt;br /&gt;
[[en:CreateBlip]]&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/createBlip&amp;diff=37332</id>
		<title>AR/createBlip</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/createBlip&amp;diff=37332"/>
		<updated>2013-10-18T03:47:01Z</updated>

		<summary type="html">&lt;p&gt;Tete: /* Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
هذه الوظيفة تقوم بعمل علامة في الخريطة تراها في الرادار مثل العلامات الموجوده على الاعبين&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
blip createBlip ( float x, float y, float z, [int icon=0, int size=2, int r=255, int g=0, int b=0, int a=255, &lt;br /&gt;
int ordering=0, float visibleDistance=99999.0, visibleTo = getRootElement()] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''x:''' للعلامه x احداثيات الـ&lt;br /&gt;
*'''y:''' للعلامه y احداثيات الـ&lt;br /&gt;
*'''z:''' للعلامه z احداثيات الـ&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''icon:''' شكل العلامة اختارها من الارقام التالية&lt;br /&gt;
{{Blip_Icons}}&lt;br /&gt;
*'''size:''' حجم العلامة و الحجم الافتراضي 2&lt;br /&gt;
*'''r:''' مقدار لون العلامة الاحمر من 0 الى 255. المقدار الافتراضي هو 255&lt;br /&gt;
*'''g:''' مقدار لون العلامة الاخضر من 0 الى 255. المقدار الافتراضي هو 0&lt;br /&gt;
*'''b:''' مقدار لون العلامة الازرق من 0 الى 255. المقدار الافتراضي هو 0&lt;br /&gt;
*'''a:''' مقدار الوضوح للعلامة من 0 الى 255. المقدار البدائي هو 255&lt;br /&gt;
{{New feature/item|3|1.0||&lt;br /&gt;
*'''ordering:''' This defines the blip's Z-level ordering (-32768 - 32767). Default is 0.&lt;br /&gt;
*'''visibleDistance:''' The maximum distance from the camera at which the blip is still visible&lt;br /&gt;
}}&lt;br /&gt;
*'''visibleTo:''' What elements can see the blip. Defaults to visible to everyone. See [[visibility]].&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
blip createBlip ( float x, float y, float z, [int icon=0, int size=2, int r=255, int g=0, int b=0, int a=255, &lt;br /&gt;
int ordering=0, float visibleDistance ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''x:''' للعلامه x احداثيات الـ&lt;br /&gt;
*'''y:''' للعلامه y احداثيات الـ&lt;br /&gt;
*'''z:''' للعلامه z احداثيات الـ&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''icon:''' شكل العلامة اختارها من الارقام التالية&lt;br /&gt;
{{Blip_Icons}}&lt;br /&gt;
*'''size:''' حجم العلامة و الحجم الافتراضي هو 2&lt;br /&gt;
*'''r:''' مقدار لون العلامة الاحمر من 0 الى 255. المقدار الافتراضي هو 255&lt;br /&gt;
*'''g:''' مقدار لون العلامة الاخضر من 0 الى 255. المقدار الافتراضي هو 0&lt;br /&gt;
*'''b:''' مقدار لون العلامة الازرق من 0 الى 255. المقدار الافتراضي هو 0&lt;br /&gt;
*'''a:''' مقدار الوضوح للعلامة من 0 الى 255. المقدار البدائي هو 255&lt;br /&gt;
{{New feature/item|3|1.0||&lt;br /&gt;
*'''ordering:''' This defines the blip's Z-level ordering (-32768 - 32767). Default is 0.&lt;br /&gt;
*'''visibleDistance:''' The maximum distance from the camera at which the blip is still visible&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns an [[element]] of the [[blip]] if it was created successfully, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
'''Example 1:''' هذا المثال تقوم بصنع علامة على لاعب عشوائي يتظهر العلامة للاعب فقط&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
myPlayer = getRandomPlayer () -- احضار لاعب عشوائي&lt;br /&gt;
x,y,z = getElementPosition ( myPlayer ) -- حضار احداثيات الاعب&lt;br /&gt;
myBlip = createBlip ( x, y, z, 52, 0, 0, 0, 255, myPlayer ) -- صنع علامة نقود على احداثيات الاعب&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 2:''' This example attaches a blip to a player. You can attach a blip to an element by just setting the blip's parent to that element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Pick a random player&lt;br /&gt;
myPlayer = getRandomPlayer ()&lt;br /&gt;
-- Create a radar blip in the middle of the map&lt;br /&gt;
myBlip = createBlip ( 0, 0, 0 )&lt;br /&gt;
-- Make the player the parent of the blip, so that the blip follows the player around&lt;br /&gt;
setElementParent ( myBlip, myPlayer )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 3:''' هذا المثال يقول بصنع علامة في احداثيات 0,0,0&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
createBlip ( 0 , 0 , 0 , 37 ) -- صنع علامة في احداثيات 0,0,0&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;
{{AR/Blip_functions}}&lt;br /&gt;
&lt;br /&gt;
[[en:CreateBlip]]&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/createBlip&amp;diff=37331</id>
		<title>AR/createBlip</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/createBlip&amp;diff=37331"/>
		<updated>2013-10-18T03:46:42Z</updated>

		<summary type="html">&lt;p&gt;Tete: /* Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
هذه الوظيفة تقوم بعمل علامة في الخريطة تراها في الرادار مثل العلامات الموجوده على الاعبين&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
blip createBlip ( float x, float y, float z, [int icon=0, int size=2, int r=255, int g=0, int b=0, int a=255, &lt;br /&gt;
int ordering=0, float visibleDistance=99999.0, visibleTo = getRootElement()] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''x:''' للعلامه x احداثيات الـ&lt;br /&gt;
*'''y:''' للعلامه y احداثيات الـ&lt;br /&gt;
*'''z:''' للعلامه z احداثيات الـ&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''icon:''' شكل العلامة اختارها من الارقام التالية&lt;br /&gt;
{{Blip_Icons}}&lt;br /&gt;
*'''size:''' حجم العلامة و الحجم الافتراضي 2&lt;br /&gt;
*'''r:''' مقدار لون العلامة الاحمر من 0 الى 255. المقدار الافتراضي هو 255&lt;br /&gt;
*'''g:''' مقدار لون العلامة الاخضر من 0 الى 255. المقدار الافتراضي هو 0&lt;br /&gt;
*'''b:''' مقدار لون العلامة الازرق من 0 الى 255. المقدار الافتراضي هو 0&lt;br /&gt;
*'''a:''' مقدار الوضوح للعلامة من 0 الى 255. المقدار البدائي هو 255&lt;br /&gt;
{{New feature/item|3|1.0||&lt;br /&gt;
*'''ordering:''' This defines the blip's Z-level ordering (-32768 - 32767). Default is 0.&lt;br /&gt;
*'''visibleDistance:''' The maximum distance from the camera at which the blip is still visible&lt;br /&gt;
}}&lt;br /&gt;
*'''visibleTo:''' What elements can see the blip. Defaults to visible to everyone. See [[visibility]].&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
blip createBlip ( float x, float y, float z, [int icon=0, int size=2, int r=255, int g=0, int b=0, int a=255, &lt;br /&gt;
int ordering=0, float visibleDistance ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''x:''' للعلامه x احداثيات الـ&lt;br /&gt;
*'''y:''' للعلامه y احداثيات الـ&lt;br /&gt;
*'''z:''' للعلامه z احداثيات الـ&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''icon:''' شكل العلامة اختارها من الارقام التالية&lt;br /&gt;
{{Blip_Icons}}&lt;br /&gt;
*'''size:''' حجم العلامة و الحجم الافتراضي 2&lt;br /&gt;
*'''r:''' مقدار لون العلامة الاحمر من 0 الى 255. المقدار الافتراضي هو 255&lt;br /&gt;
*'''g:''' مقدار لون العلامة الاخضر من 0 الى 255. المقدار الافتراضي هو 0&lt;br /&gt;
*'''b:''' مقدار لون العلامة الازرق من 0 الى 255. المقدار الافتراضي هو 0&lt;br /&gt;
*'''a:''' مقدار الوضوح للعلامة من 0 الى 255. المقدار البدائي هو 255&lt;br /&gt;
{{New feature/item|3|1.0||&lt;br /&gt;
*'''ordering:''' This defines the blip's Z-level ordering (-32768 - 32767). Default is 0.&lt;br /&gt;
*'''visibleDistance:''' The maximum distance from the camera at which the blip is still visible&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns an [[element]] of the [[blip]] if it was created successfully, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
'''Example 1:''' هذا المثال تقوم بصنع علامة على لاعب عشوائي يتظهر العلامة للاعب فقط&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
myPlayer = getRandomPlayer () -- احضار لاعب عشوائي&lt;br /&gt;
x,y,z = getElementPosition ( myPlayer ) -- حضار احداثيات الاعب&lt;br /&gt;
myBlip = createBlip ( x, y, z, 52, 0, 0, 0, 255, myPlayer ) -- صنع علامة نقود على احداثيات الاعب&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 2:''' This example attaches a blip to a player. You can attach a blip to an element by just setting the blip's parent to that element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Pick a random player&lt;br /&gt;
myPlayer = getRandomPlayer ()&lt;br /&gt;
-- Create a radar blip in the middle of the map&lt;br /&gt;
myBlip = createBlip ( 0, 0, 0 )&lt;br /&gt;
-- Make the player the parent of the blip, so that the blip follows the player around&lt;br /&gt;
setElementParent ( myBlip, myPlayer )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 3:''' هذا المثال يقول بصنع علامة في احداثيات 0,0,0&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
createBlip ( 0 , 0 , 0 , 37 ) -- صنع علامة في احداثيات 0,0,0&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;
{{AR/Blip_functions}}&lt;br /&gt;
&lt;br /&gt;
[[en:CreateBlip]]&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/createBlip&amp;diff=37330</id>
		<title>AR/createBlip</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/createBlip&amp;diff=37330"/>
		<updated>2013-10-18T03:45:30Z</updated>

		<summary type="html">&lt;p&gt;Tete: /* Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
هذه الوظيفة تقوم بعمل علامة في الخريطة تراها في الرادار مثل العلامات الموجوده على الاعبين&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
blip createBlip ( float x, float y, float z, [int icon=0, int size=2, int r=255, int g=0, int b=0, int a=255, &lt;br /&gt;
int ordering=0, float visibleDistance=99999.0, visibleTo = getRootElement()] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''x:''' للعلامه x احداثيات الـ&lt;br /&gt;
*'''y:''' للعلامه y احداثيات الـ&lt;br /&gt;
*'''z:''' للعلامه z احداثيات الـ&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''icon:''' شكل العلامة اختارها من الارقام التالية&lt;br /&gt;
{{Blip_Icons}}&lt;br /&gt;
*'''size:''' حجم العلامة و الحجم العادي 2&lt;br /&gt;
*'''r:''' مقدار لون العلامة الاحمر من 0 الى 255. المقدار البدائي هو 255&lt;br /&gt;
*'''g:''' مقدار لون العلامة الاخضر من 0 الى 255. المقدار البدائي هو 0&lt;br /&gt;
*'''b:''' مقدار لون العلامة الازرق من 0 الى 255. المقدار البدائي هو 0&lt;br /&gt;
*'''a:''' مقدار الوضوح للعلامة من 0 الى 255. المقدار البدائي هو 255&lt;br /&gt;
{{New feature/item|3|1.0||&lt;br /&gt;
*'''ordering:''' This defines the blip's Z-level ordering (-32768 - 32767). Default is 0.&lt;br /&gt;
*'''visibleDistance:''' The maximum distance from the camera at which the blip is still visible&lt;br /&gt;
}}&lt;br /&gt;
*'''visibleTo:''' What elements can see the blip. Defaults to visible to everyone. See [[visibility]].&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
blip createBlip ( float x, float y, float z, [int icon=0, int size=2, int r=255, int g=0, int b=0, int a=255, &lt;br /&gt;
int ordering=0, float visibleDistance ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''x:''' للعلامه x احداثيات الـ&lt;br /&gt;
*'''y:''' للعلامه y احداثيات الـ&lt;br /&gt;
*'''z:''' للعلامه z احداثيات الـ&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''icon:''' شكل العلامة اختارها من الارقام التالية&lt;br /&gt;
{{Blip_Icons}}&lt;br /&gt;
*'''size:''' The size of the radar blip. Only applicable to the ''Marker'' icon. Default is 2.&lt;br /&gt;
*'''r:''' مقدار لون العلامة الاحمر من 0 الى 255. المقدار البدائي هو 255&lt;br /&gt;
*'''g:''' مقدار لون العلامة الاخضر من 0 الى 255. المقدار البدائي هو 0&lt;br /&gt;
*'''b:''' مقدار لون العلامة الازرق من 0 الى 255. المقدار البدائي هو 0&lt;br /&gt;
*'''a:''' مقدار الوضوح للعلامة من 0 الى 255. المقدار البدائي هو 255&lt;br /&gt;
{{New feature/item|3|1.0||&lt;br /&gt;
*'''ordering:''' This defines the blip's Z-level ordering (-32768 - 32767). Default is 0.&lt;br /&gt;
*'''visibleDistance:''' The maximum distance from the camera at which the blip is still visible&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns an [[element]] of the [[blip]] if it was created successfully, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
'''Example 1:''' هذا المثال تقوم بصنع علامة على لاعب عشوائي يتظهر العلامة للاعب فقط&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
myPlayer = getRandomPlayer () -- احضار لاعب عشوائي&lt;br /&gt;
x,y,z = getElementPosition ( myPlayer ) -- حضار احداثيات الاعب&lt;br /&gt;
myBlip = createBlip ( x, y, z, 52, 0, 0, 0, 255, myPlayer ) -- صنع علامة نقود على احداثيات الاعب&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 2:''' This example attaches a blip to a player. You can attach a blip to an element by just setting the blip's parent to that element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Pick a random player&lt;br /&gt;
myPlayer = getRandomPlayer ()&lt;br /&gt;
-- Create a radar blip in the middle of the map&lt;br /&gt;
myBlip = createBlip ( 0, 0, 0 )&lt;br /&gt;
-- Make the player the parent of the blip, so that the blip follows the player around&lt;br /&gt;
setElementParent ( myBlip, myPlayer )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 3:''' هذا المثال يقول بصنع علامة في احداثيات 0,0,0&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
createBlip ( 0 , 0 , 0 , 37 ) -- صنع علامة في احداثيات 0,0,0&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;
{{AR/Blip_functions}}&lt;br /&gt;
&lt;br /&gt;
[[en:CreateBlip]]&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/%D9%85%D9%82%D8%AF%D9%85%D9%87_%D9%81%D9%8A_%D8%A7%D9%84%D8%A8%D8%B1%D9%85%D8%AC%D9%87&amp;diff=37203</id>
		<title>AR/مقدمه في البرمجه</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/%D9%85%D9%82%D8%AF%D9%85%D9%87_%D9%81%D9%8A_%D8%A7%D9%84%D8%A8%D8%B1%D9%85%D8%AC%D9%87&amp;diff=37203"/>
		<updated>2013-09-19T12:09:18Z</updated>

		<summary type="html">&lt;p&gt;Tete: /* About command handlers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;p align=&amp;quot;right&amp;quot;&amp;gt;  &lt;br /&gt;
السكربتات جزء أساسي في تشغيل MTA فتستطيع بإستخدامهم إنشاء تطبيقات لتحسين اللعب ، تختلف أنواع السكربتات فمنها خريطة أو وضع للعب &amp;quot; freeroam , race , deathmatch &amp;quot; وغيرها ..&lt;br /&gt;
&lt;br /&gt;
برمجة السكربتات تعتمد على لغة البرمجة (Lua) [www.lua.org] .&lt;br /&gt;
لغة البرمجة تعتمد إعتماداً كلياً على اللغة الإنجليزية , فيجب أن تكون لديك خلفية في اللغة الإنجليزية قبل المتابعة.&lt;br /&gt;
لبرمجة سكربت ما تحتاج لمحرر .. ويفضل إستخدام محرر إحترافي لكي يسهل عليك البرمجة مثل :&lt;br /&gt;
*Notepad++ [http://notepad-plus-plus.org/download]&lt;br /&gt;
*Lua Edit [http://luaedit.sourceforge.net/ LuaEdit]&lt;br /&gt;
لكن يفضل إستخدام برنامج MTASE فهو يسهل عملية إنشاء السكربتات وبرمجتها :&lt;br /&gt;
* [[MTASE|MTA Script Editor]].'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==إنشاء سكربت ==&lt;br /&gt;
سوف نتعلم كيف نقوم بإنشاء سكربت يدخل اللاعب إلى اللعبة .. خطوة بحطوة&lt;br /&gt;
===أين مسار كل البرامج النصية (السكريبتات أو المودات)؟===&lt;br /&gt;
الان نتعرف على مجلد المودات أو السكربتات.&lt;br /&gt;
اذهب إلى مجلد Multi Theft Auto واتبع المسار التالي:&lt;br /&gt;
&lt;br /&gt;
	/Your MTA Server/mods/deathmatch/resources/&lt;br /&gt;
&lt;br /&gt;
سترى الكثير من الملفات. ربما ترى مجلدات صيغتها .zip أو مجلد عادي , وجميعها يقبله الـ MTA ..&lt;br /&gt;
ولإنشاء المودات الخاصة بك: قم بعمل مجلد جديد واجعل اسمه كما تريد فمثلاً قم بتسميته &amp;quot;myserver&amp;quot; وهو الذي سنستخدمه بالبرنامج التعليمي&lt;br /&gt;
والان يجب أن يكون مسار المجلد الذي قمت بعمله هذا:&lt;br /&gt;
&lt;br /&gt;
	/Your MTA Server/mods/deathmatch/resources/myserver/&lt;br /&gt;
&lt;br /&gt;
* myserver: اسم المجلد الذي قمت بتسميته&lt;br /&gt;
&lt;br /&gt;
===تعريف السكربت (إضافة ملف meta.xml)===&lt;br /&gt;
حتى يستطيع السيرفر من معرفة المودات, يجب علينا إنشاء ملف meta.xml &lt;br /&gt;
&amp;quot; ويكون بداخل مجلد السكربت الذي قمنا بإنشائه وهو &amp;quot;myserver&amp;quot; &lt;br /&gt;
ولإنشاء ملف meta.xml : أفتح ملف نصي جديد وقم بتسميته meta.xml وافتحه باستخدام المفكرة =)&lt;br /&gt;
ولا تنسى ان يكون بداخل مجلد السكربت .&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
أدخل الكود التالي في ملف ''meta.xml'':&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
     &amp;lt;info author=&amp;quot;إسمك&amp;quot; type=&amp;quot;gamemode&amp;quot; name=&amp;quot;إسم السكربت&amp;quot; description=&amp;quot;وصف بسيط للسكربت&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;script src=&amp;quot;script.lua&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
هنا يتم تعريف أجزاء السكربت فمثلاً :&lt;br /&gt;
* &amp;lt;info ..&amp;gt;&lt;br /&gt;
تضع فيه بيانات السكربت .. مثل الإسم والنوع والوصف&lt;br /&gt;
* type=&amp;quot;gamemode&amp;quot;&lt;br /&gt;
تعني أن نوع السكربت هو مود لعب وتوجد أنواع عديدة مثل :&lt;br /&gt;
**gamemode&lt;br /&gt;
**map&lt;br /&gt;
**script&lt;br /&gt;
&lt;br /&gt;
===إنشاء ملف السكربت Lua===&lt;br /&gt;
قمنا بوضع هذا السطر في :&lt;br /&gt;
*meta.xml&lt;br /&gt;
:&lt;br /&gt;
		&amp;lt;script src=&amp;quot;script.lua&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
الآن نقوم بإنشاء ملف نصي بنفس الإسم&lt;br /&gt;
**script.lua&lt;br /&gt;
بإستخدام برنامج التحرير لديك .. نقوم بإنشاء الكود&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function joinHandler() -- الوظيفة .. وبعدها نقوم بكتابة الإسم&lt;br /&gt;
	local x = 1959.55 -- تعريف x&lt;br /&gt;
	local y = -1714.46 -- تعريف y&lt;br /&gt;
	local z = 10 -- تعريف z&lt;br /&gt;
	spawnPlayer(source, x, y, z) -- نقوم بإستخدام هذه الوظيفة لإنتاج اللاعب ونقوم بتحديد اللاعب وهو المصدر : source&lt;br /&gt;
	fadeCamera(source, true) -- نقوم بعمل fade للكاميرا&lt;br /&gt;
	setCameraTarget(source, source) -- نجعل هدف الكاميرا هو اللاعب &lt;br /&gt;
	outputChatBox(&amp;quot;مرحباً بك في السيرفر&amp;quot;, source) -- نقوم بإخراج نص في الدردشة&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerJoin&amp;quot;, getRootElement(), joinHandler) -- نقوم بإضافة المعالج حيث سيتم تشغيله بعد الحدث المحدد وهو عند دخول اللا&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
وصف وشرح الكود اعلاه : &lt;br /&gt;
	سيقوم السكربت بوضع اللاعب في الاحداثيات (x,y,z) المحدده اعلاه, عند دخوله الى السيرفر&lt;br /&gt;
	لاحظ انه يجب استخدام  وظيفة [ ''fadeCamera'' ] ستكون الشاشة سوداء وأيضاً يجب تعيين الكاميرا ( setTargetCamera ) ..&lt;br /&gt;
&lt;br /&gt;
نرى أن '''source''' هو المصدر وهو اللاعب الذي يقوم بالدخول &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
أيضاً لو رأينا في المعالج &lt;br /&gt;
*[[addEventHandler]] - إضافة معالج للحدث&lt;br /&gt;
نرى 3 أشياء&lt;br /&gt;
*: onPlayerJoin - عند دخول اللاعب&lt;br /&gt;
وهو الحدث .. حيث يحدد متى يتم تشغيل المعالج - في هذه الحالة عند دخول اللاعب&lt;br /&gt;
*getRootElement() - جلب العنصر الحالي&lt;br /&gt;
هذا يقوم بتعيين العنصر الذي يقوم بتشغيل الحدث &lt;br /&gt;
*joinHandler &lt;br /&gt;
وهو إسم الوظيفة التي قمنا بصناعتها &lt;br /&gt;
&lt;br /&gt;
يمكنك التوسع أكثر في : [[addEventHandler]]&lt;br /&gt;
&lt;br /&gt;
===تشغيل السكربت===&lt;br /&gt;
بعد أن تقوم بحفظ أجزاء السكربت في ملف واحد ويمكن حفظه في الملفات التالية :&lt;br /&gt;
* مجلد&lt;br /&gt;
* أرشيف .zip&lt;br /&gt;
ونقوم بنسخه إلى مجلد السكربتات داخل سيرفرك ونقوم بتشغيله بالطريقة العادية.&lt;br /&gt;
&lt;br /&gt;
الآن إنتهينا من صنع السكربت .. بعد هذا سنقوم بصنع سكربت مع أمر &lt;br /&gt;
* command&lt;br /&gt;
يمكنك المتابعة أو الذهاب إلى دورة صناعة النوافذ&lt;br /&gt;
*[[Introduction to Scripting GUI]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==صناعة أمر بسيط==&lt;br /&gt;
لنعد الآن إلى ملف&lt;br /&gt;
*script.lua&lt;br /&gt;
ونقوم بتعديله قليلاً لإنشاء أمر بسيط يقوم بإنشاء سيارة بجانب اللاعب&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- في البداية نقوم بكتب وظيفة إنشاء السيارة&lt;br /&gt;
function createVehicleForPlayer(thePlayer, command, vehicleModel)&lt;br /&gt;
   -- هنا نقوم بكتابة وظيفة إنشاء السيارة كـ&lt;br /&gt;
   -- createVehicle&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- نقوم بإضافة الأمر&lt;br /&gt;
addCommandHandler(&amp;quot;createvehicle&amp;quot;, createVehicleForPlayer) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
''ملاحظة: يمكنك الضغط على الوظائف والتعمق فيها بداخل الويكي.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== الوظيفة ==&lt;br /&gt;
الوظيفة هي شيء يسمى&lt;br /&gt;
&lt;br /&gt;
function&lt;br /&gt;
&lt;br /&gt;
الوظيفة هي الشيء التي يتكون عليها الحدث&lt;br /&gt;
&lt;br /&gt;
يمكنك ان تسمي الوظيفة كما شئت ويمكنك أيضاً عدم وضع اسم للوظيفة&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''مثال لـ وظيفة لها إسم'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function arabs( ) -- الوظيفة&lt;br /&gt;
    outputChatBox(&amp;quot;مرحباً بك&amp;quot;) --s  ستلاحظ بـ أن كلمة &amp;quot; مرحباً بك &amp;quot; ظهرت في الشات عند دخول الاعب &lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerJoin&amp;quot;, root, arabs) -- .الحدث مع اسم الوظيفة&lt;br /&gt;
-- root = getRootElement()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''مثال لـ وظيفة ليس لها إسم'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerWasted&amp;quot;, root,&lt;br /&gt;
function(_,killer)&lt;br /&gt;
    outputChatBox( killer .. &amp;quot; من قبل&amp;quot; .. getPlayerName(source) .. &amp;quot; لقد قُتل الاعب&amp;quot; )&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
كما تلاحظ ووضع قوس قريباً من&lt;br /&gt;
&lt;br /&gt;
end)&lt;br /&gt;
&lt;br /&gt;
هذا القوس يكمل القوس الآخر كما نلاحظ في الحدث &lt;br /&gt;
&lt;br /&gt;
addEventHandler(&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== الحدث ==&lt;br /&gt;
الحدث هو شيء يسمى&lt;br /&gt;
&lt;br /&gt;
event&lt;br /&gt;
&lt;br /&gt;
الحدث هو الذي يتكون على بناء الوظيفة&lt;br /&gt;
فـ اذا رجعنا الى الامثلة التي في الاعلى سوف نرى عدة احداث ومنها&lt;br /&gt;
&lt;br /&gt;
[[onPlayerWasted]]&lt;br /&gt;
&lt;br /&gt;
الحدث ببساطة يحدد متى سوف تحدث او كيف سوف تحدث الوظائف التي ادخلتها&lt;br /&gt;
&lt;br /&gt;
onPlayerWasted&lt;br /&gt;
&lt;br /&gt;
عند موت الاعب&lt;br /&gt;
&lt;br /&gt;
'''مثال للحدث'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function onJoin()&lt;br /&gt;
    x, y, z = getElementPosition(source) -- s يآتي بمكان الاعب x, y, z&lt;br /&gt;
	    local theVehicle = createVehicle(445, x, y, z) -- s السيارة التي سـ تصنع بمكان الاعب الذي تم تحديده مسبقاً&lt;br /&gt;
		    warpPedIntoVehicle(source, theVehicle) -- s يجعل الاعب داخل السيارة&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerJoin&amp;quot;, root, onJoin) -- s الحدث&lt;br /&gt;
-- root = getRootElement()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
هذه الوظيفة مع هذا الحدث سوف يعطون الاعب سيارة عند دخوله السيرفر&lt;br /&gt;
&lt;br /&gt;
ملاحظة الحدث ليس دائم على الوظيفة فـ أيصاً يمكنك تكوين هذه الوظيفة على حدث آخر&lt;br /&gt;
&lt;br /&gt;
'''مثال'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function onJoin()&lt;br /&gt;
    x, y, z = getElementPosition(source)&lt;br /&gt;
	    local theVehicle = createVehicle(445, x, y, z)&lt;br /&gt;
		    warpPedIntoVehicle(source, theVehicle)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerLogin&amp;quot;, root, onJoin)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
هذا سوف يعطي الاعب سيارة لاكن ليس عند دخوله السيرفر , إنما عند دخوله حسابه&lt;br /&gt;
&lt;br /&gt;
'''Edit'''&lt;br /&gt;
&lt;br /&gt;
مثال آخر&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onVehicleExplode&amp;quot;,root, -- نضيف حدث عند إنفجار اي سيارة&lt;br /&gt;
    function() -- الوظيفة&lt;br /&gt;
        setTimer(destroyElement,5000,1,source) -- يخفي السيارة بعد 5 ثواني من انفاجرها &lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
يمكنك ان تجد&lt;br /&gt;
الاحداث&lt;br /&gt;
والوظائف &lt;br /&gt;
كلنت وسيرفر&lt;br /&gt;
هنا&lt;br /&gt;
&lt;br /&gt;
كلنت:&lt;br /&gt;
&lt;br /&gt;
'''وظائف كلنت'''&lt;br /&gt;
&lt;br /&gt;
http://wiki.multitheftauto.com/wiki/Client_Scripting_Functions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''احداث كلنت'''&lt;br /&gt;
&lt;br /&gt;
http://wiki.multitheftauto.com/wiki/Client_Scripting_Events&lt;br /&gt;
&lt;br /&gt;
سيرفر:&lt;br /&gt;
&lt;br /&gt;
'''وظائف سيرفر'''&lt;br /&gt;
&lt;br /&gt;
http://wiki.multitheftauto.com/wiki/Server_Scripting_Functions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''احداث سيرفر'''&lt;br /&gt;
&lt;br /&gt;
http://wiki.multitheftauto.com/wiki/Server_Scripting_Events&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== String الـ ==&lt;br /&gt;
السترنج هو شيء يوجد في بعض الوظايف التي توجد داخل الام تي اي&lt;br /&gt;
&lt;br /&gt;
مثلاً&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;,resourceRoot, -- الايفنت هنا يجب ان تكون بين سترنق كما الموضح هنا&lt;br /&gt;
    function()&lt;br /&gt;
        outputChatBox(&amp;quot;تم بدء السكربت&amp;quot;) -- s هنا سوف يظهر رسالة بالشات &amp;quot; تم بدء السكربت &amp;quot; عند بدء السكربت ويجب ان تكون سترنق&lt;br /&gt;
    end&lt;br /&gt;
) -- نهاية قوس الحدث&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
السترنق له عدة أشكال , فيمكن ان يكون كالآتي&lt;br /&gt;
&lt;br /&gt;
&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
أو&lt;br /&gt;
&lt;br /&gt;
' '&lt;br /&gt;
&lt;br /&gt;
أو&lt;br /&gt;
&lt;br /&gt;
[[]]&lt;br /&gt;
&lt;br /&gt;
فمثلاً اذا نريد ان نخرج رسالة بعلبة الشات&lt;br /&gt;
&lt;br /&gt;
يمكن ان تكون كذلك &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
outputChatBox([[مرحباً]])&lt;br /&gt;
&lt;br /&gt;
-- أو كذلك&lt;br /&gt;
outputChatBox('مرحباً')&lt;br /&gt;
&lt;br /&gt;
-- أو كذلك&lt;br /&gt;
&lt;br /&gt;
outputChatBox(&amp;quot;مرحباً&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Command handlerعن الـ====&lt;br /&gt;
.(`) أو زر F8 التي يمكن للاعب ان يعرضها باستخدام زر Consoleهو اسم الامر الذي يمكن للاعب ان يدخله في الـ [[addCommandHandler]] في argument أول&lt;br /&gt;
&lt;br /&gt;
.&amp;quot;createVehicleForPlayer&amp;quot;هي وظيفة تُنفذ عند كتابة اللاعب الامر في هذه الحالة لـ [[addCommandHandler]] في argument ثاني&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:اذا كنت متمرس في البرمجة, ستعرف انك ستحتاج ان تنفذ وظيفة مثل&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
functionName(argument1, argument2, argument3, ..)&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;
functionName(thePlayer, commandName, argument3, ..)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If we have a closer look on the lower example above, we can see argument1 is thePlayer and argument2 the commandName. thePlayer is simply the one who typed the command, so whatever you call it, the variable will contain the player who activated the command. commandName is simply the command they typed. So if they typed &amp;quot;/greet&amp;quot;, this argument will contain &amp;quot;greet&amp;quot;. Argument 3 is something extra the player typed, you'll learn it a little bit further in the tutorial. Never forget that the first 2 arguments are standard arguments, but you can name them to anything you want.&lt;br /&gt;
&lt;br /&gt;
We called the [[addCommandHandler]] function this way already and since ''createVehicleForPlayer'' is a function too, it can be called that way as well. But we are using a command handler for that, which calls it in a similiar manner, internally.&lt;br /&gt;
&lt;br /&gt;
For example: Someone types &amp;quot;createvehicle 468&amp;quot; ingame in the console to spawn a Sanchez, the command handler calls the createVehicleForPlayer function, as '''if''' we would have this line of code in the script:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
createVehicleForPlayer(thePlayer,&amp;quot;createvehicle&amp;quot;,&amp;quot;468&amp;quot;) -- thePlayer is the player element of the player who entered the command&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
As we can see, it provides several parameters: the player who called the command, the command he entered and whatever text he had after that, in this case &amp;quot;468&amp;quot; as vehicle id for the Sanchez. The first two parameters are the same with all command handlers, which you can read on the [[addEventHandler]] page. For this fact, you always have to define at least those two parameters to use any after that (for example to process text that was entered after the command, like in our example the vehicle model id).&lt;br /&gt;
&lt;br /&gt;
''Note: You have to add the command handler AFTER you defined the handler function, else it can't find it. The order of execution matters.''&lt;br /&gt;
&lt;br /&gt;
====Writing the function====&lt;br /&gt;
In order to fill the function we created, we need to think about what we have to do:&lt;br /&gt;
* Get the players position, so we know where to spawn the vehicle (we want it to appear right beside the player)&lt;br /&gt;
* Calculate the position we want to spawn the vehicle at (we don't want it to appear in the player)&lt;br /&gt;
* Spawn the vehicle&lt;br /&gt;
* Check if it has been spawned successfully, or output a message&lt;br /&gt;
&lt;br /&gt;
In order to achieve our goals, we have to use several functions. To find function we need to use, we should visit the [[Scripting Functions|Server Functions List]]. First we need a function to get the players position. Since players are Elements, we first jump to the '''Element functions''' where we find the [[getElementPosition]] function. By clicking on the function name in the list, you get to the function description. There we can see the syntax, what it returns and usually an example. The syntax shows us what arguments we can or have to submit.&lt;br /&gt;
&lt;br /&gt;
For [[getElementPosition]], the syntax is:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
float, float, float getElementPosition ( element theElement )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The three ''float'' in front of the function name are the return type. In this case it means the function returns three floating point numbers. (x, y and z) Within the parentheses, you can see what arguments you have to submit. In this case only the element whose position you want to get, which is the player in our example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createVehicleForPlayer(thePlayer, command, vehicleModel)&lt;br /&gt;
	-- get the position and put it in the x,y,z variables&lt;br /&gt;
	-- (local means, the variables only exist in the current scope, in this case, the function)&lt;br /&gt;
	local x,y,z = getElementPosition(thePlayer)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we want to ensure that the vehicle won't spawn directly in the player, so we add a few units to the ''x'' variable, which will make it spawn east from the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createVehicleForPlayer(thePlayer, command, vehicleModel)&lt;br /&gt;
	local x,y,z = getElementPosition(thePlayer) -- get the position of the player&lt;br /&gt;
	x = x + 5 -- add 5 units to the x position&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we need another function, one to spawn a vehicle. We once again search for it on the [[Scripting Functions|Server Functions List]], this time - since we are talking about vehicles - in the '''Vehicle functions''' section, where we will choose [[createVehicle]]. In this function's syntax, we only have one return type (which is more common), a vehicle element that points to the vehicle we just created. Also, we see that some arguments are enclosed within [ ] which means that those are optional.&lt;br /&gt;
&lt;br /&gt;
We already have all arguments we need for [[createVehicle]] in our function: The position we just calculated in the ''x,y,z'' variables and the model id that we provided through the command (&amp;quot;createvehicle 468&amp;quot;) and can access in the function as ''vehicleModel'' variable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createVehicleForPlayer(thePlayer, command, vehicleModel)&lt;br /&gt;
	local x,y,z = getElementPosition(thePlayer) -- get the position of the player&lt;br /&gt;
	x = x + 5 -- add 5 units to the x position&lt;br /&gt;
	-- create the vehicle and store the returned vehicle element in the ''createdVehicle'' variable&lt;br /&gt;
	local createdVehicle = createVehicle(tonumber(vehicleModel),x,y,z)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course this code can be improved in many ways, but at least we want to add a check whether the vehicle was created successfully or not. As we can read on the [[createVehicle]] page under '''Returns''', the function returns ''false'' when it was unable to create the vehicle. Thus, we check the value of the ''createVehicle'' variable.&lt;br /&gt;
&lt;br /&gt;
Now we have our complete script:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createVehicleForPlayer(thePlayer, command, vehicleModel)&lt;br /&gt;
	local x,y,z = getElementPosition(thePlayer) -- get the position of the player&lt;br /&gt;
	x = x + 5 -- add 5 units to the x position&lt;br /&gt;
	local createdVehicle = createVehicle(tonumber(vehicleModel),x,y,z)&lt;br /&gt;
	-- check if the return value was ''false''&lt;br /&gt;
	if (createdVehicle == false) then&lt;br /&gt;
		-- if so, output a message to the chatbox, but only to this player.&lt;br /&gt;
		outputChatBox(&amp;quot;Failed to create vehicle.&amp;quot;,thePlayer)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;createvehicle&amp;quot;, createVehicleForPlayer)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, we introduced another function with [[outputChatBox]]. By now, you should be able to explore the function's documentation page yourself. For more advanced scripting, please check out the [[Map manager|Map Manager]].&lt;br /&gt;
&lt;br /&gt;
==What you need to know==&lt;br /&gt;
You already read some things about resources, command handlers and finding functions in the documentation in the first paragraph, but there is much more to learn. This section will give you a rather short overview over some of these things, while linking to related pages if possible.&lt;br /&gt;
===Clientside and Serverside scripts===&lt;br /&gt;
You may have already noticed these or similiar terms (Server/Client) somewhere on this wiki, mostly in conjunction with functions. MTA not only supports scripts that run on the server and provide commands (like the one we wrote above) or other features, but also scripts that run on the MTA client the players use to connect to the server. The reason for this is, that some features MTA provides have to be clientside (like a GUI - Graphical User Interface), others should be because they work better and still others are better off to be serverside or just don't work clientside.&lt;br /&gt;
&lt;br /&gt;
Most scripts you will make (gamemodes, maps) will probably be serverside, like the one we wrote in the first section. If you run into something that can't be solved serverside, you will probably have to make it clientside. For a clientside script for example, you would create a ordinary script file (for example called ''client.lua'') and specify it in the meta.xml, like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script src=&amp;quot;client.lua&amp;quot; type=&amp;quot;client&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The ''type'' attribute defaults to 'server', so you only need to specify it for clientside scripts. When you do this, the clientside script will be downloaded to the player's computer once he connects to the server. Read more about [[Client side scripts]].&lt;br /&gt;
&lt;br /&gt;
===More complex resources===&lt;br /&gt;
The previous section showed briefly how to add clientside scripts to the resource, but there is also much more possible. As mentioned at the very top of this page, resources can be pretty much everything. Their purpose is defined by what they do. Let's have some theoretical resources, by looking at the files it contains, the ''meta.xml'' and what they might do:&lt;br /&gt;
&lt;br /&gt;
====First example - A utility script====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
/admin_commands&lt;br /&gt;
	/meta.xml&lt;br /&gt;
	/commands.lua&lt;br /&gt;
	/client.lua&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
	&amp;lt;info author=&amp;quot;Someguy&amp;quot; description=&amp;quot;admin commands&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;commands.lua&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;client.lua&amp;quot; type=&amp;quot;client&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The ''commands.lua'' provides some admin commands, like banning a player, muting or something else that can be used to admin the server&lt;br /&gt;
* The ''client.lua'' provides a GUI to be able to perform the mentioned actions easily&lt;br /&gt;
&lt;br /&gt;
This example might be running all the time (maybe even auto-started when the server starts) as it's useful during the whole gaming experience and also wont interfere with the gameplay, unless an admin decides to take some action of course.&lt;br /&gt;
&lt;br /&gt;
====Second example - A gamemode====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
/counterstrike&lt;br /&gt;
	/meta.xml&lt;br /&gt;
	/counterstrike.lua&lt;br /&gt;
	/buymenu.lua&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
	&amp;lt;info author=&amp;quot;Someguy&amp;quot; description=&amp;quot;Counterstrike remake&amp;quot; type=&amp;quot;gamemode&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;counterstrike.lua&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;buymenu.lua&amp;quot; type=&amp;quot;client&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The ''counterstrike.lua'' contains similiar to the following features:&lt;br /&gt;
** Let players choose their team and spawn them&lt;br /&gt;
** Provide them with weapons, targets and instructions (maybe read from a Map, see below)&lt;br /&gt;
** Define the game's rules, e.g. when does the round end, what happens when a player dies&lt;br /&gt;
** .. and maybe some more&lt;br /&gt;
* The ''buymenu.lua'' is a clientside script and creates a menu to buy weapons&lt;br /&gt;
&lt;br /&gt;
This example can be called a gamemode, since it not only intereferes with the gameplay, but actually defines the rules of it. The ''type'' attribute indicates that this example works with the [[Map manager]], yet another resource that was written by the QA Team to manage gamemodes and map loading. It is highly recommended that you base your gamemodes on the techniques it provides.&lt;br /&gt;
&lt;br /&gt;
This also means that the gamemode probably won't run without a map. Gamemodes should always be as generic as possible. An example for a map is stated in the next example.&lt;br /&gt;
&lt;br /&gt;
====Third example - A Map====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
/cs-airport&lt;br /&gt;
	/meta.xml&lt;br /&gt;
	/airport.map&lt;br /&gt;
	/airport.lua&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
	&amp;lt;info author=&amp;quot;Someguy&amp;quot; description=&amp;quot;Counterstrike airport map&amp;quot; type=&amp;quot;map&amp;quot; gamemodes=&amp;quot;counterstrike&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;map src=&amp;quot;airport.map&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;airport.lua&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The ''airport.map'' in a XML file that provides information about the map to the gamemode, these may include:&lt;br /&gt;
** Where the players should spawn, with what weapons, what teams there are&lt;br /&gt;
** What the targets are&lt;br /&gt;
** Weather, World Time, Timelimit&lt;br /&gt;
** Provide vehicles&lt;br /&gt;
* The ''airport.lua'' might contain map-specific features, that may include:&lt;br /&gt;
** Opening some door/make something explode when something specific happens&lt;br /&gt;
** Create or move some custom objects, or manipulate objects that are created through the .map file&lt;br /&gt;
** .. anything else map-specific you can think of&lt;br /&gt;
&lt;br /&gt;
As you can see, the ''type'' attribute changed to 'map', telling the [[Map manager]] that this resource is a map, while the ''gamemodes'' attribute tells it for which gamemodes this map is valid, in this case the gamemode from the above example.&lt;br /&gt;
What may come as a surprise is that there is also a script in the Map resource. Of course this is not necessarily needed in a map, but opens a wide range of possibilities for map makers to create their own world within the rules of the gamemode they create it for.&lt;br /&gt;
&lt;br /&gt;
The ''airport.map'' file might look similiar to this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;map mode=&amp;quot;deathmatch&amp;quot; version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;terrorists&amp;gt;&lt;br /&gt;
		&amp;lt;spawnpoint posX=&amp;quot;2332.23&amp;quot; posY=&amp;quot;-12232.33&amp;quot; posZ=&amp;quot;4.42223&amp;quot; skins=&amp;quot;23-40&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/terrorists&amp;gt;&lt;br /&gt;
	&amp;lt;counterterrorists&amp;gt;&lt;br /&gt;
		&amp;lt;spawnpoint posX=&amp;quot;2334.23443&amp;quot; posY=&amp;quot;-12300.233&amp;quot; posZ=&amp;quot;10.2344&amp;quot; skins=&amp;quot;40-50&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/counterterrorists&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;bomb posX=&amp;quot;23342.23&amp;quot; posY=&amp;quot;&amp;quot; posZ=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	&amp;lt;vehicle posX=&amp;quot;&amp;quot; posY=&amp;quot;&amp;quot; posZ=&amp;quot;&amp;quot; model=&amp;quot;602&amp;quot; /&amp;gt;	&lt;br /&gt;
	&amp;lt;vehicle posX=&amp;quot;&amp;quot; posY=&amp;quot;&amp;quot; posZ=&amp;quot;&amp;quot; model=&amp;quot;603&amp;quot; /&amp;gt;	&lt;br /&gt;
&amp;lt;/map&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a gamemode is started with a map, the map resources is automatically started by the mapmanager and the information it contains can be read by the gamemode resource. When the map changes, the current map resource is stopped and the next map resource is started. For a more in-depth explanation and examples of how map resources are utilized in the main script, please visit the [[Writing Gamemodes]] page.&lt;br /&gt;
&lt;br /&gt;
===Events===&lt;br /&gt;
Events are the way MTA tells scripts about things that happen. For example when a player dies, the [[onPlayerWasted]] event is triggered. In order to perform any actions when a player dies, you have to prepare yourself similiar to adding a command handler, as shown in [[#Writing_the_script|the first chapter]].&lt;br /&gt;
&lt;br /&gt;
This example will output a message with the name of the player who died:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function playerDied(totalAmmo, killer, killerWeapon, bodypart)&lt;br /&gt;
	outputChatBox(getPlayerName(source)..&amp;quot; died!&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerWasted&amp;quot;,getRootElement(),playerDied)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instead of showing what arguments are needed, the documentation page for Events shows what parameters are passed to the handler function, similiar to the way a [[#About_command_handlers|command handler]] does, just that it is different from event to event. Another important point is the ''source'' variable, that exists in handler functions. It doesn't have to be added to the parameter list of the function, but it still exists. It has a different value from event to event, for player events (as in the example above) it is the player element. As another example, you can take a look at the basic spawning player script in the first section to get an idea how ''source'' is used.&lt;br /&gt;
&lt;br /&gt;
==Where to go from here==&lt;br /&gt;
You should now be familiar with the most basic aspects of MTA scripting and also a bit with the documentation. The [[Main Page]] provides you with links to more information, Tutorials and References that allow a deeper look into the topics you desire to learn about.&lt;br /&gt;
&lt;br /&gt;
From here we recommend reading the [[debugging]] tutorial. Good debugging skills are an absolute necessity when you are making scripts.&lt;br /&gt;
&lt;br /&gt;
[[ru:Scripting Introduction]]&lt;br /&gt;
[[it:Introduzione allo scripting]]&lt;br /&gt;
[[es:Introducción a la Programación]]&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Scripting_Introduction&amp;diff=37202</id>
		<title>Scripting Introduction</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Scripting_Introduction&amp;diff=37202"/>
		<updated>2013-09-19T11:47:16Z</updated>

		<summary type="html">&lt;p&gt;Tete: Added arabic language to In other languages list.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Resources are a key part of MTA. A resource is essentially a folder or zip file that contains a collection of files, plus a meta file that describes to the server how the resource should be loaded and what files it does contain. A resource can be seen as being partly equivalent to a program running in an operating system - it can be started and stopped, and multiple resources can run at once.&lt;br /&gt;
&lt;br /&gt;
Everything that has to do with scripting happens in resources, what a resource does defines if it is a gamemode, a map or anything else. MTA comes with resources that you can optionally use in your gamemodes, such as maplimits to keep playings within a playing area or deathpickups to create weapon pickups.&lt;br /&gt;
{{tip|Your first step to begin Lua scripting should be using an Lua editor. This makes scripting much easier. We recommend [http://notepad-plus.sourceforge.net/uk/site.htm Notepad++] or [http://luaedit.sourceforge.net/ LuaEdit]. There is also an unofficial [[MTASE|MTA Script Editor]] (in work-in-progress state) that you can test out.}}&lt;br /&gt;
&lt;br /&gt;
==Creating a working script==&lt;br /&gt;
We will first learn how to make a basic script that lets the player walk around in the city, step by step.&lt;br /&gt;
===Where are all the scripts?===&lt;br /&gt;
Let's take a look at the script's file structure. Go to your MTA Server folder, and follow the path below:&lt;br /&gt;
&lt;br /&gt;
	server/mods/deathmatch/resources/&lt;br /&gt;
&lt;br /&gt;
You will see a lot of .zip files, which are the packaged sample scripts shipped with MTA. Each file is a &amp;quot;resource&amp;quot;, and they will all be unzipped and loaded by the server when it starts. To create your own resource, simply make a folder with your preferred name. We'll use &amp;quot;myserver&amp;quot; for this tutorial.&lt;br /&gt;
&lt;br /&gt;
Now you should be under this directory: &lt;br /&gt;
&lt;br /&gt;
	server/mods/deathmatch/resources/myserver/&lt;br /&gt;
&lt;br /&gt;
===Identifying your resource===&lt;br /&gt;
In order to let the server know what's in the resource, a ''meta.xml'' file must be created to list the resource's content. It must be located in the resource's root directory, which is the &amp;quot;myserver&amp;quot; folder in our case. So create a text file and name it &amp;quot;meta.xml&amp;quot;, and open it with notepad.&lt;br /&gt;
&lt;br /&gt;
Enter the following codes in the ''meta.xml'' file:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
     &amp;lt;info author=&amp;quot;YourName&amp;quot; type=&amp;quot;gamemode&amp;quot; name=&amp;quot;My Server&amp;quot; description=&amp;quot;My first MTA server&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;script src=&amp;quot;script.lua&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
In the ''&amp;lt;info /&amp;gt;'' tag, there's a &amp;quot;type&amp;quot; field which indicates that the resource is a ''gamemode'' instead of a regular include or a ''map'', which will be explained later. A gamemode is what you need to make a stand-alone server. &lt;br /&gt;
&lt;br /&gt;
The ''&amp;lt;script /&amp;gt;'' tag indicates the script files contained in the resource, which we will create next.&lt;br /&gt;
===Creating a simple script===&lt;br /&gt;
Note that in the ''&amp;lt;script /&amp;gt;'' tag above, the .lua file is not under another directory. Therefore we'll create the file in the same folder as meta.xml. Now you can copy and paste the following code into script.lua:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local spawnX, spawnY, spawnZ = 1959.55, -1714.46, 10&lt;br /&gt;
function joinHandler()&lt;br /&gt;
	spawnPlayer(source, spawnX, spawnY, spawnZ)&lt;br /&gt;
	fadeCamera(source, true)&lt;br /&gt;
	setCameraTarget(source, source)&lt;br /&gt;
	outputChatBox(&amp;quot;Welcome to My Server&amp;quot;, source)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerJoin&amp;quot;, getRootElement(), joinHandler)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The script will spawn you at the coordinate (x, y, z) specified above, when you join the game. Note that the ''fadeCamera'' function must be used or the screen will be black. Also, in releases after DP2, you need to set the camera target (otherwise all the player will see is blue sky).&lt;br /&gt;
&lt;br /&gt;
The '''source''' variable indicates who triggered the event. Since a player has joined when the code is triggered, you use this variable to look which has joined. So it'll spawn that player instead of everyone or a random person.&lt;br /&gt;
&lt;br /&gt;
If we have a closer look on [[addEventHandler]], you can see 3 things: 'onPlayerJoin', which indicates when it's triggered. getRootElement(), which shows by what/who it can be triggered. (getRootElement() is everything/everyone) And joinHandler, which indicates the function that has to be triggered after the event is triggered. Other details will be explained later in another example, now let's just run the server and try it out!&lt;br /&gt;
&lt;br /&gt;
===Running the script===&lt;br /&gt;
To get the server started, simply run the executable under the server/ directory. A list of server stats will be shown first; note the port number, which you'll need when joining the game. Then the server loads all the resources under the mods/deathmatch/resources/ directory, and then &amp;quot;ready to accept connections!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Before you connect to the server, you must run the gamemode. Type &amp;quot;start myserver&amp;quot; and press Enter. The server will start the gamemode you just created, and will also show any errors and warnings from this point on. Now you can start the MTA client, and &amp;quot;Quick Connect&amp;quot; using the IP address of your server and the port number you saw earlier. If all goes well, after a few seconds your character will be walking on the streets of Los Santos.&lt;br /&gt;
&lt;br /&gt;
Next we'll add a command to your script that players can use to spawn a vehicle beside their position. You may skip it and check out more advanced scripting with the [[Map manager|Map Manager]], which continues this tutorial. Another branch from this tutorial is [[Introduction to Scripting GUI]], you may follow it to see how Graphical User Interface in MTA is drawn and scripted.&lt;br /&gt;
&lt;br /&gt;
==Creating a simple command==&lt;br /&gt;
Let's go back to the content of the ''script.lua'' file. As mentioned above, we want to provide a command to create a vehicle beside your current position in the game. Firstly we need to create a function we want to call and a command handler that creates the command the player will be able to enter in the console.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- create the function the command handler calls, with the arguments: thePlayer, command, vehicleModel&lt;br /&gt;
function createVehicleForPlayer(thePlayer, command, vehicleModel)&lt;br /&gt;
   -- create a vehicle and stuff&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- create a command handler&lt;br /&gt;
addCommandHandler(&amp;quot;createvehicle&amp;quot;, createVehicleForPlayer)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
''Note: Function names are clickable in code examples on the wiki and linked to the functions' documentation.''&lt;br /&gt;
&lt;br /&gt;
====About command handlers====&lt;br /&gt;
The first argument of [[addCommandHandler]] is the name of the command the player will be able to enter, the second argument is the function this will call, in this case ''createVehicleForPlayer''.&lt;br /&gt;
&lt;br /&gt;
If you have already experience in scripting, you will know that you call a function like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
functionName(argument1, argument2, argument3, ..)&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;
functionName(thePlayer, commandName, argument3, ..)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If we have a closer look on the lower example above, we can see argument1 is thePlayer and argument2 the commandName. thePlayer is simply the one who typed the command, so whatever you call it, the variable will contain the player who activated the command. commandName is simply the command they typed. So if they typed &amp;quot;/greet&amp;quot;, this argument will contain &amp;quot;greet&amp;quot;. Argument 3 is something extra the player typed, you'll learn it a little bit further in the tutorial. Never forget that the first 2 arguments are standard arguments, but you can name them to anything you want.&lt;br /&gt;
&lt;br /&gt;
We called the [[addCommandHandler]] function this way already and since ''createVehicleForPlayer'' is a function too, it can be called that way as well. But we are using a command handler for that, which calls it in a similiar manner, internally.&lt;br /&gt;
&lt;br /&gt;
For example: Someone types &amp;quot;createvehicle 468&amp;quot; ingame in the console to spawn a Sanchez, the command handler calls the createVehicleForPlayer function, as '''if''' we would have this line of code in the script:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
createVehicleForPlayer(thePlayer,&amp;quot;createvehicle&amp;quot;,&amp;quot;468&amp;quot;) -- thePlayer is the player element of the player who entered the command&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
As we can see, it provides several parameters: the player who called the command, the command he entered and whatever text he had after that, in this case &amp;quot;468&amp;quot; as vehicle id for the Sanchez. The first two parameters are the same with all command handlers, which you can read on the [[addEventHandler]] page. For this fact, you always have to define at least those two parameters to use any after that (for example to process text that was entered after the command, like in our example the vehicle model id).&lt;br /&gt;
&lt;br /&gt;
''Note: You have to add the command handler AFTER you defined the handler function, else it can't find it. The order of execution matters.''&lt;br /&gt;
&lt;br /&gt;
====Writing the function====&lt;br /&gt;
In order to fill the function we created, we need to think about what we have to do:&lt;br /&gt;
* Get the players position, so we know where to spawn the vehicle (we want it to appear right beside the player)&lt;br /&gt;
* Calculate the position we want to spawn the vehicle at (we don't want it to appear in the player)&lt;br /&gt;
* Spawn the vehicle&lt;br /&gt;
* Check if it has been spawned successfully, or output a message&lt;br /&gt;
&lt;br /&gt;
In order to achieve our goals, we have to use several functions. To find function we need to use, we should visit the [[Scripting Functions|Server Functions List]]. First we need a function to get the players position. Since players are Elements, we first jump to the '''Element functions''' where we find the [[getElementPosition]] function. By clicking on the function name in the list, you get to the function description. There we can see the syntax, what it returns and usually an example. The syntax shows us what arguments we can or have to submit.&lt;br /&gt;
&lt;br /&gt;
For [[getElementPosition]], the syntax is:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
float, float, float getElementPosition ( element theElement )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The three ''float'' in front of the function name are the return type. In this case it means the function returns three floating point numbers. (x, y and z) Within the parentheses, you can see what arguments you have to submit. In this case only the element whose position you want to get, which is the player in our example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createVehicleForPlayer(thePlayer, command, vehicleModel)&lt;br /&gt;
	-- get the position and put it in the x,y,z variables&lt;br /&gt;
	-- (local means, the variables only exist in the current scope, in this case, the function)&lt;br /&gt;
	local x,y,z = getElementPosition(thePlayer)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we want to ensure that the vehicle won't spawn directly in the player, so we add a few units to the ''x'' variable, which will make it spawn east from the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createVehicleForPlayer(thePlayer, command, vehicleModel)&lt;br /&gt;
	local x,y,z = getElementPosition(thePlayer) -- get the position of the player&lt;br /&gt;
	x = x + 5 -- add 5 units to the x position&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we need another function, one to spawn a vehicle. We once again search for it on the [[Scripting Functions|Server Functions List]], this time - since we are talking about vehicles - in the '''Vehicle functions''' section, where we will choose [[createVehicle]]. In this function's syntax, we only have one return type (which is more common), a vehicle element that points to the vehicle we just created. Also, we see that some arguments are enclosed within [ ] which means that those are optional.&lt;br /&gt;
&lt;br /&gt;
We already have all arguments we need for [[createVehicle]] in our function: The position we just calculated in the ''x,y,z'' variables and the model id that we provided through the command (&amp;quot;createvehicle 468&amp;quot;) and can access in the function as ''vehicleModel'' variable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createVehicleForPlayer(thePlayer, command, vehicleModel)&lt;br /&gt;
	local x,y,z = getElementPosition(thePlayer) -- get the position of the player&lt;br /&gt;
	x = x + 5 -- add 5 units to the x position&lt;br /&gt;
	-- create the vehicle and store the returned vehicle element in the ''createdVehicle'' variable&lt;br /&gt;
	local createdVehicle = createVehicle(tonumber(vehicleModel),x,y,z)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course this code can be improved in many ways, but at least we want to add a check whether the vehicle was created successfully or not. As we can read on the [[createVehicle]] page under '''Returns''', the function returns ''false'' when it was unable to create the vehicle. Thus, we check the value of the ''createVehicle'' variable.&lt;br /&gt;
&lt;br /&gt;
Now we have our complete script:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createVehicleForPlayer(thePlayer, command, vehicleModel)&lt;br /&gt;
	local x,y,z = getElementPosition(thePlayer) -- get the position of the player&lt;br /&gt;
	x = x + 5 -- add 5 units to the x position&lt;br /&gt;
	local createdVehicle = createVehicle(tonumber(vehicleModel),x,y,z)&lt;br /&gt;
	-- check if the return value was ''false''&lt;br /&gt;
	if (createdVehicle == false) then&lt;br /&gt;
		-- if so, output a message to the chatbox, but only to this player.&lt;br /&gt;
		outputChatBox(&amp;quot;Failed to create vehicle.&amp;quot;,thePlayer)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;createvehicle&amp;quot;, createVehicleForPlayer)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, we introduced another function with [[outputChatBox]]. By now, you should be able to explore the function's documentation page yourself. For more advanced scripting, please check out the [[Map manager|Map Manager]].&lt;br /&gt;
&lt;br /&gt;
==What you need to know==&lt;br /&gt;
You already read some things about resources, command handlers and finding functions in the documentation in the first paragraph, but there is much more to learn. This section will give you a rather short overview over some of these things, while linking to related pages if possible.&lt;br /&gt;
===Clientside and Serverside scripts===&lt;br /&gt;
You may have already noticed these or similiar terms (Server/Client) somewhere on this wiki, mostly in conjunction with functions. MTA not only supports scripts that run on the server and provide commands (like the one we wrote above) or other features, but also scripts that run on the MTA client the players use to connect to the server. The reason for this is, that some features MTA provides have to be clientside (like a GUI - Graphical User Interface), others should be because they work better and still others are better off to be serverside or just don't work clientside.&lt;br /&gt;
&lt;br /&gt;
Most scripts you will make (gamemodes, maps) will probably be serverside, like the one we wrote in the first section. If you run into something that can't be solved serverside, you will probably have to make it clientside. For a clientside script for example, you would create a ordinary script file (for example called ''client.lua'') and specify it in the meta.xml, like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script src=&amp;quot;client.lua&amp;quot; type=&amp;quot;client&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The ''type'' attribute defaults to 'server', so you only need to specify it for clientside scripts. When you do this, the clientside script will be downloaded to the player's computer once he connects to the server. Read more about [[Client side scripts]].&lt;br /&gt;
&lt;br /&gt;
===More complex resources===&lt;br /&gt;
The previous section showed briefly how to add clientside scripts to the resource, but there is also much more possible. As mentioned at the very top of this page, resources can be pretty much everything. Their purpose is defined by what they do. Let's have some theoretical resources, by looking at the files it contains, the ''meta.xml'' and what they might do:&lt;br /&gt;
&lt;br /&gt;
====First example - A utility script====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
/admin_commands&lt;br /&gt;
	/meta.xml&lt;br /&gt;
	/commands.lua&lt;br /&gt;
	/client.lua&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
	&amp;lt;info author=&amp;quot;Someguy&amp;quot; description=&amp;quot;admin commands&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;commands.lua&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;client.lua&amp;quot; type=&amp;quot;client&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The ''commands.lua'' provides some admin commands, like banning a player, muting or something else that can be used to admin the server&lt;br /&gt;
* The ''client.lua'' provides a GUI to be able to perform the mentioned actions easily&lt;br /&gt;
&lt;br /&gt;
This example might be running all the time (maybe even auto-started when the server starts) as it's useful during the whole gaming experience and also wont interfere with the gameplay, unless an admin decides to take some action of course.&lt;br /&gt;
&lt;br /&gt;
====Second example - A gamemode====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
/counterstrike&lt;br /&gt;
	/meta.xml&lt;br /&gt;
	/counterstrike.lua&lt;br /&gt;
	/buymenu.lua&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
	&amp;lt;info author=&amp;quot;Someguy&amp;quot; description=&amp;quot;Counterstrike remake&amp;quot; type=&amp;quot;gamemode&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;counterstrike.lua&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;buymenu.lua&amp;quot; type=&amp;quot;client&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The ''counterstrike.lua'' contains similiar to the following features:&lt;br /&gt;
** Let players choose their team and spawn them&lt;br /&gt;
** Provide them with weapons, targets and instructions (maybe read from a Map, see below)&lt;br /&gt;
** Define the game's rules, e.g. when does the round end, what happens when a player dies&lt;br /&gt;
** .. and maybe some more&lt;br /&gt;
* The ''buymenu.lua'' is a clientside script and creates a menu to buy weapons&lt;br /&gt;
&lt;br /&gt;
This example can be called a gamemode, since it not only intereferes with the gameplay, but actually defines the rules of it. The ''type'' attribute indicates that this example works with the [[Map manager]], yet another resource that was written by the QA Team to manage gamemodes and map loading. It is highly recommended that you base your gamemodes on the techniques it provides.&lt;br /&gt;
&lt;br /&gt;
This also means that the gamemode probably won't run without a map. Gamemodes should always be as generic as possible. An example for a map is stated in the next example.&lt;br /&gt;
&lt;br /&gt;
====Third example - A Map====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
/cs-airport&lt;br /&gt;
	/meta.xml&lt;br /&gt;
	/airport.map&lt;br /&gt;
	/airport.lua&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
	&amp;lt;info author=&amp;quot;Someguy&amp;quot; description=&amp;quot;Counterstrike airport map&amp;quot; type=&amp;quot;map&amp;quot; gamemodes=&amp;quot;counterstrike&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;map src=&amp;quot;airport.map&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;airport.lua&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The ''airport.map'' in a XML file that provides information about the map to the gamemode, these may include:&lt;br /&gt;
** Where the players should spawn, with what weapons, what teams there are&lt;br /&gt;
** What the targets are&lt;br /&gt;
** Weather, World Time, Timelimit&lt;br /&gt;
** Provide vehicles&lt;br /&gt;
* The ''airport.lua'' might contain map-specific features, that may include:&lt;br /&gt;
** Opening some door/make something explode when something specific happens&lt;br /&gt;
** Create or move some custom objects, or manipulate objects that are created through the .map file&lt;br /&gt;
** .. anything else map-specific you can think of&lt;br /&gt;
&lt;br /&gt;
As you can see, the ''type'' attribute changed to 'map', telling the [[Map manager]] that this resource is a map, while the ''gamemodes'' attribute tells it for which gamemodes this map is valid, in this case the gamemode from the above example.&lt;br /&gt;
What may come as a surprise is that there is also a script in the Map resource. Of course this is not necessarily needed in a map, but opens a wide range of possibilities for map makers to create their own world within the rules of the gamemode they create it for.&lt;br /&gt;
&lt;br /&gt;
The ''airport.map'' file might look similiar to this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;map mode=&amp;quot;deathmatch&amp;quot; version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;terrorists&amp;gt;&lt;br /&gt;
		&amp;lt;spawnpoint posX=&amp;quot;2332.23&amp;quot; posY=&amp;quot;-12232.33&amp;quot; posZ=&amp;quot;4.42223&amp;quot; skins=&amp;quot;23-40&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/terrorists&amp;gt;&lt;br /&gt;
	&amp;lt;counterterrorists&amp;gt;&lt;br /&gt;
		&amp;lt;spawnpoint posX=&amp;quot;2334.23443&amp;quot; posY=&amp;quot;-12300.233&amp;quot; posZ=&amp;quot;10.2344&amp;quot; skins=&amp;quot;40-50&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/counterterrorists&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;bomb posX=&amp;quot;23342.23&amp;quot; posY=&amp;quot;&amp;quot; posZ=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	&amp;lt;vehicle posX=&amp;quot;&amp;quot; posY=&amp;quot;&amp;quot; posZ=&amp;quot;&amp;quot; model=&amp;quot;602&amp;quot; /&amp;gt;	&lt;br /&gt;
	&amp;lt;vehicle posX=&amp;quot;&amp;quot; posY=&amp;quot;&amp;quot; posZ=&amp;quot;&amp;quot; model=&amp;quot;603&amp;quot; /&amp;gt;	&lt;br /&gt;
&amp;lt;/map&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a gamemode is started with a map, the map resources is automatically started by the mapmanager and the information it contains can be read by the gamemode resource. When the map changes, the current map resource is stopped and the next map resource is started. For a more in-depth explanation and examples of how map resources are utilized in the main script, please visit the [[Writing Gamemodes]] page.&lt;br /&gt;
&lt;br /&gt;
===Events===&lt;br /&gt;
Events are the way MTA tells scripts about things that happen. For example when a player dies, the [[onPlayerWasted]] event is triggered. In order to perform any actions when a player dies, you have to prepare yourself similiar to adding a command handler, as shown in [[#Writing_the_script|the first chapter]].&lt;br /&gt;
&lt;br /&gt;
This example will output a message with the name of the player who died:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function playerDied(totalAmmo, killer, killerWeapon, bodypart)&lt;br /&gt;
	outputChatBox(getPlayerName(source)..&amp;quot; died!&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerWasted&amp;quot;,getRootElement(),playerDied)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instead of showing what arguments are needed, the documentation page for Events shows what parameters are passed to the handler function, similiar to the way a [[#About_command_handlers|command handler]] does, just that it is different from event to event. Another important point is the ''source'' variable, that exists in handler functions. It doesn't have to be added to the parameter list of the function, but it still exists. It has a different value from event to event, for player events (as in the example above) it is the player element. As another example, you can take a look at the basic spawning player script in the first section to get an idea how ''source'' is used.&lt;br /&gt;
&lt;br /&gt;
==Where to go from here==&lt;br /&gt;
You should now be familiar with the most basic aspects of MTA scripting and also a bit with the documentation. The [[Main Page]] provides you with links to more information, Tutorials and References that allow a deeper look into the topics you desire to learn about.&lt;br /&gt;
{{note|From here we recommend reading the [[debugging]] tutorial. Good debugging skills are an absolute necessity when you are making scripts. We also recommend you to use the [[predefined variables list]] to help you with certain tasks and make scripting easier and faster.}}&lt;br /&gt;
'''See also:'''&lt;br /&gt;
* [[Advanced Topics]]&lt;br /&gt;
[[es:Introducción a la Programación]]&lt;br /&gt;
[[it:Introduzione allo scripting]]&lt;br /&gt;
[[nl:Scripting_introductie]]&lt;br /&gt;
[[pt-br:Introdução ao Scripting]]&lt;br /&gt;
[[ru:Scripting Introduction]]&lt;br /&gt;
[[ar:مقدمه_في_البرمجه]]&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/copyAccountData&amp;diff=36926</id>
		<title>AR/copyAccountData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/copyAccountData&amp;diff=36926"/>
		<updated>2013-08-16T11:58:13Z</updated>

		<summary type="html">&lt;p&gt;Tete: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}}&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;
bool copyAccountData ( account theAccount, account fromAccount )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===العناصر المطلوبة===&lt;br /&gt;
*'''theAccount:''' الحساب اللذي تريد نقل البيانات إليه&lt;br /&gt;
*'''fromAccount:''' الحساب اللذي تريد نسخ البيانات منه&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''true'' if the accounts were valid, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
إلى الحساب الذي تم تسجيل الدخول إليه 'guest' هذا المثال عند تسجيل الدخول يقوم بنسخ بيانات حساب &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function copyDataOnLogin(previousAccount, currentAccount)&lt;br /&gt;
   copyAccountData(currentAccount, previousAccount)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerLogin&amp;quot;, getRootElement(), copyDataOnLogin)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==انظر ايضاً==&lt;br /&gt;
{{AR/Account_functions}}&lt;br /&gt;
[[en:copyAccountData]]&lt;br /&gt;
[[ru:copyAccountData]]&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsElementMoving&amp;diff=36614</id>
		<title>IsElementMoving</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsElementMoving&amp;diff=36614"/>
		<updated>2013-07-10T21:16:40Z</updated>

		<summary type="html">&lt;p&gt;Tete: Code&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle/&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
This function checks if an element is moving.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; bool isElementMoving( element theElement ) &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns true if the element is moving, otherwise false.&lt;br /&gt;
&lt;br /&gt;
===Code===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function isElementMoving(theElement)&lt;br /&gt;
    if isElement(theElement)then --First check if the given argument is an element&lt;br /&gt;
        local x, y, z = getElementVelocity(theElement) --Get the velocity of the element given in our argument&lt;br /&gt;
        if x ~= 0 or y ~= 0 or z ~= 0 then --When there is a movement on X, Y or Z return true because our element is moving&lt;br /&gt;
            return true&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return false&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&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 piece of client side code writes the moving state to the client his screen&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local screenWidth, screenHeight = guiGetScreenSize () -- Get the screen resolution (width and height)&lt;br /&gt;
&lt;br /&gt;
function idleCheck ()&lt;br /&gt;
    if isElementMoving( getLocalPlayer() ) then --Check if it is the player &amp;quot;strolling&amp;quot;&lt;br /&gt;
        state = &amp;quot;Moving&amp;quot;&lt;br /&gt;
    elseif isElementMoving( getPedOccupiedVehicle ( getLocalPlayer() ) ) then --Player is not &amp;quot;Strolling&amp;quot; maybe the player is in a vehicle&lt;br /&gt;
        state = &amp;quot;Moving&amp;quot;&lt;br /&gt;
    else --The player not moving on feet or in a vehicle&lt;br /&gt;
        state = &amp;quot;Idling&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
	--Write our state string to the lower left corner of the screen&lt;br /&gt;
    dxDrawText ( state, 40, screenHeight - 40, screenWidth, screenHeight, tocolor ( 255, 255, 255, 255 ), 1, &amp;quot;default&amp;quot; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler ( &amp;quot;onClientRender&amp;quot;, getRootElement(), idleCheck ) -- keep the text visible with onClientRender.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetWeaponProperty&amp;diff=36030</id>
		<title>SetWeaponProperty</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetWeaponProperty&amp;diff=36030"/>
		<updated>2013-05-21T05:51:03Z</updated>

		<summary type="html">&lt;p&gt;Tete: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&amp;lt;section name=&amp;quot;setWeaponProperty&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets the weapon property of the specified weapons specified weapon type. See lower down the page for documentation related to weapon creation.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setWeaponProperty ( int weaponID/string weaponName, string weaponSkill, string property, int/float theValue )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Required Arguments==&lt;br /&gt;
*'''weaponID:''' The ID or name of the [[Weapons|weapon]] you want to set a property of. Names can be:&lt;br /&gt;
{{Some Weapon Types}}&lt;br /&gt;
*'''weaponSkill:''' Either: &amp;quot;pro&amp;quot;, &amp;quot;std&amp;quot; or &amp;quot;poor&amp;quot;. The player must have this skill level set to have the effect.&lt;br /&gt;
*'''property:''' The property you want to set the value of:&lt;br /&gt;
** &amp;quot;weapon_range&amp;quot; - float&lt;br /&gt;
** &amp;quot;target_range&amp;quot; - float&lt;br /&gt;
** &amp;quot;accuracy&amp;quot; - float&lt;br /&gt;
** &amp;quot;damage&amp;quot; - int&lt;br /&gt;
** &amp;quot;maximum_clip_ammo&amp;quot; - int&lt;br /&gt;
** &amp;quot;move_speed&amp;quot; - float&lt;br /&gt;
** &amp;quot;flags&amp;quot; - int (specify a flag to toggle it on/off) See [[Weapon Flags]]&lt;br /&gt;
** &amp;quot;anim_loop_start&amp;quot; - float&lt;br /&gt;
** &amp;quot;anim_loop_stop&amp;quot; - float&lt;br /&gt;
** &amp;quot;anim_loop_bullet_fire&amp;quot; - float&lt;br /&gt;
** &amp;quot;anim2_loop_start&amp;quot; - float&lt;br /&gt;
** &amp;quot;anim2_loop_stop&amp;quot; - float&lt;br /&gt;
** &amp;quot;anim2_loop_bullet_fire&amp;quot; - float&lt;br /&gt;
** &amp;quot;anim_breakout_time&amp;quot; - float&lt;br /&gt;
*'''theValue:''' The value to set the property to.&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
On success:&lt;br /&gt;
&lt;br /&gt;
'''bool:''' Returns true if the weapon property was successfully set&lt;br /&gt;
&lt;br /&gt;
On failure:&lt;br /&gt;
&lt;br /&gt;
'''bool:''' Returns false if the weapon property was unable to be set&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example sets the weapon range of the M4 at poor skill level to 75&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local rangeSet = setWeaponProperty(31, &amp;quot;poor&amp;quot;, &amp;quot;weapon_range&amp;quot;, 75)&lt;br /&gt;
if (rangeSet) then&lt;br /&gt;
    outputChatBox(&amp;quot;M4 range at poor skill is set now 75!&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example makes the silenced pistol dual wielded at pro skill level&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setWeaponProperty(23, &amp;quot;pro&amp;quot;, &amp;quot;flags&amp;quot;, 0x000800)&lt;br /&gt;
setWeaponProperty(23, &amp;quot;pro&amp;quot;, &amp;quot;flags&amp;quot;, 0x000002)&lt;br /&gt;
setWeaponProperty(23, &amp;quot;pro&amp;quot;, &amp;quot;maximum_clip_ammo&amp;quot;, 34)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This examples doubles the range of the colt 45 hand gun&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setWeaponProperty(22, &amp;quot;poor&amp;quot;, &amp;quot;weapon_range&amp;quot;, 70)&lt;br /&gt;
setWeaponProperty(22, &amp;quot;std&amp;quot;, &amp;quot;weapon_range&amp;quot;, 70)&lt;br /&gt;
setWeaponProperty(22, &amp;quot;pro&amp;quot;, &amp;quot;weapon_range&amp;quot;, 70)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example makes the minigun able to fire all its ammo without the short reload time&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setWeaponProperty(&amp;quot;minigun&amp;quot;, &amp;quot;pro&amp;quot;, &amp;quot;maximum_clip_ammo&amp;quot;, 1000)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|1.3|n/a|}}&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;setWeaponProperty&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
==Syntax (weapon creation)==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setWeaponProperty ( weapon theWeapon, string strProperty, value theValue )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Required Arguments==&lt;br /&gt;
&lt;br /&gt;
* '''theWeapon:''' the weapon to change the property of.&lt;br /&gt;
* '''strProperty:''' the property to edit such as damage per hit ( &amp;quot;damage&amp;quot; ).&lt;br /&gt;
* '''theValue:''' whatever you wish to set it to ( different properties use different data types so damage could be an int where as accuracy is a float ).&lt;br /&gt;
&lt;br /&gt;
Sets an individual weapons property. Only a handful of useful properties are supported now and it uses the same property names as setWeaponProperty server side.&lt;br /&gt;
&lt;br /&gt;
Returns true if the property was set.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3.0-9.04555|}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Weapon functions}}&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetPlayersByData&amp;diff=36006</id>
		<title>GetPlayersByData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPlayersByData&amp;diff=36006"/>
		<updated>2013-05-18T13:02:08Z</updated>

		<summary type="html">&lt;p&gt;Tete: /* Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function gets players who have data name you passed to it.&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table getPlayersByData ( data name )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''data name''': A string determining the data you wish to get players from.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a table containing players who have the data name ''false'' if no player has this data name or the data name is invalid.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Returns false if no player in the server has the data name.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Function source&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function getPlayersByData(dataName)&lt;br /&gt;
    if dataName and type(dataName) == &amp;quot;string&amp;quot; then&lt;br /&gt;
	local playersTable = {}&lt;br /&gt;
	for i,v in ipairs(getElementsByType(&amp;quot;player&amp;quot;)) do&lt;br /&gt;
	    if getElementData(v, dataName) then&lt;br /&gt;
                table.insert(playersTable, v)&lt;br /&gt;
	    end&lt;br /&gt;
	end&lt;br /&gt;
	if #playersTable == 0 then&lt;br /&gt;
	    return false&lt;br /&gt;
	end&lt;br /&gt;
	return playersTable&lt;br /&gt;
    else&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example outputs every player who have the certain data name.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function gettingData(cmd, dataName)&lt;br /&gt;
    if not dataName then return outputChatBox(&amp;quot;[Syntax] /getData [data name]&amp;quot;, 255) end&lt;br /&gt;
    local players = getPlayersByData(dataName)&lt;br /&gt;
    if players then&lt;br /&gt;
        for i,v in ipairs(players) do&lt;br /&gt;
	     outputChatBox(getPlayerName(v) .. &amp;quot; has '&amp;quot; .. dataName .. &amp;quot;' data.&amp;quot;)&lt;br /&gt;
        end&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox(&amp;quot;Invalid data name or no player has this data name!&amp;quot;, 255, 0, 0)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;getData&amp;quot;, gettingData)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Author: Tete&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetPlayersByData&amp;diff=36005</id>
		<title>GetPlayersByData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPlayersByData&amp;diff=36005"/>
		<updated>2013-05-18T12:58:13Z</updated>

		<summary type="html">&lt;p&gt;Tete: /* Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function gets players who have data name you passed to it.&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table getPlayersByData ( data name )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''data name''': A string determining the data you wish to get players from.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a table containing players who have the data name ''false'' if no player has this data name or the data name is invalid.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Returns false if no player in the server has the data name.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Function source&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function getPlayersByData(dataName)&lt;br /&gt;
    if dataName and type(dataName) == &amp;quot;string&amp;quot; then&lt;br /&gt;
        local players = getElementsByType(&amp;quot;player&amp;quot;)&lt;br /&gt;
	local playersTable = {}&lt;br /&gt;
	for i,v in ipairs(players) do&lt;br /&gt;
	    if getElementData(v, dataName) then&lt;br /&gt;
                table.insert(playersTable, v)&lt;br /&gt;
	    end&lt;br /&gt;
	end&lt;br /&gt;
	if #playersTable == 0 then&lt;br /&gt;
	    return false&lt;br /&gt;
	end&lt;br /&gt;
	return playersTable&lt;br /&gt;
    else&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example outputs every player who have the certain data name.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function gettingData(cmd, dataName)&lt;br /&gt;
    if not dataName then return outputChatBox(&amp;quot;[Syntax] /getData [data name]&amp;quot;, 255) end&lt;br /&gt;
    local players = getPlayersByData(dataName)&lt;br /&gt;
    if players then&lt;br /&gt;
        for i,v in ipairs(players) do&lt;br /&gt;
	     outputChatBox(getPlayerName(v) .. &amp;quot; has '&amp;quot; .. dataName .. &amp;quot;' data.&amp;quot;)&lt;br /&gt;
        end&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox(&amp;quot;Invalid data name or no player has this data name!&amp;quot;, 255, 0, 0)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;getData&amp;quot;, gettingData)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Author: Tete&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetPlayersByData&amp;diff=35983</id>
		<title>GetPlayersByData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPlayersByData&amp;diff=35983"/>
		<updated>2013-05-13T00:56:19Z</updated>

		<summary type="html">&lt;p&gt;Tete: /* Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function gets players who have data name you passed to it.&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table getPlayersByData ( data name )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''data name''': A string determining the data you wish to get players from.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a table containing players who have the data name ''false'' if no player has this data name or the data name is invalid.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Returns false if no player in the server has the data name.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Function source&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function getPlayersByData(dataName)&lt;br /&gt;
    if dataName and type(dataName) == &amp;quot;string&amp;quot; then&lt;br /&gt;
        local players = getElementsByType(&amp;quot;player&amp;quot;)&lt;br /&gt;
	local playersTable = {}&lt;br /&gt;
	for i,v in ipairs(players) do&lt;br /&gt;
	    if getElementData(v) == dataName then&lt;br /&gt;
                table.insert(playersTable, v)&lt;br /&gt;
	    end&lt;br /&gt;
	end&lt;br /&gt;
	if #playersTable == 0 then&lt;br /&gt;
	    return false&lt;br /&gt;
	end&lt;br /&gt;
	return playersTable&lt;br /&gt;
    else&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example outputs every player who have the certain data name.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function gettingData(cmd, dataName)&lt;br /&gt;
    if not dataName then return outputChatBox(&amp;quot;[Syntax] /getData [data name]&amp;quot;, 255) end&lt;br /&gt;
    local players = getPlayersByData(dataName)&lt;br /&gt;
    if players then&lt;br /&gt;
        for i,v in ipairs(players) do&lt;br /&gt;
	     outputChatBox(getPlayerName(v) .. &amp;quot; has '&amp;quot; .. dataName .. &amp;quot;' data.&amp;quot;)&lt;br /&gt;
        end&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox(&amp;quot;Invalid data name or no player has this data name!&amp;quot;, 255, 0, 0)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;getData&amp;quot;, gettingData)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Author: Tete&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/reloadBans&amp;diff=35812</id>
		<title>AR/reloadBans</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/reloadBans&amp;diff=35812"/>
		<updated>2013-05-06T04:19:37Z</updated>

		<summary type="html">&lt;p&gt;Tete: /* راجع ايضاً */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server 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;
bool reloadBans()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns النتائج===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
'''تكون النتيجه true اذا تمت إعادة تحميل ملف قائمة الحظر بنجاح&lt;br /&gt;
''وتكون false اذا كان العكس''''' &lt;br /&gt;
==مثال==&lt;br /&gt;
هذا المثال يضيف الامر &amp;quot;reloadban&amp;quot; لإعادة تحميل ملف قائمة الحظر&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function ReBan (player)&lt;br /&gt;
   if (reloadBans()) then &lt;br /&gt;
      outputChatBox(&amp;quot;تم اعادة تحميل قائمة الحظر بنجاح.&amp;quot;,player)&lt;br /&gt;
   else&lt;br /&gt;
      outputChatBox(&amp;quot;فشل في إعادة تحميل قائمة الحظر.&amp;quot;,player)&lt;br /&gt;
   end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;reloadban&amp;quot;,ReBan)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==المتطلبات==&lt;br /&gt;
{{Requirements|1.3.0-9.03931|n/a|}}&lt;br /&gt;
&lt;br /&gt;
==انظر ايضاً==&lt;br /&gt;
{{AR/Admin_functions}}&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetSoundLevelData&amp;diff=35811</id>
		<title>GetSoundLevelData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetSoundLevelData&amp;diff=35811"/>
		<updated>2013-05-06T04:14:53Z</updated>

		<summary type="html">&lt;p&gt;Tete: /* See Also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New feature/item|3.0130|1.3.0|4162|&lt;br /&gt;
This function gets the left/right level from a [[sound]] [[element]].&lt;br /&gt;
}}&lt;br /&gt;
{{New_feature|3.0139|1.3.2|&lt;br /&gt;
If the element is a player, this function will use the players voice.&lt;br /&gt;
}}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int, int getSoundLevelData ( element theSound )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theSound''' The [[sound]] [[element]] which level data you want to return.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a 2 values with Left, Right level data from sound, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
TODO&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--TODO&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3.0-9.04162|}}&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.2|Added player element to use a players voice}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[Category:Needs Example]]&lt;br /&gt;
[[AR:getSoundLevelData]]&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetSoundWaveData&amp;diff=35810</id>
		<title>GetSoundWaveData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetSoundWaveData&amp;diff=35810"/>
		<updated>2013-05-06T04:14:35Z</updated>

		<summary type="html">&lt;p&gt;Tete: /* See Also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{Needs Example}}&lt;br /&gt;
{{New feature/item|3.0130|1.3.0|4125|&lt;br /&gt;
This function gets the wave form data for an audio stream which is a table of floats representing the current audio frame as a wave.&lt;br /&gt;
This allows things like visualisations.&lt;br /&gt;
}}&lt;br /&gt;
{{New_feature|3.0139|1.3.2|&lt;br /&gt;
If the element is a player, this function will use the players voice.&lt;br /&gt;
}}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table getSoundWaveData ( element sound, int iSamples )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''sound:''' A sound element that is created using [[playSound]] or [[playSound3D]]. Streams are also supported&lt;br /&gt;
*'''iSamples:''' Allowed samples are 128, 256, 512, 1024, 2048, 4096, 8192 and 16384 and determine how many samples to return from the currently playing audio&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a table of floats representing the current audio frame waveform.&lt;br /&gt;
Returns false if the sound is not playing yet or hasn't buffered in the&lt;br /&gt;
case of streams.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- not done yet&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.2|Added player element to use a players voice}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[Category:Needs Example]]&lt;br /&gt;
[[AR:getSoundWaveData]]&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetSoundFFTData&amp;diff=35809</id>
		<title>GetSoundFFTData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetSoundFFTData&amp;diff=35809"/>
		<updated>2013-05-06T04:14:12Z</updated>

		<summary type="html">&lt;p&gt;Tete: /* See Also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{Needs Example}}&lt;br /&gt;
{{New feature/item|3.0130|1.3.0|4125|&lt;br /&gt;
This function gets the fast fourier transform data for an audio stream which is a table of floats representing the current audio frame.&lt;br /&gt;
This allows things like visualisations.&lt;br /&gt;
&lt;br /&gt;
a fast fourier transform generates a table of all the frequencies of the current audio frame which starts at the bass end of the spectrum to mids to highs in that order&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Should you have any problems there is an example resource located on the resource svn here:&lt;br /&gt;
[https://code.google.com/p/mtasa-resources/source/browse/#svn%2Ftrunk%2F%5Bgameplay%5D%2FVisualiser Visualiser]&lt;br /&gt;
&lt;br /&gt;
just type &amp;quot;startmusic mystreamurl&amp;quot; in your console and it will play on the cinema billboard near A51&lt;br /&gt;
{{New_feature|3.0139|1.3.2|&lt;br /&gt;
If the element is a player, this function will use the players voice.&lt;br /&gt;
}}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table getSoundFFTData ( element sound, int iSamples [, int iBands = 0 ] )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''sound:''' A sound element that is created using [[playSound]] or [[playSound3D]]. Streams are also supported&lt;br /&gt;
*'''iSamples:''' Allowed samples are 128, 256, 512, 1024, 2048, 4096, 8192 and 16384&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''iBands:''' Post processing option allows you to split the samples into the desired amount of bands or bars so if you only need 5 bars this saves a lot of cpu power compared to trying to do it in Lua&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a table of floats representing the current audio frame.&lt;br /&gt;
Returns false if the sound is not playing yet or hasn't buffered in the&lt;br /&gt;
case of streams.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- not done yet&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.2|Added player element to use a players voice}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[Category:Needs Example]]&lt;br /&gt;
[[AR:getSoundFFTData]]&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetSoundProperties&amp;diff=35808</id>
		<title>SetSoundProperties</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetSoundProperties&amp;diff=35808"/>
		<updated>2013-05-06T04:13:56Z</updated>

		<summary type="html">&lt;p&gt;Tete: /* See Also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New feature/item|3.0130|1.3.0|4097|&lt;br /&gt;
This function edit's the properties of a specific [[sound]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setSoundProperties(element sound, float fSampleRate, float fTempo, float fPitch, bool bReverse )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''sound:''' A sound element that is created using [[playSound]] or [[playSound3D]]&lt;br /&gt;
&lt;br /&gt;
*'''fSampleRate:''' A float that defines the new sound's [http://en.wikipedia.org/wiki/Sampling_rate sample rate]&lt;br /&gt;
&lt;br /&gt;
*'''fTempo:''' A float that defines the new sound [http://en.wikipedia.org/wiki/Tempo tempo]&lt;br /&gt;
&lt;br /&gt;
*'''fPitch:''' A float that defines the new sound [http://en.wikipedia.org/wiki/Pitch_%28music%29 pitch]&lt;br /&gt;
&lt;br /&gt;
*'''bReverse:''' A boolean representing whether the sound will be reversed or not.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns true if the properties sucessfully set, false otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function editSongSound()&lt;br /&gt;
	local sound = playSound(&amp;quot;song.wav&amp;quot;, false) -- Play the file 'song.wav' and make it play only once&lt;br /&gt;
	setSoundProperties(sound, 48000.0, 128.00, 440.0, false) -- Set its samplerate to 48,000 Hz, tempo to 128.00, pitch to 440 Hz and not reversed&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, resourceRoot, editSongSound) -- Execute the function when the resource is started&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[AR:setSoundProperties]]&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetSoundProperties&amp;diff=35807</id>
		<title>GetSoundProperties</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetSoundProperties&amp;diff=35807"/>
		<updated>2013-05-06T04:13:26Z</updated>

		<summary type="html">&lt;p&gt;Tete: /* See Also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New feature/item|3.0130|1.3.0|4097|&lt;br /&gt;
This function gets the properties of a specific [[sound]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;float, float, float, bool getSoundProperties( element sound )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''sound:''' A sound element that is created using [[playSound]] or [[playSound3D]]&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
This function returns 3 floats and a boolean value:&lt;br /&gt;
&lt;br /&gt;
The first float is the sound's [http://en.wikipedia.org/wiki/Sampling_rate sample rate], the second one the sound's [http://en.wikipedia.org/wiki/Tempo tempo], and the third one the [http://en.wikipedia.org/wiki/Pitch_%28music%29 pitch] of the sound. The boolean representing whether the sound is reversed or not.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- not done yet&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[Category:Needs Example]]&lt;br /&gt;
[[AR:getSoundProperties]]&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetSoundBPM&amp;diff=35806</id>
		<title>GetSoundBPM</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetSoundBPM&amp;diff=35806"/>
		<updated>2013-05-06T04:13:09Z</updated>

		<summary type="html">&lt;p&gt;Tete: /* See Also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New feature/item|3.0131|1.3.0|4145|&lt;br /&gt;
This function gets the beats per minute of a specific [[sound]] element.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int getSoundBPM( element sound )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''sound:''' A sound element that is created using [[playSound]] or [[playSound3D]]&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the beats per minute of the given sound.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function bpm ()&lt;br /&gt;
    -- Long version (might be more understandable as example)&lt;br /&gt;
    sound = playSound ( &amp;quot;song.mp3&amp;quot; ) -- Play the song&lt;br /&gt;
    beats = getSoundBPM ( sound ) -- Get the beats per minute of the song&lt;br /&gt;
    outputChatBox ( &amp;quot;Long code version: &amp;quot; .. beats ) -- Output the beats to the chat box&lt;br /&gt;
&lt;br /&gt;
    -- Short version + Would save some memory&lt;br /&gt;
    outputChatBox ( &amp;quot;Short code version: &amp;quot; .. getSoundBPM ( playSound ( &amp;quot;song.mp3&amp;quot; ) ) )&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;bpm&amp;quot;, bpm )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3.0-9.04162|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[AR:getSoundBPM]]&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=StopSound&amp;diff=35805</id>
		<title>StopSound</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=StopSound&amp;diff=35805"/>
		<updated>2013-05-06T04:12:50Z</updated>

		<summary type="html">&lt;p&gt;Tete: /* See Also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
Stops the sound playback for specified [[sound]] element. The sound element is also destroyed.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool stopSound ( element theSound )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theSound:''' The [[sound]] element you want to stop playing.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the sound was successfully stopped, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function startMySound()&lt;br /&gt;
    sound = playSound( &amp;quot;sound.mp3&amp;quot;, true )&lt;br /&gt;
end&lt;br /&gt;
addEventHandler( &amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement( getThisResource() ), startMySound )&lt;br /&gt;
&lt;br /&gt;
function stopMySound()&lt;br /&gt;
    stopSound( sound )&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;stopsound&amp;quot;, stopMySound ) --using the command 'stopsound' will stop the sound&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[AR:stopSound]]&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetSoundVolume&amp;diff=35804</id>
		<title>SetSoundVolume</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetSoundVolume&amp;diff=35804"/>
		<updated>2013-05-06T04:12:27Z</updated>

		<summary type="html">&lt;p&gt;Tete: /* See Also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function is used to change the volume level of the specified [[sound]] element.&lt;br /&gt;
{{New_feature|3.0139|1.3.2|&lt;br /&gt;
Use a player element to control a players voice with this function.&lt;br /&gt;
}}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setSoundVolume ( element theSound, float volume )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theSound:''' The [[sound]] element which volume you want to modify.&lt;br /&gt;
*'''volume:''' A [[float|floating]] point number representing the desired volume level. Range is from '''0.0''' to '''1.0'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the [[sound]] element volume was successfully changed, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function wasted (killer, weapon, bodypart)&lt;br /&gt;
        local sound = playSound(&amp;quot;sounds/wasted.mp3&amp;quot;) --Play wasted.mp3 from the sounds folder&lt;br /&gt;
        setSoundVolume(sound, 0.5) -- set the sound volume to 50%&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientPlayerWasted&amp;quot;, getLocalPlayer(), wasted) --add the event handler &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.2|Added player element for voice control}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[AR:setSoundVolume]]&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetSoundSpeed&amp;diff=35803</id>
		<title>SetSoundSpeed</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetSoundSpeed&amp;diff=35803"/>
		<updated>2013-05-06T04:11:55Z</updated>

		<summary type="html">&lt;p&gt;Tete: /* See Also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function can be used to change the playback speed of the specified [[sound]] element.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setSoundSpeed ( element theSound, float speed )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theSound:''' The [[sound]] element which volume you want to modify.&lt;br /&gt;
*'''speed:''' A [[float]]ing point number representing the desired sound playback speed.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the [[sound]] element playback speed was successfully changed, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function soundFunc()&lt;br /&gt;
sound = playSound ( &amp;quot;/sounds/jizzy.mp3&amp;quot;,true) -- Let's play a sound&lt;br /&gt;
setSoundSpeed ( sound, 1.2 ) -- And it will be a little bit faster !&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;play&amp;quot;,soundFunc)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[AR:setSoundSpeed]]&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetSoundPosition&amp;diff=35802</id>
		<title>SetSoundPosition</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetSoundPosition&amp;diff=35802"/>
		<updated>2013-05-06T04:11:41Z</updated>

		<summary type="html">&lt;p&gt;Tete: /* See Also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function is used to change the seek position of the specified [[sound]] element.&lt;br /&gt;
{{New_feature|3.0139|1.3.2|&lt;br /&gt;
Use a player element to control a players voice with this function.&lt;br /&gt;
}}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setSoundPosition ( element theSound, int pos )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theSound:''' The [[sound]] element which seek position you want to modify.&lt;br /&gt;
*'''pos:''' An [[int]]eger value representing the new seek position of the sound in milliseconds.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the [[sound]] element's seek position was successfully changed, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example allows the player to set how many milliseconds into the song he wants it to play from&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
theSound = playSound(&amp;quot;music/song.mp3&amp;quot;)&lt;br /&gt;
function setSongPos(cmd, ms)&lt;br /&gt;
    local ssp = setSoundPosition(theSound, ms)&lt;br /&gt;
    if ssp then&lt;br /&gt;
        local seconds = ms / 1000 --this will get the amount of seconds from milliseconds&lt;br /&gt;
        outputChatBox(&amp;quot;Sound is now playing from: &amp;quot;..seconds..&amp;quot; Seconds!&amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox(&amp;quot;An error has occured. Please make shore there are atleast&amp;quot;)&lt;br /&gt;
        local seconds = ms / 1000 --this will get the amount of seconds from milliseconds&lt;br /&gt;
        outputChatBox(seconds..&amp;quot; Seconds in this song!&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;skipsong&amp;quot;, setSongPos)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.2|Added player element for voice control}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[AR:setSoundPosition]]&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetSoundPaused&amp;diff=35801</id>
		<title>SetSoundPaused</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetSoundPaused&amp;diff=35801"/>
		<updated>2013-05-06T04:11:27Z</updated>

		<summary type="html">&lt;p&gt;Tete: /* See Also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function is used to either pause or unpause the playback of the specified [[sound]] element.&lt;br /&gt;
{{New_feature|3.0139|1.3.2|&lt;br /&gt;
Use a player element to control a players voice with this function.&lt;br /&gt;
}}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setSoundPaused ( element theSound, bool paused )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theSound:''' The [[sound]] element which you want to pause/unpause.&lt;br /&gt;
*'''paused:''' A [[boolean]] value representing whether the sound should be paused or not. To pause the sound, use ''true''.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the [[sound]] element was successfully paused, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example will allow the user to toggle sounds from paused to playing, and from playing to paused&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
theSound = playSound(&amp;quot;music/song.mp3&amp;quot;, true)&lt;br /&gt;
function togglePausedSound()&lt;br /&gt;
    if(isSoundPaused(theSound)) then --sound is paused, un-pause it&lt;br /&gt;
        setSoundPaused(theSound, false)&lt;br /&gt;
    else --sound is not paused, pause it&lt;br /&gt;
        setSoundPaused(theSound, true)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;pausesound&amp;quot;, togglePausedSound)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.2|Added player element for voice control}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[AR:setSoundPaused]]&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetSoundMinDistance&amp;diff=35800</id>
		<title>SetSoundMinDistance</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetSoundMinDistance&amp;diff=35800"/>
		<updated>2013-05-06T04:11:12Z</updated>

		<summary type="html">&lt;p&gt;Tete: /* See Also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
Sets a custom [[sound]] Minimum distance at which the sound stops getting louder.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setSoundMinDistance ( element sound, int distance )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''sound:''' a [[sound]] element.&lt;br /&gt;
*'''distance:''' an integer representing the distance the sound stops getting louder. the default value for this is 1&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''true'' if the minimum distance was set, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local sound = playSound3D(&amp;quot;sounds/song.mp3&amp;quot;, 373.14, -125.21, 1001, true)&lt;br /&gt;
&lt;br /&gt;
function distanceFunc(command, param)&lt;br /&gt;
  setSoundMinDistance(sound, tonumber(param))&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;setdistance&amp;quot;, distanceFunc)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[AR:setSoundMinDistance]]&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetSoundMaxDistance&amp;diff=35799</id>
		<title>SetSoundMaxDistance</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetSoundMaxDistance&amp;diff=35799"/>
		<updated>2013-05-06T04:10:57Z</updated>

		<summary type="html">&lt;p&gt;Tete: /* See Also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
Sets a custom [[sound]] max distance at which the sound stops.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setSoundMaxDistance ( element sound, int distance )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''sound:''' a [[sound]] element.&lt;br /&gt;
*'''distance:''' the default value for this is 10&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''true'' if the max distance was set, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local sound = playSound3D(&amp;quot;sounds/song.mp3&amp;quot;, 373.14, -125.21, 1001, true)&lt;br /&gt;
&lt;br /&gt;
function maxdistanceFunc(command, param)&lt;br /&gt;
  setSoundMaxDistance(sound, tonumber(param))&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;setmaxdistance&amp;quot;, maxdistanceFunc)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[AR:setSoundMaxDistance]]&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetRadioChannel&amp;diff=35798</id>
		<title>SetRadioChannel</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetRadioChannel&amp;diff=35798"/>
		<updated>2013-05-06T04:10:38Z</updated>

		<summary type="html">&lt;p&gt;Tete: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function sets the currently active radio channel.&lt;br /&gt;
&lt;br /&gt;
This function also works while not in a vehicle.&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 setRadioChannel ( int ID )             &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''ID:''' The ID of the radio station you want to play.&lt;br /&gt;
&lt;br /&gt;
{{SoundID}}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if channel was set successfully, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example adds a command ''setradio'' which can be used to change the current radio station by ID.&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;
addCommandHandler ( &amp;quot;setradio&amp;quot;,&lt;br /&gt;
    function ( command, stationID )&lt;br /&gt;
        local result = setRadioChannel ( tonumber( stationID ) )&lt;br /&gt;
        if result then -- if we had a valid ID&lt;br /&gt;
            outputChatBox ( &amp;quot;Changed your radio station to &amp;quot; .. getRadioChannelName ( tonumber ( stationID ) ) .. &amp;quot;!&amp;quot; )&lt;br /&gt;
        else&lt;br /&gt;
            outputChatBox ( &amp;quot;Invalid radio station ID, valid ones are 0-12.&amp;quot; )&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[AR:setRadioChannel]]&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PlaySound3D&amp;diff=35797</id>
		<title>PlaySound3D</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PlaySound3D&amp;diff=35797"/>
		<updated>2013-05-06T04:10:09Z</updated>

		<summary type="html">&lt;p&gt;Tete: /* See Also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
Creates a [[sound]] element in the GTA world and plays it immediately after creation for the local player. [[setElementPosition]] can be used to move the [[sound]] element around after it has been created.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Note:''' The only supported audio formats are MP3, WAV, OGG, RIFF, MOD, XM, IT and S3M.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;element playSound3D ( string soundPath, float x, float y, float z, [ bool looped = false ] )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''soundPath:''' The [[filepath]] to the sound file you want to play. (Sound file has to be predefined in the [[meta.xml]] file with &amp;lt;file /&amp;gt; tag. And also can use url instead of [[filepath]] )&lt;br /&gt;
*'''x:''' A floating point number representing the X coordinate on the map.&lt;br /&gt;
*'''y:''' A floating point number representing the Y coordinate on the map.&lt;br /&gt;
*'''z:''' A floating point number representing the Z coordinate on the map.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''looped:''' A [[boolean]] representing whether the sound will be looped. To loop the sound, use ''true''.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[sound]] element if the sound was successfully created, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example creates a looping sound within a pizza shop. The pizza shop is in san fierro near pier 69&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function onResourceStart()&lt;br /&gt;
	local sound = playSound3D(&amp;quot;sounds/song.mp3&amp;quot;, 373.14, -125.21, 1001, true) &lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement(getThisResource()), onResourceStart)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
This example play internet radio in groove street.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 2&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( 'onClientResourceStart', resourceRoot,&lt;br /&gt;
	function( )&lt;br /&gt;
		local uSound = playSound3D( 'http://78.31.74.220:8000/BadRadio', 2498, -1659, 12 ) &lt;br /&gt;
		setSoundMaxDistance( uSound, 100 )&lt;br /&gt;
	end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[AR:playSound3D]]&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
</feed>