This wiki is archived and useful information is being migrated to the main bzflag.org website
bz_startCountdown
From BZFlagWiki
Revision as of 09:43, 19 October 2011 by Sigonasr2 (Talk | contribs) (Create API Function Page. Include Example.)
void bz_startCountdown (int delay, float limit, const char* byWho)
Begins the starting countdown process as if a player were to type /countdown.
Parameters:
delay - How many seconds to countdown before the real countdown timer for the match starts.
limit - How many seconds to set the countdown timer to? (Basically, setting the match length.)
byWho - The name of the player starting the countdown. Note that the name displayed does not have to be a player in the server, it can be any string.
Example
Once 4 players have joined, the countdown will automatically begin by SERVER using the default time limit set by the server with a 10 second starting delay.
case bz_ePlayerJoinEvent: { if (bz_getTeamCount(eBlueTeam)+ bz_getTeamCount(eRedTeam)+ bz_getTeamCount(eRogueTeam)+ bz_getTeamCount(eGreenTeam)+ bz_getTeamCount(ePurpleTeam)>=4 && (!bz_isCountDownActive() || !bz_isCountDownInProgress)) { bz_sendTextMessage(BZ_SERVER,BZ_ALLUSERS,"Enough players have joined, starting countdown."); bz_startCountdown(10,bz_getTimeLimit(),"SERVER"); } }break;