MissionType/PUGpassword changes

This commit is contained in:
ChocoTaco 2019-02-24 05:03:49 -05:00
parent 2ec4150949
commit 33b20f0664
6 changed files with 47 additions and 67 deletions

View file

@ -32,8 +32,8 @@ if (!isActivePackage(StartTeamCounts))
function GetTeamCounts( %game, %client, %respawn )
{
//Check pug password
CheckPUGpassword();
//Run MissionTypeOptions
MissionTypeOptions();
//Get teamcounts
if( $GetCountsClientTeamChange && $countdownStarted && $MatchStarted )

View file

@ -0,0 +1,44 @@
// To manage options in certain missiontypes
// called in Getcounts.csk
// Variables
// Add these to ServerPrefs
//
// Turn on Auto Password in Tournament mode
// $Host::PUGautoPassword = 1;
// The PUG password you want
// $Host::PUGPassword = "pickup";
//
function MissionTypeOptions()
{
//Only run before mission start and countdown start
if( !$MatchStarted && !$countdownStarted )
{
if( $CurrentMissionType !$= "LakRabbit" )
{
if( $Host::TournamentMode && $Host::PUGautoPassword )
$Host::Password = $Host::PUGPassword;
else if( !$Host::TournamentMode )
{
$Host::Password = "";
}
$Host::HiVisibility = "0";
}
else if( $CurrentMissionType $= "LakRabbit" )
{
$Host::Password = "";
$Host::TournamentMode = 0;
$Host::HiVisibility = "1";
}
//For zCheckVar.cs TournyNetClient
if( $CurrentMissionType !$= "CTF" && $CheckVerObserverRunOnce )
CheckVerObserverReset();
//echo ("PUGpassCheck");
}
}

View file

@ -1,62 +0,0 @@
// To activate a password in certain gamemodes
// called in Getcounts.cs
// and also other options like distance and speed
// turn tournament mode off when switched to lak
// Variables
// Add these to ServerPrefs
//
// Turn on Auto Password at a player limit
// $Host::PUGautoPassword = 1;
// What value does Auto Password turn on
// $Host::PUGautoPasswordLimit = 10;
// The PUG password you want
// $Host::PUGPassword = "pickup";
//
function CheckPUGpassword()
{
//Only run before mission start and countdown start
if( !$MatchStarted && !$countdownStarted )
{
if( $CurrentMissionType !$= "LakRabbit" )
{
if( $Host::TournamentMode )
$Host::Password = $Host::PUGPassword;
else if( !$Host::TournamentMode )
{
$Host::Password = "";
//if 10 players are already on the server when the map changes
if( $TotalTeamPlayerCount >= $Host::PUGautoPasswordLimit && $Host::PUGautoPassword )
$Host::Password = $Host::PUGPassword;
}
$Host::HiVisibility = "0";
}
else if( $CurrentMissionType $= "LakRabbit" )
{
$Host::Password = "";
$Host::TournamentMode = 0;
$Host::HiVisibility = "1";
}
//For zCheckVar.cs TournyNetClient
if( $CurrentMissionType !$= "CTF" && $CheckVerObserverRunOnce )
CheckVerObserverReset();
//echo ("PUGpassCheck");
}
//If someone changes teams
else if( $Host::PUGautoPassword && $CurrentMissionType !$= "LakRabbit" && !$Host::TournamentMode )
{
if( $TotalTeamPlayerCount < $Host::PUGautoPasswordLimit )
$Host::Password = "";
else if( $TotalTeamPlayerCount >= $Host::PUGautoPasswordLimit )
$Host::Password = $Host::PUGPassword;
//echo ("PUGpassCheckTeamchange");
}
}