Example #1
0
static void G_BotListTeamNames( gentity_t *ent, const char *heading, team_t team, const char *marker )
{
	int i;

	if ( botNames[team].count )
	{
		ADMP( heading );
		ADMBP_begin();

		for ( i = 0; i < botNames[team].count; ++i )
		{
			ADMBP( va( "  %s^7 %s", botNames[team].name[i].inUse ? marker : " ", botNames[team].name[i].name ) );
		}

		ADMBP_end();
	}
}
Example #2
0
/*
===============
G_PrintCurrentRotation

Print the current rotation to an entity
===============
*/
void G_PrintCurrentRotation( gentity_t *ent )
{
	int           mapRotationIndex = g_currentMapRotation.integer;
	mapRotation_t *mapRotation = G_MapRotationActive() ? &mapRotations.rotations[ mapRotationIndex ] : NULL;
	int           i = 0;
	char          currentMapName[ MAX_QPATH ];
	node_t        *node;

	if ( mapRotation == NULL )
	{
		trap_SendServerCommand( ent - g_entities, "print \"^3listrotation^3: ^7there is no active map rotation on this server\n\"" );
		return;
	}

	if ( mapRotation->numNodes == 0 )
	{
		trap_SendServerCommand( ent - g_entities, "print \"^3listrotation^3: ^7there are no maps in the active map rotation\n\"" );
		return;
	}

	trap_Cvar_VariableStringBuffer( "mapname", currentMapName, sizeof( currentMapName ) );

	ADMBP_begin();
	ADMBP( va( "%s:\n", mapRotation->name ) );

	while ( ( node = mapRotation->nodes[ i++ ] ) )
	{
		int  colour = 7;
		char *prefix;
		char *suffix = "";

		switch ( node->type )
		{
			case NT_RETURN:
				prefix = "return";
				break;

			case NT_LABEL:
				prefix = "label: ";
				break;

			case NT_GOTO:
				prefix = "goto: ";
				break;

			case NT_RESUME:
				prefix = "resume: ";
				break;

			default:
				prefix = "";
				break;
		}

		if ( node->type == NT_MAP && !G_MapExists( node->u.map.name ) )
		{
			colour = 1;
		}
		else if ( G_NodeIndexAfter( i - 1, mapRotationIndex ) == G_CurrentNodeIndex( mapRotationIndex ) )
		{
			colour = 3;

			if ( node->type == NT_MAP && Q_stricmp( node->u.map.name, currentMapName ) )
			{
				suffix = va( " (%s)", currentMapName );
			}
		}

		ADMBP(
		  va( " ^%i%3i %s%s%s\n",
		      colour,
		      i,
		      prefix,
		      node->type == NT_MAP ? node->u.map.name : node->u.label.name,
		      suffix ) );
	}

	if ( G_MapExists( g_nextMap.string ) )
	{
		ADMBP( va( "^7The next map has been set to %s\n", g_nextMap.string ) );
	}

	ADMBP_end();
}