14.05.2010, 12:54
new TeamKills[2];
creates an array with two cells. In the first cell you would store the number of players left in the first team, in the second cell you would store the one in the second team.
Array-cells start with 0. If you create an array of two cells you have a variable TeamKills[0] and a variable TeamKills[1].
Hence if someone of Team 1 dies, you decrement TeamKills[0] by one (TeamKills[0]--, if someone of team 2 dies you decrement TeamKills[1] by one.
To avoid confusion I'd also suggest you do not call the array TeamKills.
creates an array with two cells. In the first cell you would store the number of players left in the first team, in the second cell you would store the one in the second team.
Array-cells start with 0. If you create an array of two cells you have a variable TeamKills[0] and a variable TeamKills[1].
Hence if someone of Team 1 dies, you decrement TeamKills[0] by one (TeamKills[0]--, if someone of team 2 dies you decrement TeamKills[1] by one.
To avoid confusion I'd also suggest you do not call the array TeamKills.