All pastes #359624 Raw Edit

Someone

public text v1 · immutable
·published 2007-02-16 23:09 UTC
rendered paste body
public endvote() {
 	new string[256];
 	if(!IsPlayerConnected(current_vote)) {
  		for(new i;i<MAX_PLAYERS;i++) {
  			if(Level[i] >= CL_votekick) {
		  		SendClientMessage(i,COLOR_LIGHTBLUE,"The Votekick has been canceled. [Player left]");
 			}
		}
	}
	else if(current_yes + current_no <= 2) { // Need 3 players or more to vote
  		for(new i;i<MAX_PLAYERS;i++) {
			if(Level[i] >= CL_votekick) {
				SendClientMessage(i,COLOR_LIGHTBLUE,"Vote canceled! [Less than 3 Players voted]");
			}
		}
 	}
	else if(current_yes / (current_yes + current_no) > VOTEPERCENT / 100) {
		for(new i;i<MAX_PLAYERS;i++) {
			if(Level[i] >= CL_votekick) {
				format(string,256,"Vote Result: [%d] Yes - [%d] No",current_yes,current_no);
				SendClientMessage(i,COLOR_LIGHTBLUE,"Vote succeed - Player kicked.");
				SendClientMessage(i,COLOR_LIGHTBLUE,string);
  				Kick(current_vote);
			}
		}
	}
	else {
		for(new i;i<MAX_PLAYERS;i++) {
			if(Level[i] >= CL_votekick) {
				SendClientMessage(i,COLOR_LIGHTBLUE,"Vote canceled!");
			}
		}
	}
	current_vote = -1;
	current_no = 0;
	current_yes = 0;
	for(new i;i<MAX_PLAYERS;i++) {
 		player_voted[i] = 0;
	}
 	return 1;
}