GetTeamName

From Multi Theft Auto: Wiki
Revision as of 15:35, 30 June 2006 by MrJax (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function is used to get a team's name.

Syntax

string getTeamName ( team theTeam )

Required Arguments

  • theTeam: The team you want to retrieve the name of.

Returns

Returns a string representing the teams name if the team was valid, 'false' otherwise.

Example

This example gets the current team of a player, then prints its name to the chatbox.

addCommandHandler ( "whatTeamAmIOn", "whatTeamAmIOn" )
function whatTeamAmIOn ( source )
  team = getPlayerTeam ( source ) -- get the player's team
  if ( team ) then -- if he was on a team
    outputChatBox ( getClientName ( source ).." is on team: "..getTeamName ( team ) )
  else
    outoutChatBox ( getClientName ( source ).." isn't on a team" )
  end
end

See Also