Network Player ID

I am making a RTS type game for online use so you can battle your friends/enemies, but I have ran into a problem. I am using arrays to store each players information, each has an index which equals the players ID. In game I run into problems because the players ID is set to one no matter when they joined the game, thus they all share the same name, color, faction, etc. is there a way to get a player ID as an integer(Int)? earlier I used Network.connections.Length, but that didn’t work because each player only has 1 connection, which is to the server.

I figured it out after posting the question. here is my code:

void OnPlayerConnected(){
Network.RPC("SetClientInfo",RPCMode.Others,Network.connections.Length);
}
[RPC]
void SetClientIngo(int PIN){
if(PlayerNumber == 0){//If the player number hasn't been sent. that way already set player numbers wont be reset.
if(PIN == 0)Debug.Log("Client Did not receive correct info");
else PlayerNumber == PIN;
}
}