// ===============
// kick teamkiller
// ===============
-set g_kick_teamkiller_rate 0 "Limit for teamkills per minute before the client gets dropped."
-set g_kick_teamkiller_mintime 2 "Minimum playtime in minutes that is used for teamkill rate calculation"
+set g_kick_teamkiller_rate 0 "Limit for teamkills per minute before the client gets dropped. 0 means that the teamkillers don't get kicked automatically"
+set g_kick_teamkiller_lower_limit 5 "Minimum number of teamkills before the teamkill rate is considered"
float autocvar_g_kick_teamkiller_rate;
-float autocvar_g_kick_teamkiller_mintime;
+float autocvar_g_kick_teamkiller_lower_limit;
REGISTER_MUTATOR(kick_teamkiller, (autocvar_g_kick_teamkiller_rate > 0));
}
int teamkills = PlayerScore_Get(attacker, SP_TEAMKILLS);
- // don't use the players actual playtime if they just started playing
- // to avoid kicking players who only teamkilled by mistake just after joining
- float playtime_minutes = max((time - attacker.alivetime)/60.0, autocvar_g_kick_teamkiller_mintime);
- if (teamkills >= autocvar_g_kick_teamkiller_rate*playtime_minutes)
+ // use the players actual playtime
+ float playtime = time - attacker.alivetime;
+ // rate is in teamkills/minutes, playtime in seconds
+ if (teamkills >= autocvar_g_kick_teamkiller_lower_limit &&
+ teamkills >= autocvar_g_kick_teamkiller_rate*playtime/60.0)
{
Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_QUIT_KICK_TEAMKILL, attacker.netname);
dropclient(attacker);