void antilag( ) { int votes; if ( match_in_progress ) { G_sprint(self, 2, "%s mode %s\n", redtext("Antilag"), OnOff(2 == cvar("sv_antilag"))); return; } // admin may turn this status alone on server... if ( !is_adm( self ) ) { // Dont need to bother if less than 2 players if ( CountPlayers() < 2 ) { G_sprint(self, 2, "You need at least 2 players to do this.\n"); return; } } self->v.antilag = !self->v.antilag; G_bprint(2, "%s %s!%s\n", self->s.v.netname, (self->v.antilag ? redtext(va("votes for antilag %s", OnOff(!(2 == cvar("sv_antilag"))))) : redtext(va("withdraws %s antilag vote", g_his(self)))), ((votes = get_votes_req( OV_ANTILAG, true )) ? va(" (%d)", votes) : "")); vote_check_antilag (); }
void VoteYes() { int votes; if( !get_votes( OV_ELECT ) ) return; if( self->v.elect_type != etNone ) { G_sprint(self, 2, "You cannot vote for yourself\n"); return; } if( self->v.elect ) { G_sprint(self, 2, "--- your vote is still good ---\n"); return; } // register the vote self->v.elect = 1; G_bprint(2, "%s gives %s vote\n", self->s.v.netname, g_his( self )); // calculate how many more votes are needed if ( (votes = get_votes_req( OV_ELECT, true )) ) G_bprint(2, "\x90%d\x91 more vote%s needed\n", votes, count_s( votes )); vote_check_elect (); }
void nospecs( ) { int votes; if ( match_in_progress ) { G_sprint(self, 2, "%s mode %s\n", redtext("No spectators"), OnOff(cvar("_k_nospecs"))); return; } // admin may turn this status alone on server... if ( !is_adm( self ) ) { // Dont need to bother if less than 2 players if ( CountPlayers() < 2 ) { G_sprint(self, 2, "You need at least 2 players to do this.\n"); return; } } self->v.nospecs = !self->v.nospecs; G_bprint(2, "%s %s!%s\n", self->s.v.netname, (self->v.nospecs ? redtext(va("votes for nospecs %s", OnOff(!cvar("_k_nospecs")))) : redtext(va("withdraws %s nospecs vote", g_his(self)))), ((votes = get_votes_req( OV_NOSPECS, true )) ? va(" (%d)", votes) : "")); vote_check_nospecs (); }
void teamoverlay( ) { int votes; if ( match_in_progress ) { G_sprint(self, 2, "%s %s\n", redtext("Teamoverlay"), OnOff(cvar("k_teamoverlay"))); return; } // admin may turn this status alone on server... if ( !is_adm( self ) ) { // Dont need to bother if less than 2 players if ( CountPlayers() < 2 ) { G_sprint(self, 2, "You need at least 2 players to do this.\n"); return; } } self->v.teamoverlay = !self->v.teamoverlay; G_bprint(2, "%s %s!%s\n", self->netname, (self->v.teamoverlay ? redtext(va("votes for teamoverlay %s", OnOff(!cvar("k_teamoverlay")))) : redtext(va("withdraws %s teamoverlay vote", g_his(self)))), ((votes = get_votes_req( OV_TEAMOVERLAY, true )) ? va(" (%d)", votes) : "")); vote_check_teamoverlay (); }
void VoteNo() { int votes; // withdraw one's vote if( !get_votes( OV_ELECT ) || self->v.elect_type != etNone || !self->v.elect ) return; // unregister the vote self->v.elect = 0; G_bprint(2, "%s withdraws %s vote\n", self->s.v.netname, g_his( self )); // calculate how many more votes are needed if ( (votes = get_votes_req( OV_ELECT, true )) ) G_bprint(2, "\x90%d\x91 more vote%s needed\n", votes, count_s( votes )); vote_check_elect (); }
void votecoop( ) { int votes; if ( deathmatch && match_in_progress ) { G_sprint(self, 2, "Match in progress and deathmatch is non zero, you can't vote for coop\n"); return; } self->v.coop = !self->v.coop; G_bprint(2, "%s %s!%s\n", self->s.v.netname, (self->v.coop ? redtext(va("votes for coop %s", OnOff(!cvar("coop")))) : redtext(va("withdraws %s coop vote", g_his(self)))), ((votes = get_votes_req( OV_COOP, true )) ? va(" (%d)", votes) : "")); vote_check_coop (); }