Exemple #1
0
// *** Start Match ***
int G_StartMatch_v(gentity_t *ent, unsigned int dwVoteIndex, char *arg, char *arg2, qboolean fRefereeCmd)
{
	// Vote request (vote is being initiated)
	if(arg) {
		if(trap_Argc() > 2) {
			if(!Q_stricmp(arg2, "?")) {
				G_refPrintf(ent, "Usage: ^3%s %s%s\n", ((fRefereeCmd) ? "\\ref" : "\\callvote"), arg, aVoteInfo[dwVoteIndex].pszVoteHelp);
				return(G_INVALID);
			}
		}

		if(g_gamestate.integer == GS_PLAYING || g_gamestate.integer == GS_INTERMISSION) {
			G_refPrintf(ent, "^3Match is already in progress!");
			return(G_INVALID);
		}

		if(g_gamestate.integer == GS_WARMUP_COUNTDOWN) {
			G_refPrintf(ent, "^3Countdown already started!");
			return(G_INVALID);
		}

		if(level.numPlayingClients < match_minplayers.integer) {
			G_refPrintf(ent, "^3Not enough players to start match!");
			return(G_INVALID);
		}

	// Vote action (vote has passed)
	} else {
		// Set everyone to "ready" status
		G_refAllReady_cmd(NULL);
	}

	return(G_OK);
}
Exemple #2
0
// Parses for a referee command.
//	--> ref arg allows for the server console to utilize all referee commands (ent == NULL)
//
qboolean G_refCommandCheck(gentity_t *ent, char *cmd)
{
		 if(!Q_stricmp(cmd, "allready"))	G_refAllReady_cmd(ent);
	else if(!Q_stricmp(cmd, "lock"))		G_refLockTeams_cmd(ent, qtrue);
	else if(!Q_stricmp(cmd, "help"))		G_refHelp_cmd(ent);
	else if(!Q_stricmp(cmd, "pause"))		G_refPause_cmd(ent, qtrue);
	else if(!Q_stricmp(cmd, "putallies"))	G_refPlayerPut_cmd(ent, TEAM_ALLIES);
	else if(!Q_stricmp(cmd, "putaxis"))		G_refPlayerPut_cmd(ent, TEAM_AXIS);
	else if(!Q_stricmp(cmd, "remove"))		G_refRemove_cmd(ent);
	else if(!Q_stricmp(cmd, "speclock"))	G_refSpeclockTeams_cmd(ent, qtrue);
	else if(!Q_stricmp(cmd, "specunlock"))	G_refSpeclockTeams_cmd(ent, qfalse);
	else if(!Q_stricmp(cmd, "unlock"))		G_refLockTeams_cmd(ent, qfalse);
	else if(!Q_stricmp(cmd, "unpause"))		G_refPause_cmd(ent, qfalse);
	else if(!Q_stricmp(cmd, "warmup"))		G_refWarmup_cmd(ent);
	else if(!Q_stricmp(cmd, "warn"))		G_refWarning_cmd(ent);
	// yada - handled by the vote functions now
	//else if(!Q_stricmp(cmd, "mute"))		G_refMute_cmd(ent, qtrue); 
	//else if(!Q_stricmp(cmd, "unmute"))		G_refMute_cmd(ent, qfalse);

	// pheno
	else if( !Q_stricmp( cmd, "makeshoutcaster" ) )
		G_refMakeShoutcaster_cmd( ent );
	else if( !Q_stricmp( cmd, "removeshoutcaster" ) )
		G_refRemoveShoutcaster_cmd( ent );
	else if( !Q_stricmp( cmd, "logout" ) )
		G_refLogout_cmd( ent );

	else return(qfalse);

	return(qtrue);
}
Exemple #3
0
/*
============
Svcmd_StartMatch_f

NERVE - SMF - starts match if in tournament mode
============
*/
void Svcmd_StartMatch_f(void)
{
/*	if ( !g_noTeamSwitching.integer ) {
		trap_SendServerCommand( -1, va("print \"g_noTeamSwitching not activated.\n\""));
		return;
	}
*/

	G_refAllReady_cmd(NULL);

/*
	if ( level.numPlayingClients <= 1 ) {
		trap_SendServerCommand( -1, va("print \"Not enough playing clients to start match.\n\""));
		return;
	}

	if ( g_gamestate.integer == GS_PLAYING ) {
		trap_SendServerCommand( -1, va("print \"Match is already in progress.\n\""));
		return;
	}

	if ( g_gamestate.integer == GS_WARMUP ) {
		trap_SendConsoleCommand( EXEC_APPEND, va( "map_restart 0 %i\n", GS_PLAYING ) );
	}
*/
}
Exemple #4
0
// Parses for a referee command.
//	--> ref arg allows for the server console to utilize all referee commands (ent == NULL)
//
qboolean G_refCommandCheck(gentity_t *ent, char *cmd)
{
		 if(!Q_stricmp(cmd, "allready"))	G_refAllReady_cmd(ent);
	else if(!Q_stricmp(cmd, "lock"))		G_refLockTeams_cmd(ent, qtrue);
	else if(!Q_stricmp(cmd, "help"))		G_refHelp_cmd(ent);
	else if(!Q_stricmp(cmd, "pause"))		G_refPause_cmd(ent, qtrue);
	else if(!Q_stricmp(cmd, "putallies"))	G_refPlayerPut_cmd(ent, TEAM_ALLIES);
	else if(!Q_stricmp(cmd, "putaxis"))		G_refPlayerPut_cmd(ent, TEAM_AXIS);
	else if(!Q_stricmp(cmd, "remove"))		G_refRemove_cmd(ent);
	else if(!Q_stricmp(cmd, "speclock"))	G_refSpeclockTeams_cmd(ent, qtrue);
	else if(!Q_stricmp(cmd, "specunlock"))	G_refSpeclockTeams_cmd(ent, qfalse);
	else if(!Q_stricmp(cmd, "unlock"))		G_refLockTeams_cmd(ent, qfalse);
	else if(!Q_stricmp(cmd, "unpause"))		G_refPause_cmd(ent, qfalse);
	else if(!Q_stricmp(cmd, "warmup"))		G_refWarmup_cmd(ent);
	else if(!Q_stricmp(cmd, "warn"))		G_refWarning_cmd(ent);
	else if(!Q_stricmp(cmd, "mute"))		G_refMute_cmd(ent, qtrue);
	else if(!Q_stricmp(cmd, "unmute"))		G_refMute_cmd(ent, qfalse);
	else return(qfalse);

	return(qtrue);
}