Beispiel #1
0
void _ConfigWithMostVotes (void)
{
	char buf[1024], sbuf[512];

	if (_ConfigMostVotesStr (sbuf))
	{
		sprintf (buf, "Most wanted config: %s\n", sbuf);
		gi.bprintf (PRINT_HIGH, strtostr2 (buf));
	}
}
Beispiel #2
0
void _MapWithMostVotes (void)
{
	char buf[1024], sbuf[512];

	if (_MostVotesStr (sbuf))
	{
		sprintf (buf, "Most wanted map: %s\n", sbuf);
		gi.bprintf (PRINT_HIGH, strtostr2 (buf));
	}
}
Beispiel #3
0
void _CheckScrambleVote (void)
{
	int i, numvotes, playernum, team;
	float votes;
	edict_t *ent, *other;
	char buf[128];

	_CalcScrambleVotes(&playernum, &numvotes, &votes);

	if (numvotes > 0)
	{
		sprintf (buf, "Scramble: %d votes (%.1f%%), need %.1f%%\n", numvotes, votes, scramblevote_pass->value);
		gi.bprintf (PRINT_HIGH, strtostr2 (buf));
	}

	if (playernum < scramblevote_min->value)
		return;
	if (numvotes < scramblevote_need->value)
		return;
	if (votes < scramblevote_pass->value)
		return;

	MakeAllLivePlayersObservers ();

	for (i = 1; i <= game.maxclients; i++)
	{
		ent = &g_edicts[i];
		if (ent->client && ent->inuse && ent->client->resp.team != NOTEAM)
		{
			other = _RandomTeamPlayer();
			if(other != NULL && rand() % 2) {
				team = other->client->resp.team;
				other->client->resp.team = ent->client->resp.team;
				ent->client->resp.team = team;
				ent->client->resp.scramblevote = false;
			}
		}
	}

	CenterPrintAll("The teams have been scrambled!");
}