<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.bzflag.org/index.php?action=history&amp;feed=atom&amp;title=Bz_gameOver</id>
	<title>Bz gameOver - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.bzflag.org/index.php?action=history&amp;feed=atom&amp;title=Bz_gameOver"/>
	<link rel="alternate" type="text/html" href="https://wiki.bzflag.org/index.php?title=Bz_gameOver&amp;action=history"/>
	<updated>2026-04-06T14:24:26Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://wiki.bzflag.org/index.php?title=Bz_gameOver&amp;diff=8038&amp;oldid=prev</id>
		<title>Sigonasr2: Create API Function Page. Include Example.</title>
		<link rel="alternate" type="text/html" href="https://wiki.bzflag.org/index.php?title=Bz_gameOver&amp;diff=8038&amp;oldid=prev"/>
		<updated>2011-10-19T05:12:38Z</updated>

		<summary type="html">&lt;p&gt;Create API Function Page. Include Example.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{apicall&lt;br /&gt;
| name        = bz_gameOver()&lt;br /&gt;
| description = Creates a Game Over, announcing the players and/or team(s) specified as the winner.&lt;br /&gt;
| param1      = playerID&lt;br /&gt;
| param1type  = int&lt;br /&gt;
| param1desc  = The player ID for the player that won the game.&lt;br /&gt;
| param2      = team&lt;br /&gt;
| param2type  = [[bz_eTeamType]]&lt;br /&gt;
| param2desc  = The team that wins the game, regardless of the player ID. By default this value is 0, which makes the team of the player &amp;#039;&amp;#039;&amp;#039;playerID&amp;#039;&amp;#039;&amp;#039; was specified for as the winner. If set to a [[bz_eTeamType]] type, it will announce that the specified color team won even if the player specified by playerID is on a different team.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
This will pick a random player currently playing and say that they won the game.&lt;br /&gt;
 bz_APIIntList *playerList = bz_newIntList();&lt;br /&gt;
 bool picked=false;&lt;br /&gt;
 bz_getPlayerIndexList(playerList);&lt;br /&gt;
  &lt;br /&gt;
 while ( !picked &amp;amp;&amp;amp; (bz_getTeamCount(eRogueTeam)+&lt;br /&gt;
 bz_getTeamCount(eRedTeam)+&lt;br /&gt;
 bz_getTeamCount(eGreenTeam)+&lt;br /&gt;
 bz_getTeamCount(eBlueTeam)+&lt;br /&gt;
 bz_getTeamCount(ePurpleTeam)+&lt;br /&gt;
 bz_getTeamCount(eHunterTeam)+&lt;br /&gt;
 bz_getTeamCount(eRabbitTeam))) {&lt;br /&gt;
 	 for (int i=0;i&amp;lt;playerList-&amp;gt;size();i++) {&lt;br /&gt;
 		if (((rand()%playerList-&amp;gt;size())==0) &amp;amp;&amp;amp; bz_getPlayerTeam(i)!=eObservers) {&lt;br /&gt;
 			bz_gameOver(i);&lt;br /&gt;
 			picked=true;&lt;br /&gt;
 			break;&lt;br /&gt;
 		}&lt;br /&gt;
 	}&lt;br /&gt;
 }&lt;br /&gt;
 bz_deleteIntList(playerList);&lt;/div&gt;</summary>
		<author><name>Sigonasr2</name></author>
	</entry>
</feed>