Added ShieldPack

ShieldPack added to antipack restrictions at low numbers
This commit is contained in:
ChocoTaco1 2020-05-13 14:29:06 -04:00
parent 5c72ec89d4
commit 8bbe24e8ae
5 changed files with 98 additions and 84 deletions

View file

@ -12,8 +12,8 @@ $Host::AllowPlayerVoteSkipMission = 1;
$Host::AllowPlayerVoteTimeLimit = 1;
$Host::AllowPlayerVoteTournamentMode = 0;
$Host::AnimateWithTransitions = 1;
$Host::AntiCloakEnable = 1;
$Host::AntiCloakPlayerCount = 6;
$Host::AntiPackEnable = 1;
$Host::AntiPackPlayerCount = 6;
$Host::AveragePings = 1;
$Host::BanTime = 1440;
$Host::BotCount = 14;
@ -50,7 +50,7 @@ $Host::ClassicLoadSniperChanges = 0;
$Host::ClassicLoadTR2Gametype = 0;
$Host::ClassicLoadVRamChanges = 0;
$Host::ClassicLogEchoEnabled = 0;
$Host::ClassicMaxVotes = 5;
$Host::ClassicMaxVotes = 3;
$Host::ClassicMaxTelepads = 3;
$Host::ClassicMOTD = "<color:3cb4b4><font:Sui Generis:22>Discord PUB\n<color:3cb4b4><font:Univers:16>Server Hosted/Provided by Branzone/Ravin\n<color:3cb4b4><font:Univers:16>Get Mappacks at https://playt2.com/";
$Host::ClassicMOTDLines = 3;

View file

@ -1,78 +0,0 @@
// AntiCloak Script
//
// Amount of players needed on server for CloakPack to be banned/unbanned
// This is useful for low numbers
//
// Enable/Disable the feature
// $Host::AntiCloakEnable = 1;
// When you would like for it to deactivate
// $Host::AntiCloakPlayerCount = 6;
//
// Called in GetCounts.cs
function CheckAntiCloak( %game )
{
//CTF only
if( $Host::AntiCloakEnable && $CurrentMissionType $= "CTF" && !$Host::TournamentMode )
{
//echo("TotalTeamPlayerCount " @ $TotalTeamPlayerCount);
//echo("AntiCloakPlayerCount " @ $AntiCloakPlayerCount);
if( $TotalTeamPlayerCount < $Host::AntiCloakPlayerCount )
{
if( $AntiCloakStatus !$= "ACTIVEON" )
$AntiCloakStatus = "ON";
}
//Off
else
{
if( $AntiCloakStatus !$= "ACTIVEOFF" )
$AntiCloakStatus = "OFF";
}
}
//All other cases outside of CTF
else
{
if( $AntiCloakStatus !$= "ACTIVEOFF" )
$AntiCloakStatus = "OFF";
}
switch$($AntiCloakStatus)
{
case ON:
$InvBanList[CTF, "CloakingPack"] = 1;
if(!isActivePackage(DisableCloakPack))
activatePackage(DisableCloakPack);
$AntiCloakStatus = "ACTIVEON";
case OFF:
$InvBanList[CTF, "CloakingPack"] = 0;
if(isActivePackage(DisableCloakPack))
deactivatePackage(DisableCloakPack);
$AntiCloakStatus = "ACTIVEOFF";
case ACTIVEON:
//Do Nothing
case ACTIVEOFF:
//Do Nothing
}
}
// So if the player is able to get a cloakpack, he cant use it
package DisableCloakPack
{
function CloakingPackImage::onActivate(%data, %obj, %slot)
{
if(%obj.client.armor $= "Light")
{
if(%obj.canCloak() $= "true")
messageClient(%obj.client, 'MsgCloakingPackInvalid', '\c2Cloakpack is disabled until %1 players.', $Host::AntiCloakPlayerCount );
}
else
{
messageClient(%obj.client, 'MsgCloakingPackInvalid', '\c2Cloaking available for light armors only.');
}
}
};

View file

