TK Autovote EndMatch Restriction

This commit is contained in:
ChocoTaco 2022-04-15 15:44:44 -04:00
parent 56d366eee5
commit cbaf5818e5

View file

@ -14,7 +14,7 @@ function DefaultGame::testTeamKill(%game, %victimID, %killerID, %damageType)
return false; // is not a tk return false; // is not a tk
// No Bots // No Bots
//if(%killerID.isAIcontrolled() || %victimID.isAIcontrolled()) // if(%killerID.isAIcontrolled() || %victimID.isAIcontrolled())
// return true; // return true;
// Log TeamKill // Log TeamKill
@ -133,6 +133,34 @@ function TKvote(%typeName, %arg1, %arg2, %arg3, %arg4)
if($Host::TournamentMode) if($Host::TournamentMode)
return; return;
//Added for vote overtime
%curTimeLeftMS = ($Host::TimeLimit * 60 * 1000) + $missionStartTime - getSimTime();
if(%curTimeLeftMS <= 90000)
{
//log it
$tkvoteLog = formatTimeString("M-d") SPC formatTimeString("[hh:nn:a]") SPC "[Autovote Cancelled]" SPC %arg1.nameBase @ "(" @ %arg1.guid @ ")" SPC "Teamkill Autovote cancelled due insufficient time. #P[" @ $HostGamePlayerCount @ "]" SPC "CM[" @ $CurrentMission @ "]";
if($Host::ClassicTeamKillLog)
{
%logpath = $Host::ClassicTeamKillLogPath;
export("$tkvoteLog", %logpath, true);
logEcho($tkvoteLog);
}
echo($tkvoteLog);
return;
}
//notify any admins on the other team
for(%i = 0; %i < ClientGroup.getCount(); %i++)
{
%cl = ClientGroup.getObject(%i);
if (%cl.isAdmin == true)
{
if(%cl.team !$= %arg1.team) //Not on admins team
messageClient(%cl, '', '\c5[A]\c1%1 \c0Teamkill Autovote started to kick %2.~wgui/objective_notification.wav', "Vote in Progress:", %arg1.nameBase);
}
}
echo(formatTimeString("M-d") SPC formatTimeString("[hh:nn:a]") SPC "Teamkill Autovote started for..." SPC %arg1.nameBase @ "(" @ %arg1.guid @ ")" SPC "#P[" @ $HostGamePlayerCount @ "]" SPC "CM[" @ $CurrentMission @ "]");
// a vote is already running, cancel it // a vote is already running, cancel it
if(Game.scheduleVote !$= "") if(Game.scheduleVote !$= "")
stopCurrentVote(); stopCurrentVote();