<?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=Hassan+saad</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=Hassan+saad"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Hassan_saad"/>
	<updated>2026-04-09T23:39:26Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=ConvertTextToSpeech&amp;diff=63265</id>
		<title>ConvertTextToSpeech</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=ConvertTextToSpeech&amp;diff=63265"/>
		<updated>2019-07-11T12:16:09Z</updated>

		<summary type="html">&lt;p&gt;Hassan saad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Useful Function}}&amp;lt;lowercasetitle/&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
{{Warning|This function is not working anymore due to Google blocking non-user calls to their TTS API. Plase feel free to fix it by using another public and reliable TTS API.|1}}&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This useful shared function converts some text to audible speech using Google's TTS.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;boolean, element, string convertTextToSpeech ( string text [, table/element broadcastTo = root, string language = &amp;quot;en&amp;quot; ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Required arguments==&lt;br /&gt;
* ''text'': the text to convert to speech.&lt;br /&gt;
&lt;br /&gt;
==Optional arguments==&lt;br /&gt;
* ''broadcastTo'': if it's a regular indexed table, the speech will be broadcasted to the players contained in it. If it's a element, the speech will be heard by the players which are children of that element. This parameter is '''ONLY''' serverside; if you're using this function clientside this will be considered as the ''language'' argument.&lt;br /&gt;
* ''language'': defines the language of the TTS output.&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
* This function returns ''[[nil]]'' and outputs an error if an argument it's not valid.&lt;br /&gt;
* If called serverside and if all arguments are valid, this function returns ''true'' if the client was successully told to play the TTS (althrough this doesn't mean that the client will always play the speech); ''false'' otherwise.&lt;br /&gt;
* If called clientside and if all arguments are valid, this function returns ''true'', the corresponding [[sound]] element and its URL if the sound could theorically be played (althrough it may not play); ''[[nil]]'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Function source==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEvent(&amp;quot;playTTS&amp;quot;, true) -- Add the event&lt;br /&gt;
&lt;br /&gt;
local function playTTS(text, lang)&lt;br /&gt;
    --local URL = &amp;quot;http://translate.google.com/translate_tts?tl=&amp;quot; .. lang .. &amp;quot;&amp;amp;q=&amp;quot; .. text&lt;br /&gt;
    local URL = &amp;quot;https://code.responsivevoice.org/getvoice.php?tl=&amp;quot; .. lang .. &amp;quot;&amp;amp;t=&amp;quot; .. text&lt;br /&gt;
    -- Play the TTS. BASS returns the sound element even if it can not be played.&lt;br /&gt;
    return true, playSound(URL), URL&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;playTTS&amp;quot;, root, playTTS)&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;Shared (server and client)&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 convertTextToSpeech(text, broadcastTo, lang)&lt;br /&gt;
    -- Ensure first argument is valid&lt;br /&gt;
    assert(type(text) == &amp;quot;string&amp;quot;, &amp;quot;Bad argument 1 @ convertTextToSpeech [ string expected, got &amp;quot; .. type(text) .. &amp;quot;]&amp;quot;)&lt;br /&gt;
    assert(#text &amp;lt;= 100, &amp;quot;Bad argument 1 @ convertTextToSpeech [ too long string; 100 characters maximum ]&amp;quot;)&lt;br /&gt;
    if triggerClientEvent then -- Is this function called serverside?&lt;br /&gt;
        -- Ensure second and third arguments are valid&lt;br /&gt;
        assert(broadcastTo == nil or type(broadcastTo) == &amp;quot;table&amp;quot; or isElement(broadcastTo), &amp;quot;Bad argument 2 @ convertTextToSpeech [ table/element expected, got &amp;quot; .. type(broadcastTo) .. &amp;quot;]&amp;quot;)&lt;br /&gt;
        assert(lang == nil or type(lang) == &amp;quot;string&amp;quot;, &amp;quot;Bad argument 3 @ convertTextToSpeech [ string expected, got &amp;quot; .. type(lang) .. &amp;quot;]&amp;quot;)&lt;br /&gt;
        -- Tell the client to play the speech&lt;br /&gt;
        return triggerClientEvent(broadcastTo or root, &amp;quot;playTTS&amp;quot;, root, text, lang or &amp;quot;en&amp;quot;)&lt;br /&gt;
    else -- This function is executed clientside&lt;br /&gt;
        local lang = broadcastTo&lt;br /&gt;
        -- Ensure second argument is valid&lt;br /&gt;
        assert(lang == nil or type(lang) == &amp;quot;string&amp;quot;, &amp;quot;Bad argument 2 @ convertTextToSpeech [ string expected, got &amp;quot; .. type(lang) .. &amp;quot;]&amp;quot;)&lt;br /&gt;
        return playTTS(text, lang or &amp;quot;en&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
*Original author: ''Al Obaidi Hassan''.&lt;br /&gt;
*Skype: ''hassan.saad2000''&lt;br /&gt;
*Discord: ''HassoN#2709''&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example disables text chat and converts that text to a speech audible to nearby players. '''NOTE''': this example requires 1.4 in order to work.&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;
local function tellClientsToPlayTTS(text, type)&lt;br /&gt;
    if type == 0 and #text &amp;lt;= 100 then -- We only want to replace normal chat if possible&lt;br /&gt;
        local x, y, z = getElementPosition(source)&lt;br /&gt;
        local col = createColSphere(x, y, z, 30) -- We need this to get nearby players&lt;br /&gt;
        triggerClientEvent(getElementsWithinColShape(col, &amp;quot;player&amp;quot;), &amp;quot;playChatTTS&amp;quot;, source, text) -- Tell the nearby clients to play the sound&lt;br /&gt;
        destroyElement(col)&lt;br /&gt;
        cancelEvent() -- Replace text chat&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerChat&amp;quot;, root, tellClientsToPlayTTS)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEvent(&amp;quot;playChatTTS&amp;quot;, true) -- Add the event&lt;br /&gt;
&lt;br /&gt;
local function playChatTTS(text)&lt;br /&gt;
    local lang = (getLocalization().code):sub(1, 2) -- Output the TTS in the local player language, but don't bother about variants&lt;br /&gt;
    local _, speech, URL = convertTextToSpeech(text, lang)&lt;br /&gt;
    -- Convert that speech to a 3D sound&lt;br /&gt;
    destroyElement(speech)&lt;br /&gt;
    local x, y, z = getElementPosition(source)&lt;br /&gt;
    local speech = playSound3D(URL, x, y, z)&lt;br /&gt;
    attachElements(speech, source) -- Make the sound follow the player&lt;br /&gt;
    setElementDimension(speech, getElementDimension(source))&lt;br /&gt;
    setSoundMinDistance(speech, 15)&lt;br /&gt;
    setSoundMaxDistance(speech, 30)&lt;br /&gt;
    -- Tricky thing ahead: make the player mouth move, but without rendering him unable to move&lt;br /&gt;
    setPedAnimation(source, &amp;quot;ped&amp;quot;, &amp;quot;factalk&amp;quot;, 0, true)&lt;br /&gt;
    setPedAnimation(source, &amp;quot;ped&amp;quot;, &amp;quot;factalk&amp;quot;, 0, true)&lt;br /&gt;
    -- Reset the player mouth after the speech has ended&lt;br /&gt;
    setTimer(function(player)&lt;br /&gt;
        if isElement(player) then&lt;br /&gt;
            setPedAnimation(player) -- Clear the animation&lt;br /&gt;
        end&lt;br /&gt;
    end, math.max(getSoundLength(speech) * 1000, 50), 1, source)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;playChatTTS&amp;quot;, root, playChatTTS)&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;
{{Useful Functions}}&lt;/div&gt;</summary>
		<author><name>Hassan saad</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:Hassan_saad&amp;diff=63181</id>
		<title>User:Hassan saad</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:Hassan_saad&amp;diff=63181"/>
		<updated>2019-07-05T21:14:51Z</updated>

		<summary type="html">&lt;p&gt;Hassan saad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hello there!&lt;br /&gt;
