GetTeamColor

From Multi Theft Auto: Wiki
Revision as of 22:08, 14 September 2006 by MrJax (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function is for retrieving the color of a team.

Syntax

colorR, colorG, colorB getTeamColor ( team theTeam )

Required Arguments

  • theTeam: The team you want to change the color of.

Returns

Returns 3 integers representing the RGB color value 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