GetTeamColor: Difference between revisions
Jump to navigation
Jump to search
m (→Returns) |
|||
Line 11: | Line 11: | ||
===Returns=== | ===Returns=== | ||
Returns 3 integers representing the red, green, and blue color | Returns 3 integers representing the red, green, and blue color values of the team if valid, otherwise 'false'. | ||
==Example== | ==Example== |
Revision as of 03:37, 2 August 2007
This function is for retrieving the color of a team.
Syntax
int, int, int getTeamColor ( team theTeam )
Required Arguments
- theTeam: The team you want to get the color of.
Returns
Returns 3 integers representing the red, green, and blue color values of the team if valid, otherwise 'false'.
Example
This example outputs the name of a players team when they spawn, in that team's color.
addEventHandler ( "onPlayerSpawn", root, "onPlayerSpawn" ) function onPlayerSpawn ( spawnpoint, team ) r, g, b = 255, 255, 255 string = getClientName ( source ) .. " spawned" if ( team ) then teamName = getTeamName ( team ) string = string.." as a "..teamName r, g, b = getTeamColor ( team ) end outputChatBox ( string, r, g, b ) end
See Also
- countPlayersInTeam
- getPlayerTeam
- getPlayersInTeam
- getTeamColor
- getTeamFriendlyFire
- getTeamFromName
- getTeamName