<?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=Sintax</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=Sintax"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Sintax"/>
	<updated>2026-04-24T20:29:50Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetServerName&amp;diff=9739</id>
		<title>GetServerName</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetServerName&amp;diff=9739"/>
		<updated>2007-08-04T07:00:43Z</updated>

		<summary type="html">&lt;p&gt;Sintax: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function returns a string containing the server's name.&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;
string getServerName ( )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''None'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
A string containing the server's name.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example creates a console command that outputs the server's name the the chatbox.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function outputServerName ( )&lt;br /&gt;
	outputChatBox ( getServerName( ) )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Add console command 'getServerName'&lt;br /&gt;
addCommandHandler ( &amp;quot;getServerName&amp;quot;, outputServerName )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Server functions}}&lt;/div&gt;</summary>
		<author><name>Sintax</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetServerName&amp;diff=9738</id>
		<title>GetServerName</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetServerName&amp;diff=9738"/>
		<updated>2007-08-04T06:59:44Z</updated>

		<summary type="html">&lt;p&gt;Sintax: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function returns a string containing the server's name.&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;
returnType getServerName ( )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''None'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
A string containing the server's name.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example creates a console command that outputs the server's name the the chatbox.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function outputServerName ( )&lt;br /&gt;
	outputChatBox ( getServerName() )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Add console command 'getServerName'&lt;br /&gt;
addCommandHandler ( &amp;quot;getServerName&amp;quot;, outputServerName )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Server functions}}&lt;/div&gt;</summary>
		<author><name>Sintax</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetSlotFromWeapon&amp;diff=9736</id>
		<title>GetSlotFromWeapon</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetSlotFromWeapon&amp;diff=9736"/>
		<updated>2007-08-04T06:41:05Z</updated>

		<summary type="html">&lt;p&gt;Sintax: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This allows you to identify the weapon slot that a weapon belongs to.&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 getSlotFromWeapon ( int weaponid )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''weaponid:''' The weapon ID to find the weapon slot of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
*Returns an integer representing the given weapon ID's associated weapon slot, false if invalid.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This will output to the chatbox what weapon slot a given weapon number belongs to when entered into the console (ie. 'getWeaponSlot 10').&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function outputWeaponSlot ( source, commandName, weaponID )&lt;br /&gt;
	local weaponSlot = getSlotFromWeapon ( weaponID )&lt;br /&gt;
	&lt;br /&gt;
	if (weaponSlot) then&lt;br /&gt;
	    outputChatBox ( &amp;quot;Weapon ID &amp;quot; .. weaponID ..  &amp;quot; is in weapon slot &amp;quot; .. weaponSlot)&lt;br /&gt;
	else&lt;br /&gt;
	    outputChatBox ( &amp;quot;Invalid weapon ID&amp;quot; )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;getWeaponSlot&amp;quot;, outputWeaponSlot )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc --&amp;gt;&lt;br /&gt;
[[Weapons|Weapon IDs]]&lt;br /&gt;
{{Weapon_functions}}&lt;/div&gt;</summary>
		<author><name>Sintax</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetTeamFriendlyFire&amp;diff=9735</id>
		<title>GetTeamFriendlyFire</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetTeamFriendlyFire&amp;diff=9735"/>
		<updated>2007-08-04T06:39:33Z</updated>

		<summary type="html">&lt;p&gt;Sintax: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function returns the friendly fire value for the specified team.&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 getTeamFriendlyFire ( team theTeam )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theTeam:''' The team object that will be checked&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if friendly fire is on for the specified team, ''false'' if friendly fire is turned off for the specified team or if invalid arguments are specified.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example makes a command that checks if friendly fire is on for each team, and toggles it on if it isn't.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function setFriendlyFireOn ( )&lt;br /&gt;
	-- For each team,	&lt;br /&gt;
	for index, theTeam in ipairs(getElementsByType ( &amp;quot;team&amp;quot; )) do&lt;br /&gt;
	        -- if friendly fire is off,&lt;br /&gt;
	        if ( getTeamFriendlyFire ( theTeam ) == false ) then&lt;br /&gt;
	                -- switch it on.&lt;br /&gt;
	                setTeamFriendlyFire ( theTeam, true )&lt;br /&gt;
	        end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
