<?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=MaStFa</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=MaStFa"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/MaStFa"/>
	<updated>2026-04-06T05:09:10Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=RestartResource&amp;diff=63393</id>
		<title>RestartResource</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=RestartResource&amp;diff=63393"/>
		<updated>2019-07-23T08:18:26Z</updated>

		<summary type="html">&lt;p&gt;MaStFa: /* Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server function}}&lt;br /&gt;
{{note| Don't forget to give admin rights to the resource, in which you are using restartResource function or it won't work.}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function restarts a running resource. Restarting will destroy all the elements that the resource has created (as stopping the resource does).&lt;br /&gt;
&lt;br /&gt;
'''Note:''' This function does not restart the resource immediately. Restarts are queued up until the end of the server's frame to ensure that they occur in the correct order (and that dependent resources can start and stop correctly). The resource being restarted will have an [[onResourceStop]] event triggered and the restarted instance will receive an [[onResourceStart]] event. Remember that the element and resource variables will be invalidated during the restart, though of course, the resource's name will not. &lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool restartResource ( resource theResource [, bool persistent = false, bool configs = true, bool maps = true, bool scripts = true, bool html = true, bool clientConfigs = true, bool clientScripts = true, bool clientFiles = true ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
'''-- المقصد اعادات تشغيل المودات من خلال سكربت او اضافت وقت لعدات التشيغيل المودات ويمكن ترسيت بعض الملفات&lt;br /&gt;
''' &lt;br /&gt;
{{OOP||[[resource]]:restart}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theResource:''' the [[resource]] you want to restart.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''persistent:''' Unused&lt;br /&gt;
*'''configs:''' Reload configs?&lt;br /&gt;
*'''maps:''' Reload maps?&lt;br /&gt;
*'''scripts:''' Reload (server) scripts?&lt;br /&gt;
*'''html:''' Reload html files (for resource web access)?&lt;br /&gt;
*'''clientConfigs:''' Reload client configs?&lt;br /&gt;
*'''clientScripts:''' Reload client scripts?&lt;br /&gt;
*'''clientFiles:''' Reload files?&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the resource was restarted, ''false'' if the resource wasn't running, or an invalid resource was passed.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
Example 1: This function restarts all running resources.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function restartAllResources()&lt;br /&gt;
	-- we store a table of resources&lt;br /&gt;
	local allResources = getResources()&lt;br /&gt;
	-- for each one of them,&lt;br /&gt;
	for index, res in ipairs(allResources) do&lt;br /&gt;
		-- if it's running,&lt;br /&gt;
		if getResourceState(res) == &amp;quot;running&amp;quot; then&lt;br /&gt;
			-- then restart it&lt;br /&gt;
			restartResource(res)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example 2: This example will restart the specify resource every 3600000 milliseconds (hour).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setTimer(&lt;br /&gt;
    function()  &lt;br /&gt;
	--restarting this resource every hour&lt;br /&gt;
        restartResource(getThisResource())&lt;br /&gt;
    end,&lt;br /&gt;
3600000, 0)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Resource_functions}}&lt;/div&gt;</summary>
		<author><name>MaStFa</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=RestartResource&amp;diff=63392</id>
		<title>RestartResource</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=RestartResource&amp;diff=63392"/>
		<updated>2019-07-23T08:17:48Z</updated>

		<summary type="html">&lt;p&gt;MaStFa: /* Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server function}}&lt;br /&gt;
{{note| Don't forget to give admin rights to the resource, in which you are using restartResource function or it won't work.}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function restarts a running resource. Restarting will destroy all the elements that the resource has created (as stopping the resource does).&lt;br /&gt;
&lt;br /&gt;
'''Note:''' This function does not restart the resource immediately. Restarts are queued up until the end of the server's frame to ensure that they occur in the correct order (and that dependent resources can start and stop correctly). The resource being restarted will have an [[onResourceStop]] event triggered and the restarted instance will receive an [[onResourceStart]] event. Remember that the element and resource variables will be invalidated during the restart, though of course, the resource's name will not. &lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool restartResource ( resource theResource [, bool persistent = false, bool configs = true, bool maps = true, bool scripts = true, bool html = true, bool clientConfigs = true, bool clientScripts = true, bool clientFiles = true ] )&lt;br /&gt;
'''-- المقصد اعادات تشغيل المودات من خلال سكربت او اضافت وقت لعدات التشيغيل المودات ويمكن ترسيت بعض الملفات&lt;br /&gt;
'''&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[resource]]:restart}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theResource:''' the [[resource]] you want to restart.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''persistent:''' Unused&lt;br /&gt;
*'''configs:''' Reload configs?&lt;br /&gt;
*'''maps:''' Reload maps?&lt;br /&gt;
*'''scripts:''' Reload (server) scripts?&lt;br /&gt;
*'''html:''' Reload html files (for resource web access)?&lt;br /&gt;
*'''clientConfigs:''' Reload client configs?&lt;br /&gt;
*'''clientScripts:''' Reload client scripts?&lt;br /&gt;
*'''clientFiles:''' Reload files?&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the resource was restarted, ''false'' if the resource wasn't running, or an invalid resource was passed.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
Example 1: This function restarts all running resources.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function restartAllResources()&lt;br /&gt;
	-- we store a table of resources&lt;br /&gt;
	local allResources = getResources()&lt;br /&gt;
	-- for each one of them,&lt;br /&gt;
	for index, res in ipairs(allResources) do&lt;br /&gt;
		-- if it's running,&lt;br /&gt;
		if getResourceState(res) == &amp;quot;running&amp;quot; then&lt;br /&gt;
			-- then restart it&lt;br /&gt;
			restartResource(res)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example 2: This example will restart the specify resource every 3600000 milliseconds (hour).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setTimer(&lt;br /&gt;
    function()  &lt;br /&gt;
	--restarting this resource every hour&lt;br /&gt;
        restartResource(getThisResource())&lt;br /&gt;
    end,&lt;br /&gt;
3600000, 0)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Resource_functions}}&lt;/div&gt;</summary>
		<author><name>MaStFa</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetPlayerName&amp;diff=63391</id>
		<title>SetPlayerName</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetPlayerName&amp;diff=63391"/>
		<updated>2019-07-23T08:12:34Z</updated>

		<summary type="html">&lt;p&gt;MaStFa: /* Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server function}} &lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function changes the specified [[player]]'s name. Note that any change made to a players name with this function is not saved in their settings so the name change only lasts till they disconnect.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setPlayerName ( player thePlayer, string newName ) -- تعديل اسم الاعب&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{OOP||[[player]]:setName|name|getPlayerName}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePlayer:''' the [[player]] that will have its name set.&lt;br /&gt;
*'''newName:''' the new name to set for the player.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the player name was changed succesfully, ''false'' if invalid arguments are specified.&lt;br /&gt;
&lt;br /&gt;
===Limits===&lt;br /&gt;
* Only ASCII characters between 33 and 126 are allowed (basic latin, no spaces):&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;!&amp;quot;#$%&amp;amp;'()*+,-./0123456789:;&amp;lt;=&amp;gt;?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
* Minimal player name length is 1 character. &lt;br /&gt;
* Maximum player name length is 22 characters.&lt;br /&gt;
* Player names are case-insensitive. It is not possible to have two clients with same name but different character case.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example adds a tag before a player's nickname via a /changetag command&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-- Define the function for this command (/changetag, as defined below)&lt;br /&gt;
-- source = the player that triggered this command&lt;br /&gt;
-- command = the command passed into the function (changetag)&lt;br /&gt;
-- thePlayer = the player that you wish to add a tag to&lt;br /&gt;
-- tag = the tag to add to the players nickname&lt;br /&gt;
function tagPlayer ( source, command, thePlayer, tag )&lt;br /&gt;
	-- Attempt to grab the element id for the player from the parsed name.&lt;br /&gt;
	local sPlayerElement = getPlayerFromName ( thePlayer )&lt;br /&gt;
	-- Check to see if the player were changing the tag for exists.&lt;br /&gt;
	if ( sPlayerElement ) then&lt;br /&gt;
		-- make sure that the element type of thePlayer is acctually pointing to a player element&lt;br /&gt;
		if getElementType ( sPlayerElement ) == &amp;quot;player&amp;quot; then&lt;br /&gt;
			-- we store the player's current name,&lt;br /&gt;
			local oldName = getPlayerName ( sPlayerElement )&lt;br /&gt;
			-- append the tag passed to this function before it&lt;br /&gt;
			local taggedName = tag .. oldName&lt;br /&gt;
			-- then set it as his new name&lt;br /&gt;
			setPlayerName ( sPlayerElement, taggedName )&lt;br /&gt;
			-- Tell the player who triggerd the command that the tag has been applied&lt;br /&gt;
			outputChatBox ( &amp;quot;Player &amp;quot; .. thePlayer .. &amp;quot;'s tag changed to &amp;quot; .. taggedName, source )&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		-- Tell the player who triggerd the command that the player could not be found&lt;br /&gt;
		outputChatBox ( &amp;quot;Unable to change player tag: Player &amp;quot; .. thePlayer .. &amp;quot; not found&amp;quot;, source )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
-- Add a command handler for either the console or / chat commands&lt;br /&gt;
-- Example: /changetag &amp;lt;playername&amp;gt; &amp;lt;tag&amp;gt;&lt;br /&gt;
addCommandHandler ( &amp;quot;changetag&amp;quot;, tagPlayer )&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;
{{Player functions}}&lt;br /&gt;
[[ru:setPlayerName]]&lt;/div&gt;</summary>
		<author><name>MaStFa</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetDistanceBetweenPoints3D&amp;diff=63367</id>
		<title>GetDistanceBetweenPoints3D</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetDistanceBetweenPoints3D&amp;diff=63367"/>
		<updated>2019-07-21T20:32:49Z</updated>

		<summary type="html">&lt;p&gt;MaStFa: /* Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
{{Note box|This function is equivalent to the [[Vector3]] class ''getLength'' method when used with a vector that holds the direction and distance between two points. In other words, it produces exactly the same result as substracting the points' coordinates and getting the length of the result vector.}}&lt;br /&gt;
&lt;br /&gt;
This function returns the distance between two 3 dimensional points using the pythagorean theorem.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;float getDistanceBetweenPoints3D ( float x1, float y1, float z1, float x2, float y2, float z2 )&amp;lt;/syntaxhighlight&amp;gt; -- '''المقصود هنى وضع مسافه بين اشياء او قياس مسافه بنضريات'''&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''x1''': The X position of the first point&lt;br /&gt;
* '''y1''': The Y position of the first point&lt;br /&gt;
* '''z1''': The Z position of the first point&lt;br /&gt;
* '''x2''': The X position of the second point&lt;br /&gt;
* '''y2''': The Y position of the second point&lt;br /&gt;
* '''z2''': The Z position of the second point&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a float containing the distance between the two points as a [[float]]. Returns ''false'' if an argument passed was invalid.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example gets the distance between two vehicles and outputs it to the chat box.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
vehicle1x, vehicle1y, vehicle1z = getElementPosition ( vehicle1 )&lt;br /&gt;
vehicle2x, vehicle2y, vehicle2z = getElementPosition ( vehicle2 )&lt;br /&gt;
outputChatBox ( &amp;quot;The distance between vehicle1 and vehicle2 is &amp;quot;..tostring(getDistanceBetweenPoints3D ( vehicle1x, vehicle1y, vehicle1z, vehicle2x,&lt;br /&gt;
 vehicle2y, vehicle2z )) )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''getDistanceBetweenPoints3D'' can also be used to measure the length of 3 dimensional vectors. This example calculates the speed of a vehicle by measuring the size of the it's velocity vector:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
speed = getDistanceBetweenPoints3D ( 0, 0, 0, getElementVelocity ( vehicle ) )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
''Lua note: Using multiple return values as arguments for another function can only be done at the end of the argument list.''&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Utility functions}}&lt;/div&gt;</summary>
		<author><name>MaStFa</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetDistanceBetweenPoints3D&amp;diff=63366</id>
		<title>GetDistanceBetweenPoints3D</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetDistanceBetweenPoints3D&amp;diff=63366"/>
		<updated>2019-07-21T20:32:15Z</updated>

		<summary type="html">&lt;p&gt;MaStFa: /* Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
{{Note box|This function is equivalent to the [[Vector3]] class ''getLength'' method when used with a vector that holds the direction and distance between two points. In other words, it produces exactly the same result as substracting the points' coordinates and getting the length of the result vector.}}&lt;br /&gt;
&lt;br /&gt;
This function returns the distance between two 3 dimensional points using the pythagorean theorem.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;float getDistanceBetweenPoints3D ( float x1, float y1, float z1, float x2, float y2, float z2 )&amp;lt;/syntaxhighlight&amp;gt; -- المقصود هنى وضع مسافه بين اشياء او قياس مسافه بنضريات&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''x1''': The X position of the first point&lt;br /&gt;
* '''y1''': The Y position of the first point&lt;br /&gt;
* '''z1''': The Z position of the first point&lt;br /&gt;
* '''x2''': The X position of the second point&lt;br /&gt;
* '''y2''': The Y position of the second point&lt;br /&gt;
* '''z2''': The Z position of the second point&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a float containing the distance between the two points as a [[float]]. Returns ''false'' if an argument passed was invalid.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example gets the distance between two vehicles and outputs it to the chat box.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
vehicle1x, vehicle1y, vehicle1z = getElementPosition ( vehicle1 )&lt;br /&gt;
vehicle2x, vehicle2y, vehicle2z = getElementPosition ( vehicle2 )&lt;br /&gt;
outputChatBox ( &amp;quot;The distance between vehicle1 and vehicle2 is &amp;quot;..tostring(getDistanceBetweenPoints3D ( vehicle1x, vehicle1y, vehicle1z, vehicle2x,&lt;br /&gt;
 vehicle2y, vehicle2z )) )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''getDistanceBetweenPoints3D'' can also be used to measure the length of 3 dimensional vectors. This example calculates the speed of a vehicle by measuring the size of the it's velocity vector:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
speed = getDistanceBetweenPoints3D ( 0, 0, 0, getElementVelocity ( vehicle ) )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
''Lua note: Using multiple return values as arguments for another function can only be done at the end of the argument list.''&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Utility functions}}&lt;/div&gt;</summary>
		<author><name>MaStFa</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GuiComboBoxGetItemCount&amp;diff=63365</id>
		<title>GuiComboBoxGetItemCount</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GuiComboBoxGetItemCount&amp;diff=63365"/>
		<updated>2019-07-21T20:17:52Z</updated>

		<summary type="html">&lt;p&gt;MaStFa: /* Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{New feature/item|3.0157|1.5.6|14489|This function returns the number of items in a combo box.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int guiComboBoxGetItemCount ( element comboBox ) -- المقصد الحصول على عدد الاشياء الموجوده في الوحه&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''comboBox:''' The combo box to get the number of items from.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the number of items if the function is successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example creates a gui combo box, fills it with the names of the connected players and prints the number of items (players) in the chatbox.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler('onClientResourceStart',resourceRoot,function()&lt;br /&gt;
	local playersList = guiCreateComboBox(0.35,0.40,0.31,0.20,'Players',true) -- create gui combo box&lt;br /&gt;
&lt;br /&gt;
	for key,player in ipairs(getElementsByType('player')) do -- get the connected players&lt;br /&gt;
		guiComboBoxAddItem(playersList, getPlayerName(player)) -- add players name to the combo box&lt;br /&gt;
	end&lt;br /&gt;
	local playersCount = guiComboBoxGetItemCount(playersList) -- get the number of items &lt;br /&gt;
	outputChatBox('Number of connected players: '..playersCount) -- show info on chatbox&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{GUI functions}}&lt;br /&gt;
{{GUI_events}}&lt;/div&gt;</summary>
		<author><name>MaStFa</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GuiCreateComboBox&amp;diff=63364</id>
		<title>GuiCreateComboBox</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GuiCreateComboBox&amp;diff=63364"/>
		<updated>2019-07-21T20:17:35Z</updated>

		<summary type="html">&lt;p&gt;MaStFa: /* Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function creates a combobox GUI element, which you can compare to a gridlist with a dropdown feature.&lt;br /&gt;
* '''NOTE:''' The height of a combobox must be enough to fit the drop down menu, else the drop down won't appear. See [[guiComboBoxAdjustHeight]] to give your combobox the correct height.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element guiCreateComboBox ( float x, float y, float width, float height, string caption, bool relative, [ element parent = nil ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[Element/GUI/Combobox|GuiComboBox]]}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
[[Image:Gui-combobox.jpg|frame|Example GUI ComboBox.]]&lt;br /&gt;
*'''x:''' A float of the 2D x position of the GUI combobox on a player's screen.  This is affected by the ''relative'' argument.&lt;br /&gt;
*'''y:''' A float of the 2D y position of the GUI combobox on a player's screen. This is affected by the ''relative'' argument.&lt;br /&gt;
*'''width:''' A float of the width of the GUI combobox. This is affected by the ''relative'' argument.&lt;br /&gt;
*'''height:''' A float of the height of the GUI combobox. This is affected by the ''relative'' argument. Note: height must be enough to fit the drop down menu, else the drop down won't appear.&lt;br /&gt;
*'''caption:''' A string for what the title of your combobox will be. This will be shown if no item is selected.&lt;br /&gt;
*'''relative:''' This is whether sizes and positioning are relative.  If this is ''true'', then all x,y,width,height floats must be between 0 and 1, representing sizes relative to the parent.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''parent:''' This is the parent that the GUI combobox is attached to.  If the ''relative'' argument is true, sizes and positioning will be made relative to this parent. If the ''relative'' argument is false, positioning will be the number of offset pixels from the parent's origin. If no parent is passed, the parent will become the screen - causing positioning and sizing according to screen positioning.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns an element of the created combobox if it was successfully created, false otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example creates a combo box in the center of the screen with all server vehicles on it.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;addEventHandler (&amp;quot;onClientResourceStart&amp;quot;,resourceRoot,function()&lt;br /&gt;
	local screenWidth, screenHeight = guiGetScreenSize()&lt;br /&gt;
	local windowWidth, windowHeight = 200,100&lt;br /&gt;
	local left = screenWidth/2 - windowWidth/2&lt;br /&gt;
	local top = screenHeight/2 - windowHeight/2&lt;br /&gt;
	local vehiclesComboBox = guiCreateComboBox ( left, top, windowWidth,windowHeight, &amp;quot;Vehicle Names&amp;quot;, false ) -- We create a combo box.&lt;br /&gt;
	for index, vehicle in ipairs ( getElementsByType ( &amp;quot;vehicle&amp;quot; ) ) do -- We loop through all vehicles.&lt;br /&gt;
		guiComboBoxAddItem ( vehiclesComboBox, getVehicleName ( vehicle ) ) -- We add the vehicle name to our combo box.&lt;br /&gt;
	end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{GUI functions}}&lt;br /&gt;
{{GUI_events}}&lt;/div&gt;</summary>
		<author><name>MaStFa</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GuiCreateComboBox&amp;diff=63363</id>
		<title>GuiCreateComboBox</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GuiCreateComboBox&amp;diff=63363"/>
		<updated>2019-07-21T20:17:03Z</updated>

		<summary type="html">&lt;p&gt;MaStFa: /* Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function creates a combobox GUI element, which you can compare to a gridlist with a dropdown feature.&lt;br /&gt;
* '''NOTE:''' The height of a combobox must be enough to fit the drop down menu, else the drop down won't appear. See [[guiComboBoxAdjustHeight]] to give your combobox the correct height.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element guiCreateComboBox ( float x, float y, float width, float height, string caption, bool relative, [ element parent = nil ] ) -- المقصد الحصول على عدد الاشياء الموجوده في الوحه&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[Element/GUI/Combobox|GuiComboBox]]}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
[[Image:Gui-combobox.jpg|frame|Example GUI ComboBox.]]&lt;br /&gt;
*'''x:''' A float of the 2D x position of the GUI combobox on a player's screen.  This is affected by the ''relative'' argument.&lt;br /&gt;
*'''y:''' A float of the 2D y position of the GUI combobox on a player's screen. This is affected by the ''relative'' argument.&lt;br /&gt;
*'''width:''' A float of the width of the GUI combobox. This is affected by the ''relative'' argument.&lt;br /&gt;
*'''height:''' A float of the height of the GUI combobox. This is affected by the ''relative'' argument. Note: height must be enough to fit the drop down menu, else the drop down won't appear.&lt;br /&gt;
*'''caption:''' A string for what the title of your combobox will be. This will be shown if no item is selected.&lt;br /&gt;
*'''relative:''' This is whether sizes and positioning are relative.  If this is ''true'', then all x,y,width,height floats must be between 0 and 1, representing sizes relative to the parent.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''parent:''' This is the parent that the GUI combobox is attached to.  If the ''relative'' argument is true, sizes and positioning will be made relative to this parent. If the ''relative'' argument is false, positioning will be the number of offset pixels from the parent's origin. If no parent is passed, the parent will become the screen - causing positioning and sizing according to screen positioning.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns an element of the created combobox if it was successfully created, false otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example creates a combo box in the center of the screen with all server vehicles on it.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;addEventHandler (&amp;quot;onClientResourceStart&amp;quot;,resourceRoot,function()&lt;br /&gt;
	local screenWidth, screenHeight = guiGetScreenSize()&lt;br /&gt;
	local windowWidth, windowHeight = 200,100&lt;br /&gt;
	local left = screenWidth/2 - windowWidth/2&lt;br /&gt;
	local top = screenHeight/2 - windowHeight/2&lt;br /&gt;
	local vehiclesComboBox = guiCreateComboBox ( left, top, windowWidth,windowHeight, &amp;quot;Vehicle Names&amp;quot;, false ) -- We create a combo box.&lt;br /&gt;
	for index, vehicle in ipairs ( getElementsByType ( &amp;quot;vehicle&amp;quot; ) ) do -- We loop through all vehicles.&lt;br /&gt;
		guiComboBoxAddItem ( vehiclesComboBox, getVehicleName ( vehicle ) ) -- We add the vehicle name to our combo box.&lt;br /&gt;
	end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{GUI functions}}&lt;br /&gt;
{{GUI_events}}&lt;/div&gt;</summary>
		<author><name>MaStFa</name></author>
	</entry>
</feed>