This wiki is archived and useful information is being migrated to the main bzflag.org website

Difference between revisions of "Bz getReports"

From BZFlagWiki
Jump to: navigation, search
(Create API Function Page. Include Example.)
 
m (doe -> does)
 
Line 3: Line 3:
 
| returns      = A [[bz_APIStringList]] data type containing all the reports available on the server.
 
| returns      = A [[bz_APIStringList]] data type containing all the reports available on the server.
 
| returntype    = bz_APIStringList*
 
| returntype    = bz_APIStringList*
| description  = Retrieves reports made by other players in the same format as the '''/viewreports''' command doe
+
| description  = Retrieves reports made by other players in the same format as the '''/viewreports''' command does
 
}}
 
}}
  

Latest revision as of 09:06, 19 October 2011

bz_APIStringList* bz_getReports ()


Retrieves reports made by other players in the same format as the /viewreports command does

Returns:
A bz_APIStringList data type containing all the reports available on the server.


Example[edit]

Shows all reports to any administrators that join the game as if they typed /viewreports.

case bz_ePlayerJoinEvent: {
	if (bz_getAdmin(((bz_PlayerJoinPartEventData_V1*)eventData)->playerID)) {
		for (int i=0;i<bz_getReports()->size();i++) {
			bz_sendTextMessagef(BZ_SERVER,
				((bz_PlayerJoinPartEventData_V1*)eventData)->playerID,"%s",bz_getReports()->get(i).c_str());
		}
	}
}break;