@ -0,0 +1,92 @@
// AntiPack Script
//
// Amount of players needed on server for (Cloak and Shield) Pack to be banned/unbanned
// This is useful for low numbers
//
// Enable/Disable the feature
// $Host::AntiPackEnable = 1;
// When you would like for it to deactivate
// $Host::AntiPackPlayerCount = 6;
//
// Called in GetCounts.cs
function CheckAntiPack( %game )
{
//CTF only
if( $Host::AntiPackEnable && $CurrentMissionType $= "CTF" && !$Host::TournamentMode )
{
//echo("TotalTeamPlayerCount " @ $TotalTeamPlayerCount);
//echo("AntiPackPlayerCount " @ $AntiPackPlayerCount);
if( $TotalTeamPlayerCount < $Host::AntiPackPlayerCount )
{
if( $AntiPackStatus !$= "ACTIVEON" )
$AntiPackStatus = "ON";
}
//Off
else
{
if( $AntiPackStatus !$= "ACTIVEOFF" )
$AntiPackStatus = "OFF";
}
}
//All other cases outside of CTF
else
{
if( $AntiPackStatus !$= "ACTIVEOFF" )
$AntiPackStatus = "OFF";
}
switch$($AntiPackStatus)
{
case ON:
$InvBanList[CTF, "CloakingPack"] = 1;
$InvBanList[CTF, "ShieldPack"] = 1;
if(!isActivePackage(AntiPack))
activatePackage(AntiPack);
$AntiPackStatus = "ACTIVEON";
case OFF:
$InvBanList[CTF, "CloakingPack"] = 0;
$InvBanList[CTF, "ShieldPack"] = 0;
if(isActivePackage(AntiPack))
deactivatePackage(AntiPack);
$AntiPackStatus = "ACTIVEOFF";
case ACTIVEON:
//Do Nothing
case ACTIVEOFF:
//Do Nothing
}
}
// So if the player is able to get said pack, he cant use it
package AntiPack
{
function CloakingPackImage::onActivate(%data, %obj, %slot)
{
if(%obj.client.armor $= "Light")
{
if(%obj.canCloak() $= "true")
messageClient(%obj.client, 'MsgCloakingPackInvalid', '\c2Cloakpack is disabled until %1 players.', $Host::AntiPackPlayerCount );
}
else
{
messageClient(%obj.client, 'MsgCloakingPackInvalid', '\c2Cloaking available for light armors only.');
}
}
function ShieldPackImage::onActivate(%data, %obj, %slot)
{
messageClient(%obj.client, 'MsgShieldPackInvalid', '\c2Shieldpack is disabled until %1 players.', $Host::AntiPackPlayerCount );
%obj.setImageTrigger(%slot,false);
%obj.isShielded = "";
}
function ShieldPackImage::onDeactivate(%data, %obj, %slot)
{
//Nothing
}
};

View file

@ -75,7 +75,7 @@ function GetTeamCounts( %game, %client, %respawn )
//Start Team Balance Notify
schedule(1000, 0, "TeamBalanceNotify", %game, %team1difference, %team2difference);
//Start AntiCloak
schedule(1500, 0, "CheckAntiCloak", %game);
schedule(1500, 0, "CheckAntiPack", %game);
//Set so counter wont run when it doesnt need to.
$GetCountsStatus = "IDLE";

View file

@ -126,8 +126,8 @@ $Host::EnableNoBaseRapeNotify = 1; //Get a base rape notification
$Host::EnableTeamBalanceNotify = 1; //Get a teambalance notification
$Host::EnableTurretPlayerCount = 10; //How many to enable turrets
$Host::EnableVoteSoundReminders = 3; //If you want a sound chime during voting, number of times
$Host::AntiCloakEnable = 1; //Enable or disable AntiCloak
$Host::AntiCloakPlayerCount = 6; //How many to enable Cloak
$Host::AntiPackEnable = 1; //Enable or disable AntiCloak
$Host::AntiPackPlayerCount = 6; //How many to enable Cloak
$Host::PUGautoPassword = 0; //Auto enable a password in tournament mode
$Host::PUGPassword = "pickup"; //PUG password, Auto or enable/disable thru admin menu
$Host::PUGpasswordAlwaysOn = 0; //If you want the pug password Always on