Page 1 of 1

[N/A][Maniascript/TM] Players array and Gamemode Rounds

Posted: 09 Feb 2014, 20:28
by undef.de
This piece of code counts the amount of Players and Spectators:

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);
}
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.

Re: [Maniascript/TM] Players array and Gamemode Rounds

Posted: 11 Feb 2014, 06:18
by spaii
Perhaps in round mode, when a player hit DEL or reach finish line, this player is moved to PlayersWaiting array...
http://maniascript.stunters.org/struct_c_tm_mode.html

Re: [Maniascript/TM] Players array and Gamemode Rounds

Posted: 11 Feb 2014, 18:10
by undef.de
Maybe, but i can't access "PlayersWaiting", "PlayersRacing" or "ConnectedPlayers":

Code: Select all

ERROR[N, N] The member or variable ... does not exist.