mirror of
https://github.com/ChocoTaco1/TacoServer.git
synced 2026-03-03 11:50:20 +00:00
Corrected file structure
This commit is contained in:
parent
2fe441f421
commit
2097008ccb
30 changed files with 6 additions and 1700 deletions
88
Classic/scripts/autoexec/VoteOverTime.cs
Normal file
88
Classic/scripts/autoexec/VoteOverTime.cs
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
//Changes were also made in the Evo Admin.ovl and DefaultGame.ovl
|
||||
//DefaultGame::voteChangeMission, DefaultGame::voteChangeTimeLimit, serverCmdStartNewVote
|
||||
|
||||
package VoteOverTime {
|
||||
|
||||
function DefaultGame::checkTimeLimit(%game, %forced)
|
||||
{
|
||||
// Don't add extra checks:
|
||||
if ( %forced )
|
||||
cancel( %game.timeCheck );
|
||||
|
||||
// if there is no time limit, check back in a minute to see if it's been set
|
||||
if(($Host::TimeLimit $= "") || $Host::TimeLimit == 0)
|
||||
{
|
||||
%game.timeCheck = %game.schedule(20000, "checkTimeLimit");
|
||||
return;
|
||||
}
|
||||
|
||||
%curTimeLeftMS = ($Host::TimeLimit * 60 * 1000) + $missionStartTime - getSimTime();
|
||||
|
||||
if (%curTimeLeftMS <= 0)
|
||||
{
|
||||
//Vote Overtime
|
||||
//Check if Vote is active or if the timelimit has changed.
|
||||
if( !$VoteInProgress && !$TimeLimitChanged ) {
|
||||
// time's up, put down your pencils
|
||||
%game.timeLimitReached();
|
||||
|
||||
//Reset Everything to do with Vote Overtime
|
||||
//Moved to function DefaultGame::gameOver in DefaultGame.ovl in evo
|
||||
}
|
||||
else if( $missionRunning && $VoteInProgress && !$TimeLimitChanged ) {
|
||||
//Restart the function so the map can end if the Vote doesnt pass.
|
||||
schedule(2000, 0, "RestartcheckTimeLimit", %game, %forced);
|
||||
|
||||
//Messege
|
||||
if( !$VoteInProgressMessege ) {
|
||||
messageAll('', '\c2Vote Overtime Initiated.~wfx/powered/turret_heavy_activate.wav', %display);
|
||||
$VoteInProgressMessege = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(%curTimeLeftMS >= 20000)
|
||||
%game.timeCheck = %game.schedule(20000, "checkTimeLimit");
|
||||
else
|
||||
%game.timeCheck = %game.schedule(%curTimeLeftMS + 1, "checkTimeLimit");
|
||||
|
||||
//now synchronize everyone's clock
|
||||
messageAll('MsgSystemClock', "", $Host::TimeLimit, %curTimeLeftMS);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
function RestartcheckTimeLimit(%game, %forced)
|
||||
{
|
||||
%game.checkTimeLimit(%game, %forced);
|
||||
}
|
||||
|
||||
function StartVOTimeVote(%game)
|
||||
{
|
||||
$VoteSoundInProgress = true;
|
||||
$VoteInProgress = true;
|
||||
$TimeLimitChanged = false;
|
||||
}
|
||||
|
||||
function ResetVOTimeChanged(%game)
|
||||
{
|
||||
$VoteInProgress = false;
|
||||
$TimeLimitChanged = true;
|
||||
$VoteInProgressMessege = false;
|
||||
$VoteSoundInProgress = false;
|
||||
}
|
||||
|
||||
function ResetVOall(%game)
|
||||
{
|
||||
$VoteInProgress = false;
|
||||
$TimeLimitChanged = false;
|
||||
$VoteInProgressMessege = false;
|
||||
$VoteSoundInProgress = false;
|
||||
}
|
||||
|
||||
|
||||
// Prevent package from being activated if it is already
|
||||
if (!isActivePackage(VoteOverTime))
|
||||
activatePackage(VoteOverTime);
|
||||
Loading…
Add table
Add a link
Reference in a new issue