<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/DgsSelectorGetSelectedItem?action=history&amp;feed=atom</id>
	<title>DgsSelectorGetSelectedItem - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/DgsSelectorGetSelectedItem?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DgsSelectorGetSelectedItem&amp;action=history"/>
	<updated>2026-05-17T16:10:35Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DgsSelectorGetSelectedItem&amp;diff=67051&amp;oldid=prev</id>
		<title>Temois: Created page with &quot;{{Client function}} __NOTOC__ This function returns the index of the selected dgs selector item.  ==Syntax==  &lt;syntaxhighlight lang=&quot;lua&quot;&gt; int dgsSelectorGetSelectedItem( elem...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DgsSelectorGetSelectedItem&amp;diff=67051&amp;oldid=prev"/>
		<updated>2020-07-13T11:05:40Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Client function}} __NOTOC__ This function returns the index of the selected dgs selector item.  ==Syntax==  &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; int dgsSelectorGetSelectedItem( elem...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function returns the index of the selected dgs selector item.&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 dgsSelectorGetSelectedItem( element selector )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''selector:''' the dgs selector you want to know the selected item index of&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the index of the selected item if the specified dgs selector is valid and has a selected item, ''-1'' if no item is selected, ''false'' or ''nil'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example outputs selected item text.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
DGS = exports.dgs &lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, resourceRoot, function()&lt;br /&gt;
    local selector = DGS:dgsCreateSelector(0, 100, 300, 100)&lt;br /&gt;
    for i = 1, 10 do&lt;br /&gt;
        DGS:dgsSelectorAddItem(selector, i )&lt;br /&gt;
    end&lt;br /&gt;
   outputChatBox(DGS:dgsSelectorGetSelectedItem(selector))&lt;br /&gt;
   DGS:dgsCenterElement(selector)&lt;br /&gt;
   showCursor(true) &lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{DGSFUNCTIONS}}&lt;/div&gt;</summary>
		<author><name>Temois</name></author>
	</entry>
</feed>