Welcome to my own profile page. Feel free to contact me on Skype: '''''hassan.saad2000''''' or Discord: '''''HassoN#2709''''' for any scripting related stuff.&lt;br /&gt;
&lt;br /&gt;
'''''Some of my works:'''''&lt;br /&gt;
&lt;br /&gt;
[[ConvertTextToSpeech]]&lt;br /&gt;
&lt;br /&gt;
[[RenameAclGroup]]&lt;br /&gt;
&lt;br /&gt;
[[DxDrawTextOnElement]]&lt;br /&gt;
&lt;br /&gt;
[[DxDrawImageOnElement]]&lt;/div&gt;</summary>
		<author><name>Hassan saad</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=ConvertTextToSpeech&amp;diff=53337</id>
		<title>ConvertTextToSpeech</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=ConvertTextToSpeech&amp;diff=53337"/>
		<updated>2018-01-14T20:42:51Z</updated>

		<summary type="html">&lt;p&gt;Hassan saad: /* Function source */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Useful Function}}&amp;lt;lowercasetitle/&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
{{Warning|This function is not working anymore due to Google blocking non-user calls to their TTS API. Plase feel free to fix it by using another public and reliable TTS API.|1}}&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This useful shared function converts some text to audible speech using Google's TTS.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;boolean, element, string convertTextToSpeech ( string text [, table/element broadcastTo = root, string language = &amp;quot;en&amp;quot; ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Required arguments==&lt;br /&gt;
* ''text'': the text to convert to speech.&lt;br /&gt;
&lt;br /&gt;
==Optional arguments==&lt;br /&gt;
* ''broadcastTo'': if it's a regular indexed table, the speech will be broadcasted to the players contained in it. If it's a element, the speech will be heard by the players which are children of that element. This parameter is '''ONLY''' serverside; if you're using this function clientside this will be considered as the ''language'' argument.&lt;br /&gt;
* ''language'': defines the language of the TTS output.&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
* This function returns ''[[nil]]'' and outputs an error if an argument it's not valid.&lt;br /&gt;
* If called serverside and if all arguments are valid, this function returns ''true'' if the client was successully told to play the TTS (althrough this doesn't mean that the client will always play the speech); ''false'' otherwise.&lt;br /&gt;
* If called clientside and if all arguments are valid, this function returns ''true'', the corresponding [[sound]] element and its URL if the sound could theorically be played (althrough it may not play); ''[[nil]]'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Function source==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEvent(&amp;quot;playTTS&amp;quot;, true) -- Add the event&lt;br /&gt;
&lt;br /&gt;
local function playTTS(text, lang)&lt;br /&gt;
    --local URL = &amp;quot;http://translate.google.com/translate_tts?tl=&amp;quot; .. lang .. &amp;quot;&amp;amp;q=&amp;quot; .. text&lt;br /&gt;
    local URL = &amp;quot;https://code.responsivevoice.org/getvoice.php?tl=&amp;quot; .. lang .. &amp;quot;&amp;amp;t=&amp;quot; .. text&lt;br /&gt;
    -- Play the TTS. BASS returns the sound element even if it can not be played.&lt;br /&gt;
    return true, playSound(URL), URL&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;playTTS&amp;quot;, root, playTTS)&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;Shared (server and client)&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 convertTextToSpeech(text, broadcastTo, lang)&lt;br /&gt;
    -- Ensure first argument is valid&lt;br /&gt;
    assert(type(text) == &amp;quot;string&amp;quot;, &amp;quot;Bad argument 1 @ convertTextToSpeech [ string expected, got &amp;quot; .. type(text) .. &amp;quot;]&amp;quot;)&lt;br /&gt;
    assert(#text &amp;lt;= 100, &amp;quot;Bad argument 1 @ convertTextToSpeech [ too long string; 100 characters maximum ]&amp;quot;)&lt;br /&gt;
    if triggerClientEvent then -- Is this function called serverside?&lt;br /&gt;
        -- Ensure second and third arguments are valid&lt;br /&gt;
        assert(broadcastTo == nil or type(broadcastTo) == &amp;quot;table&amp;quot; or isElement(broadcastTo), &amp;quot;Bad argument 2 @ convertTextToSpeech [ table/element expected, got &amp;quot; .. type(broadcastTo) .. &amp;quot;]&amp;quot;)&lt;br /&gt;
        assert(lang == nil or type(lang) == &amp;quot;string&amp;quot;, &amp;quot;Bad argument 3 @ convertTextToSpeech [ string expected, got &amp;quot; .. type(lang) .. &amp;quot;]&amp;quot;)&lt;br /&gt;
        -- Tell the client to play the speech&lt;br /&gt;
        return triggerClientEvent(broadcastTo or root, &amp;quot;playTTS&amp;quot;, root, text, lang or &amp;quot;en&amp;quot;)&lt;br /&gt;
    else -- This function is executed clientside&lt;br /&gt;
        local lang = broadcastTo&lt;br /&gt;
        -- Ensure second argument is valid&lt;br /&gt;
        assert(lang == nil or type(lang) == &amp;quot;string&amp;quot;, &amp;quot;Bad argument 2 @ convertTextToSpeech [ string expected, got &amp;quot; .. type(lang) .. &amp;quot;]&amp;quot;)&lt;br /&gt;
        return playTTS(text, lang or &amp;quot;en&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
*Original author: ''Al Obaidi Hassan''.&lt;br /&gt;
*Skype: ''hassan.saad2000''&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example disables text chat and converts that text to a speech audible to nearby players. '''NOTE''': this example requires 1.4 in order to work.&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;
local function tellClientsToPlayTTS(text, type)&lt;br /&gt;
    if type == 0 and #text &amp;lt;= 100 then -- We only want to replace normal chat if possible&lt;br /&gt;
        local x, y, z = getElementPosition(source)&lt;br /&gt;
        local col = createColSphere(x, y, z, 30) -- We need this to get nearby players&lt;br /&gt;
        triggerClientEvent(getElementsWithinColShape(col, &amp;quot;player&amp;quot;), &amp;quot;playChatTTS&amp;quot;, source, text) -- Tell the nearby clients to play the sound&lt;br /&gt;
        destroyElement(col)&lt;br /&gt;
        cancelEvent() -- Replace text chat&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerChat&amp;quot;, root, tellClientsToPlayTTS)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEvent(&amp;quot;playChatTTS&amp;quot;, true) -- Add the event&lt;br /&gt;
&lt;br /&gt;
local function playChatTTS(text)&lt;br /&gt;
    local lang = (getLocalization().code):sub(1, 2) -- Output the TTS in the local player language, but don't bother about variants&lt;br /&gt;
    local _, speech, URL = convertTextToSpeech(text, lang)&lt;br /&gt;
    -- Convert that speech to a 3D sound&lt;br /&gt;
    destroyElement(speech)&lt;br /&gt;
    local x, y, z = getElementPosition(source)&lt;br /&gt;
    local speech = playSound3D(URL, x, y, z)&lt;br /&gt;
    attachElements(speech, source) -- Make the sound follow the player&lt;br /&gt;
    setElementDimension(speech, getElementDimension(source))&lt;br /&gt;
    setSoundMinDistance(speech, 15)&lt;br /&gt;
    setSoundMaxDistance(speech, 30)&lt;br /&gt;
    -- Tricky thing ahead: make the player mouth move, but without rendering him unable to move&lt;br /&gt;
    setPedAnimation(source, &amp;quot;ped&amp;quot;, &amp;quot;factalk&amp;quot;, 0, true)&lt;br /&gt;
    setPedAnimation(source, &amp;quot;ped&amp;quot;, &amp;quot;factalk&amp;quot;, 0, true)&lt;br /&gt;
    -- Reset the player mouth after the speech has ended&lt;br /&gt;
    setTimer(function(player)&lt;br /&gt;
        if isElement(player) then&lt;br /&gt;
            setPedAnimation(player) -- Clear the animation&lt;br /&gt;
        end&lt;br /&gt;
    end, math.max(getSoundLength(speech) * 1000, 50), 1, source)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;playChatTTS&amp;quot;, root, playChatTTS)&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;
{{Useful Functions}}&lt;/div&gt;</summary>
		<author><name>Hassan saad</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawTextOnElement&amp;diff=53336</id>
		<title>DxDrawTextOnElement</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawTextOnElement&amp;diff=53336"/>
		<updated>2018-01-14T20:42:40Z</updated>

		<summary type="html">&lt;p&gt;Hassan saad: /* Function source */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&amp;lt;lowercasetitle/&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This useful client function draws a text on any element you choose.&lt;br /&gt;
{{Note|You have to use [[onClientRender]] or [[onClientPreRender]] events with this function.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;boolean dxDrawTextOnElement(element TheElement, string text [, int height = 1, int distance = 20, int R = 255, int G = 255, int B = 255, int alpha = 255, int size = 1, string font = &amp;quot;arial&amp;quot;, bool checkBuildings = true, bool checkVehicles = false, bool checkPeds = false, bool checkDummies = true, bool seeThroughStuff = true, bool ignoreSomeObjectsForCamera = false, element ignoredElement = nil ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[Image:dxDrawTextOnElement.png|thumb|Example of how it should looks like.|284x230px]]&lt;br /&gt;
&lt;br /&gt;
==Required arguments==&lt;br /&gt;
* ''TheElement'': The element you want to draw the text on it.&lt;br /&gt;
* ''text'': The text you want.&lt;br /&gt;
&lt;br /&gt;
==Optional arguments==&lt;br /&gt;
* ''height'': The height of the text, it's 1 by default.&lt;br /&gt;
* ''distance'': The distance you will be able to view the text from, it's 20 by default.&lt;br /&gt;
* ''R'': The Red color code (0-255), it's 255 by default.&lt;br /&gt;
* ''G'': The Green color code (0-255), it's 255 by default.&lt;br /&gt;
* ''B'': The Blue color code (0-255), it's 255 by default.&lt;br /&gt;
* ''alpha'': The alpha of the text, it's 255 by default.&lt;br /&gt;
* ''size'': The size of the text, it's 1 by default.&lt;br /&gt;
* ''font'': Either a custom [[DX font]] element or the name of a built-in DX font:&lt;br /&gt;
{{DxFonts}}&lt;br /&gt;
It's arial by default.&lt;br /&gt;
*'''checkBuildings:''' Allow the line of sight to be blocked by GTA's internally placed buildings, i.e. the world map.&lt;br /&gt;
*'''checkVehicles:''' Allow the line of sight to be blocked by [[Vehicle|vehicles]].&lt;br /&gt;
*'''checkPeds:''' Allow the line of sight to be blocked by peds, i.e. [[Player|players]].&lt;br /&gt;
*'''checkObjects:''' Allow the line of sight to be blocked by [[Object|objects]].&lt;br /&gt;
*'''checkDummies:''' Allow the line of sight to be blocked by GTA's internal dummies.  These are not used in the current MTA version so this argument can be set to ''false''.&lt;br /&gt;
*'''seeThroughStuff:''' Allow the line of sight to be blocked by translucent game objects, e.g. glass.&lt;br /&gt;
*'''ignoreSomeObjectsForCamera:''' Allow the line of sight to be blocked by certain objects.&lt;br /&gt;
*'''ignoredElement:''' Allow the line of sight to pass through a certain specified element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Function source==&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 dxDrawTextOnElement(TheElement,text,height,distance,R,G,B,alpha,size,font,checkBuildings,checkVehicles,checkPeds,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement)&lt;br /&gt;
				local x, y, z = getElementPosition(TheElement)&lt;br /&gt;
				local x2, y2, z2 = getElementPosition(localPlayer)&lt;br /&gt;
				local distance = distance or 20&lt;br /&gt;
				local height = height or 1&lt;br /&gt;
                                local checkBuildings = checkBuildings or true&lt;br /&gt;
                                local checkVehicles = checkVehicles or false&lt;br /&gt;
                                local checkPeds = checkPeds or false&lt;br /&gt;
                                local checkObjects = checkObjects or true&lt;br /&gt;
                                local checkDummies = checkDummies or true&lt;br /&gt;
                                local seeThroughStuff = seeThroughStuff or false&lt;br /&gt;
                                local ignoreSomeObjectsForCamera = ignoreSomeObjectsForCamera or false&lt;br /&gt;
                                local ignoredElement = ignoredElement or nil&lt;br /&gt;
				if (isLineOfSightClear(x, y, z, x2, y2, z2, checkBuildings, checkVehicles, checkPeds , checkObjects,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement)) then&lt;br /&gt;
					local sx, sy = getScreenFromWorldPosition(x, y, z+height)&lt;br /&gt;
					if(sx) and (sy) then&lt;br /&gt;
						local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2)&lt;br /&gt;
						if(distanceBetweenPoints &amp;lt; distance) then&lt;br /&gt;
							dxDrawText(text, sx+2, sy+2, sx, sy, tocolor(R or 255, G or 255, B or 255, alpha or 255), (size or 1)-(distanceBetweenPoints / distance), font or &amp;quot;arial&amp;quot;, &amp;quot;center&amp;quot;, &amp;quot;center&amp;quot;)&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
*Original author: ''Al Obaidi Hassan''.&lt;br /&gt;
*Skype: ''hassan.saad2000''&lt;br /&gt;
&lt;br /&gt;
==Example #1==&lt;br /&gt;
This example creates a text on a random ped in the Grove street.&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;
randomPed = createPed(285,2476.91406,-1665.31799,13.32435)&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientRender&amp;quot;, getRootElement(), &lt;br /&gt;
function ()&lt;br /&gt;
dxDrawTextOnElement(randomPed,&amp;quot;SWATTEAM Officer&amp;quot;,1,20,0,0,255,255,1,&amp;quot;pricedown&amp;quot;)&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;
==Example #2==&lt;br /&gt;
This example creates a text 'HassoN' on all the players are in a team named HassoN.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onClientRender&amp;quot;, getRootElement(), &lt;br /&gt;
function ()&lt;br /&gt;
for k,v in ipairs(getElementsByType(&amp;quot;player&amp;quot;)) do&lt;br /&gt;
		if getPlayerTeam(v) == getTeamFromName(&amp;quot;HassoN&amp;quot;) then&lt;br /&gt;
			if v == localPlayer then return end&lt;br /&gt;
			dxDrawTextOnElement(v,&amp;quot;HassoN&amp;quot;,1,20,0,0,255,255,1,&amp;quot;arial&amp;quot;)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
{{Useful Functions}}&lt;/div&gt;</summary>
		<author><name>Hassan saad</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawImageOnElement&amp;diff=53335</id>
		<title>DxDrawImageOnElement</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawImageOnElement&amp;diff=53335"/>
		<updated>2018-01-14T20:42:27Z</updated>

		<summary type="html">&lt;p&gt;Hassan saad: /* Function source */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&amp;lt;lowercasetitle/&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This useful client function draws an image on any element you choose.&lt;br /&gt;
{{Note|You have to use [[onClientRender]] or [[onClientPreRender]] events with this function.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;boolean dxDrawImageOnElement(element TheElement, element Image [, int distance = 20, int height = 1, int width = 1, int R = 255, int G = 255, int B = 255, int alpha = 255, bool checkBuildings = true, bool checkVehicles = false, bool checkPeds = false, bool checkDummies = true, bool seeThroughStuff = true, bool ignoreSomeObjectsForCamera = false, element ignoredElement = nil ] ) &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:DxDrawImageOnElement.png|thumb|Example of how it should looks like.|284x230px]]&lt;br /&gt;
&lt;br /&gt;
==Required arguments==&lt;br /&gt;
* ''TheElement'': The element you want to draw the image on it.&lt;br /&gt;
* ''Image'': The image you want. Use [[dxCreateTexture]] to create it.&lt;br /&gt;
&lt;br /&gt;
==Optional arguments==&lt;br /&gt;
* ''height'': The height of the text, it's 1 by default.&lt;br /&gt;
* ''distance'': The distance you will be able to view the image from, it's 20 by default.&lt;br /&gt;
* ''height'': The height of the image, it's 1 by default.&lt;br /&gt;
* ''width'': The width of the image, it's 1 by default.&lt;br /&gt;
* ''R'': The Red color code (0-255), it's 255 by default.&lt;br /&gt;
* ''G'': The Green color code (0-255), it's 255 by default.&lt;br /&gt;
* ''B'': The Blue color code (0-255), it's 255 by default.&lt;br /&gt;
* ''alpha'': The alpha of the image, it's 255 by default.&lt;br /&gt;
&lt;br /&gt;
*'''checkBuildings:''' Allow the line of sight to be blocked by GTA's internally placed buildings, i.e. the world map.&lt;br /&gt;
*'''checkVehicles:''' Allow the line of sight to be blocked by [[Vehicle|vehicles]].&lt;br /&gt;
*'''checkPeds:''' Allow the line of sight to be blocked by peds, i.e. [[Player|players]].&lt;br /&gt;
*'''checkObjects:''' Allow the line of sight to be blocked by [[Object|objects]].&lt;br /&gt;
*'''checkDummies:''' Allow the line of sight to be blocked by GTA's internal dummies.  These are not used in the current MTA version so this argument can be set to ''false''.&lt;br /&gt;
*'''seeThroughStuff:''' Allow the line of sight to be blocked by translucent game objects, e.g. glass.&lt;br /&gt;
*'''ignoreSomeObjectsForCamera:''' Allow the line of sight to be blocked by certain objects.&lt;br /&gt;
*'''ignoredElement:''' Allow the line of sight to pass through a certain specified element.&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Function source==&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 dxDrawImageOnElement(TheElement,Image,distance,height,width,R,G,B,alpha)&lt;br /&gt;
				local x, y, z = getElementPosition(TheElement)&lt;br /&gt;
				local x2, y2, z2 = getElementPosition(localPlayer)&lt;br /&gt;
				local distance = distance or 20&lt;br /&gt;
				local height = height or 1&lt;br /&gt;
				local width = width or 1&lt;br /&gt;
                                local checkBuildings = checkBuildings or true&lt;br /&gt;
                                local checkVehicles = checkVehicles or false&lt;br /&gt;
                                local checkPeds = checkPeds or false&lt;br /&gt;
                                local checkObjects = checkObjects or true&lt;br /&gt;
                                local checkDummies = checkDummies or true&lt;br /&gt;
                                local seeThroughStuff = seeThroughStuff or false&lt;br /&gt;
                                local ignoreSomeObjectsForCamera = ignoreSomeObjectsForCamera or false&lt;br /&gt;
                                local ignoredElement = ignoredElement or nil&lt;br /&gt;
				if (isLineOfSightClear(x, y, z, x2, y2, z2, checkBuildings, checkVehicles, checkPeds , checkObjects,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement)) then&lt;br /&gt;
					local sx, sy = getScreenFromWorldPosition(x, y, z+height)&lt;br /&gt;
					if(sx) and (sy) then&lt;br /&gt;
						local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2)&lt;br /&gt;
						if(distanceBetweenPoints &amp;lt; distance) then&lt;br /&gt;
							dxDrawMaterialLine3D(x, y, z+1+height-(distanceBetweenPoints/distance), x, y, z+height, Image, width-(distanceBetweenPoints/distance), tocolor(R or 255, G or 255, B or 255, alpha or 255))&lt;br /&gt;
						end&lt;br /&gt;
					end&lt;br /&gt;
			end&lt;br /&gt;
	end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
*Original author: ''Al Obaidi Hassan''.&lt;br /&gt;
*Skype: ''hassan.saad2000''&lt;br /&gt;
&lt;br /&gt;
==Example #1==&lt;br /&gt;
This example creates an image on a random ped in the Grove street.&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;
randomPed = createPed(285,2506.83423,-1684.89941,13.55648)&lt;br /&gt;
tag = dxCreateTexture(&amp;quot;crown.png&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root,&lt;br /&gt;
function()&lt;br /&gt;
dxDrawImageOnElement(randomPed,tag)&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;
==Example #2==&lt;br /&gt;
This example creates an image on all the vehicles in the game.&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 tag = dxCreateTexture(&amp;quot;bike.png&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root,&lt;br /&gt;
function()&lt;br /&gt;
for k,v in ipairs(getElementsByType(&amp;quot;vehicle&amp;quot;)) do&lt;br /&gt;
dxDrawImageOnElement(v,tag)&lt;br /&gt;
end&lt;br /&gt;
end) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
{{Useful Functions}}&lt;/div&gt;</summary>
		<author><name>Hassan saad</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=RenameAclGroup&amp;diff=53334</id>
		<title>RenameAclGroup</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=RenameAclGroup&amp;diff=53334"/>
		<updated>2018-01-14T20:40:59Z</updated>

		<summary type="html">&lt;p&gt;Hassan saad: /* 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;
This function is used to rename an [[Aclgroup|ACL group]].&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool renameAclGroup ( string old, string new )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Required Arguments==&lt;br /&gt;
* '''old:''' name of the ACL group you want to change&lt;br /&gt;
* '''new:''' the name we want the group to be changed to&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the rename was successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function renameAclGroup( old, new )&lt;br /&gt;
	if ( type( old ) ~= &amp;quot;string&amp;quot; ) then&lt;br /&gt;
		outputDebugString( &amp;quot;Bad argument 1 @ renameAclGroup [ string expected, got &amp;quot; .. type( old ) .. &amp;quot; ] &amp;quot;, 2 )&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if ( type( new ) ~= &amp;quot;string&amp;quot; ) then&lt;br /&gt;
		outputDebugString( &amp;quot;Bad argument 2 @ renameAclGroup [ string expected, got &amp;quot; .. type( new ) .. &amp;quot; ] &amp;quot;, 2 )&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local oldACLGroup = aclGetGroup( old )&lt;br /&gt;
	&lt;br /&gt;
	if ( not oldACLGroup ) then&lt;br /&gt;
		outputDebugString( &amp;quot;Bad argument 1 @ renameAclGroup [ no acl group found with this name ] &amp;quot;, 2 )&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if ( aclGetGroup( new ) ) then&lt;br /&gt;
		outputDebugString( &amp;quot;Bad argument 2 @ renameAclGroup [ there is already a group with this name ] &amp;quot;, 2 )&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local oldACL = aclGroupListACL( oldACLGroup )&lt;br /&gt;
	local oldObjects = aclGroupListObjects( oldACLGroup )&lt;br /&gt;
	local newACLGroup = aclCreateGroup( new )&lt;br /&gt;
	&lt;br /&gt;
	for _,nameOfACL in pairs( oldACL ) do&lt;br /&gt;
		aclGroupAddACL( newACLGroup, nameOfACL )&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	for _,nameOfObject in pairs( oldObjects ) do&lt;br /&gt;
		aclGroupAddObject( newACLGroup, nameOfObject )&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	aclDestroyGroup( oldACLGroup )&lt;br /&gt;
	aclSave( )&lt;br /&gt;
	aclReload( )&lt;br /&gt;
	&lt;br /&gt;
	return true&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Original author: ''Al Obaidi Hassan''&lt;br /&gt;
*Skype: ''hassan.saad2000''&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example changes a group named ''Moderator'' to ''HassoN'' when the script is loaded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler( &amp;quot;onResourceStart&amp;quot;, resourceRoot,&lt;br /&gt;
	function( )&lt;br /&gt;
		renameAclGroup( &amp;quot;Moderator&amp;quot;, &amp;quot;HassoN&amp;quot; )&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;
{{Useful Functions}}&lt;/div&gt;</summary>
		<author><name>Hassan saad</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawTextOnElement&amp;diff=46862</id>
		<title>DxDrawTextOnElement</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawTextOnElement&amp;diff=46862"/>
		<updated>2016-03-13T14:04:07Z</updated>

		<summary type="html">&lt;p&gt;Hassan saad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&amp;lt;lowercasetitle/&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This useful client function draws a text on any element you choose.&lt;br /&gt;
{{Note|You have to use [[onClientRender]] or [[onClientPreRender]] events with this function.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;boolean dxDrawTextOnElement(element TheElement, string text [, int height = 1, int distance = 20, int R = 255, int G = 255, int B = 255, int alpha = 255, int size = 1, string font = &amp;quot;arial&amp;quot;, bool checkBuildings = true, bool checkVehicles = false, bool checkPeds = false, bool checkDummies = true, bool seeThroughStuff = true, bool ignoreSomeObjectsForCamera = false, element ignoredElement = nil ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[Image:dxDrawTextOnElement.png|thumb|Example of how it should looks like.|284x230px]]&lt;br /&gt;
&lt;br /&gt;
==Required arguments==&lt;br /&gt;
* ''TheElement'': The element you want to draw the text on it.&lt;br /&gt;
* ''text'': The text you want.&lt;br /&gt;
&lt;br /&gt;
==Optional arguments==&lt;br /&gt;
* ''height'': The height of the text, it's 1 by default.&lt;br /&gt;
* ''distance'': The distance you will be able to view the text from, it's 20 by default.&lt;br /&gt;
* ''R'': The Red color code (0-255), it's 255 by default.&lt;br /&gt;
* ''G'': The Green color code (0-255), it's 255 by default.&lt;br /&gt;
* ''B'': The Blue color code (0-255), it's 255 by default.&lt;br /&gt;
* ''alpha'': The alpha of the text, it's 255 by default.&lt;br /&gt;
* ''size'': The size of the text, it's 1 by default.&lt;br /&gt;
* ''font'': Either a custom [[DX font]] element or the name of a built-in DX font:&lt;br /&gt;
{{DxFonts}}&lt;br /&gt;
It's arial by default.&lt;br /&gt;
*'''checkBuildings:''' Allow the line of sight to be blocked by GTA's internally placed buildings, i.e. the world map.&lt;br /&gt;
*'''checkVehicles:''' Allow the line of sight to be blocked by [[Vehicle|vehicles]].&lt;br /&gt;
*'''checkPeds:''' Allow the line of sight to be blocked by peds, i.e. [[Player|players]].&lt;br /&gt;
*'''checkObjects:''' Allow the line of sight to be blocked by [[Object|objects]].&lt;br /&gt;
*'''checkDummies:''' Allow the line of sight to be blocked by GTA's internal dummies.  These are not used in the current MTA version so this argument can be set to ''false''.&lt;br /&gt;
*'''seeThroughStuff:''' Allow the line of sight to be blocked by translucent game objects, e.g. glass.&lt;br /&gt;
*'''ignoreSomeObjectsForCamera:''' Allow the line of sight to be blocked by certain objects.&lt;br /&gt;
*'''ignoredElement:''' Allow the line of sight to pass through a certain specified element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Function source==&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 dxDrawTextOnElement(TheElement,text,height,distance,R,G,B,alpha,size,font,checkBuildings,checkVehicles,checkPeds,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement)&lt;br /&gt;
				local x, y, z = getElementPosition(TheElement)&lt;br /&gt;
				local x2, y2, z2 = getElementPosition(localPlayer)&lt;br /&gt;
				local distance = distance or 20&lt;br /&gt;
				local height = height or 1&lt;br /&gt;
                                local checkBuildings = checkBuildings or true&lt;br /&gt;
                                local checkVehicles = checkVehicles or false&lt;br /&gt;
                                local checkPeds = checkPeds or false&lt;br /&gt;
                                local checkObjects = checkObjects or true&lt;br /&gt;
                                local checkDummies = checkDummies or true&lt;br /&gt;
                                local seeThroughStuff = seeThroughStuff or false&lt;br /&gt;
                                local ignoreSomeObjectsForCamera = ignoreSomeObjectsForCamera or false&lt;br /&gt;
                                local ignoredElement = ignoredElement or nil&lt;br /&gt;
				if (isLineOfSightClear(x, y, z, x2, y2, z2, checkBuildings, checkVehicles, checkPeds , checkObjects,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement)) then&lt;br /&gt;
					local sx, sy = getScreenFromWorldPosition(x, y, z+height)&lt;br /&gt;
					if(sx) and (sy) then&lt;br /&gt;
						local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2)&lt;br /&gt;
						if(distanceBetweenPoints &amp;lt; distance) then&lt;br /&gt;
							dxDrawText(text, sx+2, sy+2, sx, sy, tocolor(R or 255, G or 255, B or 255, alpha or 255), (size or 1)-(distanceBetweenPoints / distance), font or &amp;quot;arial&amp;quot;, &amp;quot;center&amp;quot;, &amp;quot;center&amp;quot;)&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
*Original author: ''Has[S]oN''.&lt;br /&gt;
*Skype: ''hassan.saad2000''&lt;br /&gt;
&lt;br /&gt;
==Example #1==&lt;br /&gt;
This example creates a text on a random ped in the Grove street.&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;
randomPed = createPed(285,2476.91406,-1665.31799,13.32435)&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientRender&amp;quot;, getRootElement(), &lt;br /&gt;
function ()&lt;br /&gt;
dxDrawTextOnElement(randomPed,&amp;quot;SWATTEAM Officer&amp;quot;,1,20,0,0,255,255,1,&amp;quot;pricedown&amp;quot;)&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;
==Example #2==&lt;br /&gt;
This example creates a text 'HassoN' on all the players are in a team named HassoN.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onClientRender&amp;quot;, getRootElement(), &lt;br /&gt;
function ()&lt;br /&gt;
for k,v in ipairs(getElementsByType(&amp;quot;player&amp;quot;)) do&lt;br /&gt;
		if getPlayerTeam(v) == getTeamFromName(&amp;quot;HassoN&amp;quot;) then&lt;br /&gt;
			if v == localPlayer then return end&lt;br /&gt;
			dxDrawTextOnElement(v,&amp;quot;HassoN&amp;quot;,1,20,0,0,255,255,1,&amp;quot;arial&amp;quot;)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
{{Useful Functions}}&lt;/div&gt;</summary>
		<author><name>Hassan saad</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawImageOnElement&amp;diff=46861</id>
		<title>DxDrawImageOnElement</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawImageOnElement&amp;diff=46861"/>
		<updated>2016-03-13T14:01:43Z</updated>

		<summary type="html">&lt;p&gt;Hassan saad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&amp;lt;lowercasetitle/&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This useful client function draws an image on any element you choose.&lt;br /&gt;
{{Note|You have to use [[onClientRender]] or [[onClientPreRender]] events with this function.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;boolean dxDrawImageOnElement(element TheElement, element Image [, int distance = 20, int height = 1, int width = 1, int R = 255, int G = 255, int B = 255, int alpha = 255, bool checkBuildings = true, bool checkVehicles = false, bool checkPeds = false, bool checkDummies = true, bool seeThroughStuff = true, bool ignoreSomeObjectsForCamera = false, element ignoredElement = nil ] ) &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:DxDrawImageOnElement.png|thumb|Example of how it should looks like.|284x230px]]&lt;br /&gt;
&lt;br /&gt;
==Required arguments==&lt;br /&gt;
* ''TheElement'': The element you want to draw the image on it.&lt;br /&gt;
* ''Image'': The image you want. Use [[dxCreateTexture]] to create it.&lt;br /&gt;
&lt;br /&gt;
==Optional arguments==&lt;br /&gt;
* ''height'': The height of the text, it's 1 by default.&lt;br /&gt;
* ''distance'': The distance you will be able to view the image from, it's 20 by default.&lt;br /&gt;
* ''height'': The height of the image, it's 1 by default.&lt;br /&gt;
* ''width'': The width of the image, it's 1 by default.&lt;br /&gt;
* ''R'': The Red color code (0-255), it's 255 by default.&lt;br /&gt;
* ''G'': The Green color code (0-255), it's 255 by default.&lt;br /&gt;
* ''B'': The Blue color code (0-255), it's 255 by default.&lt;br /&gt;
* ''alpha'': The alpha of the image, it's 255 by default.&lt;br /&gt;
&lt;br /&gt;
*'''checkBuildings:''' Allow the line of sight to be blocked by GTA's internally placed buildings, i.e. the world map.&lt;br /&gt;
*'''checkVehicles:''' Allow the line of sight to be blocked by [[Vehicle|vehicles]].&lt;br /&gt;
*'''checkPeds:''' Allow the line of sight to be blocked by peds, i.e. [[Player|players]].&lt;br /&gt;
*'''checkObjects:''' Allow the line of sight to be blocked by [[Object|objects]].&lt;br /&gt;
*'''checkDummies:''' Allow the line of sight to be blocked by GTA's internal dummies.  These are not used in the current MTA version so this argument can be set to ''false''.&lt;br /&gt;
*'''seeThroughStuff:''' Allow the line of sight to be blocked by translucent game objects, e.g. glass.&lt;br /&gt;
*'''ignoreSomeObjectsForCamera:''' Allow the line of sight to be blocked by certain objects.&lt;br /&gt;
*'''ignoredElement:''' Allow the line of sight to pass through a certain specified element.&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Function source==&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 dxDrawImageOnElement(TheElement,Image,distance,height,width,R,G,B,alpha)&lt;br /&gt;
				local x, y, z = getElementPosition(TheElement)&lt;br /&gt;
				local x2, y2, z2 = getElementPosition(localPlayer)&lt;br /&gt;
				local distance = distance or 20&lt;br /&gt;
				local height = height or 1&lt;br /&gt;
				local width = width or 1&lt;br /&gt;
                                local checkBuildings = checkBuildings or true&lt;br /&gt;
                                local checkVehicles = checkVehicles or false&lt;br /&gt;
                                local checkPeds = checkPeds or false&lt;br /&gt;
                                local checkObjects = checkObjects or true&lt;br /&gt;
                                local checkDummies = checkDummies or true&lt;br /&gt;
                                local seeThroughStuff = seeThroughStuff or false&lt;br /&gt;
                                local ignoreSomeObjectsForCamera = ignoreSomeObjectsForCamera or false&lt;br /&gt;
                                local ignoredElement = ignoredElement or nil&lt;br /&gt;
				if (isLineOfSightClear(x, y, z, x2, y2, z2, checkBuildings, checkVehicles, checkPeds , checkObjects,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement)) then&lt;br /&gt;
					local sx, sy = getScreenFromWorldPosition(x, y, z+height)&lt;br /&gt;
					if(sx) and (sy) then&lt;br /&gt;
						local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2)&lt;br /&gt;
						if(distanceBetweenPoints &amp;lt; distance) then&lt;br /&gt;
							dxDrawMaterialLine3D(x, y, z+1+height-(distanceBetweenPoints/distance), x, y, z+height, Image, width-(distanceBetweenPoints/distance), tocolor(R or 255, G or 255, B or 255, alpha or 255))&lt;br /&gt;
						end&lt;br /&gt;
					end&lt;br /&gt;
			end&lt;br /&gt;
	end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
*Original author: ''Has[S]oN''.&lt;br /&gt;
*Skype: ''hassan.saad2000''&lt;br /&gt;
&lt;br /&gt;
==Example #1==&lt;br /&gt;
This example creates an image on a random ped in the Grove street.&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;
randomPed = createPed(285,2506.83423,-1684.89941,13.55648)&lt;br /&gt;
tag = dxCreateTexture(&amp;quot;crown.png&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root,&lt;br /&gt;
function()&lt;br /&gt;
dxDrawImageOnElement(randomPed,tag)&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;
==Example #2==&lt;br /&gt;
This example creates an image on all the vehicles in the game.&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 tag = dxCreateTexture(&amp;quot;bike.png&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root,&lt;br /&gt;
function()&lt;br /&gt;
for k,v in ipairs(getElementsByType(&amp;quot;vehicle&amp;quot;)) do&lt;br /&gt;
dxDrawImageOnElement(v,tag)&lt;br /&gt;
end&lt;br /&gt;
end) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
{{Useful Functions}}&lt;/div&gt;</summary>
		<author><name>Hassan saad</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawTextOnElement&amp;diff=46838</id>
		<title>DxDrawTextOnElement</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawTextOnElement&amp;diff=46838"/>
		<updated>2016-03-12T01:50:58Z</updated>

		<summary type="html">&lt;p&gt;Hassan saad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&amp;lt;lowercasetitle/&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This useful client function draws a text on any element you choose.&lt;br /&gt;
{{Note|You have to use [[onClientRender]] or [[onClientPreRender]] events with this function.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;boolean dxDrawTextOnElement(element TheElement, string text [, int height, int distance, int R, int G, int B, int alpha, int size, string font, bool checkBuildings, bool checkVehicles, bool checkPeds, bool checkDummies, bool seeThroughStuff, bool ignoreSomeObjectsForCamera, element ignoredElement ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[Image:dxDrawTextOnElement.png|thumb|Example of how it should looks like.|284x230px]]&lt;br /&gt;
&lt;br /&gt;
==Required arguments==&lt;br /&gt;
* ''TheElement'': The element you want to draw the text on it.&lt;br /&gt;
* ''text'': The text you want.&lt;br /&gt;
&lt;br /&gt;
==Optional arguments==&lt;br /&gt;
* ''height'': The height of the text, it's 1 by default.&lt;br /&gt;
* ''distance'': The distance you will be able to view the text from, it's 20 by default.&lt;br /&gt;
* ''R'': The Red color code (0-255), it's 255 by default.&lt;br /&gt;
* ''G'': The Green color code (0-255), it's 255 by default.&lt;br /&gt;
* ''B'': The Blue color code (0-255), it's 255 by default.&lt;br /&gt;
* ''alpha'': The alpha of the text, it's 255 by default.&lt;br /&gt;
* ''size'': The size of the text, it's 1 by default.&lt;br /&gt;
* ''font'': Either a custom [[DX font]] element or the name of a built-in DX font:&lt;br /&gt;
{{DxFonts}}&lt;br /&gt;
It's arial by default.&lt;br /&gt;
*'''checkBuildings:''' Allow the line of sight to be blocked by GTA's internally placed buildings, i.e. the world map.&lt;br /&gt;
*'''checkVehicles:''' Allow the line of sight to be blocked by [[Vehicle|vehicles]].&lt;br /&gt;
*'''checkPeds:''' Allow the line of sight to be blocked by peds, i.e. [[Player|players]].&lt;br /&gt;
*'''checkObjects:''' Allow the line of sight to be blocked by [[Object|objects]].&lt;br /&gt;
*'''checkDummies:''' Allow the line of sight to be blocked by GTA's internal dummies.  These are not used in the current MTA version so this argument can be set to ''false''.&lt;br /&gt;
*'''seeThroughStuff:''' Allow the line of sight to be blocked by translucent game objects, e.g. glass.&lt;br /&gt;
*'''ignoreSomeObjectsForCamera:''' Allow the line of sight to be blocked by certain objects.&lt;br /&gt;
*'''ignoredElement:''' Allow the line of sight to pass through a certain specified element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Function source==&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 dxDrawTextOnElement(TheElement,text,height,distance,R,G,B,alpha,size,font,checkBuildings,checkVehicles,checkPeds,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement)&lt;br /&gt;
				local x, y, z = getElementPosition(TheElement)&lt;br /&gt;
				local x2, y2, z2 = getElementPosition(localPlayer)&lt;br /&gt;
				local distance = distance or 20&lt;br /&gt;
				local height = height or 1&lt;br /&gt;
                                local checkBuildings = checkBuildings or true&lt;br /&gt;
                                local checkVehicles = checkVehicles or false&lt;br /&gt;
                                local checkPeds = checkPeds or false&lt;br /&gt;
                                local checkObjects = checkObjects or true&lt;br /&gt;
                                local checkDummies = checkDummies or true&lt;br /&gt;
                                local seeThroughStuff = seeThroughStuff or false&lt;br /&gt;
                                local ignoreSomeObjectsForCamera = ignoreSomeObjectsForCamera or false&lt;br /&gt;
                                local ignoredElement = ignoredElement or nil&lt;br /&gt;
				if (isLineOfSightClear(x, y, z, x2, y2, z2, checkBuildings, checkVehicles, checkPeds , checkObjects,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement)) then&lt;br /&gt;
					local sx, sy = getScreenFromWorldPosition(x, y, z+height)&lt;br /&gt;
					if(sx) and (sy) then&lt;br /&gt;
						local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2)&lt;br /&gt;
						if(distanceBetweenPoints &amp;lt; distance) then&lt;br /&gt;
							dxDrawText(text, sx+2, sy+2, sx, sy, tocolor(R or 255, G or 255, B or 255, alpha or 255), (size or 1)-(distanceBetweenPoints / distance), font or &amp;quot;arial&amp;quot;, &amp;quot;center&amp;quot;, &amp;quot;center&amp;quot;)&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
*Original author: ''Has[S]oN''.&lt;br /&gt;
*Skype: ''hassan.saad2000''&lt;br /&gt;
&lt;br /&gt;
==Example #1==&lt;br /&gt;
This example creates a text on a random ped in the Grove street.&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;
randomPed = createPed(285,2476.91406,-1665.31799,13.32435)&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientRender&amp;quot;, getRootElement(), &lt;br /&gt;
function ()&lt;br /&gt;
dxDrawTextOnElement(randomPed,&amp;quot;SWATTEAM Officer&amp;quot;,1,20,0,0,255,255,1,&amp;quot;pricedown&amp;quot;)&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;
==Example #2==&lt;br /&gt;
This example creates a text 'HassoN' on all the players are in a team named HassoN.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onClientRender&amp;quot;, getRootElement(), &lt;br /&gt;
function ()&lt;br /&gt;
for k,v in ipairs(getElementsByType(&amp;quot;player&amp;quot;)) do&lt;br /&gt;
		if getPlayerTeam(v) == getTeamFromName(&amp;quot;HassoN&amp;quot;) then&lt;br /&gt;
			if v == localPlayer then return end&lt;br /&gt;
			dxDrawTextOnElement(v,&amp;quot;HassoN&amp;quot;,1,20,0,0,255,255,1,&amp;quot;arial&amp;quot;)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
{{Useful Functions}}&lt;/div&gt;</summary>
		<author><name>Hassan saad</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawImageOnElement&amp;diff=46837</id>
		<title>DxDrawImageOnElement</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawImageOnElement&amp;diff=46837"/>
		<updated>2016-03-12T01:50:57Z</updated>

		<summary type="html">&lt;p&gt;Hassan saad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&amp;lt;lowercasetitle/&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This useful client function draws an image on any element you choose.&lt;br /&gt;
{{Note|You have to use [[onClientRender]] or [[onClientPreRender]] events with this function.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;boolean dxDrawImageOnElement(element TheElement, element Image [, int distance, int height, int width, int R, int G, int B, int alpha, bool checkBuildings, bool checkVehicles, bool checkPeds, bool checkDummies, bool seeThroughStuff, bool ignoreSomeObjectsForCamera, element ignoredElement ] ) &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:DxDrawImageOnElement.png|thumb|Example of how it should looks like.|284x230px]]&lt;br /&gt;
&lt;br /&gt;
==Required arguments==&lt;br /&gt;
* ''TheElement'': The element you want to draw the image on it.&lt;br /&gt;
* ''Image'': The image you want. Use [[dxCreateTexture]] to create it.&lt;br /&gt;
&lt;br /&gt;
==Optional arguments==&lt;br /&gt;
* ''height'': The height of the text, it's 1 by default.&lt;br /&gt;
* ''distance'': The distance you will be able to view the image from, it's 20 by default.&lt;br /&gt;
* ''height'': The height of the image, it's 1 by default.&lt;br /&gt;
* ''width'': The width of the image, it's 1 by default.&lt;br /&gt;
* ''R'': The Red color code (0-255), it's 255 by default.&lt;br /&gt;
* ''G'': The Green color code (0-255), it's 255 by default.&lt;br /&gt;
* ''B'': The Blue color code (0-255), it's 255 by default.&lt;br /&gt;
* ''alpha'': The alpha of the image, it's 255 by default.&lt;br /&gt;
&lt;br /&gt;
*'''checkBuildings:''' Allow the line of sight to be blocked by GTA's internally placed buildings, i.e. the world map.&lt;br /&gt;
*'''checkVehicles:''' Allow the line of sight to be blocked by [[Vehicle|vehicles]].&lt;br /&gt;
*'''checkPeds:''' Allow the line of sight to be blocked by peds, i.e. [[Player|players]].&lt;br /&gt;
*'''checkObjects:''' Allow the line of sight to be blocked by [[Object|objects]].&lt;br /&gt;
*'''checkDummies:''' Allow the line of sight to be blocked by GTA's internal dummies.  These are not used in the current MTA version so this argument can be set to ''false''.&lt;br /&gt;
*'''seeThroughStuff:''' Allow the line of sight to be blocked by translucent game objects, e.g. glass.&lt;br /&gt;
*'''ignoreSomeObjectsForCamera:''' Allow the line of sight to be blocked by certain objects.&lt;br /&gt;
*'''ignoredElement:''' Allow the line of sight to pass through a certain specified element.&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Function source==&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 dxDrawImageOnElement(TheElement,Image,distance,height,width,R,G,B,alpha)&lt;br /&gt;
				local x, y, z = getElementPosition(TheElement)&lt;br /&gt;
				local x2, y2, z2 = getElementPosition(localPlayer)&lt;br /&gt;
				local distance = distance or 20&lt;br /&gt;
				local height = height or 1&lt;br /&gt;
				local width = width or 1&lt;br /&gt;
                                local checkBuildings = checkBuildings or true&lt;br /&gt;
                                local checkVehicles = checkVehicles or false&lt;br /&gt;
                                local checkPeds = checkPeds or false&lt;br /&gt;
                                local checkObjects = checkObjects or true&lt;br /&gt;
                                local checkDummies = checkDummies or true&lt;br /&gt;
                                local seeThroughStuff = seeThroughStuff or false&lt;br /&gt;
                                local ignoreSomeObjectsForCamera = ignoreSomeObjectsForCamera or false&lt;br /&gt;
                                local ignoredElement = ignoredElement or nil&lt;br /&gt;
				if (isLineOfSightClear(x, y, z, x2, y2, z2, checkBuildings, checkVehicles, checkPeds , checkObjects,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement)) then&lt;br /&gt;
					local sx, sy = getScreenFromWorldPosition(x, y, z+height)&lt;br /&gt;
					if(sx) and (sy) then&lt;br /&gt;
						local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2)&lt;br /&gt;
						if(distanceBetweenPoints &amp;lt; distance) then&lt;br /&gt;
							dxDrawMaterialLine3D(x, y, z+1+height-(distanceBetweenPoints/distance), x, y, z+height, Image, width-(distanceBetweenPoints/distance), tocolor(R or 255, G or 255, B or 255, alpha or 255))&lt;br /&gt;
						end&lt;br /&gt;
					end&lt;br /&gt;
			end&lt;br /&gt;
	end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
*Original author: ''Has[S]oN''.&lt;br /&gt;
*Skype: ''hassan.saad2000''&lt;br /&gt;
&lt;br /&gt;
==Example #1==&lt;br /&gt;
This example creates an image on a random ped in the Grove street.&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;
randomPed = createPed(285,2506.83423,-1684.89941,13.55648)&lt;br /&gt;
tag = dxCreateTexture(&amp;quot;crown.png&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root,&lt;br /&gt;
function()&lt;br /&gt;
dxDrawImageOnElement(randomPed,tag)&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;
==Example #2==&lt;br /&gt;
This example creates an image on all the vehicles in the game.&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 tag = dxCreateTexture(&amp;quot;bike.png&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root,&lt;br /&gt;
function()&lt;br /&gt;
for k,v in ipairs(getElementsByType(&amp;quot;vehicle&amp;quot;)) do&lt;br /&gt;
dxDrawImageOnElement(v,tag)&lt;br /&gt;
end&lt;br /&gt;
end) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
{{Useful Functions}}&lt;/div&gt;</summary>
		<author><name>Hassan saad</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Installing_and_Running_MTASA_Server_on_GNU_Linux&amp;diff=46756</id>
		<title>Installing and Running MTASA Server on GNU Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Installing_and_Running_MTASA_Server_on_GNU_Linux&amp;diff=46756"/>
		<updated>2016-02-26T18:57:15Z</updated>

		<summary type="html">&lt;p&gt;Hassan saad: /* Default resources */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Installation 32 bit ==&lt;br /&gt;
&lt;br /&gt;
=== Main binary===&lt;br /&gt;
Download the latest stable 32 bit Linux binaries:&lt;br /&gt;
 rm multitheftauto_linux-{{Current Version|full}}.tar.gz&lt;br /&gt;
 wget &amp;lt;nowiki&amp;gt;http&amp;lt;/nowiki&amp;gt;://linux.mtasa.com/dl/{{Current Version|fullnodots}}/multitheftauto_linux-{{Current Version|full}}.tar.gz&lt;br /&gt;
&lt;br /&gt;
Unpack into a directory:&lt;br /&gt;
 tar -xf multitheftauto_linux-{{Current Version|full}}.tar.gz&lt;br /&gt;
&lt;br /&gt;
=== Default config ===&lt;br /&gt;
Download the default config files:&lt;br /&gt;
 rm baseconfig-{{Current Version|full}}.tar.gz&lt;br /&gt;
 wget &amp;lt;nowiki&amp;gt;http&amp;lt;/nowiki&amp;gt;://linux.mtasa.com/dl/{{Current Version|fullnodots}}/baseconfig-{{Current Version|full}}.tar.gz&lt;br /&gt;
&lt;br /&gt;
Unpack and move into the deathmatch directory:&amp;lt;br/&amp;gt;&lt;br /&gt;
('''''Note:''' Only do this for new installations as it will overwrite any existing config files.)''&lt;br /&gt;
 tar -xf baseconfig-{{Current Version|full}}.tar.gz&lt;br /&gt;
 mv baseconfig/* multitheftauto_linux-{{Current Version|full}}/mods/deathmatch&lt;br /&gt;
&lt;br /&gt;
Change to the MTA server install directory:&lt;br /&gt;
 cd multitheftauto_linux-{{Current Version|full}}&lt;br /&gt;
&lt;br /&gt;
=== Test ===&lt;br /&gt;
You can now test if the server will start correctly:&lt;br /&gt;
 ./mta-server&lt;br /&gt;
&lt;br /&gt;
=== Default resources ===&lt;br /&gt;
If you need the default resources:&lt;br /&gt;
Download the latest default resources zip from http://mirror.mtasa.com/mtasa/resources/&lt;br /&gt;
and unzip into '''mods/deathmatch/resources'''&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Make sure you are in the MTA server install directory when following this example:'''&lt;br /&gt;
  apt-get install unzip&lt;br /&gt;
  mkdir mods/deathmatch/resources&lt;br /&gt;
  cd mods/deathmatch/resources&lt;br /&gt;
  wget http://mirror.mtasa.com/mtasa/resources/mtasa-resources-latest.zip&lt;br /&gt;
  unzip mtasa-resources-latest.zip&lt;br /&gt;
  rm mtasa-resources-latest.zip&lt;br /&gt;
&lt;br /&gt;
== Installation 64 bit ==&lt;br /&gt;
&lt;br /&gt;
=== Main binary ===&lt;br /&gt;
Download the latest stable 64 bit Linux binaries:&lt;br /&gt;
 rm multitheftauto_linux_x64-{{Current Version|full}}.tar.gz&lt;br /&gt;
 wget &amp;lt;nowiki&amp;gt;http&amp;lt;/nowiki&amp;gt;://linux.mtasa.com/dl/{{Current Version|fullnodots}}/multitheftauto_linux_x64-{{Current Version|full}}.tar.gz&lt;br /&gt;
&lt;br /&gt;
Unpack into a directory:&lt;br /&gt;
 tar -xf multitheftauto_linux_x64-{{Current Version|full}}.tar.gz&lt;br /&gt;
&lt;br /&gt;
=== Default config ===&lt;br /&gt;
Download the default config files:&lt;br /&gt;
 rm baseconfig-{{Current Version|full}}.tar.gz&lt;br /&gt;
 wget &amp;lt;nowiki&amp;gt;http&amp;lt;/nowiki&amp;gt;://linux.mtasa.com/dl/{{Current Version|fullnodots}}/baseconfig-{{Current Version|full}}.tar.gz&lt;br /&gt;
&lt;br /&gt;
Unpack and move into the deathmatch directory:&amp;lt;br/&amp;gt;&lt;br /&gt;
('''''Note:''' Only do this for new installations as it will overwrite any existing config files.)''&lt;br /&gt;
 tar -xf baseconfig-{{Current Version|full}}.tar.gz&lt;br /&gt;
 mv baseconfig/* multitheftauto_linux_x64-{{Current Version|full}}/mods/deathmatch&lt;br /&gt;
&lt;br /&gt;
Change to the MTA server install directory:&lt;br /&gt;
 cd multitheftauto_linux_x64-{{Current Version|full}}&lt;br /&gt;
&lt;br /&gt;
=== Test ===&lt;br /&gt;
You can now test if the server will start correctly:&lt;br /&gt;
 ./mta-server64&lt;br /&gt;
&lt;br /&gt;
=== Default resources ===&lt;br /&gt;
If you need the default resources:&lt;br /&gt;
Download the latest default resources zip from http://mirror.mtasa.com/mtasa/resources/&lt;br /&gt;
and unzip into '''mods/deathmatch/resources'''&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Make sure you are in the MTA server install directory when following this example:'''&lt;br /&gt;
 apt-get install unzip&lt;br /&gt;
 mkdir mods/deathmatch/resources&lt;br /&gt;
 cd mods/deathmatch/resources&lt;br /&gt;
 rm mtasa-resources-latest.zip&lt;br /&gt;
 wget &amp;lt;nowiki&amp;gt;http&amp;lt;/nowiki&amp;gt;://mirror.mtasa.com/mtasa/resources/mtasa-resources-latest.zip&lt;br /&gt;
 unzip mtasa-resources-latest.zip&lt;br /&gt;
 rm mtasa-resources-latest.zip&lt;br /&gt;
&lt;br /&gt;
== Running with 32 or 64 bit Linux==&lt;br /&gt;
=== Make sure your server libraries and stuff are up to date ===&lt;br /&gt;
On Debian/Ubuntu this is done with:&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
&lt;br /&gt;
===Troubleshooting===&lt;br /&gt;
* If you get a problem with such as &amp;quot;libreadline.so.5: cannot open shared object file: No such file or directory.&amp;quot;, it can be solved on 32 bit Debian/Ubuntu by doing this:&lt;br /&gt;
&lt;br /&gt;
 apt-get install libreadline5&lt;br /&gt;
&lt;br /&gt;
* If you get a problem with such as &amp;quot;libncursesw.so.5 cannot open shared object file: No such file or directory&amp;quot;, it can be solved on 32 bit Debian/Ubuntu by doing this:&lt;br /&gt;
&lt;br /&gt;
 apt-get install libncursesw5&lt;br /&gt;
&lt;br /&gt;
== MySQL Troubleshooting==&lt;br /&gt;
* If you are using the inbuilt MySQL functions such as [[dbConnect]] and [[dbQuery]], you will need to have '''libmysqlclient.so.16''' installed.&lt;br /&gt;
* If you get a problem with such as &amp;quot;libmysqlclient.so.16: cannot open shared object file: No such file or directory&amp;quot;, it can be solved on Debian/Ubuntu by doing this:&lt;br /&gt;
&lt;br /&gt;
 apt-get install libmysqlclient16&lt;br /&gt;
&lt;br /&gt;
If that fails:&lt;br /&gt;
* For 32 bit Linux, download [http://nightly.mtasa.com/files/modules/32/libmysqlclient.so.16 32 bit libmysqlclient.so.16] and put it in '''/usr/lib/'''&lt;br /&gt;
* For 64 bit Linux, download [http://nightly.mtasa.com/files/modules/64/libmysqlclient.so.16 64 bit libmysqlclient.so.16] and put it in '''/usr/lib/'''&lt;br /&gt;
&lt;br /&gt;
==[Optional] Installing and Configuring an External Web Server==&lt;br /&gt;
Instructions on how to install and configure Nginx as an external web server for MTA is here: [[Installing and Configuring Nginx as an External Web Server]]&lt;br /&gt;
&lt;br /&gt;
== Server crashes ==&lt;br /&gt;
&lt;br /&gt;
If your Linux server crashes, please obtain a backtrace and post a report on our [http://bugs.mtasa.com/ Bug tracker]&lt;br /&gt;
&lt;br /&gt;
====To obtain a backtrace:====&lt;br /&gt;
===Do you have a core dump file in the the MTA server directory?===&lt;br /&gt;
It's usually called 'core', and usually over 100MB, and looks something like this:&lt;br /&gt;
 [[Image:Core.png]]&lt;br /&gt;
====If you have a core dump file in the the MTA server directory:====&lt;br /&gt;
*Install gdb. To install gdb on Debian, use this command:&lt;br /&gt;
 apt-get install gdb&lt;br /&gt;
*And from the MTA install directory do this command&lt;br /&gt;
 gdb mta-server -c core&lt;br /&gt;
*When gdb launches, do this command to get a  module list:&lt;br /&gt;
 i sh&lt;br /&gt;
*And then this command to get a backtrace:&lt;br /&gt;
 bt&lt;br /&gt;
*Save the output&lt;br /&gt;
*(To exit gdb, use the quit command)&lt;br /&gt;
&lt;br /&gt;
====If you do not have a core dump file in the the MTA server directory:====&lt;br /&gt;
*Install gdb. To install gdb on Debian, use this command:&lt;br /&gt;
 apt-get install gdb&lt;br /&gt;
*And from the MTA server directory start the mta-server like this:&lt;br /&gt;
 gdb mta-server -ex &amp;quot;set print thread-events off&amp;quot; --eval-command run&lt;br /&gt;
*Now wait for a crash. (Ignore any weird screen output in the meantime)&lt;br /&gt;
*When a crash occurs, do this command to get a module list:&lt;br /&gt;
 i sh&lt;br /&gt;
*And then this command to get a backtrace:&lt;br /&gt;
 bt&lt;br /&gt;
*Save the output&lt;br /&gt;
*(To exit gdb, use the quit command)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Server freezes''' ==&lt;br /&gt;
&lt;br /&gt;
If your Linux server freezes, please obtain a backtrace with thread information and post a report on our [http://bugs.mtasa.com/ Bug tracker]&lt;br /&gt;
&lt;br /&gt;
====To obtain a backtrace with thread information:====&lt;br /&gt;
*Install gdb. To install gdb on Debian, use this command:&lt;br /&gt;
 apt-get install gdb&lt;br /&gt;
*And from the MTA server directory start the mta-server like this:&lt;br /&gt;
 gdb mta-server -ex &amp;quot;set print thread-events off&amp;quot; --eval-command run&lt;br /&gt;
*Now wait for a freeze. (Ignore any weird screen output in the meantime)&lt;br /&gt;
*When a freeze occurs, press ctrl-c to start gdb&lt;br /&gt;
*Then do this command to get a module list:&lt;br /&gt;
 i sh&lt;br /&gt;
*And then this command to get a backtrace:&lt;br /&gt;
 bt&lt;br /&gt;
*And then this command to get thread information:&lt;br /&gt;
 info threads&lt;br /&gt;
*Save the output&lt;br /&gt;
*(To exit gdb, use the quit command)&lt;/div&gt;</summary>
		<author><name>Hassan saad</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawImageOnElement&amp;diff=46542</id>
		<title>DxDrawImageOnElement</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawImageOnElement&amp;diff=46542"/>
		<updated>2016-02-02T10:11:30Z</updated>

		<summary type="html">&lt;p&gt;Hassan saad: /* Optional arguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&amp;lt;lowercasetitle/&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This useful client function draws an image on any element you choose.&lt;br /&gt;
{{Note|You have to use [[onClientRender]] or [[onClientPreRender]] events with this function.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;boolean dxDrawImageOnElement(element TheElement, element Image [, int distance, int height, int width, int R, int G, int B, int alpha ] ) &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:DxDrawImageOnElement.png|thumb|Example of how it should looks like.|284x230px]]&lt;br /&gt;
&lt;br /&gt;
==Required arguments==&lt;br /&gt;
* ''TheElement'': The element you want to draw the image on it.&lt;br /&gt;
* ''Image'': The image you want. Use [[dxCreateTexture]] to create it.&lt;br /&gt;
&lt;br /&gt;
==Optional arguments==&lt;br /&gt;
* ''height'': The height of the text, it's 1 by default.&lt;br /&gt;
* ''distance'': The distance you will be able to view the image from, it's 20 by default.&lt;br /&gt;
* ''height'': The height of the image, it's 1 by default.&lt;br /&gt;
* ''width'': The width of the image, it's 1 by default.&lt;br /&gt;
* ''R'': The Red color code (0-255), it's 255 by default.&lt;br /&gt;
* ''G'': The Green color code (0-255), it's 255 by default.&lt;br /&gt;
* ''B'': The Blue color code (0-255), it's 255 by default.&lt;br /&gt;
* ''alpha'': The alpha of the image, it's 255 by default.&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Function source==&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 dxDrawImageOnElement(TheElement,Image,distance,height,width,R,G,B,alpha)&lt;br /&gt;
				local x, y, z = getElementPosition(TheElement)&lt;br /&gt;
				local x2, y2, z2 = getElementPosition(localPlayer)&lt;br /&gt;
				local distance = distance or 20&lt;br /&gt;
				local height = height or 1&lt;br /&gt;
				local width = width or 1&lt;br /&gt;
				if (isLineOfSightClear(x, y, z, x2, y2, z2, true, false, false, false)) then&lt;br /&gt;
					local sx, sy = getScreenFromWorldPosition(x, y, z+height)&lt;br /&gt;
					if(sx) and (sy) then&lt;br /&gt;
						local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2)&lt;br /&gt;
						if(distanceBetweenPoints &amp;lt; distance) then&lt;br /&gt;
							dxDrawMaterialLine3D(x, y, z+1+height-(distanceBetweenPoints/distance), x, y, z+height, Image, width-(distanceBetweenPoints/distance), tocolor(R or 255, G or 255, B or 255, alpha or 255))&lt;br /&gt;
						end&lt;br /&gt;
					end&lt;br /&gt;
			end&lt;br /&gt;
	end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
*Original author: ''Has[S]oN''.&lt;br /&gt;
*Skype: ''hassan.saad2000''&lt;br /&gt;
&lt;br /&gt;
==Example #1==&lt;br /&gt;
This example creates an image on a random ped in the Grove street.&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;
randomPed = createPed(285,2506.83423,-1684.89941,13.55648)&lt;br /&gt;
tag = dxCreateTexture(&amp;quot;crown.png&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root,&lt;br /&gt;
function()&lt;br /&gt;
dxDrawImageOnElement(randomPed,tag)&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;
==Example #2==&lt;br /&gt;
This example creates an image on all the vehicles in the game.&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 tag = dxCreateTexture(&amp;quot;bike.png&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root,&lt;br /&gt;
function()&lt;br /&gt;
for k,v in ipairs(getElementsByType(&amp;quot;vehicle&amp;quot;)) do&lt;br /&gt;
dxDrawImageOnElement(v,tag)&lt;br /&gt;
end&lt;br /&gt;
end) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
{{Useful Functions}}&lt;/div&gt;</summary>
		<author><name>Hassan saad</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawImageOnElement&amp;diff=46541</id>
		<title>DxDrawImageOnElement</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawImageOnElement&amp;diff=46541"/>
		<updated>2016-02-01T22:52:34Z</updated>

		<summary type="html">&lt;p&gt;Hassan saad: /* Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&amp;lt;lowercasetitle/&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This useful client function draws an image on any element you choose.&lt;br /&gt;
{{Note|You have to use [[onClientRender]] or [[onClientPreRender]] events with this function.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;boolean dxDrawImageOnElement(element TheElement, element Image [, int distance, int height, int width, int R, int G, int B, int alpha ] ) &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:DxDrawImageOnElement.png|thumb|Example of how it should looks like.|284x230px]]&lt;br /&gt;
&lt;br /&gt;
==Required arguments==&lt;br /&gt;
* ''TheElement'': The element you want to draw the image on it.&lt;br /&gt;
* ''Image'': The image you want. Use [[dxCreateTexture]] to create it.&lt;br /&gt;
&lt;br /&gt;
==Optional arguments==&lt;br /&gt;
* ''height'': The height of the text, it's 1 by default.&lt;br /&gt;
* ''distance'': The distance you will be able to view the image from, it's 20 by default.&lt;br /&gt;
* ''height'': The height of the image, it's 1 by default.&lt;br /&gt;
* ''width'': The width of the image, it's 1 by default.&lt;br /&gt;
* ''R'': The Red color code (0-255), it's 255 by default.&lt;br /&gt;
* ''G'': The Green color code (0-255), it's 255 by default.&lt;br /&gt;
* ''B'': The Blue color code (0-255), it's 255 by default.&lt;br /&gt;
* ''alpha'': The alpha of the text, it's 255 by default.&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Function source==&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 dxDrawImageOnElement(TheElement,Image,distance,height,width,R,G,B,alpha)&lt;br /&gt;
				local x, y, z = getElementPosition(TheElement)&lt;br /&gt;
				local x2, y2, z2 = getElementPosition(localPlayer)&lt;br /&gt;
				local distance = distance or 20&lt;br /&gt;
				local height = height or 1&lt;br /&gt;
				local width = width or 1&lt;br /&gt;
				if (isLineOfSightClear(x, y, z, x2, y2, z2, true, false, false, false)) then&lt;br /&gt;
					local sx, sy = getScreenFromWorldPosition(x, y, z+height)&lt;br /&gt;
					if(sx) and (sy) then&lt;br /&gt;
						local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2)&lt;br /&gt;
						if(distanceBetweenPoints &amp;lt; distance) then&lt;br /&gt;
							dxDrawMaterialLine3D(x, y, z+1+height-(distanceBetweenPoints/distance), x, y, z+height, Image, width-(distanceBetweenPoints/distance), tocolor(R or 255, G or 255, B or 255, alpha or 255))&lt;br /&gt;
						end&lt;br /&gt;
					end&lt;br /&gt;
			end&lt;br /&gt;
	end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
*Original author: ''Has[S]oN''.&lt;br /&gt;
*Skype: ''hassan.saad2000''&lt;br /&gt;
&lt;br /&gt;
==Example #1==&lt;br /&gt;
This example creates an image on a random ped in the Grove street.&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;
randomPed = createPed(285,2506.83423,-1684.89941,13.55648)&lt;br /&gt;
tag = dxCreateTexture(&amp;quot;crown.png&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root,&lt;br /&gt;
function()&lt;br /&gt;
dxDrawImageOnElement(randomPed,tag)&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;
==Example #2==&lt;br /&gt;
This example creates an image on all the vehicles in the game.&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 tag = dxCreateTexture(&amp;quot;bike.png&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root,&lt;br /&gt;
function()&lt;br /&gt;
for k,v in ipairs(getElementsByType(&amp;quot;vehicle&amp;quot;)) do&lt;br /&gt;
dxDrawImageOnElement(v,tag)&lt;br /&gt;
end&lt;br /&gt;
end) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
{{Useful Functions}}&lt;/div&gt;</summary>
		<author><name>Hassan saad</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawImageOnElement&amp;diff=46540</id>
		<title>DxDrawImageOnElement</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawImageOnElement&amp;diff=46540"/>
		<updated>2016-02-01T18:38:29Z</updated>

		<summary type="html">&lt;p&gt;Hassan saad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&amp;lt;lowercasetitle/&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This useful client function draws an image on any element you choose.&lt;br /&gt;
{{Note|You have to use [[onClientRender]] or [[onClientPreRender]] events with this function.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;boolean dxDrawImageOnElement(element TheElement, string Image [, int distance, int height, int width, int R, int G, int B, int alpha ] ) &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:DxDrawImageOnElement.png|thumb|Example of how it should looks like.|284x230px]]&lt;br /&gt;
&lt;br /&gt;
==Required arguments==&lt;br /&gt;
* ''TheElement'': The element you want to draw the image on it.&lt;br /&gt;
* ''Image'': The image you want. Use [[dxCreateTexture]] to create it.&lt;br /&gt;
&lt;br /&gt;
==Optional arguments==&lt;br /&gt;
* ''height'': The height of the text, it's 1 by default.&lt;br /&gt;
* ''distance'': The distance you will be able to view the image from, it's 20 by default.&lt;br /&gt;
* ''height'': The height of the image, it's 1 by default.&lt;br /&gt;
* ''width'': The width of the image, it's 1 by default.&lt;br /&gt;
* ''R'': The Red color code (0-255), it's 255 by default.&lt;br /&gt;
* ''G'': The Green color code (0-255), it's 255 by default.&lt;br /&gt;
* ''B'': The Blue color code (0-255), it's 255 by default.&lt;br /&gt;
* ''alpha'': The alpha of the text, it's 255 by default.&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Function source==&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 dxDrawImageOnElement(TheElement,Image,distance,height,width,R,G,B,alpha)&lt;br /&gt;
				local x, y, z = getElementPosition(TheElement)&lt;br /&gt;
				local x2, y2, z2 = getElementPosition(localPlayer)&lt;br /&gt;
				local distance = distance or 20&lt;br /&gt;
				local height = height or 1&lt;br /&gt;
				local width = width or 1&lt;br /&gt;
				if (isLineOfSightClear(x, y, z, x2, y2, z2, true, false, false, false)) then&lt;br /&gt;
					local sx, sy = getScreenFromWorldPosition(x, y, z+height)&lt;br /&gt;
					if(sx) and (sy) then&lt;br /&gt;
						local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2)&lt;br /&gt;
						if(distanceBetweenPoints &amp;lt; distance) then&lt;br /&gt;
							dxDrawMaterialLine3D(x, y, z+1+height-(distanceBetweenPoints/distance), x, y, z+height, Image, width-(distanceBetweenPoints/distance), tocolor(R or 255, G or 255, B or 255, alpha or 255))&lt;br /&gt;
						end&lt;br /&gt;
					end&lt;br /&gt;
			end&lt;br /&gt;
	end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
*Original author: ''Has[S]oN''.&lt;br /&gt;
*Skype: ''hassan.saad2000''&lt;br /&gt;
&lt;br /&gt;
==Example #1==&lt;br /&gt;
This example creates an image on a random ped in the Grove street.&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;
randomPed = createPed(285,2506.83423,-1684.89941,13.55648)&lt;br /&gt;
tag = dxCreateTexture(&amp;quot;crown.png&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root,&lt;br /&gt;
function()&lt;br /&gt;
dxDrawImageOnElement(randomPed,tag)&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;
==Example #2==&lt;br /&gt;
This example creates an image on all the vehicles in the game.&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 tag = dxCreateTexture(&amp;quot;bike.png&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root,&lt;br /&gt;
function()&lt;br /&gt;
for k,v in ipairs(getElementsByType(&amp;quot;vehicle&amp;quot;)) do&lt;br /&gt;
dxDrawImageOnElement(v,tag)&lt;br /&gt;
end&lt;br /&gt;
end) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
{{Useful Functions}}&lt;/div&gt;</summary>
		<author><name>Hassan saad</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawTextOnElement&amp;diff=46539</id>
		<title>DxDrawTextOnElement</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawTextOnElement&amp;diff=46539"/>
		<updated>2016-02-01T18:38:19Z</updated>

		<summary type="html">&lt;p&gt;Hassan saad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&amp;lt;lowercasetitle/&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This useful client function draws a text on any element you choose.&lt;br /&gt;
{{Note|You have to use [[onClientRender]] or [[onClientPreRender]] events with this function.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;boolean dxDrawTextOnElement(element TheElement, string text [, int height, int distance, int R, int G, int B, int alpha, int size, string font ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[Image:dxDrawTextOnElement.png|thumb|Example of how it should looks like.|284x230px]]&lt;br /&gt;
&lt;br /&gt;
==Required arguments==&lt;br /&gt;
* ''TheElement'': The element you want to draw the text on it.&lt;br /&gt;
* ''text'': The text you want.&lt;br /&gt;
&lt;br /&gt;
==Optional arguments==&lt;br /&gt;
* ''height'': The height of the text, it's 1 by default.&lt;br /&gt;
* ''distance'': The distance you will be able to view the text from, it's 20 by default.&lt;br /&gt;
* ''R'': The Red color code (0-255), it's 255 by default.&lt;br /&gt;
* ''G'': The Green color code (0-255), it's 255 by default.&lt;br /&gt;
* ''B'': The Blue color code (0-255), it's 255 by default.&lt;br /&gt;
* ''alpha'': The alpha of the text, it's 255 by default.&lt;br /&gt;
* ''size'': The size of the text, it's 1 by default.&lt;br /&gt;
* ''font'': Either a custom [[DX font]] element or the name of a built-in DX font:&lt;br /&gt;
{{DxFonts}}&lt;br /&gt;
It's arial by default.&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Function source==&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 dxDrawTextOnElement(TheElement,text,height,distance,R,G,B,alpha,size,font)&lt;br /&gt;
				local x, y, z = getElementPosition(TheElement)&lt;br /&gt;
				local x2, y2, z2 = getElementPosition(localPlayer)&lt;br /&gt;
				local distance = distance or 20&lt;br /&gt;
				local height = height or 1&lt;br /&gt;
				if (isLineOfSightClear(x, y, z, x2, y2, z2, true, true, false, true)) then&lt;br /&gt;
					local sx, sy = getScreenFromWorldPosition(x, y, z+height)&lt;br /&gt;
					if(sx) and (sy) then&lt;br /&gt;
						local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2)&lt;br /&gt;
						if(distanceBetweenPoints &amp;lt; distance) then&lt;br /&gt;
							dxDrawText(text, sx+2, sy+2, sx, sy, tocolor(R or 255, G or 255, B or 255, alpha or 255), (size or 1)-(distanceBetweenPoints / distance), font or &amp;quot;arial&amp;quot;, &amp;quot;center&amp;quot;, &amp;quot;center&amp;quot;)&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
*Original author: ''Has[S]oN''.&lt;br /&gt;
*Skype: ''hassan.saad2000''&lt;br /&gt;
&lt;br /&gt;
==Example #1==&lt;br /&gt;
This example creates a text on a random ped in the Grove street.&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;
randomPed = createPed(285,2476.91406,-1665.31799,13.32435)&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientRender&amp;quot;, getRootElement(), &lt;br /&gt;
function ()&lt;br /&gt;
dxDrawTextOnElement(randomPed,&amp;quot;SWATTEAM Officer&amp;quot;,1,20,0,0,255,255,1,&amp;quot;pricedown&amp;quot;)&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;
==Example #2==&lt;br /&gt;
This example creates a text 'HassoN' on all the players are in a team named HassoN.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onClientRender&amp;quot;, getRootElement(), &lt;br /&gt;
function ()&lt;br /&gt;
for k,v in ipairs(getElementsByType(&amp;quot;player&amp;quot;)) do&lt;br /&gt;
		if getPlayerTeam(v) == getTeamFromName(&amp;quot;HassoN&amp;quot;) then&lt;br /&gt;
			if v == localPlayer then return end&lt;br /&gt;
			dxDrawTextOnElement(v,&amp;quot;HassoN&amp;quot;,1,20,0,0,255,255,1,&amp;quot;arial&amp;quot;)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
{{Useful Functions}}&lt;/div&gt;</summary>
		<author><name>Hassan saad</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Useful_Functions&amp;diff=46538</id>
		<title>Template:Useful Functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Useful_Functions&amp;diff=46538"/>
		<updated>2016-02-01T18:05:52Z</updated>

		<summary type="html">&lt;p&gt;Hassan saad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[attachEffect]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you attach an effect to an element.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[bindControlKeys]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to bind each key bound to a control individually. Doing this bypasses a little MTA restriction.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[callClientFunction]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to call any client-side function from the server's side.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[callServerFunction]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to call any server-side function from the client's side.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[capitalize]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function capitalizes a given string.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[centerWindow]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function centers a CEGUI window element responsively in any resolution.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[Check]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if its arguments are of the right type and calls the error-function if one is not.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[convertNumber]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts and formats large numbers.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[convertServerTickToTimeStamp]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts server ticks to a unix timestamp.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[convertTextToSpeech]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts the provided text to a speech in the provided language which players can hear.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[coroutine.resume]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function applies a fix for hidden coroutine error messages.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawAnimWindow]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws an animated 2D window on the screen.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawCircle]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a number of 2D lines in order to achieve a circle shape on the screen.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawEmptyRectangle]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws an empty 2D rectangle on the screen.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawGifImage]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function simulates the effect of a GIF image by using image sprites in 2D.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawImage3D]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a 3D image in GTA world.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawImageOnElement]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws an image on any element.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawLoading]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a loading bar on the screen.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawRectangle3D]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a 3D rectangle in GTA world.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawTextOnElement]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a text on any element.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxGetFontSizeFromHeight]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function calculates the font size from given height.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxGetRealFontHeight]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function calculates the height of a font.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[findRotation]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function takes two points and returns the direction from point A to point B.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[FormatDate]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function formats a date on the basis of a format string and returns it.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[generateString]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function generates a random string with any characters.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[generateRandomASCIIString]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a random string which uses ASCII characters. &amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getAge]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function calculates the age of a given birthday.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getAlivePlayers (Client)|getAlivePlayers]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the alive players client-side.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getAlivePlayersInTeam]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the alive players in a team.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getBanFromName]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This functions returns the ban of the given playername.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getBoundControls]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of control names that are bound to the specified key.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getCurrentFPS]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns the frames per second at which GTA: SA is running.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getCursorMoveOn]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks in which way the cursor is currently moving.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getDistanceBetweenPointAndSegment2D]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function takes point coordinates and line (a segment) starting and ending coordinates. It returns the shortest distance between the point and the line.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getElementSpeed]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns the specified element's speed in m/s, km/h or mph.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getElementsInDimension]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of elements that are in the specified dimension.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getElementsWithinMarker]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of elements that are within a marker's collision shape.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getJetpackWeaponsEnabled]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of enabled weapons usable on a jetpack.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getKeyFromValueInTable]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns the key of the specified value in a table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getOffsetFromXYZ]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to take an entity and a position and calculate the relative offset between them accounting for rotations.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getOnlineAdmins]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of all logged-in administrators.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getOnlineStaff]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a string of all logged-in administrators separated by two whitespace characters.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPedMaxHealth]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a pedestrians's maximum health by converting it from their maximum health stat.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPedMaxOxygenLevel]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a ped's maximum oxygen level by converting it from their maximum underwater stamina stat.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayerFromNamePart]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a player from partial name.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayerFromSerial]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a player from their serial.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayerAcls]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of all ACL groups on a player.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayersByData]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of players that have the specified data name.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayersInPhotograph]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of all players in photograph.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPointFromDistanceRotation]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function finds a point based on a starting point, direction and distance.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getResourceSettings]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the resource settings.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getResourceScripts]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the resource scripts.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getRGColorFromPercentage]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia', sans-serif; font-size:smaller;&amp;quot;&amp;gt;»This function returns two integers representing red and green colors according to the specified percentage.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getScreenRotationFromWorldPosition]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a screen relative rotation to a world position.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getTeamFromColor]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a team element by the specified color.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getTeamWithFewestPlayers]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a team element with least players of all the specified teams.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getTimestamp]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns the UNIX timestamp of a specified date and time.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getValidVehicleModels]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of all valid vehicle models.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getVehicleRespawnPosition]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to get the respawn position of a vehicle.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getXMLNodes]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns all children of a XML node.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getGridListRowIndexFromText]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns the GridList row index from the specified text.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[guiComboBoxAdjustHeight]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function adjusts a CEGUI combobox element to have the correct height.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[guiGridListGetSelectedText]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a string containing the inner text of a selected gridlist item.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[IfElse]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns one of two values based on a boolean expression.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isCursorOnElement]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether the cursor is in a particular area.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementInPhotograph]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if an element is in the player's camera picture area.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementInRange]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to check if an element's range to a main point is within the maximum range.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementMoving]]&amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if an element is moving.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementWithinAColShape]]&amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if an element is within a collision shape element.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isLeapYear]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a boolean representing if a given year is a leap year.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isMouseInPosition]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to check whether the mouse cursor/pointer is within a rectangular position.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPedAiming]]&amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a pedestrian is aiming their weapon.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPedDrivingVehicle]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a specified pedestrian is driving a vehicle.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPlayerInACL]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a player element is in an ACL group.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPlayerInTeam]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a player is in a specified team.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isSoundFinished]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a sound element has finished.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isVehicleEmpty]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether a vehicle is empty.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isVehicleOccupied]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a specified vehicle is occupied.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isVehicleOnRoof]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether vehicle is on roof.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPedAimingNearPed]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This is similar to isPedAiming but uses a colshape to be more precise.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isTextInGridList]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if some text exist or not in the GridList.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[iterElements]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns ''a time-saving'' iterator for your for-loops.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[mathNumber]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function is a workaround for the client-side floating-point precision of 24-bits.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.percent]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a percentage from two number values.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.round]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Rounds a number whereas the number of decimals to keep and the method may be set.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[multi_check]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks one element to many, handy and clean.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[onVehicleWeaponFire]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This code implements an event that is triggered when a player in a vehicle fires a vehicle's weapon.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[rangeToTable]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts a string range to a table containing number values.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[refreshResource]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function refreshes your resource if you changed any of the files&lt;br /&gt;
*[[renameAclGroup]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gives an existing ACL group a new name.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[RGBToHex]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a string representing the color in hexadecimal.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[secondsToTimeDesc]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts a plain seconds-integer into a user-friendly time description.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setAccountName]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function is used to change an existing account's name.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setElementSpeed]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to set the speed of an element in kph or mph units.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setTableProtected]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function protects a table and makes it read-only.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setVehicleGravityPoint]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function sets a vehicle's gravity in the direction of a 3 dimensional coordinate with the strength specified.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[smoothMoveCamera]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to create a cinematic camera flight.&lt;br /&gt;
*[[string.count]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function counts the amount of occurences of a string in a string.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[string.explode]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function splits a string at a given separator pattern and returns a table with the pieces.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[switch]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows the value of a variable or expression to control the flow of program execution via a multiway branch.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.copy]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function copies a whole table and all the tables in that table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.compare]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether two given tables are equal.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.empty]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether a table is empty.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.map]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function goes through a table and replaces every field with the return of the passed function, where the field's value is passed as first argument and optionally more arguments.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.merge]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function merges two or more tables together.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.random]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function retrieves a random value from a table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.size]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns the absolute size of a table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.removeValue]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function removes a specified value from a table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[toHex]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts a decimal number to a hexadecimal number, as a fix to be used client-side.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[unbindControlKeys]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to unbind each key bound to a control individually. Use this function with [[bindControlKeys]].&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[var dump]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function outputs information about one or more variables using outputConsole.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[wavelengthToRGBA]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts a physical wavelength of light to a RGBA color.&amp;lt;/span&amp;gt;&lt;br /&gt;
[[Category:Useful Functions]]&lt;/div&gt;</summary>
		<author><name>Hassan saad</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=RenameAclGroup&amp;diff=46537</id>
		<title>RenameAclGroup</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=RenameAclGroup&amp;diff=46537"/>
		<updated>2016-02-01T15:53:42Z</updated>

		<summary type="html">&lt;p&gt;Hassan saad: /* 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;
This function is used to rename an [[Aclgroup|ACL group]].&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool renameAclGroup ( string old, string new )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Required Arguments==&lt;br /&gt;
* '''old:''' name of the ACL group you want to change&lt;br /&gt;
* '''new:''' the name we want the group to be changed to&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the rename was successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function renameAclGroup( old, new )&lt;br /&gt;
	if ( type( old ) ~= &amp;quot;string&amp;quot; ) then&lt;br /&gt;
		outputDebugString( &amp;quot;Bad argument 1 @ renameAclGroup [ string expected, got &amp;quot; .. type( old ) .. &amp;quot; ] &amp;quot;, 2 )&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if ( type( new ) ~= &amp;quot;string&amp;quot; ) then&lt;br /&gt;
		outputDebugString( &amp;quot;Bad argument 2 @ renameAclGroup [ string expected, got &amp;quot; .. type( new ) .. &amp;quot; ] &amp;quot;, 2 )&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local oldACLGroup = aclGetGroup( old )&lt;br /&gt;
	&lt;br /&gt;
	if ( not oldACLGroup ) then&lt;br /&gt;
		outputDebugString( &amp;quot;Bad argument 1 @ renameAclGroup [ no acl group found with this name ] &amp;quot;, 2 )&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if ( aclGetGroup( new ) ) then&lt;br /&gt;
		outputDebugString( &amp;quot;Bad argument 2 @ renameAclGroup [ there is already a group with this name ] &amp;quot;, 2 )&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local oldACL = aclGroupListACL( oldACLGroup )&lt;br /&gt;
	local oldObjects = aclGroupListObjects( oldACLGroup )&lt;br /&gt;
	local newACLGroup = aclCreateGroup( new )&lt;br /&gt;
	&lt;br /&gt;
	for _,nameOfACL in pairs( oldACL ) do&lt;br /&gt;
		aclGroupAddACL( newACLGroup, nameOfACL )&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	for _,nameOfObject in pairs( oldObjects ) do&lt;br /&gt;
		aclGroupAddObject( newACLGroup, nameOfObject )&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	aclDestroyGroup( oldACLGroup )&lt;br /&gt;
	aclSave( )&lt;br /&gt;
	aclReload( )&lt;br /&gt;
	&lt;br /&gt;
	return true&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Original author: ''Has[S]oN''&lt;br /&gt;
*Skype: ''hassan.saad2000''&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example changes a group named ''Moderator'' to ''HassoN'' when the script is loaded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler( &amp;quot;onResourceStart&amp;quot;, resourceRoot,&lt;br /&gt;
	function( )&lt;br /&gt;
		renameAclGroup( &amp;quot;Moderator&amp;quot;, &amp;quot;HassoN&amp;quot; )&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;
{{Useful Functions}}&lt;/div&gt;</summary>
		<author><name>Hassan saad</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=ConvertTextToSpeech&amp;diff=46536</id>
		<title>ConvertTextToSpeech</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=ConvertTextToSpeech&amp;diff=46536"/>
		<updated>2016-02-01T15:53:36Z</updated>

		<summary type="html">&lt;p&gt;Hassan saad: /* Function source */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&amp;lt;lowercasetitle/&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This useful shared function converts some text to audible speech using Google's TTS.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;boolean, element, string convertTextToSpeech ( string text [, table/element broadcastTo = root, string language = &amp;quot;en&amp;quot; ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Required arguments==&lt;br /&gt;
* ''text'': the text to convert to speech.&lt;br /&gt;
&lt;br /&gt;
==Optional arguments==&lt;br /&gt;
* ''broadcastTo'': if it's a regular indexed table, the speech will be broadcasted to the players contained in it. If it's a element, the speech will be heard by the players which are children of that element. This parameter is '''ONLY''' serverside; if you're using this function clientside this will be considered as the ''language'' argument.&lt;br /&gt;
* ''language'': defines the language of the TTS output.&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
* This function returns ''[[nil]]'' and outputs an error if an argument it's not valid.&lt;br /&gt;
* If called serverside and if all arguments are valid, this function returns ''true'' if the client was successully told to play the TTS (althrough this doesn't mean that the client will always play the speech); ''false'' otherwise.&lt;br /&gt;
* If called clientside and if all arguments are valid, this function returns ''true'', the corresponding [[sound]] element and its URL if the sound could theorically be played (althrough it may not play); ''[[nil]]'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Function source==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEvent(&amp;quot;playTTS&amp;quot;, true) -- Add the event&lt;br /&gt;
&lt;br /&gt;
local function playTTS(text, lang)&lt;br /&gt;
    local URL = &amp;quot;http://translate.google.com/translate_tts?tl=&amp;quot; .. lang .. &amp;quot;&amp;amp;q=&amp;quot; .. text&lt;br /&gt;
    -- Play the TTS. BASS returns the sound element even if it can not be played.&lt;br /&gt;
    return true, playSound(URL), URL&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;playTTS&amp;quot;, root, playTTS)&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;Shared (server and client)&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 convertTextToSpeech(text, broadcastTo, lang)&lt;br /&gt;
    -- Ensure first argument is valid&lt;br /&gt;
    assert(type(text) == &amp;quot;string&amp;quot;, &amp;quot;Bad argument 1 @ convertTextToSpeech [ string expected, got &amp;quot; .. type(text) .. &amp;quot;]&amp;quot;)&lt;br /&gt;
    assert(#text &amp;lt;= 100, &amp;quot;Bad argument 1 @ convertTextToSpeech [ too long string; 100 characters maximum ]&amp;quot;)&lt;br /&gt;
    if triggerClientEvent then -- Is this function called serverside?&lt;br /&gt;
        -- Ensure second and third arguments are valid&lt;br /&gt;
        assert(broadcastTo == nil or type(broadcastTo) == &amp;quot;table&amp;quot; or isElement(broadcastTo), &amp;quot;Bad argument 2 @ convertTextToSpeech [ table/element expected, got &amp;quot; .. type(broadcastTo) .. &amp;quot;]&amp;quot;)&lt;br /&gt;
        assert(lang == nil or type(lang) == &amp;quot;string&amp;quot;, &amp;quot;Bad argument 3 @ convertTextToSpeech [ string expected, got &amp;quot; .. type(lang) .. &amp;quot;]&amp;quot;)&lt;br /&gt;
        -- Tell the client to play the speech&lt;br /&gt;
        return triggerClientEvent(broadcastTo or root, &amp;quot;playTTS&amp;quot;, root, text, lang or &amp;quot;en&amp;quot;)&lt;br /&gt;
    else -- This function is executed clientside&lt;br /&gt;
        local lang = broadcastTo&lt;br /&gt;
        -- Ensure second argument is valid&lt;br /&gt;
        assert(lang == nil or type(lang) == &amp;quot;string&amp;quot;, &amp;quot;Bad argument 2 @ convertTextToSpeech [ string expected, got &amp;quot; .. type(lang) .. &amp;quot;]&amp;quot;)&lt;br /&gt;
        return playTTS(text, lang or &amp;quot;en&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
*Original author: ''Has[S]oN''.&lt;br /&gt;
*Skype: ''hassan.saad2000''&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example disables text chat and converts that text to a speech audible to nearby players. '''NOTE''': this example requires 1.4 in order to work.&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;
local function tellClientsToPlayTTS(text, type)&lt;br /&gt;
    if type == 0 and #text &amp;lt;= 100 then -- We only want to replace normal chat if possible&lt;br /&gt;
        local x, y, z = getElementPosition(source)&lt;br /&gt;
        local col = createColSphere(x, y, z, 30) -- We need this to get nearby players&lt;br /&gt;
        triggerClientEvent(getElementsWithinColShape(col, &amp;quot;player&amp;quot;), &amp;quot;playChatTTS&amp;quot;, source, text) -- Tell the nearby clients to play the sound&lt;br /&gt;
        destroyElement(col)&lt;br /&gt;
        cancelEvent() -- Replace text chat&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerChat&amp;quot;, root, tellClientsToPlayTTS)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEvent(&amp;quot;playChatTTS&amp;quot;, true) -- Add the event&lt;br /&gt;
&lt;br /&gt;
local function playChatTTS(text)&lt;br /&gt;
    local lang = (getLocalization().code):sub(1, 2) -- Output the TTS in the local player language, but don't bother about variants&lt;br /&gt;
    local _, speech, URL = convertTextToSpeech(text, lang)&lt;br /&gt;
    -- Convert that speech to a 3D sound&lt;br /&gt;
    destroyElement(speech)&lt;br /&gt;
    local x, y, z = getElementPosition(source)&lt;br /&gt;
    local speech = playSound3D(URL, x, y, z)&lt;br /&gt;
    attachElements(speech, source) -- Make the sound follow the player&lt;br /&gt;
    setElementDimension(speech, getElementDimension(source))&lt;br /&gt;
    setSoundMinDistance(speech, 15)&lt;br /&gt;
    setSoundMaxDistance(speech, 30)&lt;br /&gt;
    -- Tricky thing ahead: make the player mouth move, but without rendering him unable to move&lt;br /&gt;
    setPedAnimation(source, &amp;quot;ped&amp;quot;, &amp;quot;factalk&amp;quot;, 0, true)&lt;br /&gt;
    setPedAnimation(source, &amp;quot;ped&amp;quot;, &amp;quot;factalk&amp;quot;, 0, true)&lt;br /&gt;
    -- Reset the player mouth after the speech has ended&lt;br /&gt;
    setTimer(function(player)&lt;br /&gt;
        if isElement(player) then&lt;br /&gt;
            setPedAnimation(player) -- Clear the animation&lt;br /&gt;
        end&lt;br /&gt;
    end, math.max(getSoundLength(speech) * 1000, 50), 1, source)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;playChatTTS&amp;quot;, root, playChatTTS)&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;
{{Useful Functions}}&lt;/div&gt;</summary>
		<author><name>Hassan saad</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:Hassan_saad&amp;diff=46535</id>
		<title>User:Hassan saad</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:Hassan_saad&amp;diff=46535"/>
		<updated>2016-02-01T15:12:23Z</updated>

		<summary type="html">&lt;p&gt;Hassan saad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hello there!&lt;br /&gt;
Welcome to my own profile page. Feel free to contact me on Skype: '''''hassan.saad2000''''' for any scripting related stuff.&lt;br /&gt;
&lt;br /&gt;
'''''Some of my works:'''''&lt;br /&gt;
&lt;br /&gt;
[[ConvertTextToSpeech]]&lt;br /&gt;
&lt;br /&gt;
[[RenameAclGroup]]&lt;br /&gt;
&lt;br /&gt;
[[DxDrawTextOnElement]]&lt;br /&gt;
&lt;br /&gt;
[[DxDrawImageOnElement]]&lt;/div&gt;</summary>
		<author><name>Hassan saad</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawImageOnElement&amp;diff=46534</id>
		<title>DxDrawImageOnElement</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawImageOnElement&amp;diff=46534"/>
		<updated>2016-02-01T15:07:56Z</updated>

		<summary type="html">&lt;p&gt;Hassan saad: Created page with &amp;quot;{{Useful Function}}&amp;lt;lowercasetitle/&amp;gt; __NOTOC__ This useful client function draws an image on any element you choose.  ==Syntax== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;boolean dxDrawImageOnElement(elem...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&amp;lt;lowercasetitle/&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This useful client function draws an image on any element you choose.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;boolean dxDrawImageOnElement(element TheElement, string Image [, int distance, int height, int width, int R, int G, int B, int alpha ] ) &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:DxDrawImageOnElement.png|thumb|Example of how it should looks like.|284x230px]]&lt;br /&gt;
&lt;br /&gt;
==Required arguments==&lt;br /&gt;
* ''TheElement'': The element you want to draw the image on it.&lt;br /&gt;
* ''Image'': The image you want. Use [[dxCreateTexture]] to create it.&lt;br /&gt;
&lt;br /&gt;
==Optional arguments==&lt;br /&gt;
* ''height'': The height of the text, it's 1 by default.&lt;br /&gt;
* ''distance'': The distance you will be able to view the image from, it's 20 by default.&lt;br /&gt;
* ''height'': The height of the image, it's 1 by default.&lt;br /&gt;
* ''width'': The width of the image, it's 1 by default.&lt;br /&gt;
* ''R'': The Red color code (0-255), it's 255 by default.&lt;br /&gt;
* ''G'': The Green color code (0-255), it's 255 by default.&lt;br /&gt;
* ''B'': The Blue color code (0-255), it's 255 by default.&lt;br /&gt;
* ''alpha'': The alpha of the text, it's 255 by default.&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Function source==&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 dxDrawImageOnElement(TheElement,Image,distance,height,width,R,G,B,alpha)&lt;br /&gt;
				local x, y, z = getElementPosition(TheElement)&lt;br /&gt;
				local x2, y2, z2 = getElementPosition(localPlayer)&lt;br /&gt;
				local distance = distance or 20&lt;br /&gt;
				local height = height or 1&lt;br /&gt;
				local width = width or 1&lt;br /&gt;
				if (isLineOfSightClear(x, y, z, x2, y2, z2, true, false, false, false)) then&lt;br /&gt;
					local sx, sy = getScreenFromWorldPosition(x, y, z+height)&lt;br /&gt;
					if(sx) and (sy) then&lt;br /&gt;
						local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2)&lt;br /&gt;
						if(distanceBetweenPoints &amp;lt; distance) then&lt;br /&gt;
							dxDrawMaterialLine3D(x, y, z+1+height-(distanceBetweenPoints/distance), x, y, z+height, Image, width-(distanceBetweenPoints/distance), tocolor(R or 255, G or 255, B or 255, alpha or 255))&lt;br /&gt;
						end&lt;br /&gt;
					end&lt;br /&gt;
			end&lt;br /&gt;
	end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
