Exemple #1
0
/*
==================
BotTeamplayReport
==================
*/
void BotTeamplayReport(void) {
	int i;
	char buf[MAX_INFO_STRING];

	BotAI_Print(PRT_MESSAGE, S_COLOR_RED"RED\n");
	for (i = 0; i < maxclients && i < MAX_CLIENTS; i++) {
		//
		if ( !botstates[i] || !botstates[i]->inuse ) continue;
		//
		trap_GetConfigstring(CS_PLAYERS+i, buf, sizeof(buf));
		//if no config string or no name
		if (!strlen(buf) || !strlen(Info_ValueForKey(buf, "n"))) continue;
		//skip spectators
		if (atoi(Info_ValueForKey(buf, "t")) == TEAM_RED) {
			BotReportStatus(botstates[i]);
		}
	}
	BotAI_Print(PRT_MESSAGE, S_COLOR_BLUE"BLUE\n");
	for (i = 0; i < maxclients && i < MAX_CLIENTS; i++) {
		//
		if ( !botstates[i] || !botstates[i]->inuse ) continue;
		//
		trap_GetConfigstring(CS_PLAYERS+i, buf, sizeof(buf));
		//if no config string or no name
		if (!strlen(buf) || !strlen(Info_ValueForKey(buf, "n"))) continue;
		//skip spectators
		if (atoi(Info_ValueForKey(buf, "t")) == TEAM_BLUE) {
			BotReportStatus(botstates[i]);
		}
	}
}
Exemple #2
0
/*
==================
Svcmd_BotTeamplayReport_f
==================
*/
void Svcmd_BotTeamplayReport_f(void) {
	int i;

	if (!bot_report.integer) {
		BotAI_Print(PRT_MESSAGE, "Must set bot_report 1 before using botreport command.\n");
		return;
	}

	if (gametype >= GT_TEAM) {
		BotAI_Print(PRT_MESSAGE, S_COLOR_RED"RED\n");
		for (i = 0; i < level.maxplayers; i++) {
			//
			if ( !botstates[i] || !botstates[i]->inuse ) continue;
			//
			if (BotTeam(botstates[i]) == TEAM_RED) {
				BotReportStatus(botstates[i]);
			}
		}
		BotAI_Print(PRT_MESSAGE, S_COLOR_BLUE"BLUE\n");
		for (i = 0; i < level.maxplayers; i++) {
			//
			if ( !botstates[i] || !botstates[i]->inuse ) continue;
			//
			if (BotTeam(botstates[i]) == TEAM_BLUE) {
				BotReportStatus(botstates[i]);
			}
		}
	}
	else {
		for (i = 0; i < level.maxplayers; i++) {
			//
			if ( !botstates[i] || !botstates[i]->inuse ) continue;
			//
			BotReportStatus(botstates[i]);
		}
	}
}