Its a release, but its untested and i'm not sure if it works. You can edit it if you want to, just keep my name in the load message 
It was made for mw2 and worked afaik, i just modified it for mw3.
You can start a vote for any player with any reason.
60% has to vote for to kick the player and if you don't vote you automaticly vote against.
you can change the votetime and the cooldown time in your sv_config.ini:

It was made for mw2 and worked afaik, i just modified it for mw3.
You can start a vote for any player with any reason.
60% has to vote for to kick the player and if you don't vote you automaticly vote against.
you can change the votetime and the cooldown time in your sv_config.ini:
Code:
[VOTEKICK]
cooldown=30
votetime=15Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Addon;
namespace mw3_votekick
{
public class VoteKick : CPlugin
{
Vote vote;
int Interval;
int VoteTime;
public override void OnServerFrame()
{
if ( Interval > 0 )
Interval--;
if ( VoteTime > 0 )
{
VoteTime--;
if ( VoteTime == 0 && vote.InProgress )
{
if ( vote.Agree.Count / GetClients().Count * 100 >= 60 )
{
ServerCommand( "clientkick " + vote.Client.ClientNum );
ServerSay( "^3Player " + vote.Client.Name + " got kicked" + vote.Reason, true );
}
else
ServerSay( "^3Not enough players agree to kick " + vote.Client.Name, true );
VoteTime = 0;
vote.Client = null;
vote.Agree.Clear();
vote.InProgress = false;
}
}
}
public override void OnServerLoad()
{
ServerPrint( "VoteKick plugin loaded. Author: iAegle. Version 1.2" );
}
public override ChatType OnSay( string Message, ServerClient Client )
{
string lowMsg = Message.ToLower();
if ( lowMsg.StartsWith( "!votekick" ) )
{
if ( Interval > 0 )
{
TellClient( Client.ClientNum, "^3You can start a vote now! wait " + Interval + " seconds.", true );
return ChatType.ChatContinue;
}
if ( lowMsg.Length <= 10 )
TellClient( Client.ClientNum, "^3Usage: !votekick [Player Name]", true );
else if ( vote.InProgress )
TellClient( Client.ClientNum, "^3There's already a vote in progress!", true );
else
{
string player = Message.Substring( 10 ).Split( ' ' )[0];
string reason = ( Message.Substring( 10 ).Split( ' ' )[1] != null
|| Message.Substring( 10 ).Split( ' ' )[1] != "" ) ? " for " + Message.Substring( 10 ).Split( ' ' )[1] : "";
ServerClient KickClient = GetClientByName( player );
ServerSay( "^3" + Client.Name + " wants to kick " + KickClient.Name + " for " + reason +
". Please vote: ^2Y^3es or ^1N^3o", true );
vote.Client = KickClient;
vote.Agree = new List<ServerClient>();
vote.Agree.Add( Client );
vote.InProgress = true;
vote.Reason = reason;
VoteTime = Convert.ToInt32( GetServerCFG( "VOTEKICK", "votetime", "15" ) ) * 50;
Interval = Convert.ToInt32( GetServerCFG( "VOTEKICK", "cooldown", "30" ) ) * 50 + VoteTime;
}
return ChatType.ChatContinue;
}
else if ( lowMsg.StartsWith( "!currentvote" ) )
{
if ( !vote.InProgress )
{
TellClient( Client.ClientNum, "^3There is currently no vote in progress.", true );
return ChatType.ChatContinue;
}
string s = "^3Kick: " + vote.Client.Name + "\r\n";
s += ( vote.Agree.Count / GetClients().Count * 100 ).ToString() + "% of the players agree";
TellClient( Client.ClientNum, s, true );
return ChatType.ChatContinue;
}
else if ( lowMsg.StartsWith( "!vote" ) )
{
if ( !vote.InProgress )
{
TellClient( Client.ClientNum, "^3There is currently no vote in progress.", true );
return ChatType.ChatContinue;
}
if ( lowMsg.Length <= 6 )
TellClient( Client.ClientNum, "^3Usage: !vote [Yes/No]", true );
else if ( ( lowMsg.Substring( 6 ) == "y" || lowMsg.Substring( 6 ) == "yes" ) && !vote.Agree.Contains( Client ) )
{
vote.Agree.Add( Client );
TellClient( Client.ClientNum, "^3You agreed with kicking " + vote.Client.Name, true );
}
else if ( ( lowMsg.Substring( 6 ) == "n" || lowMsg.Substring( 6 ) == "no" ) && vote.Agree.Contains( Client ) )
{
vote.Agree.Add( Client );
TellClient( Client.ClientNum, "^3You voted against kicking " + vote.Client.Name, true );
}
else
TellClient( Client.ClientNum, "^3Invalid argument \"" + lowMsg.Substring( 6 ) + "\"", true );
return ChatType.ChatContinue;
}
return ChatType.ChatContinue;
}
public ServerClient GetClientByName( string name ) // thanks to pozzuh
{
if ( name == null || name == "" )
return null;
ServerClient Client = null;
for ( int i = 0 ; i < Convert.ToInt32( GetDvar( "sv_maxclients" ) ) ; i++ )
{
Client = GetClient( i );
if ( Client == null )
continue;
if ( Client.Name.StartsWith( name, StringComparison.InvariantCultureIgnoreCase ) )
return Client;
else if ( Client.Name.ToLower().Contains( name.ToLower() ) )
return Client;
}
return null;
}
public struct Vote
{
public bool InProgress;
public string Reason;
public ServerClient Client;
public List<ServerClient> Agree;
}
}
}(08-10-2011, 12:58)Pozzuh Wrote:Se7en Wrote:Stealed, from cod4 mod ...look who's talking
[Release] Old School Mod v2.2
[Release] Scroll menu



![[Image: lQDUjba.jpg]](http://i.imgur.com/lQDUjba.jpg)
