set g_dynamic_handicap_scale 1 "The scale of the handicap. Larger values mean more penalties for strong players and more buffs for weak players."
set g_dynamic_handicap_min 0 "The minimum value of the handicap."
set g_dynamic_handicap_max 0 "The maximum value of the handicap."
+
+// ===============
+// kick teamkiller
+// ===============
+set g_kick_teamkiller_limit 0 "Limit for teamkills before the client gets dropped."
case "kd": return CTX(_("SCO^k/d"));
case "kdr": return CTX(_("SCO^kdr"));
case "kills": return CTX(_("SCO^kills"));
+ case "teamkills": return CTX(_("SC0^teamkills"));
case "laps": return CTX(_("SCO^laps"));
case "lives": return CTX(_("SCO^lives"));
case "losses": return CTX(_("SCO^losses"));
LOG_INFO(_("^3deaths^7 Number of deaths"));
LOG_INFO(_("^3suicides^7 Number of suicides"));
LOG_INFO(_("^3frags^7 kills - suicides"));
+ LOG_INFO(_("^3teamkills^7 Number of teamkills"));
LOG_INFO(_("^3kd^7 The kill-death ratio"));
LOG_INFO(_("^3dmg^7 The total damage done"));
LOG_INFO(_("^3dmgtaken^7 The total damage taken"));
" -teams,rc,cts,inv,lms/kills +ft,tdm/kills ?+rc,inv/kills" \
" -teams,lms/deaths +ft,tdm/deaths" \
" -teams,lms,rc,cts,inv,ka/suicides +ft,tdm/suicides ?+rc,inv/suicides" \
+" +teams/teamkills"\
" -cts,dm,tdm,ka,ft/frags" /* tdm already has this in "score" */ \
" -rc,cts,nb/dmg -rc,cts,nb/dmgtaken" \
" +ctf/caps +ctf/pickups +ctf/fckills +ctf/returns +ons/caps +ons/takes" \
#include <common/mutators/mutator/instagib/_mod.inc>
#include <common/mutators/mutator/invincibleproj/_mod.inc>
#include <common/mutators/mutator/itemstime/_mod.inc>
+#include <common/mutators/mutator/kick_teamkiller/_mod.inc>
#include <common/mutators/mutator/melee_only/_mod.inc>
#include <common/mutators/mutator/midair/_mod.inc>
#include <common/mutators/mutator/multijump/_mod.inc>
#include <common/mutators/mutator/instagib/_mod.qh>
#include <common/mutators/mutator/invincibleproj/_mod.qh>
#include <common/mutators/mutator/itemstime/_mod.qh>
+#include <common/mutators/mutator/kick_teamkiller/_mod.qh>
#include <common/mutators/mutator/melee_only/_mod.qh>
#include <common/mutators/mutator/midair/_mod.qh>
#include <common/mutators/mutator/multijump/_mod.qh>
--- /dev/null
+// generated file; do not modify
+#ifdef SVQC
+ #include <common/mutators/mutator/kick_teamkiller/sv_kick_teamkiller.qc>
+#endif
--- /dev/null
+// generated file; do not modify
--- /dev/null
+
+float autocvar_g_kick_teamkiller_limit;
+
+REGISTER_MUTATOR(kick_teamkiller, (autocvar_g_kick_teamkiller_limit > 0));
+
+MUTATOR_HOOKFUNCTION(kick_teamkiller, PlayerDies)
+{
+ if (!teamplay)
+ return;
+ entity attacker = M_ARGV(1, entity);
+ if (!IS_REAL_CLIENT(attacker))
+ {
+ return;
+ }
+
+ int teamkills = PlayerScore_Get(attacker, SP_TEAMKILLS);
+ if (teamkills >= autocvar_g_kick_teamkiller_limit)
+ {
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_QUIT_KICK_TEAMKILL, attacker.netname);
+ dropclient(attacker);
+ }
+}
MSG_INFO_NOTIF(QUIT_DISCONNECT, N_CHATCON, 1, 0, "s1", "", "", _("^BG%s^F3 disconnected"), "")
MSG_INFO_NOTIF(QUIT_KICK_IDLING, N_CHATCON, 1, 0, "s1", "", "", _("^BG%s^F3 was kicked for idling"), "")
MSG_INFO_NOTIF(QUIT_KICK_SPECTATING, N_CONSOLE, 0, 0, "", "", "", _("^F2You were kicked from the server because you are a spectator and spectators aren't allowed at the moment."), "")
+ MSG_INFO_NOTIF(QUIT_KICK_TEAMKILL, N_CHATCON, 1, 0, "s1", "", "", _("^BG%s^F3 was kicked for excessive teamkilling"), "")
MSG_INFO_NOTIF(QUIT_SPECTATE, N_CONSOLE, 1, 0, "s1", "", "", _("^BG%s^F3 is now spectating"), "")
MSG_INFO_NOTIF(RACE_ABANDONED, N_CONSOLE, 1, 0, "s1", "", "", _("^BG%s^BG has abandoned the race"), "")
REGISTER_SP(KILLS);
REGISTER_SP(DEATHS);
REGISTER_SP(SUICIDES);
+REGISTER_SP(TEAMKILLS);
REGISTER_SP(FRAGS);
REGISTER_SP(ELO);
else
{
// teamkill
- GameRules_scoring_add(attacker, KILLS, -1); // or maybe add a teamkills field?
+ GameRules_scoring_add(attacker, TEAMKILLS, 1);
}
}
else
PlayerStats_GameReport_AddTeam(t);
}
-float TeamScore_AddToTeam(float t, float scorefield, float score)
+float TeamScore_AddToTeam(int t, float scorefield, float score)
{
entity s;
* NEVER call this if team has not been set yet!
* Returns the new score.
*/
-float TeamScore_AddToTeam(float t, float scorefield, float score);
+float TeamScore_AddToTeam(int t, float scorefield, float score);
/**
* Returns a value indicating the team score (and higher is better).
ScoreInfo_SetLabel_PlayerScore(SP_DEATHS, "deaths", SFL_LOWER_IS_BETTER);
if (!INDEPENDENT_PLAYERS)
+ {
ScoreInfo_SetLabel_PlayerScore(SP_SUICIDES, "suicides", SFL_LOWER_IS_BETTER);
+ ScoreInfo_SetLabel_PlayerScore(SP_TEAMKILLS, "teamkills", SFL_LOWER_IS_BETTER);
+ }
if(score_enabled)
ScoreInfo_SetLabel_PlayerScore(SP_SCORE, "score", sprio);