Player

Parameters
number integer
comment

Returns the instance of player based on ID number.

This function always returns the same instance, does not create new objects. If used with invalid values (below 0 or above GetBJMaxPlayerSlots), returns null in Reforged, crashed on Classic.

note

Common.j: IDs start from 0, e.g. Player(0) is red, 1 is blue etc. -> GetPlayerId Blizzard.j (WorldEdit): IDs start with 1 -> GetConvertedPlayerId.

note

See: GetPlayerId, GetBJMaxPlayers, GetBJMaxPlayerSlots, GetPlayerNeutralPassive, GetPlayerNeutralAggressive.

bug

In old versions (which?) crashes the game if used with wrong values, that is values greather than 15 or values lower than 0.

pure
This function is pure. For the same values passed to it, it will always return the same value.
patch

1.00

Source
common.j
return type
player
Source code
constant native Player              takes integer number returns player