<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.gtaconnected.com/wiki/index.php?action=history&amp;feed=atom&amp;title=ScriptingExamples%2FGameCommandTargetPlayer</id>
	<title>ScriptingExamples/GameCommandTargetPlayer - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.gtaconnected.com/wiki/index.php?action=history&amp;feed=atom&amp;title=ScriptingExamples%2FGameCommandTargetPlayer"/>
	<link rel="alternate" type="text/html" href="https://wiki.gtaconnected.com/wiki/index.php?title=ScriptingExamples/GameCommandTargetPlayer&amp;action=history"/>
	<updated>2026-04-28T21:06:29Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.15</generator>
	<entry>
		<id>https://wiki.gtaconnected.com/wiki/index.php?title=ScriptingExamples/GameCommandTargetPlayer&amp;diff=9941&amp;oldid=prev</id>
		<title>Lyuu: remove gta ug refs</title>
		<link rel="alternate" type="text/html" href="https://wiki.gtaconnected.com/wiki/index.php?title=ScriptingExamples/GameCommandTargetPlayer&amp;diff=9941&amp;oldid=prev"/>
		<updated>2021-10-03T10:46:52Z</updated>

		<summary type="html">&lt;p&gt;remove gta ug refs&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 10:46, 3 October 2021&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-l22&quot;&gt;Line 22:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 22:&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;	elseif gameId == GAME_GTA_VC then return &amp;#039;GTA VC&amp;#039;&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;	elseif gameId == GAME_GTA_VC then return &amp;#039;GTA VC&amp;#039;&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;	elseif gameId == GAME_GTA_SA then return &amp;#039;GTA SA&amp;#039;&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;	elseif gameId == GAME_GTA_SA then return &amp;#039;GTA SA&amp;#039;&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;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	elseif gameId == GAME_GTA_UG then return &#039;GTA Underground&#039;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&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;	elseif gameId == GAME_GTA_IV then return &amp;#039;GTA IV&amp;#039;&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;	elseif gameId == GAME_GTA_IV then return &amp;#039;GTA IV&amp;#039;&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;/table&gt;</summary>
		<author><name>Lyuu</name></author>
	</entry>
	<entry>
		<id>https://wiki.gtaconnected.com/wiki/index.php?title=ScriptingExamples/GameCommandTargetPlayer&amp;diff=4659&amp;oldid=prev</id>
		<title>Mex at 16:56, 3 February 2019</title>
		<link rel="alternate" type="text/html" href="https://wiki.gtaconnected.com/wiki/index.php?title=ScriptingExamples/GameCommandTargetPlayer&amp;diff=4659&amp;oldid=prev"/>
		<updated>2019-02-03T16:56:19Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{DISPLAYTITLE:Game Command for target player}}&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
This code adds a green chat message to the chat box for all players, showing the name of the game that a specified player is playing, when typing /game player.&amp;lt;br&amp;gt;&lt;br /&gt;
If the specified player is not found, an orange chat message is shown to only the player that typed the command.&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Lua, Server-Side:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
{{LuaCode|1=addCommandHandler(&amp;#039;game&amp;#039;, function(cmd, args, client)&lt;br /&gt;
	local client2 = getClientFromText(args)&lt;br /&gt;
	if not client2 then&lt;br /&gt;
		messageClient(&amp;#039;Player not found&amp;#039;, client, COLOUR_ORANGE)&lt;br /&gt;
	else&lt;br /&gt;
		message(client2.player.name .. &amp;#039; is playing &amp;#039; .. getGameNameFromGameId(client2.game), COLOUR_GREEN)&lt;br /&gt;
	end&lt;br /&gt;
end)&lt;br /&gt;
&lt;br /&gt;
function getGameNameFromGameId(gameId)&lt;br /&gt;
	if gameId == GAME_GTA_III then return &amp;#039;GTA III&amp;#039;&lt;br /&gt;
	elseif gameId == GAME_GTA_VC then return &amp;#039;GTA VC&amp;#039;&lt;br /&gt;
	elseif gameId == GAME_GTA_SA then return &amp;#039;GTA SA&amp;#039;&lt;br /&gt;
	elseif gameId == GAME_GTA_UG then return &amp;#039;GTA Underground&amp;#039;&lt;br /&gt;
	elseif gameId == GAME_GTA_IV then return &amp;#039;GTA IV&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	return &amp;#039;Unknown Game&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
{{ScriptingExamples/UtilityCode/Lua/getClientFromText}}}}&lt;/div&gt;</summary>
		<author><name>Mex</name></author>
	</entry>
</feed>