setTeamName | Multi Theft Auto: Wiki Skip to content

setTeamName

Client-side
Server-side
Shared

Pair: getTeamName

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


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

Syntax

setTeamName ( )

Code Examples

server

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

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