Exemple #1
0
// Anti-Lag
int G_AntiLag_v(gentity_t *ent, unsigned int dwVoteIndex, char *arg, char *arg2, qboolean fRefereeCmd) {
	// Vote request (vote is being initiated)
	if (arg) {
		return G_voteProcessOnOff(ent, arg2, fRefereeCmd,
		                          !!(g_antilag.integer),
		                          vote_allow_antilag.integer,
		                          dwVoteIndex);

		// Vote action (vote has passed)
	}
	// Anti-Lag (g_antilag)
	G_voteSetOnOff("Anti-Lag", "g_antilag");

	return G_OK;
}
// *** Team Damage ***
int G_FriendlyFire_v( gentity_t *ent, unsigned int dwVoteIndex, char *arg, char *arg2, qboolean fRefereeCmd ) {
	// Vote request (vote is being initiated)
	if ( arg ) {
		return( G_voteProcessOnOff( ent, arg, arg2, fRefereeCmd,
									!!( g_friendlyFire.integer ),
									vote_allow_friendlyfire.integer,
									dwVoteIndex ) );

		// Vote action (vote has passed)
	} else {
		// Team damage (friendlyFire)
		G_voteSetOnOff( "Friendly Fire", "g_friendlyFire" );
	}

	return( G_OK );
}
// *** Mute Spectators ***
int G_Mutespecs_v( gentity_t *ent, unsigned int dwVoteIndex, char *arg, char *arg2, qboolean fRefereeCmd ) {
	// Vote request (vote is being initiated)
	if ( arg ) {
		return( G_voteProcessOnOff( ent, arg, arg2, fRefereeCmd,
									!!( match_mutespecs.integer ),
									vote_allow_mutespecs.integer,
									dwVoteIndex ) );

		// Vote action (vote has passed)
	} else {
		// Mute/unmute spectators
		G_voteSetOnOff( "Spectator Muting", "match_mutespecs" );
	}

	return( G_OK );
}
// Balanced Teams
int G_BalancedTeams_v( gentity_t *ent, unsigned int dwVoteIndex, char *arg, char *arg2, qboolean fRefereeCmd ) {
	// Vote request (vote is being initiated)
	if ( arg ) {
		return( G_voteProcessOnOff( ent, arg, arg2, fRefereeCmd,
									!!( g_balancedteams.integer ),
									vote_allow_balancedteams.integer,
									dwVoteIndex ) );
		// Vote action (vote has passed)
	} else {
		// Balanced Teams (g_balancedteams)
		G_voteSetOnOff( "Balanced Teams", "g_balancedteams" );
		trap_Cvar_Set( "g_teamForceBalance", level.voteInfo.vote_value );
		trap_Cvar_Set( "g_lms_teamForceBalance", level.voteInfo.vote_value );
	}

	return( G_OK );
}