try this havent tested fully as im at work atm.
Code:
/*
Blizzards Plugins Comply With GNU General Public License
TK Punish is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Under no circumstances are you allowed to redistribute and/or modify
it claming that you are the original author of such plugin/modification.
TK Punish is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include < amxmodx >
#include < amxmisc >
#include < fun >
#include < cstrike >
#pragma semicolon 1
#define PLUGIN "TK Punish"
#define VERSION "1.0"
#define AUTHOR "Blizzard"
new g_iTkCount[ 33 ];
new g_iTkTotal;
new g_sSlay[] = { "bo/slay" };
new g_sKick[] = { "bo/kick" };
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_event( "DeathMsg", "Event_DeathMsg", "a" );
g_iTkTotal = register_cvar( "amx_tk_total", "3" );
}
public plugin_precache()
{
precache_sound( g_sKick );
precache_sound( g_sSlay );
}
public client_connect( id ) g_iTkCount[ id ] = 0;
public Event_DeathMsg()
{
new iKiller = read_data( 1 );
new iVictim = read_data( 2 );
new TkTotal = get_pcvar_num( g_iTkTotal );
if( iVictim != iKiller )
{
if( cs_get_user_team( iKiller ) == cs_get_user_team( iVictim ) )
{
if( g_iTkCount[ iKiller ] >= TkTotal )
{
set_task( 5.0, "KickTKiller", iKiller );
client_cmd( 0, "spk %s", g_sKick );
}
else {
user_silentkill( iKiller );
client_cmd( 0, "spk %s", g_sSlay );
g_iTkCount[ iKiller ]++;
}
}
}
}
public KickTKiller( id )
{
server_cmd( "kick #%i ^"You Killed To Many Players On Your Team!^"", get_user_userid(id) );
}
__________________