SC2Mapster.com Wiki

SC2 API / Functions / PlayerGetColorIndex

PlayerGetColorIndex

int PlayerGetColorIndex(int player, bool ?);

Color index of the player

Parameters

int player

Player slot. It must be between 0 and 15 or it throws a bound check error.

bool ?

Unknown

Return value

int - Color index of the player. Return a number from 0 to 15 which correspond to

  • White, Red, Blue, Teal, Purple, Yellow, Orange, Green, Pink, Violet, Light Grey, Dark Green, Brown, Light Green, Dark Grey, Lavender

Examples

Example #1: Usage
text color;

color = PlayerColorName(PlayerGetColorIndex(0, false)); // White
color = PlayerColorName(PlayerGetColorIndex(1, false)); // Red
Example #2: Helper
text PlayerColor(int player) {
  return PlayerColorName(PlayerGetColorIndex(player, false));
}

You must login to post a comment. Don't have an account? Register to get one!

Facts

Date created
Mar 11, 2010
Last updated
Mar 11, 2010

Author