diff --git a/Classic/prefs/serverPrefs.cs b/Classic/prefs/serverPrefs.cs index baf8eb3..e2e0b68 100644 --- a/Classic/prefs/serverPrefs.cs +++ b/Classic/prefs/serverPrefs.cs @@ -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 = "Discord PUB\nServer Hosted/Provided by Branzone/Ravin\nGet Mappacks at https://playt2.com/"; $Host::ClassicMOTDLines = 3; diff --git a/Classic/scripts/autoexec/AntiCloak.cs b/Classic/scripts/autoexec/AntiCloak.cs deleted file mode 100644 index e830508..0000000 --- a/Classic/scripts/autoexec/AntiCloak.cs +++ /dev/null @@ -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.'); - } -} - -}; - - diff --git a/Classic/scripts/autoexec/AntiPack.cs b/Classic/scripts/autoexec/AntiPack.cs new file mode 100644 index 0000000..dd9e9c2 --- /dev/null +++ b/Classic/scripts/autoexec/AntiPack.cs @@ -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 +} + +}; + + diff --git a/Classic/scripts/autoexec/GetTeamCounts.cs b/Classic/scripts/autoexec/GetTeamCounts.cs index be82bc9..36c2d3e 100644 --- a/Classic/scripts/autoexec/GetTeamCounts.cs +++ b/Classic/scripts/autoexec/GetTeamCounts.cs @@ -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"; diff --git a/Classic/scripts/serverDefaults.cs b/Classic/scripts/serverDefaults.cs index 407721b..6055f31 100644 --- a/Classic/scripts/serverDefaults.cs +++ b/Classic/scripts/serverDefaults.cs @@ -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