# Set Player Color

Grammar — Set player player color to color (changeUnits the color of existing units)
FlagsNative | Action

Sets the player color for the player.

# Arguments

  • int — Player
  • int [ playercolor ] — Color
  • bool [ preset::ChangeRetainOption ] — Change/Retain

Returns — void

native void PlayerSetColorIndex(
	int inPlayer,
	int inIndex,
	bool inChangeUnits,
);

Category: Player / Player Settings

# Examples

# campaigns/liberty.sc2campaign

MapScript.galaxy

// L722
PlayerSetColorIndex(gv_p2_ENEMY, 2, true)
// L864
PlayerSetColorIndex(gv_p2_ENEMY, 1, true)
// L1191
PlayerSetColorIndex(gv_p2_ENEMY, 1, true)
// L940
PlayerSetColorIndex(gv_p02_ZERG_EAST, 4, true)
// L941
PlayerSetColorIndex(gv_p03_VIROPHAGE, 4, true)
// L942
PlayerSetColorIndex(gv_p04_ZERG_NORTH, 4, true)
// L943
PlayerSetColorIndex(gv_p05_COLONIST, 0, true)
// L944
PlayerSetColorIndex(gv_p06_COLONIST, 0, true)
// L945
PlayerSetColorIndex(gv_p07_ZERG_INFESTED, 4, true)
// L946
PlayerSetColorIndex(gv_p08_ZERG_SOUTH, 4, true)
// L692
PlayerSetColorIndex(gv_pLAYER_02_DOMINION, 1, true)
// L693
PlayerSetColorIndex(gv_pLAYER_03_DOMINION, 1, true)
// L694
PlayerSetColorIndex(gv_pLAYER_04_DOMINION, 1, true)
// L695
PlayerSetColorIndex(gv_pLAYER_06_TRAIN, 1, true)
// L395
PlayerSetColorIndex(auto317FADF5_var, 1, true)
// L858
PlayerSetColorIndex(gv_p03_DOMINION_SIEGE, 1, true)
// L859
PlayerSetColorIndex(gv_p04_DOMINION_AIR, 1, true)
// L860
PlayerSetColorIndex(gv_p05_DOMINION_RAIDER, 1, true)
// L592
PlayerSetColorIndex(gv_pLAYER03_ZERG, 4, true)
// L593
PlayerSetColorIndex(gv_pLAYER04_ZERG, 4, true)
// L359
PlayerSetColorIndex(gv_p04_ZERG, 4, true)
// L725
PlayerSetColorIndex(autoA366C10A_var, 3, true)
// L626
PlayerSetColorIndex(gv_p4_DOMINION_PURPLE, 1, true)
// L627
PlayerSetColorIndex(gv_p5_DOMINION_GREY, 1, true)
// L628
PlayerSetColorIndex(gv_p6_DOMINION_ORANGE, 1, true)
// L629
PlayerSetColorIndex(gv_p8_ALLIED_PINK, 3, true)
// L630
PlayerSetColorIndex(gv_p9_ALLIED_GREEN, 3, true)
// L631
PlayerSetColorIndex(gv_p11_ALLIED_CELLBLOCK_A, 3, true)
// L632
PlayerSetColorIndex(gv_p12_ALLIED_CELLBLOCK_B, 3, true)
// L461
PlayerSetColorIndex(auto09E5D80C_var, 3, true)
// L580
PlayerSetColorIndex(gv_p02_ZERG, 4, true)
// L581
PlayerSetColorIndex(gv_p05_ZERG_BASE, 4, true)
// L582
PlayerSetColorIndex(gv_p07_ZERG_KERRIGAN, 4, true)
// L333
PlayerSetColorIndex(gv_pLAYER02_PROTOSS, 3, true)
// L334
PlayerSetColorIndex(gv_pLAYER03_PROTOSS, 3, true)
// L335
PlayerSetColorIndex(gv_pLAYER04_PROTOSS, 3, true)
// L441
PlayerSetColorIndex(gv_pLAYER_02_ScriptedTOSS, 3, true)
// L442
PlayerSetColorIndex(gv_pLAYER_03_HighTOSS, 3, true)
// L443
PlayerSetColorIndex(gv_pLAYER_04_DarkTOSS, 3, true)
// L444
PlayerSetColorIndex(gv_pLAYER_05_WORLDSHIP, 1, true)
// L914
PlayerSetColorIndex(gv_p02_ZERG_PURPLE_NE, 4, true)
// L915
PlayerSetColorIndex(gv_p05_ZERG_ORANGE_NW, 4, true)
// L916
PlayerSetColorIndex(gv_p06_ZERG_GREEN_SW, 4, true)
// L917
PlayerSetColorIndex(gv_p07_ZERG_PINK, 4, true)
// L918
PlayerSetColorIndex(gv_p10_ZERG_WHITEHIVE, 4, true)
// L919
PlayerSetColorIndex(gv_p11_ZERG_YELLOWSPORECANNON, 4, true)
// L6577
PlayerSetColorIndex(gv_p01_USER, 1, true)
// L750
PlayerSetColorIndex(gv_p2_ZERG, 4, true)
// L751
PlayerSetColorIndex(gv_p5_EGGS, 4, true)
// L682
PlayerSetColorIndex(gv_pLAYER_P03_ZERG_BR, 4, true)
// L683
PlayerSetColorIndex(gv_pLAYER_P04_ZERG_BL, 4, true)
// L684
PlayerSetColorIndex(gv_pLAYER_P05_ZERG_TL, 4, true)
// L685
PlayerSetColorIndex(gv_pLAYER_P06_ZERG_TR, 4, true)
// L686
PlayerSetColorIndex(gv_pLAYER_P07_ZERG_EXP, 4, true)
// L687
PlayerSetColorIndex(gv_pLAYER_P08_MUTALISK_TOWERS, 4, true)
// L789
PlayerSetColorIndex(gv_pLAYER_ZERG_SOUTH, 4, true)
// L790
PlayerSetColorIndex(gv_pLAYER_ZERG_EAST, 4, true)
// L791
PlayerSetColorIndex(gv_pLAYER_ZERG_SPECIAL, 4, true)
// L582
PlayerSetColorIndex(gv_p4_RUNOUT_ZERG, 4, true)
// L590
PlayerSetColorIndex(gv_p2_PROTOSS_STALKER, 7, true)
// L591
PlayerSetColorIndex(gv_p3_PROTOSS_ENEMY, 7, true)
// L592
PlayerSetColorIndex(gv_p4_PROTOSS_ENEMY, 7, true)
// L593
PlayerSetColorIndex(gv_p6_PROTOSS_ENEMY, 7, true)
// L432
PlayerSetColorIndex(gv_p03_ZERG_NORTH, 4, true)
// L433
PlayerSetColorIndex(gv_p04_ZERG_EAST, 4, true)
// L434
PlayerSetColorIndex(gv_p05_ZERG_LOW_GROUND_NOAI, 4, true)
// L446
PlayerSetColorIndex(gv_p04_ZERG_NW, 4, true)
// L447
PlayerSetColorIndex(gv_p05_ZERG_NE, 4, true)
// L448
PlayerSetColorIndex(gv_p06_ZERG_SE, 4, true)
// L449
PlayerSetColorIndex(gv_p07_FRENZIED_ZERG, 4, true)
// L722
PlayerSetColorIndex(gv_p2_ENEMY, 2, true)
// L864
PlayerSetColorIndex(gv_p2_ENEMY, 1, true)
// L1191
PlayerSetColorIndex(gv_p2_ENEMY, 1, true)
// L940
PlayerSetColorIndex(gv_p02_ZERG_EAST, 4, true)
// L941
PlayerSetColorIndex(gv_p03_VIROPHAGE, 4, true)
// L942
PlayerSetColorIndex(gv_p04_ZERG_NORTH, 4, true)
// L943
PlayerSetColorIndex(gv_p05_COLONIST, 0, true)
// L944
PlayerSetColorIndex(gv_p06_COLONIST, 0, true)
// L945
PlayerSetColorIndex(gv_p07_ZERG_INFESTED, 4, true)
// L946
PlayerSetColorIndex(gv_p08_ZERG_SOUTH, 4, true)
// L692
PlayerSetColorIndex(gv_pLAYER_02_DOMINION, 1, true)
// L693
PlayerSetColorIndex(gv_pLAYER_03_DOMINION, 1, true)
// L694
PlayerSetColorIndex(gv_pLAYER_04_DOMINION, 1, true)
// L695
PlayerSetColorIndex(gv_pLAYER_06_TRAIN, 1, true)
// L395
PlayerSetColorIndex(auto317FADF5_var, 1, true)
// L858
PlayerSetColorIndex(gv_p03_DOMINION_SIEGE, 1, true)
// L859
PlayerSetColorIndex(gv_p04_DOMINION_AIR, 1, true)
// L860
PlayerSetColorIndex(gv_p05_DOMINION_RAIDER, 1, true)
// L592
PlayerSetColorIndex(gv_pLAYER03_ZERG, 4, true)
// L593
PlayerSetColorIndex(gv_pLAYER04_ZERG, 4, true)
// L359
PlayerSetColorIndex(gv_p04_ZERG, 4, true)
// L725
PlayerSetColorIndex(autoA366C10A_var, 3, true)
// L626
PlayerSetColorIndex(gv_p4_DOMINION_PURPLE, 1, true)
// L627
PlayerSetColorIndex(gv_p5_DOMINION_GREY, 1, true)
// L628
PlayerSetColorIndex(gv_p6_DOMINION_ORANGE, 1, true)
// L629
PlayerSetColorIndex(gv_p8_ALLIED_PINK, 3, true)
// L630
PlayerSetColorIndex(gv_p9_ALLIED_GREEN, 3, true)
// L631
PlayerSetColorIndex(gv_p11_ALLIED_CELLBLOCK_A, 3, true)
// L632
PlayerSetColorIndex(gv_p12_ALLIED_CELLBLOCK_B, 3, true)
// L461
PlayerSetColorIndex(auto09E5D80C_var, 3, true)