-- Add console command 'setFF'&lt;br /&gt;
addCommandHandler ( &amp;quot;setFF&amp;quot;, setFriendlyFireOn )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Team functions}}&lt;/div&gt;</summary>
		<author><name>Sintax</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetSlotFromWeapon&amp;diff=9732</id>
		<title>GetSlotFromWeapon</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetSlotFromWeapon&amp;diff=9732"/>
		<updated>2007-08-04T06:31:49Z</updated>

		<summary type="html">&lt;p&gt;Sintax: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This allows you to identify the weapon slot that a weapon belongs to.&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 getSlotFromWeapon ( int weaponid )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''weaponid:''' The weapon ID to find the weapon slot of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
*Returns an integer representing the given weapon ID's associated weapon slot, false if invalid.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This will output to the chatbox what weapon slot a given weapon number belongs to when entered into the console (ie. 'getWeaponSlot 10').&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function outputWeaponSlot ( source, commandName, weaponID )&lt;br /&gt;
	local weaponSlot = getSlotFromWeapon ( weaponID )&lt;br /&gt;
	&lt;br /&gt;
	if (weaponSlot) then&lt;br /&gt;
		outputChatBox ( &amp;quot;Weapon ID &amp;quot; .. weaponID ..  &amp;quot; is in weapon slot &amp;quot; .. weaponSlot)&lt;br /&gt;
	else&lt;br /&gt;
	    outputChatBox ( &amp;quot;Invalid weapon ID&amp;quot; )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;getWeaponSlot&amp;quot;, outputWeaponSlot )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc --&amp;gt;&lt;br /&gt;
[[Weapons|Weapon IDs]]&lt;br /&gt;
{{Weapon_functions}}&lt;/div&gt;</summary>
		<author><name>Sintax</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetSlotFromWeapon&amp;diff=9730</id>
		<title>GetSlotFromWeapon</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetSlotFromWeapon&amp;diff=9730"/>
		<updated>2007-08-04T06:29:42Z</updated>

		<summary type="html">&lt;p&gt;Sintax: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This allows you to identify the weapon slot that a weapon belongs to.&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 getSlotFromWeapon ( int weaponid )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''weaponid:''' Specify the weapon of which weapon slot you want to know.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
*Returns an integer representing the given weapon ID's associated weapon slot, false if invalid.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This will output to the chatbox what weapon slot a given weapon number belongs to when entered into the console (ie. 'getWeaponSlot 10').&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function outputWeaponSlot ( source, commandName, weaponID )&lt;br /&gt;
	local weaponSlot = getSlotFromWeapon ( weaponID )&lt;br /&gt;
	&lt;br /&gt;
	if (weaponSlot) then&lt;br /&gt;
		outputChatBox ( &amp;quot;Weapon ID &amp;quot; .. weaponID ..  &amp;quot; is in weapon slot &amp;quot; .. weaponSlot)&lt;br /&gt;
	else&lt;br /&gt;
	    outputChatBox ( &amp;quot;Invalid weapon ID&amp;quot; )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;getWeaponSlot&amp;quot;, outputWeaponSlot )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc --&amp;gt;&lt;br /&gt;
[[Weapons|Weapon IDs]]&lt;br /&gt;
{{Weapon_functions}}&lt;/div&gt;</summary>
		<author><name>Sintax</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetSlotFromWeapon&amp;diff=9729</id>
		<title>GetSlotFromWeapon</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetSlotFromWeapon&amp;diff=9729"/>
		<updated>2007-08-04T06:28:02Z</updated>

		<summary type="html">&lt;p&gt;Sintax: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This allows you to identify the weapon slot that a weapon belongs to.&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 getSlotFromWeapon ( int weaponid )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''weaponid:''' Specify the weapon of which weapon slot you want to know.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
*Returns the player's current weapon slot ID.&lt;br /&gt;
*Returns false if it fails to retrieve current weapon slot or if the weaponid is invalid.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This will output to the chatbox what weapon slot a given weapon number belongs to when entered into the console (ie. 'getWeaponSlot 10').&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function outputWeaponSlot ( source, commandName, weaponID )&lt;br /&gt;
	local weaponSlot = getSlotFromWeapon ( weaponID )&lt;br /&gt;
	&lt;br /&gt;
	if (weaponSlot) then&lt;br /&gt;
		outputChatBox ( &amp;quot;Weapon ID &amp;quot; .. weaponID ..  &amp;quot; is in weapon slot &amp;quot; .. weaponSlot)&lt;br /&gt;
	else&lt;br /&gt;
	    outputChatBox ( &amp;quot;Invalid weapon ID&amp;quot; )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;getWeaponSlot&amp;quot;, outputWeaponSlot )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc --&amp;gt;&lt;br /&gt;
[[Weapons|Weapon IDs]]&lt;br /&gt;
{{Weapon_functions}}&lt;/div&gt;</summary>
		<author><name>Sintax</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetTeamFromName&amp;diff=9610</id>
		<title>GetTeamFromName</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetTeamFromName&amp;diff=9610"/>
		<updated>2007-08-02T03:45:33Z</updated>

		<summary type="html">&lt;p&gt;Sintax: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
This function is for finding a team object from its name.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
team getTeamFromName ( string teamName )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''teamName:''' A string determining the name of the team you wish to find.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the team object if it was found, 'false' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example joins a team named &amp;quot;Red&amp;quot;, if it is found.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function joinRedTeam ( source )&lt;br /&gt;
 	-- Try to find the team named 'Red'&lt;br /&gt;
	team = getTeamFromName ( &amp;quot;Red&amp;quot; )&lt;br /&gt;
	&lt;br /&gt;
	if ( team ) then -- If it was found (not false)&lt;br /&gt;
		addPlayerToTeam ( source, team )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--Add console command to join the team when 'joinTeam' is typed.&lt;br /&gt;
