<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/ConvertGridListToText?action=history&amp;feed=atom</id>
	<title>ConvertGridListToText - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/ConvertGridListToText?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=ConvertGridListToText&amp;action=history"/>
	<updated>2026-05-14T20:37:23Z</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=ConvertGridListToText&amp;diff=77886&amp;oldid=prev</id>
		<title>IManGaaX: no element on function outputChatBox in client side</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=ConvertGridListToText&amp;diff=77886&amp;oldid=prev"/>
		<updated>2023-10-05T08:34:51Z</updated>

		<summary type="html">&lt;p&gt;no element on function outputChatBox in client side&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 08:34, 5 October 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l55&quot;&gt;Line 55:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 55:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		if report then&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		if report then&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;			setClipboard ( report )&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;			setClipboard ( report )&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;			outputChatBox ( &amp;quot;* Use CTRL+V to paste the report.&amp;quot;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;, localPlayer &lt;/del&gt;)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;			outputChatBox ( &amp;quot;* Use CTRL+V to paste the report.&amp;quot; )&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		end&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		end&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	end&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	end&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki-wiki_dev_:diff::1.12:old-59310:rev-77886 --&gt;
&lt;/table&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=ConvertGridListToText&amp;diff=59310&amp;oldid=prev</id>
		<title>3NAD: Created page with &quot;{{Useful Function}} &lt;lowercasetitle/&gt; __NOTOC__ This function converts the grid list contents to a text that can be written in a notepad ==Syntax== &lt;syntaxhighlight lang=&quot;lua&quot;...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=ConvertGridListToText&amp;diff=59310&amp;oldid=prev"/>
		<updated>2018-09-23T19:49:47Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Useful Function}} &amp;lt;lowercasetitle/&amp;gt; __NOTOC__ This function converts the grid list contents to a text that can be written in a notepad ==Syntax== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle/&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function converts the grid list contents to a text that can be written in a notepad&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;string convertGridListToText ( element gridList )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* '''gridList''': The grid list element.&lt;br /&gt;
===Return===&lt;br /&gt;
Returns a text if the arguments are right, false otherwise.&lt;br /&gt;
&lt;br /&gt;
==Code==&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 convertGridListToText ( gridlist )&lt;br /&gt;
	if not gridlist or getElementType ( gridlist ) ~= &amp;quot;gui-gridlist&amp;quot; then return false end&lt;br /&gt;
	local colCount, rowCount = guiGridListGetColumnCount ( gridlist ), guiGridListGetRowCount ( gridlist )&lt;br /&gt;
	if colCount == 0 or rowCount == 0 then return false end&lt;br /&gt;
	local storing = { row = {}, col = {} };&lt;br /&gt;
	for i=1, colCount do &lt;br /&gt;
		table.insert ( storing.col, { id = i, text = guiGridListGetColumnTitle ( gridlist, i ) } ) &lt;br /&gt;
	end&lt;br /&gt;
	for i=0, rowCount do &lt;br /&gt;
		for index, value in ipairs ( storing.col ) do&lt;br /&gt;
			local message = guiGridListGetItemText ( gridlist, i, value.id )&lt;br /&gt;
			table.insert ( storing.row, { col = value.id, rows = i, message = message } )&lt;br /&gt;
		end&lt;br /&gt;
	end	&lt;br /&gt;
	for i, v in ipairs ( storing.col ) do&lt;br /&gt;
		text = ( ( i &amp;gt; 1 and text ) or &amp;quot;&amp;quot; )..v.text..( ( i &amp;lt; #storing.col and &amp;quot;    |    &amp;quot; ) or &amp;quot;\n&amp;quot; );&lt;br /&gt;
	end&lt;br /&gt;
	text = text..(&amp;quot;-&amp;quot;):rep(colCount*13)..&amp;quot;\n&amp;quot;&lt;br /&gt;
	for i, v in ipairs ( storing.row ) do&lt;br /&gt;
		text = text..( ( v.rows &amp;gt;= rowCount and &amp;quot;&amp;quot; ) or ( v.col &amp;gt; 1 and &amp;quot;    |    &amp;quot; ) or &amp;quot;&amp;quot; )..v.message..( ( v.col &amp;gt;= #storing.col and v.rows &amp;lt; rowCount and &amp;quot;\n&amp;quot; ) or &amp;quot;&amp;quot; )&lt;br /&gt;
	end&lt;br /&gt;
	return text..&amp;quot;\nColumns: &amp;quot;..colCount..&amp;quot;\nRows: &amp;quot;..rowCount..&amp;quot;\nValues: &amp;quot;..#storing.row&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==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler ( &amp;quot;onClientResourceStart&amp;quot;, resourceRoot,&lt;br /&gt;
	function ( )&lt;br /&gt;
		local playerList = guiCreateGridList ( 0.80, 0.10, 0.15, 0.60, true ) &lt;br /&gt;
		guiGridListAddColumn( playerList, &amp;quot;id&amp;quot;, 0.2 ) &lt;br /&gt;
		guiGridListAddColumn( playerList, &amp;quot;name&amp;quot;, 0.75 ) &lt;br /&gt;
		for id, player in ipairs(getElementsByType(&amp;quot;player&amp;quot;)) do &lt;br /&gt;
			local row = guiGridListAddRow ( playerList )&lt;br /&gt;
			guiGridListSetItemText ( playerList, row, 1, id, false, false )&lt;br /&gt;
			guiGridListSetItemText ( playerList, row, 2, getPlayerName ( player ), false, false )&lt;br /&gt;
		end&lt;br /&gt;
		local report = convertGridListToText ( playerList )&lt;br /&gt;
		if report then&lt;br /&gt;
			setClipboard ( report )&lt;br /&gt;
			outputChatBox ( &amp;quot;* Use CTRL+V to paste the report.&amp;quot;, localPlayer )&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Author: 3NAD&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>3NAD</name></author>
	</entry>
</feed>