*Original author: ''Has[S]oN''.&lt;br /&gt;
*Skype: ''hassan.saad2000''&lt;br /&gt;
&lt;br /&gt;
==Example #1==&lt;br /&gt;
This example creates an image on a random ped in the Grove street.&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;
randomPed = createPed(285,2506.83423,-1684.89941,13.55648)&lt;br /&gt;
tag = dxCreateTexture(&amp;quot;crown.png&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root,&lt;br /&gt;
function()&lt;br /&gt;
dxDrawImageOnElement(randomPed,tag)&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;
==Example #2==&lt;br /&gt;
This example creates an image on all the vehicles in the game.&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 tag = dxCreateTexture(&amp;quot;bike.png&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root,&lt;br /&gt;
function()&lt;br /&gt;
for k,v in ipairs(getElementsByType(&amp;quot;vehicle&amp;quot;)) do&lt;br /&gt;
dxDrawImageOnElement(v,tag)&lt;br /&gt;
end&lt;br /&gt;
end) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
{{Useful Functions}}&lt;/div&gt;</summary>
		<author><name>Hassan saad</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=File:DxDrawImageOnElement.png&amp;diff=46533</id>
		<title>File:DxDrawImageOnElement.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=File:DxDrawImageOnElement.png&amp;diff=46533"/>
		<updated>2016-02-01T14:57:12Z</updated>

		<summary type="html">&lt;p&gt;Hassan saad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hassan saad</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawTextOnElement&amp;diff=46532</id>
		<title>DxDrawTextOnElement</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawTextOnElement&amp;diff=46532"/>
		<updated>2016-02-01T13:02:16Z</updated>

		<summary type="html">&lt;p&gt;Hassan saad: /* Function source */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&amp;lt;lowercasetitle/&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This useful client function draws a text on any element you choose.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;boolean dxDrawTextOnElement(element TheElement, string text [, int height, int distance, int R, int G, int B, int alpha, int size, string font ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[Image:dxDrawTextOnElement.png|thumb|Example of how it should looks like.|284x230px]]&lt;br /&gt;
&lt;br /&gt;
==Required arguments==&lt;br /&gt;
* ''TheElement'': The element you want to draw the text on it.&lt;br /&gt;
* ''text'': The text you want.&lt;br /&gt;
&lt;br /&gt;
==Optional arguments==&lt;br /&gt;
* ''height'': The height of the text, it's 1 by default.&lt;br /&gt;
* ''distance'': The distance you will be able to view the text from, it's 20 by default.&lt;br /&gt;
* ''R'': The Red color code (0-255), it's 255 by default.&lt;br /&gt;
* ''G'': The Green color code (0-255), it's 255 by default.&lt;br /&gt;
* ''B'': The Blue color code (0-255), it's 255 by default.&lt;br /&gt;
* ''alpha'': The alpha of the text, it's 255 by default.&lt;br /&gt;
* ''size'': The size of the text, it's 1 by default.&lt;br /&gt;
* ''font'': Either a custom [[DX font]] element or the name of a built-in DX font:&lt;br /&gt;
{{DxFonts}}&lt;br /&gt;
It's arial by default.&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Function source==&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 dxDrawTextOnElement(TheElement,text,height,distance,R,G,B,alpha,size,font)&lt;br /&gt;
				local x, y, z = getElementPosition(TheElement)&lt;br /&gt;
				local x2, y2, z2 = getElementPosition(localPlayer)&lt;br /&gt;
				local distance = distance or 20&lt;br /&gt;
				local height = height or 1&lt;br /&gt;
				if (isLineOfSightClear(x, y, z, x2, y2, z2, true, true, false, true)) then&lt;br /&gt;
					local sx, sy = getScreenFromWorldPosition(x, y, z+height)&lt;br /&gt;
					if(sx) and (sy) then&lt;br /&gt;
						local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2)&lt;br /&gt;
						if(distanceBetweenPoints &amp;lt; distance) then&lt;br /&gt;
							dxDrawText(text, sx+2, sy+2, sx, sy, tocolor(R or 255, G or 255, B or 255, alpha or 255), (size or 1)-(distanceBetweenPoints / distance), font or &amp;quot;arial&amp;quot;, &amp;quot;center&amp;quot;, &amp;quot;center&amp;quot;)&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
*Original author: ''Has[S]oN''.&lt;br /&gt;
*Skype: ''hassan.saad2000''&lt;br /&gt;
&lt;br /&gt;
==Example #1==&lt;br /&gt;
This example creates a text on a random ped in the Grove street.&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;
randomPed = createPed(285,2476.91406,-1665.31799,13.32435)&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientRender&amp;quot;, getRootElement(), &lt;br /&gt;
function ()&lt;br /&gt;
dxDrawTextOnElement(randomPed,&amp;quot;SWATTEAM Officer&amp;quot;,1,20,0,0,255,255,1,&amp;quot;pricedown&amp;quot;)&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;
==Example #2==&lt;br /&gt;
This example creates a text 'HassoN' on all the players are in a team named HassoN.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onClientRender&amp;quot;, getRootElement(), &lt;br /&gt;
function ()&lt;br /&gt;
for k,v in ipairs(getElementsByType(&amp;quot;player&amp;quot;)) do&lt;br /&gt;
		if getPlayerTeam(v) == getTeamFromName(&amp;quot;HassoN&amp;quot;) then&lt;br /&gt;
			if v == localPlayer then return end&lt;br /&gt;
			dxDrawTextOnElement(v,&amp;quot;HassoN&amp;quot;,1,20,0,0,255,255,1,&amp;quot;arial&amp;quot;)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
{{Useful Functions}}&lt;/div&gt;</summary>
		<author><name>Hassan saad</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:Hassan_saad&amp;diff=46531</id>
		<title>User:Hassan saad</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:Hassan_saad&amp;diff=46531"/>
		<updated>2016-02-01T11:59:33Z</updated>

		<summary type="html">&lt;p&gt;Hassan saad: Created page with &amp;quot;Hello there! Welcome to my own profile page. Feel free to contact me on Skype: '''''hassan.saad2000''''' for any scripting related stuff.  '''''Some of my works:'''''  Conve...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hello there!&lt;br /&gt;
Welcome to my own profile page. Feel free to contact me on Skype: '''''hassan.saad2000''''' for any scripting related stuff.&lt;br /&gt;
&lt;br /&gt;
'''''Some of my works:'''''&lt;br /&gt;
&lt;br /&gt;
[[ConvertTextToSpeech]]&lt;br /&gt;
&lt;br /&gt;
[[RenameAclGroup]]&lt;br /&gt;
&lt;br /&gt;
[[DxDrawTextOnElement]]&lt;/div&gt;</summary>
		<author><name>Hassan saad</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawTextOnElement&amp;diff=46529</id>
		<title>DxDrawTextOnElement</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawTextOnElement&amp;diff=46529"/>
		<updated>2016-01-31T21:43:44Z</updated>

		<summary type="html">&lt;p&gt;Hassan saad: Created page with &amp;quot;{{Useful Function}}&amp;lt;lowercasetitle/&amp;gt; __NOTOC__ This useful client function draws a text on any element you choose.  ==Syntax== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;boolean dxDrawTextOnElement(element...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&amp;lt;lowercasetitle/&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This useful client function draws a text on any element you choose.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;boolean dxDrawTextOnElement(element TheElement, string text [, int height, int distance, int R, int G, int B, int alpha, int size, string font ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[Image:dxDrawTextOnElement.png|thumb|Example of how it should looks like.|284x230px]]&lt;br /&gt;
&lt;br /&gt;
==Required arguments==&lt;br /&gt;
* ''TheElement'': The element you want to draw the text on it.&lt;br /&gt;
* ''text'': The text you want.&lt;br /&gt;
&lt;br /&gt;
==Optional arguments==&lt;br /&gt;
* ''height'': The height of the text, it's 1 by default.&lt;br /&gt;
* ''distance'': The distance you will be able to view the text from, it's 20 by default.&lt;br /&gt;
* ''R'': The Red color code (0-255), it's 255 by default.&lt;br /&gt;
* ''G'': The Green color code (0-255), it's 255 by default.&lt;br /&gt;
* ''B'': The Blue color code (0-255), it's 255 by default.&lt;br /&gt;
* ''alpha'': The alpha of the text, it's 255 by default.&lt;br /&gt;
* ''size'': The size of the text, it's 1 by default.&lt;br /&gt;
* ''font'': Either a custom [[DX font]] element or the name of a built-in DX font:&lt;br /&gt;
{{DxFonts}}&lt;br /&gt;
It's arial by default.&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Function source==&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 dxDrawTextOnElement(TheElement,text,height,distance,R,G,B,alpha,size,font)&lt;br /&gt;
				local x, y, z = getElementPosition(TheElement)&lt;br /&gt;
				local x2, y2, z2 = getElementPosition(localPlayer)&lt;br /&gt;
				local distance = distance or 20&lt;br /&gt;
				if (isLineOfSightClear(x, y, z, x2, y2, z2, true, true, false, true)) then&lt;br /&gt;
					local sx, sy = getScreenFromWorldPosition(x, y, z+height or 1)&lt;br /&gt;
					if(sx) and (sy) then&lt;br /&gt;
						local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2)&lt;br /&gt;
						if(distanceBetweenPoints &amp;lt; distance) then&lt;br /&gt;
							dxDrawText(text, sx+2, sy+2, sx, sy, tocolor(R or 255, G or 255, B or 255, alpha or 255), (size or 1)-(distanceBetweenPoints / distance), font or &amp;quot;arial&amp;quot;, &amp;quot;center&amp;quot;, &amp;quot;center&amp;quot;)&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
*Original author: ''Has[S]oN''.&lt;br /&gt;
*Skype: ''hassan.saad2000''&lt;br /&gt;
&lt;br /&gt;
==Example #1==&lt;br /&gt;
This example creates a text on a random ped in the Grove street.&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;
randomPed = createPed(285,2476.91406,-1665.31799,13.32435)&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientRender&amp;quot;, getRootElement(), &lt;br /&gt;
function ()&lt;br /&gt;
dxDrawTextOnElement(randomPed,&amp;quot;SWATTEAM Officer&amp;quot;,1,20,0,0,255,255,1,&amp;quot;pricedown&amp;quot;)&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;
==Example #2==&lt;br /&gt;
This example creates a text 'HassoN' on all the players are in a team named HassoN.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onClientRender&amp;quot;, getRootElement(), &lt;br /&gt;
function ()&lt;br /&gt;
for k,v in ipairs(getElementsByType(&amp;quot;player&amp;quot;)) do&lt;br /&gt;
		if getPlayerTeam(v) == getTeamFromName(&amp;quot;HassoN&amp;quot;) then&lt;br /&gt;
			if v == localPlayer then return end&lt;br /&gt;
			dxDrawTextOnElement(v,&amp;quot;HassoN&amp;quot;,1,20,0,0,255,255,1,&amp;quot;arial&amp;quot;)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
{{Useful Functions}}&lt;/div&gt;</summary>
		<author><name>Hassan saad</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=File:DxDrawTextOnElement.png&amp;diff=46528</id>
		<title>File:DxDrawTextOnElement.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=File:DxDrawTextOnElement.png&amp;diff=46528"/>
		<updated>2016-01-31T21:38:19Z</updated>

		<summary type="html">&lt;p&gt;Hassan saad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hassan saad</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=RenameAclGroup&amp;diff=41681</id>
		<title>RenameAclGroup</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=RenameAclGroup&amp;diff=41681"/>
		<updated>2014-08-29T23:06:07Z</updated>

		<summary type="html">&lt;p&gt;Hassan saad: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool renameAclGroup(string old , string new )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Required arguments==&lt;br /&gt;
* ''old '': old name of acl group you want to change&lt;br /&gt;
* ''new '': the new name of acl group&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Function source==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function renameAclGroup(old,new)&lt;br /&gt;
if (type(old) ~= &amp;quot;string&amp;quot; ) then&lt;br /&gt;
outputDebugString(&amp;quot;Bad argument 1 @ renameAclGroup [ string expected, got &amp;quot; .. type(old) .. &amp;quot;] &amp;quot;,2)&lt;br /&gt;
end&lt;br /&gt;
if (type(new) ~= &amp;quot;string&amp;quot; ) then&lt;br /&gt;
outputDebugString(&amp;quot;Bad argument 2 @ renameAclGroup [ string expected, got &amp;quot; .. type(new) .. &amp;quot;] &amp;quot;,2)&lt;br /&gt;
end&lt;br /&gt;
if (not aclGetGroup(old) ) then &lt;br /&gt;
return outputDebugString(&amp;quot;Bad argument 1 @ renameAclGroup [ we cant found this Group Name ] &amp;quot;,2)&lt;br /&gt;
end&lt;br /&gt;
if ( aclGetGroup(new) ) then &lt;br /&gt;
return outputDebugString(&amp;quot;Bad argument 2 @ renameAclGroup [ already there is this group Name ] &amp;quot;,2)&lt;br /&gt;
end&lt;br /&gt;
oldObjects = aclGroupListObjects(aclGetGroup(old))&lt;br /&gt;
oldacl = aclGroupListACL(aclGetGroup(old))&lt;br /&gt;
aclDestroyGroup(aclGetGroup (old))&lt;br /&gt;
aclCreateGroup(new)&lt;br /&gt;
for Ha,nameofacl in pairs(oldacl) do&lt;br /&gt;
aclGroupAddACL(aclGetGroup(new),nameofacl)&lt;br /&gt;
end&lt;br /&gt;
for Yo,nameofObject in pairs(oldObjects) do&lt;br /&gt;
aclGroupAddObject(aclGetGroup(new),nameofObject)&lt;br /&gt;
end&lt;br /&gt;
aclSave ()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
*Original author: ''Has[S]oN''.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
this Example change Group the Name of Group Moderator From &amp;quot;Moderator&amp;quot; to &amp;quot;HassoN&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setTimer( function ()&lt;br /&gt;
renameAclGroup(&amp;quot;Moderator&amp;quot;,&amp;quot;HassoN&amp;quot;)&lt;br /&gt;
end,5000,1)&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;
{{Useful Functions}}&lt;/div&gt;</summary>
		<author><name>Hassan saad</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=RenameAclGroup&amp;diff=41680</id>
		<title>RenameAclGroup</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=RenameAclGroup&amp;diff=41680"/>
		<updated>2014-08-29T22:53:21Z</updated>

		<summary type="html">&lt;p&gt;Hassan saad: /* Function source */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool renameAclGroup(string old , string new )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Required arguments==&lt;br /&gt;
* ''old '': old name of acl group you want to change&lt;br /&gt;
* ''new '': the new name of acl group&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Function source==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function renameAclGroup(old,new)&lt;br /&gt;
if (type(old) ~= &amp;quot;string&amp;quot; ) then&lt;br /&gt;
outputDebugString(&amp;quot;Bad argument 1 @ renameAclGroup [ string expected, got &amp;quot; .. type(old) .. &amp;quot;] &amp;quot;,2)&lt;br /&gt;
end&lt;br /&gt;
if (type(new) ~= &amp;quot;string&amp;quot; ) then&lt;br /&gt;
outputDebugString(&amp;quot;Bad argument 2 @ renameAclGroup [ string expected, got &amp;quot; .. type(new) .. &amp;quot;] &amp;quot;,2)&lt;br /&gt;
end&lt;br /&gt;
if (not aclGetGroup(old) ) then &lt;br /&gt;
return outputDebugString(&amp;quot;Bad argument 1 @ renameAclGroup [ we cant found this Group Name ] &amp;quot;,2)&lt;br /&gt;
end&lt;br /&gt;
if ( aclGetGroup(new) ) then &lt;br /&gt;
return outputDebugString(&amp;quot;Bad argument 2 @ renameAclGroup [ already there is this group Name ] &amp;quot;,2)&lt;br /&gt;
end&lt;br /&gt;
oldObjects = aclGroupListObjects(aclGetGroup(old))&lt;br /&gt;
oldacl = aclGroupListACL(aclGetGroup(old))&lt;br /&gt;
aclDestroyGroup(aclGetGroup (old))&lt;br /&gt;
aclCreateGroup(new)&lt;br /&gt;
for Ha,nameofacl in pairs(oldacl) do&lt;br /&gt;
aclGroupAddACL(aclGetGroup(new),nameofacl)&lt;br /&gt;
end&lt;br /&gt;
for Yo,nameofObject in pairs(oldObjects) do&lt;br /&gt;
aclGroupAddObject(aclGetGroup(new),nameofObject)&lt;br /&gt;
end&lt;br /&gt;
aclSave ()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
*Original author: ''Has[S]oN''.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
this Example change Group the Name of Group Admin From &amp;quot;Admin&amp;quot; to &amp;quot;HassoN&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setTimer( function ()&lt;br /&gt;
renameAclGroup(&amp;quot;Admin&amp;quot;,&amp;quot;HassoN&amp;quot;)&lt;br /&gt;
end,5000,1)&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;
{{Useful Functions}}&lt;/div&gt;</summary>
		<author><name>Hassan saad</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=RenameAclGroup&amp;diff=41677</id>
		<title>RenameAclGroup</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=RenameAclGroup&amp;diff=41677"/>
		<updated>2014-08-29T20:36:58Z</updated>

		<summary type="html">&lt;p&gt;Hassan saad: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool renameAclGroup(string old , string new )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Required arguments==&lt;br /&gt;
* ''old '': old name of acl group you want to change&lt;br /&gt;
* ''new '': the new name of acl group&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Function source==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function renameAclGroup(old,new)&lt;br /&gt;
if (type(old) ~= &amp;quot;string&amp;quot; ) then&lt;br /&gt;
outputDebugString(&amp;quot;Bad argument 1 @ renameAclGroup [ string expected, got &amp;quot; .. type(old) .. &amp;quot;] &amp;quot;,2)&lt;br /&gt;
end&lt;br /&gt;
if (type(new) ~= &amp;quot;string&amp;quot; ) then&lt;br /&gt;
outputDebugString(&amp;quot;Bad argument 2 @ renameAclGroup [ string expected, got &amp;quot; .. type(new) .. &amp;quot;] &amp;quot;,2)&lt;br /&gt;
end&lt;br /&gt;
if aclGetGroup(old) then&lt;br /&gt;
oldObjects = aclGroupListObjects(aclGetGroup(old))&lt;br /&gt;
oldacl = aclGroupListACL(aclGetGroup(old))&lt;br /&gt;
aclDestroyGroup(aclGetGroup (old))&lt;br /&gt;
aclCreateGroup(new)&lt;br /&gt;
end&lt;br /&gt;
for Ha,nameofacl in pairs(oldacl) do&lt;br /&gt;
aclGroupAddACL(aclGetGroup(new),nameofacl)&lt;br /&gt;
end&lt;br /&gt;
for Yo,nameofObject in pairs(oldObjects) do&lt;br /&gt;
aclGroupAddObject(aclGetGroup(new),nameofObject)&lt;br /&gt;
end&lt;br /&gt;
aclSave ()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
*Original author: ''Has[S]oN''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
this Example change Group the Name of Group Admin From &amp;quot;Admin&amp;quot; to &amp;quot;HassoN&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setTimer( function ()&lt;br /&gt;
renameAclGroup(&amp;quot;Admin&amp;quot;,&amp;quot;HassoN&amp;quot;)&lt;br /&gt;
end,5000,1)&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;
{{Useful Functions}}&lt;/div&gt;</summary>
		<author><name>Hassan saad</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=RenameAclGroup&amp;diff=41676</id>
		<title>RenameAclGroup</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=RenameAclGroup&amp;diff=41676"/>
		<updated>2014-08-29T20:06:25Z</updated>

		<summary type="html">&lt;p&gt;Hassan saad: this function is changed the acl Group Name..&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool renameAclGroup(string old , string new )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Required arguments==&lt;br /&gt;
* ''old '': old name of acl group you want to change&lt;br /&gt;
* ''new '': the new name of acl group&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Function source==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function renameAclGroup(old,new)&lt;br /&gt;
if (type(old) ~= &amp;quot;string&amp;quot; ) then&lt;br /&gt;
outputDebugString(&amp;quot;Bad argument 1 @ renameAclGroup [ string expected, got &amp;quot; .. type(old) .. &amp;quot;] &amp;quot;,2)&lt;br /&gt;
end&lt;br /&gt;
if (type(new) ~= &amp;quot;string&amp;quot; ) then&lt;br /&gt;
outputDebugString(&amp;quot;Bad argument 2 @ renameAclGroup [ string expected, got &amp;quot; .. type(new) .. &amp;quot;] &amp;quot;,2)&lt;br /&gt;
end&lt;br /&gt;
if aclGetGroup(old) then&lt;br /&gt;
oldObjects = aclGroupListObjects(aclGetGroup(old))&lt;br /&gt;
oldacl = aclGroupListACL(aclGetGroup(old))&lt;br /&gt;
aclDestroyGroup(aclGetGroup (old))&lt;br /&gt;
aclCreateGroup(new)&lt;br /&gt;
end&lt;br /&gt;
for Ha,nameofacl in pairs(oldacl) do&lt;br /&gt;
aclGroupAddACL(aclGetGroup(new),nameofacl)&lt;br /&gt;
end&lt;br /&gt;
for Yo,nameofObject in pairs(oldObjects) do&lt;br /&gt;
aclGroupAddObject(aclGetGroup(new),nameofObject)&lt;br /&gt;
end&lt;br /&gt;
aclSave ()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
*Original author: ''Has[S]oN''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
this Example change Group the Name of Group Console From &amp;quot;Console&amp;quot; to &amp;quot;HassoN&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setTimer( function ()&lt;br /&gt;
renameAclGroup(&amp;quot;Console&amp;quot;,&amp;quot;HassoN&amp;quot;)&lt;br /&gt;
end,5000,1)&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;
&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
{{Useful Functions}}&lt;/div&gt;</summary>
		<author><name>Hassan saad</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Useful_Functions/convertWordsToSound&amp;diff=41632</id>
		<title>Useful Functions/convertWordsToSound</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Useful_Functions/convertWordsToSound&amp;diff=41632"/>
		<updated>2014-08-24T21:52:08Z</updated>

		<summary type="html">&lt;p&gt;Hassan saad: Hassan saad moved page Useful Functions/convertWordsToSound to Multi Theft Auto: Wiki:Useful Functions/convertWordsToSound&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Multi Theft Auto: Wiki:Useful Functions/convertWordsToSound]]&lt;/div&gt;</summary>
		<author><name>Hassan saad</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=ConvertTextToSpeech&amp;diff=41631</id>
		<title>ConvertTextToSpeech</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=ConvertTextToSpeech&amp;diff=41631"/>
		<updated>2014-08-24T21:52:08Z</updated>

		<summary type="html">&lt;p&gt;Hassan saad: Hassan saad moved page Useful Functions/convertWordsToSound to Multi Theft Auto: Wiki:Useful Functions/convertWordsToSound&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''&lt;br /&gt;
