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

Moderator: NADEO

Locked
User avatar
undef.de
Posts: 2095
Joined: 06 Apr 2011, 21:57
Location: Germany, North Sea Coast
Contact:

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

Post 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.
Last edited by undef.de on 11 Feb 2014, 18:47, edited 2 times in total.
Developer of UASECO, a controller with support of the Modescript Gamemodes for TM².
Visit the official website for more: UASECO.org


Developer of various plugins for XAseco/XAseco2 and MPAseco, visit my lab: www.undef.name

You like what I do? Then award a ManiaStar.
User avatar
spaii
Posts: 1075
Joined: 19 Jun 2010, 00:04
Location: Rémy - France
Contact:

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

Post 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
User avatar
undef.de
Posts: 2095
Joined: 06 Apr 2011, 21:57
Location: Germany, North Sea Coast
Contact:

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

Post 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.
Developer of UASECO, a controller with support of the Modescript Gamemodes for TM².
Visit the official website for more: UASECO.org


Developer of various plugins for XAseco/XAseco2 and MPAseco, visit my lab: www.undef.name

You like what I do? Then award a ManiaStar.
Locked

Return to “Maniaplanet Reports”

Who is online

Users browsing this forum: No registered users and 2 guests