addCommandHandler ( &amp;quot;joinTeam&amp;quot;, joinRedTeam )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Team_functions}}&lt;/div&gt;</summary>
		<author><name>Sintax</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetTeamColor&amp;diff=9608</id>
		<title>GetTeamColor</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetTeamColor&amp;diff=9608"/>
		<updated>2007-08-02T03:40:52Z</updated>

		<summary type="html">&lt;p&gt;Sintax: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
This function is for retrieving the color of a team.&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, int, int getTeamColor ( team theTeam )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theTeam:''' The team you want to get the color of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns 3 integers representing the red, green, and blue color values of the team if valid, otherwise 'false'.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example outputs the player's team name and colors if he is on a team.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function teamInfo ( source )&lt;br /&gt;
  local r, g, b = 255, 255, 255&lt;br /&gt;
  local team = getPlayerTeam( source )&lt;br /&gt;
  &lt;br /&gt;
  -- Make a string to print out the player's team information&lt;br /&gt;
  local string = getClientName ( source ) .. &amp;quot; spawned&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  if ( team ) then -- If the player is on a team (team is not false)&lt;br /&gt;
    -- Add the team name to the string&lt;br /&gt;
    string = string..&amp;quot; as &amp;quot;.. getTeamName ( team )&lt;br /&gt;
    &lt;br /&gt;
    -- Get the red, green, and blue values of the team's color&lt;br /&gt;
    r, g, b = getTeamColor ( team )&lt;br /&gt;
    &lt;br /&gt;
    -- Convert the colors to strings and add them to the string&lt;br /&gt;
    string = string .. &amp;quot; with team colors: &amp;quot; .. tostring(r) .. &amp;quot;, &amp;quot; .. tostring(g) .. &amp;quot;, &amp;quot; .. tostring(b)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  -- Print the string with the player's team information&lt;br /&gt;
  outputChatBox ( string )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Add console command to print out your team information&lt;br /&gt;
addCommandHandler ( &amp;quot;teamInfo&amp;quot;, teamInfo )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Team_functions}}&lt;/div&gt;</summary>
		<author><name>Sintax</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetTeamColor&amp;diff=9607</id>
		<title>GetTeamColor</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetTeamColor&amp;diff=9607"/>
		<updated>2007-08-02T03:37:09Z</updated>

		<summary type="html">&lt;p&gt;Sintax: /* Returns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
This function is for retrieving the color of a team.&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, int, int getTeamColor ( team theTeam )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theTeam:''' The team you want to get the color of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns 3 integers representing the red, green, and blue color values of the team if valid, otherwise 'false'.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example outputs the name of a players team when they spawn, in that team's color.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerSpawn&amp;quot;, root, &amp;quot;onPlayerSpawn&amp;quot; )&lt;br /&gt;
function onPlayerSpawn ( spawnpoint, team )&lt;br /&gt;
  r, g, b = 255, 255, 255&lt;br /&gt;
  string = getClientName ( source ) .. &amp;quot; spawned&amp;quot;&lt;br /&gt;
  if ( team ) then&lt;br /&gt;
    teamName = getTeamName ( team )&lt;br /&gt;
    string = string..&amp;quot; as a &amp;quot;..teamName&lt;br /&gt;
    r, g, b = getTeamColor ( team )&lt;br /&gt;
  end&lt;br /&gt;
  outputChatBox ( string, r, g, b )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Team_functions}}&lt;/div&gt;</summary>
		<author><name>Sintax</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetTeamColor&amp;diff=9606</id>
		<title>GetTeamColor</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetTeamColor&amp;diff=9606"/>
		<updated>2007-08-02T03:36:39Z</updated>

		<summary type="html">&lt;p&gt;Sintax: /* Returns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
This function is for retrieving the color of a team.&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, int, int getTeamColor ( team theTeam )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theTeam:''' The team you want to get the color of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns 3 integers representing the red, green, and blue color value of the team if valid, otherwise 'false'.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example outputs the name of a players team when they spawn, in that team's color.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerSpawn&amp;quot;, root, &amp;quot;onPlayerSpawn&amp;quot; )&lt;br /&gt;
function onPlayerSpawn ( spawnpoint, team )&lt;br /&gt;
  r, g, b = 255, 255, 255&lt;br /&gt;
  string = getClientName ( source ) .. &amp;quot; spawned&amp;quot;&lt;br /&gt;
  if ( team ) then&lt;br /&gt;
    teamName = getTeamName ( team )&lt;br /&gt;
    string = string..&amp;quot; as a &amp;quot;..teamName&lt;br /&gt;
    r, g, b = getTeamColor ( team )&lt;br /&gt;
  end&lt;br /&gt;
  outputChatBox ( string, r, g, b )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Team_functions}}&lt;/div&gt;</summary>
		<author><name>Sintax</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetTeamFromName&amp;diff=9601</id>
		<title>GetTeamFromName</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetTeamFromName&amp;diff=9601"/>
		<updated>2007-08-01T22:01:34Z</updated>

		<summary type="html">&lt;p&gt;Sintax: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
This function is for finding a team object from its name.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
team getTeamFromName ( string teamName )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''teamName:''' A string determining the name of the team you wish to find.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the team object if it was found, 'false' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example destroys a team named &amp;quot;Red&amp;quot;, if it is found.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function joinRedTeam ( source )&lt;br /&gt;
 	-- Try to find the team named 'Red'&lt;br /&gt;
	team = getTeamFromName ( &amp;quot;Red&amp;quot; )&lt;br /&gt;
	&lt;br /&gt;
	if ( team ) then -- If it was found (not false)&lt;br /&gt;
		addPlayerToTeam ( source, team )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--Add console command to join the team when 'joinTeam' is typed.&lt;br /&gt;
addCommandHandler ( &amp;quot;joinTeam&amp;quot;, joinRedTeam )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Team_functions}}&lt;/div&gt;</summary>
		<author><name>Sintax</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetTeamName&amp;diff=9599</id>
		<title>GetTeamName</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetTeamName&amp;diff=9599"/>
		<updated>2007-08-01T21:48:03Z</updated>

		<summary type="html">&lt;p&gt;Sintax: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
This function is used to get a team's name.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string getTeamName ( team theTeam )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theTeam:''' The team you want to retrieve the name of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a string representing the teams name if the team was valid, 'false' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example gets the current team of a player, then prints its name to the chatbox.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function whatTeamAmIOn ( source )&lt;br /&gt;
  -- Get the player's team (source is the player who entered the command)&lt;br /&gt;
  team = getPlayerTeam ( source )&lt;br /&gt;
  &lt;br /&gt;
  if ( team ) then -- if he was on a team&lt;br /&gt;
    outputChatBox ( getClientName ( source )..&amp;quot; is on team: &amp;quot;..getTeamName ( team ) )&lt;br /&gt;
  else&lt;br /&gt;
    outputChatBox ( getClientName ( source )..&amp;quot; isn't on a team&amp;quot; )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Add console command to find your team when 'whatTeamAmIOn' is typed.&lt;br /&gt;
addCommandHandler ( &amp;quot;whatTeamAmIOn&amp;quot;, whatTeamAmIOn )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Team_functions}}&lt;/div&gt;</summary>
		<author><name>Sintax</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetTeamName&amp;diff=9598</id>
		<title>GetTeamName</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetTeamName&amp;diff=9598"/>
		<updated>2007-08-01T21:47:13Z</updated>

		<summary type="html">&lt;p&gt;Sintax: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
This function is used to get a team's name.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string getTeamName ( team theTeam )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theTeam:''' The team you want to retrieve the name of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a string representing the teams name if the team was valid, 'false' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example gets the current team of a player, then prints its name to the chatbox.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function whatTeamAmIOn ( source )&lt;br /&gt;
  -- get the player's team (source is the player who entered the command)&lt;br /&gt;
  team = getPlayerTeam ( source )&lt;br /&gt;
  &lt;br /&gt;
  if ( team ) then -- if he was on a team&lt;br /&gt;
    outputChatBox ( getClientName ( source )..&amp;quot; is on team: &amp;quot;..getTeamName ( team ) )&lt;br /&gt;
  else&lt;br /&gt;
    outputChatBox ( getClientName ( source )..&amp;quot; isn't on a team&amp;quot; )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--Add console command to find your team when 'whatTeamAmIOn' is typed.&lt;br /&gt;
addCommandHandler ( &amp;quot;whatTeamAmIOn&amp;quot;, whatTeamAmIOn )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Team_functions}}&lt;/div&gt;</summary>
		<author><name>Sintax</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetTeamName&amp;diff=9597</id>
		<title>GetTeamName</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetTeamName&amp;diff=9597"/>
		<updated>2007-08-01T21:46:47Z</updated>

		<summary type="html">&lt;p&gt;Sintax: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
This function is used to get a team's name.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string getTeamName ( team theTeam )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theTeam:''' The team you want to retrieve the name of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a string representing the teams name if the team was valid, 'false' otherwise.&lt;br /&gt;
&lt;br /&gt;
function whatTeamAmIOn ( source )&lt;br /&gt;
  -- get the player's team (source is the player who entered the command)&lt;br /&gt;
  team = getPlayerTeam ( source )&lt;br /&gt;
  &lt;br /&gt;
  if ( team ) then -- if he was on a team&lt;br /&gt;
    outputChatBox ( getClientName ( source )..&amp;quot; is on team: &amp;quot;..getTeamName ( team ) )&lt;br /&gt;
  else&lt;br /&gt;
    outputChatBox ( getClientName ( source )..&amp;quot; isn't on a team&amp;quot; )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--Add console command to find your team when 'whatTeamAmIOn' is typed.&lt;br /&gt;
addCommandHandler ( &amp;quot;whatTeamAmIOn&amp;quot;, whatTeamAmIOn )&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Team_functions}}&lt;/div&gt;</summary>
		<author><name>Sintax</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetThisResource&amp;diff=9595</id>
		<title>GetThisResource</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetThisResource&amp;diff=9595"/>
		<updated>2007-08-01T21:25:26Z</updated>

		<summary type="html">&lt;p&gt;Sintax: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function retrieves the resource from which the function call was made.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
resource getThisResource ( )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the resource in which the current script is.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example retrieves the current resource's root element and attaches it to an onResourceStart event handler. This causes the event handler to get called only when the ''current'' resource is started rather than when ''any'' resource is started, thereby reducing unnecessary overhead.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- get the root element of this resource (the resource that the script is a part of)&lt;br /&gt;
resourceRoot = getResourceRootElement(getThisResource())&lt;br /&gt;
&lt;br /&gt;
-- create a function to handle the onResourceStart event&lt;br /&gt;
function onCurrentResourceStart(theResource)&lt;br /&gt;
   local resourceName = getResourceName(theResource)&lt;br /&gt;
   outputChatBox(&amp;quot;Hello and welcome to &amp;quot; .. resourceName .. &amp;quot;!&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- add the event handler&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;, resourceRoot, onCurrentResourceStart)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Resource_functions}}&lt;br /&gt;
[[Category:Needs_Checking]]&lt;/div&gt;</summary>
		<author><name>Sintax</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetThisResource&amp;diff=9594</id>
		<title>GetThisResource</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetThisResource&amp;diff=9594"/>
		<updated>2007-08-01T21:14:27Z</updated>

		<summary type="html">&lt;p&gt;Sintax: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function retrieves the resource from which the function call was made.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
resource getThisResource ( )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the resource in which the current script is.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function onStartInScoresResource(resource)&lt;br /&gt;
     local thisResource = getThisResource() -- get the resource that this script is a part of&lt;br /&gt;
     if (resource == thisResource) then -- make sure the resource that started is the one this script is a part of&lt;br /&gt;
          -- Note: without this check, the operations below would execute whenever ANY resource is loaded&lt;br /&gt;
          -- perform some operations this script will be used for, in this case keeping track of player scores and money:&lt;br /&gt;
          local players = getElementsByType(&amp;quot;player&amp;quot;)&lt;br /&gt;
          for playerKey, playerValue in ipairs(players) do&lt;br /&gt;
               setPlayerMoney(playerValue, 500)&lt;br /&gt;
               setElementData(playerValue, &amp;quot;score&amp;quot;, 0)&lt;br /&gt;
          end&lt;br /&gt;
     end&lt;br /&gt;
end   &lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;, getResourceRootElement(getThisResource()), onStartInScoresResource) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Resource_functions}}&lt;br /&gt;
[[Category:Needs_Checking]]&lt;/div&gt;</summary>
		<author><name>Sintax</name></author>
	</entry>
</feed>