SetTeamName

From Multi Theft Auto: Wiki
Revision as of 15:39, 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 set a team's name.

Syntax

bool setTeamName ( team theTeam, string newName )

Required Arguments

  • theTeam: The team you want to change the name of.
  • newName: A string representing the name you want the team to be called.

Returns

Returns 'true' if the team was valid and the name was changed, 'false' otherwise.

Example

This example gets the current team of a player, then changes its name.

addCommandHandler ( "changeMyTeamName", "changeMyTeamName" )
function changeMyTeamNam ( source, key, newName )
  team = getPlayerTeam ( source ) -- get the player's team
  if ( team ) then -- if he was on a team
    oldName = getTeamName ( team ) -- get the teams current name
    setTeamName ( team, newName ) -- change the teams name to blue
    outputChatBox ( "Changed ".. getClientName ( source ).."'s team name from "..oldName.." to "..newName )
  end
end

See Also