GetTeamName: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 13: | Line 13: | ||
Returns a string representing the teams name if the team was valid, 'false' otherwise. | Returns a string representing the teams name if the team was valid, 'false' otherwise. | ||
function whatTeamAmIOn ( source ) | function whatTeamAmIOn ( source ) | ||
-- get the player's team (source is the player who entered the command) | |||
team = getPlayerTeam ( source ) | |||
if ( team ) then -- if he was on a team | if ( team ) then -- if he was on a team | ||
outputChatBox ( getClientName ( source ).." is on team: "..getTeamName ( team ) ) | outputChatBox ( getClientName ( source ).." is on team: "..getTeamName ( team ) ) | ||
else | else | ||
outputChatBox ( getClientName ( source ).." isn't on a team" ) | |||
end | end | ||
end | end | ||
--Add console command to find your team when 'whatTeamAmIOn' is typed. | |||
addCommandHandler ( "whatTeamAmIOn", whatTeamAmIOn ) | |||
==See Also== | ==See Also== | ||
{{Team_functions}} | {{Team_functions}} |
Revision as of 21:46, 1 August 2007
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.
function whatTeamAmIOn ( source )
-- get the player's team (source is the player who entered the command) team = getPlayerTeam ( source ) if ( team ) then -- if he was on a team outputChatBox ( getClientName ( source ).." is on team: "..getTeamName ( team ) ) else outputChatBox ( getClientName ( source ).." isn't on a team" ) end
end
--Add console command to find your team when 'whatTeamAmIOn' is typed. addCommandHandler ( "whatTeamAmIOn", whatTeamAmIOn )
See Also
- countPlayersInTeam
- getPlayerTeam
- getPlayersInTeam
- getTeamColor
- getTeamFriendlyFire
- getTeamFromName
- getTeamName