# Set Player Commander

Grammar — Set Player player’s commander to commander.
FlagsNative | Action

Sets the commander of the specified player.

# Arguments

  • int — Player
  • string [ gamelink::Commander ] — Commander

Returns — void

native void PlayerSetCommander(
	int inPlayer,
	string inCommander,
);

Category: Player / Player Settings

# Examples

# mods/starcoop/starcoop.sc2mod

LibCOOC.galaxy

// L1958
PlayerSetCommander(lp_player, libCOOC_gf_CC_CommanderData(lp_commander))
// L4433
PlayerSetCommander(1, UserDataGetGameLink("PlayerCommanders", lv_commander1, "CommanderData", 1))
// L4436
PlayerSetCommander(2, UserDataGetGameLink("PlayerCommanders", lv_commander2, "CommanderData", 1))

# mods/warcoop/warcoopdata.sc2mod

WarCoopData.galaxy

// L2071
PlayerSetCommander(lp_player, lv_commander)