mirror of
https://github.com/ChocoTaco1/TacoServer.git
synced 2026-01-20 00:24:49 +00:00
TK Autovote EndMatch Restriction
This commit is contained in:
parent
56d366eee5
commit
cbaf5818e5
|
|
@ -133,6 +133,34 @@ function TKvote(%typeName, %arg1, %arg2, %arg3, %arg4)
|
|||
if($Host::TournamentMode)
|
||||
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
|
||||
if(Game.scheduleVote !$= "")
|
||||
stopCurrentVote();
|
||||
|
|
|
|||
Loading…
Reference in a new issue