<?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=Ahmedsayed+Hamada</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=Ahmedsayed+Hamada"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Ahmedsayed_Hamada"/>
	<updated>2026-04-11T21:54:28Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetPlayerTeam&amp;diff=56820</id>
		<title>GetPlayerTeam</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPlayerTeam&amp;diff=56820"/>
		<updated>2018-07-23T21:10:59Z</updated>

		<summary type="html">&lt;p&gt;Ahmedsayed Hamada: /* Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function gets the current [[team]] a [[player]] is on.&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 getPlayerTeam ( player  )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[player]]:getTeam|team|setPlayerTeam}}&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''thePlayer''': The [[player]] whose team you want to find out.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''team'' element representing the team the player is on, ''false'' if the player is not part of a team.&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;
This example finds the team a player is on, and then changes its name.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function teamName ( source, key, newTeamName )&lt;br /&gt;
    local playerTeam = getPlayerTeam ( source )          -- get the player's team&lt;br /&gt;
    if ( playerTeam ) then                               -- if he's on a team&lt;br /&gt;
        local oldTeamName = getTeamName ( playerTeam )   -- get the team's current name&lt;br /&gt;
        setTeamName ( playerTeam, newTeamName )          -- change its name&lt;br /&gt;
        outputChatBox ( &amp;quot;Changed &amp;quot; .. getPlayerName ( source )..&amp;quot;'s team name from &amp;quot; .. oldTeamName .. &amp;quot; to &amp;quot; .. newTeamName )&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox ( getPlayerName ( source ) .. &amp;quot; isn't on a team&amp;quot; )&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;teamname&amp;quot;, teamName )&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>Ahmedsayed Hamada</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CountPlayersInTeam&amp;diff=56819</id>
		<title>CountPlayersInTeam</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CountPlayersInTeam&amp;diff=56819"/>
		<updated>2018-07-23T21:09:59Z</updated>

		<summary type="html">&lt;p&gt;Ahmedsayed Hamada: /* Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function is for returning the number of players in 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;
int countPlayersInTeam ( team [TY] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[team]]:countPlayers|playerCount|}}&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''theTeam:''' The team you wish to retrieve the player count of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns an integer containing the number of players in the team, ''false'' if it could not be retrieved.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 1&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt; &lt;br /&gt;
This example adds a command in the console to find out how many players are on your team.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function outputTeamSize ( source, ty7i )&lt;br /&gt;
	-- Get player's team&lt;br /&gt;
	local theTeam = getPlayerTeam ( source )&lt;br /&gt;
	-- If the player is in any team&lt;br /&gt;
	if theTeam then&lt;br /&gt;
		-- Tell the player how big his team is&lt;br /&gt;
		outputChatBox ( &amp;quot;Your team has &amp;quot; .. countPlayersInTeam ( theTeam ) .. &amp;quot; players.&amp;quot;, source )&lt;br /&gt;
	else&lt;br /&gt;
		outputChatBox ( &amp;quot;You're not in a team.&amp;quot;, source )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;teamsize&amp;quot;, outputTeamSize )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 2&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt; &lt;br /&gt;
This example adds a command in the console to find out how many players are on your team, clientside&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function outputTeamSize ( commandName )&lt;br /&gt;
	-- Get player's team&lt;br /&gt;
	local theTeam = getPlayerTeam ( getLocalPlayer() )&lt;br /&gt;
	-- If the player is in any team&lt;br /&gt;
	if team then&lt;br /&gt;
		-- Tell the player how big his team is&lt;br /&gt;
		outputChatBox ( &amp;quot;Your team has &amp;quot; .. countPlayersInTeam ( theTeam ) .. &amp;quot; players.&amp;quot; )&lt;br /&gt;
	else&lt;br /&gt;
		outputChatBox ( &amp;quot;You're not in a team.&amp;quot; )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;teamsize&amp;quot;, outputTeamSize )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 3&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt; &lt;br /&gt;
This example balances a gamemode, to ensure equal number of players between the &amp;quot;grove&amp;quot; and &amp;quot;ballas&amp;quot; teams.  This could be triggered when a player joins the server, or for all players currently in the server when the gamemode starts.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function balanceTeams ( thePlayer )&lt;br /&gt;
	--get the team pointers from their names&lt;br /&gt;
	local groveTeam = getTeamFromName ( &amp;quot;grove&amp;quot; )&lt;br /&gt;
	local ballasTeam = getTeamFromName ( &amp;quot;ballas&amp;quot; )&lt;br /&gt;
	--count the number of players in each team, and store them&lt;br /&gt;
	local groveCount = countPlayersInTeam ( groveTeam )&lt;br /&gt;
	local ballasCount = countPlayersInTeam ( ballasTeam )&lt;br /&gt;
	if groveCount == ballasCount then --if the teams are equal&lt;br /&gt;
		setPlayerTeam ( thePlayer , groveTeam ) --place the player in grove&lt;br /&gt;
	elseif groveCount &amp;gt; ballasCount then --if there are more in grove&lt;br /&gt;
		setPlayerTeam ( thePlayer , ballasTeam ) --place him in ballas&lt;br /&gt;
	elseif groveCount &amp;lt; ballasCount then --if there are more in ballas&lt;br /&gt;
		setPlayerTeam ( thePlayer , groveTeam ) --place him in grove.&lt;br /&gt;
	end&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Team functions}}&lt;/div&gt;</summary>
		<author><name>Ahmedsayed Hamada</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CountPlayersInTeam&amp;diff=56818</id>
		<title>CountPlayersInTeam</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CountPlayersInTeam&amp;diff=56818"/>
		<updated>2018-07-23T21:09:32Z</updated>

		<summary type="html">&lt;p&gt;Ahmedsayed Hamada: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function is for returning the number of players in 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;
int countPlayersInTeam ( team theTeam )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[team]]:countPlayers|playerCount|}}&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''theTeam:''' The team you wish to retrieve the player count of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns an integer containing the number of players in the team, ''false'' if it could not be retrieved.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 1&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt; &lt;br /&gt;
This example adds a command in the console to find out how many players are on your team.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function outputTeamSize ( source, ty7i )&lt;br /&gt;
	-- Get player's team&lt;br /&gt;
	local theTeam = getPlayerTeam ( source )&lt;br /&gt;
	-- If the player is in any team&lt;br /&gt;
	if theTeam then&lt;br /&gt;
		-- Tell the player how big his team is&lt;br /&gt;
		outputChatBox ( &amp;quot;Your team has &amp;quot; .. countPlayersInTeam ( theTeam ) .. &amp;quot; players.&amp;quot;, source )&lt;br /&gt;
	else&lt;br /&gt;
		outputChatBox ( &amp;quot;You're not in a team.&amp;quot;, source )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;teamsize&amp;quot;, outputTeamSize )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 2&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt; &lt;br /&gt;
This example adds a command in the console to find out how many players are on your team, clientside&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function outputTeamSize ( commandName )&lt;br /&gt;
	-- Get player's team&lt;br /&gt;
	local theTeam = getPlayerTeam ( getLocalPlayer() )&lt;br /&gt;
	-- If the player is in any team&lt;br /&gt;
	if team then&lt;br /&gt;
		-- Tell the player how big his team is&lt;br /&gt;
		outputChatBox ( &amp;quot;Your team has &amp;quot; .. countPlayersInTeam ( theTeam ) .. &amp;quot; players.&amp;quot; )&lt;br /&gt;
	else&lt;br /&gt;
		outputChatBox ( &amp;quot;You're not in a team.&amp;quot; )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;teamsize&amp;quot;, outputTeamSize )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 3&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt; &lt;br /&gt;
This example balances a gamemode, to ensure equal number of players between the &amp;quot;grove&amp;quot; and &amp;quot;ballas&amp;quot; teams.  This could be triggered when a player joins the server, or for all players currently in the server when the gamemode starts.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function balanceTeams ( thePlayer )&lt;br /&gt;
	--get the team pointers from their names&lt;br /&gt;
	local groveTeam = getTeamFromName ( &amp;quot;grove&amp;quot; )&lt;br /&gt;
	local ballasTeam = getTeamFromName ( &amp;quot;ballas&amp;quot; )&lt;br /&gt;
	--count the number of players in each team, and store them&lt;br /&gt;
	local groveCount = countPlayersInTeam ( groveTeam )&lt;br /&gt;
	local ballasCount = countPlayersInTeam ( ballasTeam )&lt;br /&gt;
	if groveCount == ballasCount then --if the teams are equal&lt;br /&gt;
		setPlayerTeam ( thePlayer , groveTeam ) --place the player in grove&lt;br /&gt;
	elseif groveCount &amp;gt; ballasCount then --if there are more in grove&lt;br /&gt;
		setPlayerTeam ( thePlayer , ballasTeam ) --place him in ballas&lt;br /&gt;
	elseif groveCount &amp;lt; ballasCount then --if there are more in ballas&lt;br /&gt;
		setPlayerTeam ( thePlayer , groveTeam ) --place him in grove.&lt;br /&gt;
	end&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Team functions}}&lt;/div&gt;</summary>
		<author><name>Ahmedsayed Hamada</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CreateTeam&amp;diff=56817</id>
		<title>CreateTeam</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CreateTeam&amp;diff=56817"/>
		<updated>2018-07-23T21:07:36Z</updated>

		<summary type="html">&lt;p&gt;Ahmedsayed Hamada: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function is for creating a new [[team]], which can be used to group players. Players will not join the team until they are respawned.&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 createTeam ( string teamName, [int colorR = 255, int colorG = 255, int colorB = 255] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||Team.create||}}&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''teamName:[TY][[https:joinTY team&amp;amp;13462354]]&lt;br /&gt;
== Headline text ==Egypt&lt;br /&gt;
[http://@ahmty@2345245]&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''colorR:''' An integer representing the red color value.&lt;br /&gt;
*'''colorG:''' An integer representing the green color value.&lt;br /&gt;
*'''colorB:''' An integer representing the blue color value.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
join TY team&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
'''Example 1:''' This example creates a new team for a player, then adds him to it.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function gimmeATeam ( source, ty7i, [TY] )&lt;br /&gt;
  local newTeam = createTeam ( [TY] ) -- create a new team with the specified name&lt;br /&gt;
  if newTeam then -- if it was successfully created&lt;br /&gt;
    setPlayerTeam ( source, [TY] ) -- add the player to the new team&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;giveteam&amp;quot;, ty7i)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 2:''' This example creates two teams, one for Admin and one for Freeroamers, when the resource this script is in is started.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createTeamsOnStart ()&lt;br /&gt;
	teamAdmmin = createTeam ( &amp;quot;ty7i&amp;quot;, 0, 255, 0 ) --change the 3 numbers(0,255,0), the first number is ColourR, the second is ColourG, and the last one is ColourB&lt;br /&gt;
	teamFreeroamers = createTeam ( &amp;quot;Freeroamer&amp;quot;, 200, 0, 100 )&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;, resourceRoot, createTeamsOnStart) --we attach the function to this resource's root element&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 3:''' This example creates a team for Admin and when an admin logs in, he will be set in the Admin team.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createAdminTeamOnStart ()&lt;br /&gt;
	AdminTeam = createTeam ( &amp;quot;Admin&amp;quot;, 0, 255, 0 )-- create a new team and name it 'Admin'&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;, resourceRoot, createAdminTeamOnStart) -- add an event handler&lt;br /&gt;
&lt;br /&gt;
function setAdminTeam()&lt;br /&gt;
if isObjectInACLGroup(&amp;quot;user.&amp;quot;..getAccountName(getPlayerAccount(source)), aclGetGroup(&amp;quot;Admin&amp;quot;)) then -- if he is admin&lt;br /&gt;
   setPlayerTeam(source, AdminTeam) -- set him to admin team&lt;br /&gt;
   end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerLogin&amp;quot;,getRootElement(),setAdminTeam) -- add an event handler&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>Ahmedsayed Hamada</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CreateTeam&amp;diff=56816</id>
		<title>CreateTeam</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CreateTeam&amp;diff=56816"/>
		<updated>2018-07-23T21:05:53Z</updated>

		<summary type="html">&lt;p&gt;Ahmedsayed Hamada: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function is for creating a new [[team]], which can be used to group players. Players will not join the team until they are respawned.&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 createTeam ( string teamName, [int colorR = 255, int colorG = 255, int colorB = 255] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||Team.create||}}&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''teamName:[TY][[https:joinTY team&amp;amp;13462354]]&lt;br /&gt;
== Headline text ==Egypt&lt;br /&gt;
[http://@ahmty@2345245]&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''colorR:''' An integer representing the red color value.&lt;br /&gt;
*'''colorG:''' An integer representing the green color value.&lt;br /&gt;
*'''colorB:''' An integer representing the blue color value.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
join TY team&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
'''Example 1:''' This example creates a new team for a player, then adds him to it.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function gimmeATeam ( source, ty7i, [TY] )&lt;br /&gt;
  local newTeam = createTeam ( [TY] ) -- create a new team with the specified name&lt;br /&gt;
  if newTeam then -- if it was successfully created&lt;br /&gt;
    setPlayerTeam ( source, [TY] ) -- add the player to the new team&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;giveteam&amp;quot;, ty7i)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 2:''' This example creates two teams, one for Admin and one for Freeroamers, when the resource this script is in is started.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createTeamsOnStart ()&lt;br /&gt;
	teamAdmmin = createTeam ( &amp;quot;Admin&amp;quot;, 0, 255, 0 ) --change the 3 numbers(0,255,0), the first number is ColourR, the second is ColourG, and the last one is ColourB&lt;br /&gt;
	teamFreeroamers = createTeam ( &amp;quot;Freeroamer&amp;quot;, 200, 0, 100 )&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;, resourceRoot, createTeamsOnStart) --we attach the function to this resource's root element&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 3:''' This example creates a team for Admin and when an admin logs in, he will be set in the Admin team.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createAdminTeamOnStart ()&lt;br /&gt;
	AdminTeam = createTeam ( &amp;quot;Admin&amp;quot;, 0, 255, 0 )-- create a new team and name it 'Admin'&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;, resourceRoot, createAdminTeamOnStart) -- add an event handler&lt;br /&gt;
&lt;br /&gt;
function setAdminTeam()&lt;br /&gt;
if isObjectInACLGroup(&amp;quot;user.&amp;quot;..getAccountName(getPlayerAccount(source)), aclGetGroup(&amp;quot;Admin&amp;quot;)) then -- if he is admin&lt;br /&gt;
   setPlayerTeam(source, AdminTeam) -- set him to admin team&lt;br /&gt;
   end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerLogin&amp;quot;,getRootElement(),setAdminTeam) -- add an event handler&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>Ahmedsayed Hamada</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CreateTeam&amp;diff=56815</id>
		<title>CreateTeam</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CreateTeam&amp;diff=56815"/>
		<updated>2018-07-23T21:04:46Z</updated>

		<summary type="html">&lt;p&gt;Ahmedsayed Hamada: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function is for creating a new [[team]], which can be used to group players. Players will not join the team until they are respawned.&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 createTeam ( string teamName, [int colorR = 255, int colorG = 255, int colorB = 255] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||Team.create||}}&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''teamName:[TY][[https:joinTY team&amp;amp;13462354]]&lt;br /&gt;
== Headline text ==Egypt&lt;br /&gt;
[http://@ahmty@2345245]&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''colorR:''' An integer representing the red color value.&lt;br /&gt;
*'''colorG:''' An integer representing the green color value.&lt;br /&gt;
*'''colorB:''' An integer representing the blue color value.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
join TY team&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
'''Example 1:''' This example creates a new team for a player, then adds him to it.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function gimmeATeam ( source, ty7i, [TY] )&lt;br /&gt;
  local newTeam = createTeam ( [TY] ) -- create a new team with the specified name&lt;br /&gt;
  if newTeam then -- if it was successfully created&lt;br /&gt;
    setPlayerTeam ( source, newTeam ) -- add the player to the new team&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;giveteam&amp;quot;, gimmeATeam)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 2:''' This example creates two teams, one for Admin and one for Freeroamers, when the resource this script is in is started.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createTeamsOnStart ()&lt;br /&gt;
	teamAdmmin = createTeam ( &amp;quot;Admin&amp;quot;, 0, 255, 0 ) --change the 3 numbers(0,255,0), the first number is ColourR, the second is ColourG, and the last one is ColourB&lt;br /&gt;
	teamFreeroamers = createTeam ( &amp;quot;Freeroamer&amp;quot;, 200, 0, 100 )&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;, resourceRoot, createTeamsOnStart) --we attach the function to this resource's root element&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 3:''' This example creates a team for Admin and when an admin logs in, he will be set in the Admin team.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createAdminTeamOnStart ()&lt;br /&gt;
	AdminTeam = createTeam ( &amp;quot;Admin&amp;quot;, 0, 255, 0 )-- create a new team and name it 'Admin'&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;, resourceRoot, createAdminTeamOnStart) -- add an event handler&lt;br /&gt;
&lt;br /&gt;
function setAdminTeam()&lt;br /&gt;
if isObjectInACLGroup(&amp;quot;user.&amp;quot;..getAccountName(getPlayerAccount(source)), aclGetGroup(&amp;quot;Admin&amp;quot;)) then -- if he is admin&lt;br /&gt;
   setPlayerTeam(source, AdminTeam) -- set him to admin team&lt;br /&gt;
   end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerLogin&amp;quot;,getRootElement(),setAdminTeam) -- add an event handler&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>Ahmedsayed Hamada</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CreateTeam&amp;diff=56814</id>
		<title>CreateTeam</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CreateTeam&amp;diff=56814"/>
		<updated>2018-07-23T21:02:19Z</updated>

		<summary type="html">&lt;p&gt;Ahmedsayed Hamada: /* Returns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function is for creating a new [[team]], which can be used to group players. Players will not join the team until they are respawned.&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 createTeam ( string teamName, [int colorR = 255, int colorG = 255, int colorB = 255] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||Team.create||}}&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''teamName:[TY][[https:joinTY team&amp;amp;13462354]]&lt;br /&gt;
== Headline text ==Egypt&lt;br /&gt;
[http://@ahmty@2345245]&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''colorR:''' An integer representing the red color value.&lt;br /&gt;
*'''colorG:''' An integer representing the green color value.&lt;br /&gt;
*'''colorB:''' An integer representing the blue color value.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
join TY team&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
'''Example 1:''' This example creates a new team for a player, then adds him to it.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function gimmeATeam ( source, commandName, teamName )&lt;br /&gt;
  local newTeam = createTeam ( teamName ) -- create a new team with the specified name&lt;br /&gt;
  if newTeam then -- if it was successfully created&lt;br /&gt;
    setPlayerTeam ( source, newTeam ) -- add the player to the new team&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;giveteam&amp;quot;, gimmeATeam)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 2:''' This example creates two teams, one for Admin and one for Freeroamers, when the resource this script is in is started.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createTeamsOnStart ()&lt;br /&gt;
	teamAdmmin = createTeam ( &amp;quot;Admin&amp;quot;, 0, 255, 0 ) --change the 3 numbers(0,255,0), the first number is ColourR, the second is ColourG, and the last one is ColourB&lt;br /&gt;
	teamFreeroamers = createTeam ( &amp;quot;Freeroamer&amp;quot;, 200, 0, 100 )&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;, resourceRoot, createTeamsOnStart) --we attach the function to this resource's root element&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 3:''' This example creates a team for Admin and when an admin logs in, he will be set in the Admin team.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createAdminTeamOnStart ()&lt;br /&gt;
	AdminTeam = createTeam ( &amp;quot;Admin&amp;quot;, 0, 255, 0 )-- create a new team and name it 'Admin'&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;, resourceRoot, createAdminTeamOnStart) -- add an event handler&lt;br /&gt;
&lt;br /&gt;
function setAdminTeam()&lt;br /&gt;
if isObjectInACLGroup(&amp;quot;user.&amp;quot;..getAccountName(getPlayerAccount(source)), aclGetGroup(&amp;quot;Admin&amp;quot;)) then -- if he is admin&lt;br /&gt;
   setPlayerTeam(source, AdminTeam) -- set him to admin team&lt;br /&gt;
   end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerLogin&amp;quot;,getRootElement(),setAdminTeam) -- add an event handler&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>Ahmedsayed Hamada</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CreateTeam&amp;diff=56810</id>
		<title>CreateTeam</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CreateTeam&amp;diff=56810"/>
		<updated>2018-07-23T20:59:15Z</updated>

		<summary type="html">&lt;p&gt;Ahmedsayed Hamada: /* Required Arguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function is for creating a new [[team]], which can be used to group players. Players will not join the team until they are respawned.&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 createTeam ( string teamName, [int colorR = 255, int colorG = 255, int colorB = 255] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||Team.create||}}&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''teamName:[TY][[https:joinTY team&amp;amp;13462354]]&lt;br /&gt;
== Headline text ==Egypt&lt;br /&gt;
[http://@ahmty@2345245]&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''colorR:''' An integer representing the red color value.&lt;br /&gt;
*'''colorG:''' An integer representing the green color value.&lt;br /&gt;
*'''colorB:''' An integer representing the blue color value.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a team element if it was successfully created, ''false'' if invalid arguments are passed or a team with that name already exists.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
'''Example 1:''' This example creates a new team for a player, then adds him to it.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function gimmeATeam ( source, commandName, teamName )&lt;br /&gt;
  local newTeam = createTeam ( teamName ) -- create a new team with the specified name&lt;br /&gt;
  if newTeam then -- if it was successfully created&lt;br /&gt;
    setPlayerTeam ( source, newTeam ) -- add the player to the new team&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;giveteam&amp;quot;, gimmeATeam)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 2:''' This example creates two teams, one for Admin and one for Freeroamers, when the resource this script is in is started.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createTeamsOnStart ()&lt;br /&gt;
	teamAdmmin = createTeam ( &amp;quot;Admin&amp;quot;, 0, 255, 0 ) --change the 3 numbers(0,255,0), the first number is ColourR, the second is ColourG, and the last one is ColourB&lt;br /&gt;
	teamFreeroamers = createTeam ( &amp;quot;Freeroamer&amp;quot;, 200, 0, 100 )&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;, resourceRoot, createTeamsOnStart) --we attach the function to this resource's root element&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 3:''' This example creates a team for Admin and when an admin logs in, he will be set in the Admin team.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createAdminTeamOnStart ()&lt;br /&gt;
	AdminTeam = createTeam ( &amp;quot;Admin&amp;quot;, 0, 255, 0 )-- create a new team and name it 'Admin'&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;, resourceRoot, createAdminTeamOnStart) -- add an event handler&lt;br /&gt;
&lt;br /&gt;
function setAdminTeam()&lt;br /&gt;
if isObjectInACLGroup(&amp;quot;user.&amp;quot;..getAccountName(getPlayerAccount(source)), aclGetGroup(&amp;quot;Admin&amp;quot;)) then -- if he is admin&lt;br /&gt;
   setPlayerTeam(source, AdminTeam) -- set him to admin team&lt;br /&gt;
   end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerLogin&amp;quot;,getRootElement(),setAdminTeam) -- add an event handler&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>Ahmedsayed Hamada</name></author>
	</entry>
</feed>