<?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=Karthik184</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=Karthik184"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Karthik184"/>
	<updated>2026-05-22T00:53:43Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=BindKey&amp;diff=34887</id>
		<title>BindKey</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=BindKey&amp;diff=34887"/>
		<updated>2013-02-15T16:01:14Z</updated>

		<summary type="html">&lt;p&gt;Karthik184: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
Binds a player's key to a handler function or command, which will be called when the key is pressed. &lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server - Syntax 1&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;bindKey ( player thePlayer, string key, string keyState, function handlerFunction,  [ var arguments, ... ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''thePlayer:''' The player you wish to bind the key of.&lt;br /&gt;
*'''key:''' The key or control you wish to bind to the command. See [[key names]] for a list of possible keys and [[control names]] for a list of possible controls.&lt;br /&gt;
*'''keyState:''' A string that has one of the following values:&lt;br /&gt;
**'''&amp;quot;up&amp;quot;:''' If the bound key should trigger the function when the key is released&lt;br /&gt;
**'''&amp;quot;down&amp;quot;:''' If the bound key should trigger the function when the key is pressed&lt;br /&gt;
**'''&amp;quot;both&amp;quot;:''' If the bound key should trigger the function when the key is pressed or released&lt;br /&gt;
*'''handlerFunction:''' The function that will be triggered when the player's key is pressed. This function should have the form:&lt;br /&gt;
:&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function functionName ( player keyPresser, string key, string keyState, [ var arguments, ... ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
:The values passed to this function are:&lt;br /&gt;
:*'''keyPresser:''' The player who pressed the key&lt;br /&gt;
:*'''key:''' The key that was pressed&lt;br /&gt;
:*'''keyState:''' The state of the key that was pressed, ''down'' if it was pressed, ''up'' if it was released.&lt;br /&gt;
:*'''arguments''' The optional arguments you specified when calling [[bindKey]] (see below).&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server - Syntax 2&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This alternative syntax allows you to bind a key with a command.  This will also allow users to customize the control in their Settings menu.  Use in conjunction with [[addCommandHandler]] to add handler functions to the keybind.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bindKey ( player thePlayer, string key, string keyState, string commandName, [ string arguments ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''thePlayer:''' The player you wish to bind the key of.&lt;br /&gt;
*'''key:''' The key or control you wish to bind to the command. See [[key names]] for a list of possible keys.&lt;br /&gt;
*'''keyState:''' A string that has one of the following values:&lt;br /&gt;
**'''&amp;quot;up&amp;quot;:''' If the bound key should trigger the function when the key is released&lt;br /&gt;
**'''&amp;quot;down&amp;quot;:''' If the bound key should trigger the function when the key is pressed&lt;br /&gt;
**'''&amp;quot;both&amp;quot;:''' If the bound key should trigger the function when the key is pressed or released&lt;br /&gt;
*'''commandName:''' The name of the command that the key should be binded to.  &lt;br /&gt;
*'''arguments''' Space delimited arguments that are entered as if one was typing the command.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client - Syntax 1&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;bindKey ( string key, string keyState, function handlerFunction,  [ var arguments, ... ] ) &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''key:''' The key or control you wish to bind to the command. See [[key names]] for a list of possible keys and [[control names]] for a list of possible controls.&lt;br /&gt;
*'''keyState:''' A string that has one of the following values:&lt;br /&gt;
**'''&amp;quot;up&amp;quot;:''' If the bound key should trigger the function when the key is released&lt;br /&gt;
**'''&amp;quot;down&amp;quot;:''' If the bound key should trigger the function when the key is pressed&lt;br /&gt;
**'''&amp;quot;both&amp;quot;:''' If the bound key should trigger the function when the key is pressed or released&lt;br /&gt;
&amp;lt;!--*'''bindName:''' The name for this key bind when it appears in the client's settings dialog.--&amp;gt;&lt;br /&gt;
*'''handlerFunction:''' The function that will be triggered when the player's key is pressed. This function should have the form:&lt;br /&gt;
:&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function functionName ( string key, string keyState, [ var arguments, ... ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
:The values passed to this function are:&lt;br /&gt;
:*'''key:''' The key that was pressed&lt;br /&gt;
:*'''keyState:''' The state of the key that was pressed, ''down'' if it was pressed, ''up'' if it was released.&lt;br /&gt;
:*'''arguments''' The optional arguments you specified when calling [[bindKey]] (see below).&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client - Syntax 2&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This alternative syntax allows you to bind a key with a command.  This will also allow users to customize the control in their Settings menu.  Use in conjunction with [[addCommandHandler]] to add handler functions to the keybind.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bindKey ( string key, string keyState, string commandName, [ string arguments ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''key:''' The key or control you wish to bind to the command. See [[key names]] for a list of possible keys.&lt;br /&gt;
*'''keyState:''' A string that has one of the following values:&lt;br /&gt;
**'''&amp;quot;up&amp;quot;:''' If the bound key should trigger the function when the key is released&lt;br /&gt;
**'''&amp;quot;down&amp;quot;:''' If the bound key should trigger the function when the key is pressed&lt;br /&gt;
**'''&amp;quot;both&amp;quot;:''' If the bound key should trigger the function when the key is pressed or released&lt;br /&gt;
*'''commandName:''' The name of the command that the key should be binded to.  &lt;br /&gt;
*'''arguments''' Space delimited arguments that are entered as if one was typing the command.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''arguments:''' Any arguments you may want to pass to the function when the key is pressed by the user. Any number of arguments of  can be specified, each being passed to the designated function. You may not pass functions.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
Example 1&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 will bind a player's 'F1' key and 'fire' control to 1 input function.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function funcInput ( player, key, keyState )&lt;br /&gt;
  local state = &amp;quot;let go of&amp;quot;&lt;br /&gt;
  if ( keyState == &amp;quot;down&amp;quot; ) then&lt;br /&gt;
    state = &amp;quot;pressed&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
  outputChatBox ( getPlayerName ( player) .. &amp;quot; &amp;quot; .. state .. &amp;quot; the &amp;quot; .. key .. &amp;quot; key!&amp;quot; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function bindTheKeys ( player, commandName )&lt;br /&gt;
  bindKey ( player, &amp;quot;F1&amp;quot;, &amp;quot;down&amp;quot;, funcInput )   -- bind the player's F1 down key&lt;br /&gt;
  bindKey ( player, &amp;quot;F1&amp;quot;, &amp;quot;up&amp;quot;, funcInput )     -- bind the player's F1 up key&lt;br /&gt;
  bindKey ( player, &amp;quot;fire&amp;quot;, &amp;quot;both&amp;quot;, funcInput ) -- bind the player's fire down and up control&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;bindme&amp;quot;, bindTheKeys )&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;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example will bind a player's 'F1' key and 'fire' control to 1 input function, clientside.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function funcInput ( key, keyState )&lt;br /&gt;
  local state = &amp;quot;let go of&amp;quot;&lt;br /&gt;
  if ( keyState == &amp;quot;down&amp;quot; ) then&lt;br /&gt;
    state = &amp;quot;pressed&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
  outputChatBox ( &amp;quot;You &amp;quot; .. state .. &amp;quot; the &amp;quot; .. key .. &amp;quot; key!&amp;quot; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function bindTheKeys ()&lt;br /&gt;
  bindKey ( &amp;quot;F1&amp;quot;, &amp;quot;down&amp;quot;, funcInput )   -- bind the player's F1 down key&lt;br /&gt;
  bindKey ( &amp;quot;F1&amp;quot;, &amp;quot;up&amp;quot;, funcInput )     -- bind the player's F1 up key&lt;br /&gt;
  bindKey ( &amp;quot;fire&amp;quot;, &amp;quot;both&amp;quot;, funcInput ) -- bind the player's fire down and up control&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;bindme&amp;quot;, bindTheKeys )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;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;
This example says how cool &amp;lt;s&amp;gt;Robpol86&amp;lt;/s&amp;gt; Ransom is if players wants to move.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function fanFunction()&lt;br /&gt;
  bindKey (source,&amp;quot;forwards&amp;quot;,&amp;quot;down&amp;quot;,&lt;br /&gt;
    function(player,key,state)&lt;br /&gt;
      outputChatBox (getPlayerName (player) .. &amp;quot;#FFFF00 thinks Ransom is cool.&amp;quot;,getRootElement(),255,255,0,true)&lt;br /&gt;
    end&lt;br /&gt;
  )&lt;br /&gt;
end&lt;br /&gt;
addEventHandler (&amp;quot;onPlayerLogin&amp;quot;,getRootElement(),fanFunction)&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;
{{Input functions}}&lt;/div&gt;</summary>
		<author><name>Karthik184</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetPlayerVoiceBroadcastTo&amp;diff=33220</id>
		<title>SetPlayerVoiceBroadcastTo</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetPlayerVoiceBroadcastTo&amp;diff=33220"/>
		<updated>2012-09-09T06:32:52Z</updated>

		<summary type="html">&lt;p&gt;Karthik184: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server function}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px dotted blue; background: #00CC66;padding:4px;margin-bottom:2px;&amp;quot;&amp;gt;'''Note''':  This function should only be used as a low-level function for advanced users.  For typical Voice scripting, please see the [[Resource:Voice|Voice Resource]]&amp;lt;/div&amp;gt;&lt;br /&gt;
This function allows you to change who can hear the voice of a player.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setPlayerVoiceBroadcastTo ( element thePlayer, mixed broadcastTo )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePlayer:''' The [[player]] you wish to change&lt;br /&gt;
*'''broadcastTo :''' Element or table of elements who should hear the voice from this player&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the value was set successfully, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function getPlayerFromName(...)&lt;br /&gt;
	if( ... ) then&lt;br /&gt;
		local foundList = {}&lt;br /&gt;
		for i,v in ipairs( ... ) do&lt;br /&gt;
			for i,p in ipairs( getElementsByType 'player' ) do&lt;br /&gt;
				if( string.find( getPlayerName(p):lower(), tostring(v):lower(), 1, true ) then&lt;br /&gt;
					table.insert( foundList, p )&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		return unpack( foundList )&lt;br /&gt;
	end&lt;br /&gt;
	return false&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function setBroadcastTo( p, cmd, p1, p2 )&lt;br /&gt;
	if( p1 and p2 ) then&lt;br /&gt;
		p1, p2 = getPlayerFromName( p1, p2 )&lt;br /&gt;
		if( p1 and p2 ) then&lt;br /&gt;
			setPlayerVoiceBroadcastTo( p1, p2 )&lt;br /&gt;
		else&lt;br /&gt;
			outputChatBox( p1 == false and 'Player to change broadcast could not be found!' or p2 == false and 'Players to hear player 1 could not be found!', p, 255, 0, 0, false )&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler( 'bt', setBroadcastTo )&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;/div&gt;</summary>
		<author><name>Karthik184</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GuiGridListSetScrollBars&amp;diff=31596</id>
		<title>GuiGridListSetScrollBars</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GuiGridListSetScrollBars&amp;diff=31596"/>
		<updated>2012-06-24T06:32:30Z</updated>

		<summary type="html">&lt;p&gt;Karthik184: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function allows a gridlist's scrollbar to be forced '''on''', or returned to default.&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 guiGridListSetScrollBars ( element guiGridlist, bool horizontalBar, bool verticalBar )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''guiGridlist:''' The GUI gridlist you wish to change the state of scrollbars&lt;br /&gt;
*'''horizontalBar:''' A bool where ''true'' forces the horizontal scrollbar on, and ''false'' returns them to default.&lt;br /&gt;
*'''verticalBar:''' A bool where ''true'' forces the verical scrollbar on, and ''false'' returns them to default.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the scrollbars were successfully set, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example creates a gridlist and checks if it's created then sets the scroll bars. (TESTED!) &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;gridlist = guiCreateGridList(332,195,286,249,false)&lt;br /&gt;
&lt;br /&gt;
if(gridlist)then&lt;br /&gt;
	guiGridListSetScrollBars(gridlist,true,true)&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;/div&gt;</summary>
		<author><name>Karthik184</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:Karthik184&amp;diff=31575</id>
		<title>User:Karthik184</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:Karthik184&amp;diff=31575"/>
		<updated>2012-06-23T09:32:05Z</updated>

		<summary type="html">&lt;p&gt;Karthik184: Created page with &amp;quot;Hi&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hi&lt;/div&gt;</summary>
		<author><name>Karthik184</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GuiGridListSetItemData&amp;diff=29913</id>
		<title>GuiGridListSetItemData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GuiGridListSetItemData&amp;diff=29913"/>
		<updated>2012-04-07T06:41:07Z</updated>

		<summary type="html">&lt;p&gt;Karthik184: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function sets a Item Data associated to a grid list item.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Note:''' This function will only work '''after''' you set the item's text using [[guiGridListSetItemText]]!&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 guiGridListSetItemData ( element gridList, int rowIndex, int columnIndex, string data )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''gridList:''' A gridlist element of the data you wish to set to&lt;br /&gt;
*'''rowIndex:''' The row of the item you wish to set to&lt;br /&gt;
*'''columnIndex:''' The column of the item you wish to set to&lt;br /&gt;
*'''data:''' The data you wish to set to the item.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the data was set successfully, false otherwise&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
In this example, the gridlist shows the list of players without their color codes and outputs their names with color-codes at the chatbox when player is selected.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function showPlayers()&lt;br /&gt;
    local window = guiCreateWindow(0,0,500,400,&amp;quot;Window example - Title&amp;quot;,false) -- Create the window&lt;br /&gt;
    grid = guiCreateGridList(0,0,100,300,false,window) -- Create the gridlist&lt;br /&gt;
    local column = guiGridListAddColumn(grid, &amp;quot;Players online&amp;quot;, 0.9) -- Create a column&lt;br /&gt;
    showCursor(true)--show cursor&lt;br /&gt;
    for index,player in ipairs(getElementsByType(&amp;quot;player&amp;quot;)) do -- Loop through all players&lt;br /&gt;
        local row = guiGridListAddRow(grid) -- Add a row&lt;br /&gt;
        guiGridListSetItemText ( grid, row, column, (string.gsub ( getPlayerName(player), '#%x%x%x%x%x%x', '' ) or getPlayerName(player)), false, false) -- Set it's text to the player's name excluding colorcodes&lt;br /&gt;
        guiGridListSetItemData ( grid, row, column, getPlayerName(player)) -- Set it's data to the player's name with colorcodes&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
function outputPlayerName()&lt;br /&gt;
    if source == grid then -- If the player clicked something in the grid&lt;br /&gt;
        local selectedRow, selectedColumn = guiGridListGetSelectedItem(grid) -- See which player he selected&lt;br /&gt;
        local playerName = guiGridListGetItemData(grid, selectedRow, selectedColumn) -- Get the selected player's name with color codes   local playerNameWithoutColorCodes = guiGridListGetItemText(grid, selectedRow, selectedColumn) -- Get the selected player's name without color codes&lt;br /&gt;
        local playerNameWithoutColorCodes = guiGridListGetItemText(grid, selectedRow, selectedColumn) -- Get the selected player's name without color codes&lt;br /&gt;
        if playerName and playerNameWithoutColorCodes then -- If he really selected something&lt;br /&gt;
            outputChatBox(&amp;quot;The selected player's name without color codes : &amp;quot;..playerNameWithoutColorCodes, 255,255,255,false) -- output without color codes&lt;br /&gt;
            outputChatBox(&amp;quot;The selected player's name with color codes : &amp;quot;..playerName, 255,255,255,false) -- output with color codes&lt;br /&gt;
            outputChatBox(&amp;quot;The selected player's name with colors : &amp;quot;..playerName, 255,255,255,true) -- output with colors&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
addEventHandler(&amp;quot;onClientGUIClick&amp;quot;, getRootElement(), outputPlayerName)&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement(getThisResource()), showPlayers)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{GUI functions}}&lt;br /&gt;
[[Category:Needs Example]]&lt;/div&gt;</summary>
		<author><name>Karthik184</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GuiGridListSetItemData&amp;diff=29912</id>
		<title>GuiGridListSetItemData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GuiGridListSetItemData&amp;diff=29912"/>
		<updated>2012-04-07T06:32:18Z</updated>

		<summary type="html">&lt;p&gt;Karthik184: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function sets a Item Data associated to a grid list item.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Note:''' This function will only work '''after''' you set the item's text using [[guiGridListSetItemText]]!&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 guiGridListSetItemData ( element gridList, int rowIndex, int columnIndex, string data )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''gridList:''' A gridlist element of the data you wish to set to&lt;br /&gt;
*'''rowIndex:''' The row of the item you wish to set to&lt;br /&gt;
*'''columnIndex:''' The column of the item you wish to set to&lt;br /&gt;
*'''data:''' The data you wish to set to the item.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the data was set successfully, false otherwise&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
In this example, the gridlist shows the list of players without their color codes and outputs their names with color-codes at the chatbox when player is selected.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function showPlayers()&lt;br /&gt;
    local window = guiCreateWindow(0,0,500,400,&amp;quot;Window example - Title&amp;quot;,false) -- Create the window&lt;br /&gt;
    grid = guiCreateGridList(0,0,100,300,false,window) -- Create the gridlist&lt;br /&gt;
    local column = guiGridListAddColumn(grid, &amp;quot;Players online&amp;quot;, 0.9) -- Create a column&lt;br /&gt;
	showCursor(true)--show cursor&lt;br /&gt;
    for index,player in ipairs(getElementsByType(&amp;quot;player&amp;quot;)) do -- Loop through all players&lt;br /&gt;
        local row = guiGridListAddRow(grid) -- Add a row&lt;br /&gt;
        guiGridListSetItemText ( grid, row, column, (string.gsub ( getPlayerName(player), '#%x%x%x%x%x%x', '' ) or getPlayerName(player)), false, false) -- Set it's text to the player's name excluding colorcodes&lt;br /&gt;
        guiGridListSetItemData ( grid, row, column, getPlayerName(player)) -- Set it's data to the player's name with colorcodes&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
function outputPlayerName()&lt;br /&gt;
    if source == grid then -- If the player clicked something in the grid&lt;br /&gt;
        local selectedRow, selectedColumn = guiGridListGetSelectedItem(grid) -- See which player he selected&lt;br /&gt;
        local playerName = guiGridListGetItemData(grid, selectedRow, selectedColumn) -- Get the selected player's name with color codes&lt;br /&gt;
        local playerNameWithoutColorCodes = guiGridListGetItemText(grid, selectedRow, selectedColumn) -- Get the selected player's name without color codes&lt;br /&gt;
        outputChatBox(&amp;quot;The selected player's name without color codes : &amp;quot;..playerNameWithoutColorCodes, 255,255,255,false) -- output without color codes&lt;br /&gt;
        outputChatBox(&amp;quot;The selected player's name with color codes : &amp;quot;..playerName, 255,255,255,false) -- output with color codes&lt;br /&gt;
        outputChatBox(&amp;quot;The selected player's name with colors : &amp;quot;..playerName, 255,255,255,true) -- output with colors&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
addEventHandler(&amp;quot;onClientGUIClick&amp;quot;, getRootElement(), outputPlayerName)&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement(getThisResource()), showPlayers)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{GUI functions}}&lt;br /&gt;
[[Category:Needs Example]]&lt;/div&gt;</summary>
		<author><name>Karthik184</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GuiGridListSetItemData&amp;diff=29911</id>
		<title>GuiGridListSetItemData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GuiGridListSetItemData&amp;diff=29911"/>
		<updated>2012-04-07T06:25:47Z</updated>

		<summary type="html">&lt;p&gt;Karthik184: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function sets a Item Data associated to a grid list item.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Note:''' This function will only work '''after''' you set the item's text using [[guiGridListSetItemText]]!&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 guiGridListSetItemData ( element gridList, int rowIndex, int columnIndex, string data )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''gridList:''' A gridlist element of the data you wish to set to&lt;br /&gt;
*'''rowIndex:''' The row of the item you wish to set to&lt;br /&gt;
*'''columnIndex:''' The column of the item you wish to set to&lt;br /&gt;
*'''data:''' The data you wish to set to the item.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the data was set successfully, false otherwise&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
In this example, the gridlist shows the list of players without their color codes and outputs their names with color-codes at the chatbox when player is selected.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function showPlayers()&lt;br /&gt;
    local window = guiCreateWindow(0,0,500,400,&amp;quot;Window example - Title&amp;quot;,false) -- Create the window&lt;br /&gt;
    local grid = guiCreateGridList(0,0,100,300,false,window) -- Create the gridlist&lt;br /&gt;
    local column = guiGridListAddColumn(grid, &amp;quot;Players online&amp;quot;, 0.9) -- Create a column&lt;br /&gt;
    for index,player in ipairs(getElementsByType(&amp;quot;player&amp;quot;)) do -- Loop through all players&lt;br /&gt;
        local row = guiGridListAddRow(grid) -- Add a row&lt;br /&gt;
        guiGridListSetItemText ( grid, row, column, (string.gsub ( getPlayerName(player), '#%x%x%x%x%x%x', '' ) or getPlayerName(player)), false, false) -- Set it's text to the player's name excluding colorcodes&lt;br /&gt;
        guiGridListSetItemData ( grid, row, column, getPlayerName(player)) -- Set it's data to the player's name with colorcodes&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function outputPlayerName()&lt;br /&gt;
    if source == grid then -- If the player clicked something in the grid&lt;br /&gt;
        local selectedRow, selectedColumn = guiGridListGetSelectedItem(grid) -- See which player he selected&lt;br /&gt;
        local playerName = guiGridListGetItemData(grid, selectedRow, selectedColumn) -- Get the selected player's name with color codes&lt;br /&gt;
        local playerNameWithoutColorCodes = guiGridListGetItemText(grid, selectedRow, selectedColumn) -- Get the selected player's name without color codes&lt;br /&gt;
        outputChatBox(&amp;quot;The selected player's name without color codes : &amp;quot;..playerNameWithoutColorCodes, 255,255,255,false) -- output without color codes&lt;br /&gt;
        outputChatBox(&amp;quot;The selected player's name with color codes : &amp;quot;..playerName, 255,255,255,false) -- output with color codes&lt;br /&gt;
        outputChatBox(&amp;quot;The selected player's name with colors : &amp;quot;..playerName, 255,255,255,true) -- output with colors&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientGUIClick&amp;quot;, getRootElement(), outputPlayerName)&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement(getThisResource()), showPlayers)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{GUI functions}}&lt;br /&gt;
[[Category:Needs Example]]&lt;/div&gt;</summary>
		<author><name>Karthik184</name></author>
	</entry>
</feed>