== * convertWordsToSound ==&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
*only Server Side&lt;br /&gt;
*Author: Has[S]oN&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;convertWordsToSound(string text)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
== Required Arguments: ==&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
* text: the Text you want to convert it from word to sound&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
== Code: ==&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;--Server Side&lt;br /&gt;
 &lt;br /&gt;
function convertWordsToSound(str)&lt;br /&gt;
local str2 = &amp;quot;&amp;quot;&lt;br /&gt;
str2 = &amp;quot;http://translate.google.com/translate_tts?tl=en&amp;amp;q=&amp;quot;..str..&amp;quot;&amp;quot;&lt;br /&gt;
triggerClientEvent(source,&amp;quot;VoiceClient&amp;quot;,source,str2)&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
--Client Side&lt;br /&gt;
 &lt;br /&gt;
function sayVoice(str)&lt;br /&gt;
currentVoice = playSound(str)&lt;br /&gt;
end&lt;br /&gt;
addEvent(&amp;quot;VoiceClient&amp;quot;,true)&lt;br /&gt;
addEventHandler(&amp;quot;VoiceClient&amp;quot;,localPlayer,sayVoice)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
== Example: ==&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Server Side:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function convertWordsToSound(str)&lt;br /&gt;
local str2 = &amp;quot;&amp;quot;&lt;br /&gt;
str2 = &amp;quot;http://translate.google.com/translate_tts?tl=en&amp;amp;q=&amp;quot;..str..&amp;quot;&amp;quot;&lt;br /&gt;
triggerClientEvent(source,&amp;quot;VoiceClient&amp;quot;,source,str2)&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
addEventHandler(&amp;quot;onPlayerChat&amp;quot;,root,&lt;br /&gt;
function (messag)&lt;br /&gt;
convertWordsToSound(messag)&lt;br /&gt;
end)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Client Side:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function sayVoice(str)&lt;br /&gt;
currentVoice = playSound(str)&lt;br /&gt;
end&lt;br /&gt;
addEvent(&amp;quot;VoiceClient&amp;quot;,true)&lt;br /&gt;
addEventHandler(&amp;quot;VoiceClient&amp;quot;,localPlayer,sayVoice)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Of course the function Very clear from his name&lt;br /&gt;
convert any word to sound &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For do the function work with arabic please replace&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;str2 = &amp;quot;http://translate.google.com/translate_tts?tl=en&amp;amp;q=&amp;quot;..str..&amp;quot;&amp;quot;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;str2 = &amp;quot;http://translate.google.com/translate_tts?tl=ar&amp;amp;q=&amp;quot;..str..&amp;quot;&amp;quot;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thx and sorry for bad english :)&lt;/div&gt;</summary>
		<author><name>Hassan saad</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=ConvertTextToSpeech&amp;diff=41630</id>
		<title>ConvertTextToSpeech</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=ConvertTextToSpeech&amp;diff=41630"/>
		<updated>2014-08-24T21:46:18Z</updated>

		<summary type="html">&lt;p&gt;Hassan saad: this function is convert any word to sound&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''&lt;br /&gt;
