[N/A][Maniascript/TM] Players array and Gamemode Rounds
Posted: 09 Feb 2014, 20:28
This piece of code counts the amount of Players and Spectators:
But in Gamemode "Rounds" when a Player finish the map or pressed DEL, then this Player is removed from the Players array (so the count is wrong). Only Players that haven't finish the map (or doesn't pressed DEL) are in the Players array. When all Players have finished and the next round starts, then all Players are back again in the Players array.
I have tested it with Canyon and Statium, with the same results.
EDIT: Just tested the Gamemode Cup and Team, with the same result in Stadium.
Code: Select all
declare Integer PlayerCount = 0;
declare Integer SpectatorCount = 0;
foreach (Player in Players) {
if (Player.Login == CurrentServerLogin) {
continue;
}
if (Player.RequestsSpectate == True) {
SpectatorCount += 1;
}
else {
PlayerCount += 1;
}
log(PlayerCount ^" / "^ SpectatorCount);
}
I have tested it with Canyon and Statium, with the same results.
EDIT: Just tested the Gamemode Cup and Team, with the same result in Stadium.