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

bz_getReports

From BZFlagWiki
Revision as of 08:49, 19 October 2011 by Sigonasr2 (Talk | contribs) (Create API Function Page. Include Example.)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

bz_APIStringList* bz_getReports ()


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

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


Example

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;