mirror of
https://github.com/ChocoTaco1/TacoServer.git
synced 2026-07-13 15:14:34 +00:00
Added TKwarn
Warn players of excessive tks Boot them when threshold is met
This commit is contained in:
parent
713d28a994
commit
cc815fc534
1 changed files with 39 additions and 0 deletions
39
Classic/scripts/autoexec/TKwarn.cs
Normal file
39
Classic/scripts/autoexec/TKwarn.cs
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
$Host::TKMax = 12;
|
||||||
|
$Host::TKWarn1 = 4;
|
||||||
|
$Host::TKWarn2 = 8;
|
||||||
|
|
||||||
|
package TKwarn
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
// From Evo
|
||||||
|
function DefaultGame::testTeamKill(%game, %victimID, %killerID)
|
||||||
|
{
|
||||||
|
%tk = Parent::testTeamKill(%game, %victimID, %killerID);
|
||||||
|
if(!%tk)
|
||||||
|
return false; // is not a tk
|
||||||
|
|
||||||
|
if($Host::TournamentMode || %killerID.isAdmin || %killerID.isAIcontrolled() || %victimID.isAIcontrolled())
|
||||||
|
return true;
|
||||||
|
|
||||||
|
// warn the player
|
||||||
|
if((%killerID.teamkills == $Host::TKWarn1 - 1) && $Host::TKWarn1 != 0)
|
||||||
|
centerprint(%killerID, "<font:Univers Condensed Bold:22><color:ff2222>You have teamkilled " @ %killerID.teamkills + 1 @ " players.\nCut it out!", 5, 3);
|
||||||
|
// warn the player of his imminent kick
|
||||||
|
else if((%killerID.teamkills == $Host::TKWarn2 - 1) && $Host::TKWarn2 != 0)
|
||||||
|
centerprint(%killerID, "<font:Univers Condensed Bold:22><color:ff2222>You have teamkilled " @ %killerID.teamkills + 1 @ " players.\nWith " @ $Host::TKMax @ " teamkills, you will be kicked.", 5, 3);
|
||||||
|
// kick the player
|
||||||
|
else if((%killerID.teamkills >= $Host::TKMax - 1) && $Host::TKMax != 0)
|
||||||
|
{
|
||||||
|
Game.kickClientName = %killerID.name;
|
||||||
|
kick(%killerID, false, %killerID.guid);
|
||||||
|
adminLog( %killerID, " was autokicked for too many teamkills." );
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
// Prevent package from being activated if it is already
|
||||||
|
if (!isActivePackage(TKwarn))
|
||||||
|
activatePackage(TKwarn);
|
||||||
Loading…
Add table
Add a link
Reference in a new issue