bz_getCountdownRemaining

From BZFlagWiki
Jump to: navigation, search

float bz_getCountdownRemaining ()


Retrieves the time remaining in a running countdown.

Returns:
The amount of time remaining in a match in seconds, or -1 if a match is not currently in progress.


Example

Display the remaining time to a user upon joining.

case bz_ePlayerJoinEvent: {
	int player = (bz_PlayerJoinPartEventData_V1*)eventData)->playerID;
	if (bz_isCountDownActive()) {
	 	bz_sendTextMessagef(BZ_SERVER, player,
	 		"Welcome! The current match will finish in %.0f seconds!", bz_getCountdownRemaining());
	} else {
	 	bz_sendTextMessage(BZ_SERVER, player,
	 		"Welcome! No match is currently running.");
	}
}break;