== * convertWordsToSound ==&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
*only Server Side&lt;br /&gt;
*Author: Has[S]oN&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;convertWordsToSound(string text)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
== Required Arguments: ==&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
* text: the Text you want to convert it from word to sound&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
== Code: ==&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;--Server Side&lt;br /&gt;
 &lt;br /&gt;
function convertWordsToSound(str)&lt;br /&gt;
local str2 = &amp;quot;&amp;quot;&lt;br /&gt;
str2 = &amp;quot;http://translate.google.com/translate_tts?tl=en&amp;amp;q=&amp;quot;..str..&amp;quot;&amp;quot;&lt;br /&gt;
triggerClientEvent(source,&amp;quot;VoiceClient&amp;quot;,source,str2)&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
--Client Side&lt;br /&gt;
 &lt;br /&gt;
function sayVoice(str)&lt;br /&gt;
currentVoice = playSound(str)&lt;br /&gt;
end&lt;br /&gt;
addEvent(&amp;quot;VoiceClient&amp;quot;,true)&lt;br /&gt;
addEventHandler(&amp;quot;VoiceClient&amp;quot;,localPlayer,sayVoice)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
== Example: ==&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Server Side:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function convertWordsToSound(str)&lt;br /&gt;
local str2 = &amp;quot;&amp;quot;&lt;br /&gt;
str2 = &amp;quot;http://translate.google.com/translate_tts?tl=en&amp;amp;q=&amp;quot;..str..&amp;quot;&amp;quot;&lt;br /&gt;
triggerClientEvent(source,&amp;quot;VoiceClient&amp;quot;,source,str2)&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
addEventHandler(&amp;quot;onPlayerChat&amp;quot;,root,&lt;br /&gt;
function (messag)&lt;br /&gt;
convertWordsToSound(messag)&lt;br /&gt;
end)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Client Side:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function sayVoice(str)&lt;br /&gt;
currentVoice = playSound(str)&lt;br /&gt;
end&lt;br /&gt;
addEvent(&amp;quot;VoiceClient&amp;quot;,true)&lt;br /&gt;
addEventHandler(&amp;quot;VoiceClient&amp;quot;,localPlayer,sayVoice)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Of course the function Very clear from his name&lt;br /&gt;
convert any word to sound &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For do the function work with arabic please replace&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;str2 = &amp;quot;http://translate.google.com/translate_tts?tl=en&amp;amp;q=&amp;quot;..str..&amp;quot;&amp;quot;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;str2 = &amp;quot;http://translate.google.com/translate_tts?tl=ar&amp;amp;q=&amp;quot;..str..&amp;quot;&amp;quot;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thx and sorry for bad english :)&lt;/div&gt;</summary>
		<author><name>Hassan saad</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/createBlip&amp;diff=41071</id>
		<title>AR/createBlip</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/createBlip&amp;diff=41071"/>
		<updated>2014-07-29T22:15:58Z</updated>

		<summary type="html">&lt;p&gt;Hassan saad: /* Example */&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;
==مثال== &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>Hassan saad</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/setSoundEffectEnabled&amp;diff=41070</id>
		<title>AR/setSoundEffectEnabled</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/setSoundEffectEnabled&amp;diff=41070"/>
		<updated>2014-07-29T22:13:14Z</updated>

		<summary type="html">&lt;p&gt;Hassan saad: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
Used to enable or disable specific sound effects.&lt;br /&gt;
{{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 setSoundEffectEnabled ( element sound, string effectName, bool bEnable )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''sound:''' a [[sound]] element.&lt;br /&gt;
*'''effectName:''' the effect you want to enable or disable&lt;br /&gt;
{{Sound_Effects}}&lt;br /&gt;
*'''bEnable:''' ''true'' if you want to enable the effect, ''false'' if you want to disable it.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the effect was set successfully, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==مثال== &lt;br /&gt;
This example creates a sound and set's the flanger sound effect enabled.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;addCommandHandler(&amp;quot;flanger&amp;quot;,function(cmd,enabled)&lt;br /&gt;
	if(isElement(waterSplashes))then&lt;br /&gt;
		setSoundEffectEnabled(waterSplashes,cmd,enabled)&lt;br /&gt;
	else&lt;br /&gt;
		waterSplashes = playSound(&amp;quot;splashes.mp3&amp;quot;,true)&lt;br /&gt;
		setSoundEffectEnabled(waterSplashes,cmd,enabled)&lt;br /&gt;
	end&lt;br /&gt;
end,true) --set it case sensitive as we are going to get the command name and use it in the setSoundEffectEnabled&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.2|Added player element for voice control}}&lt;br /&gt;
&lt;br /&gt;
==أنظر أيضاً==&lt;br /&gt;
{{AR/Audio_functions}}&lt;/div&gt;</summary>
		<author><name>Hassan saad</name></author>
	</entry>
</feed>