Added disable mech

This commit is contained in:
ChocoTaco 2019-01-02 23:07:31 -05:00
parent 72c4d0d69e
commit 62c0429f40

View file

@ -13,12 +13,52 @@ function ActivateAntiCloak()
//echo("AntiCloakPlayerCount " @ $AntiCloakPlayerCount);
//If server is in Tourny mode and the team population is lower than the AntiCloakPlayerCount cloak is not selectable.
if( !$Host::TournamentMode && $TotalTeamPlayerCount < $Host::AntiCloakPlayerCount )
if( !$Host::TournamentMode && $TotalTeamPlayerCount < $Host::AntiCloakPlayerCount && !$CloakpackRunOnce )
{
$InvBanList[CTF, "CloakingPack"] = true;
//All other cases it is.
else
$InvBanList[CTF, "CloakingPack"] = false;
}
if(!isActivePackage(DisableCloakPack))
activatePackage(DisableCloakPack);
$CloakpackRunOnce = false;
}
//All other cases it is.
else if( $CloakpackRunOnce )
{
$InvBanList[CTF, "CloakingPack"] = false;
if(isActivePackage(DisableCloakPack))
deactivatePackage(DisableCloakPack);
$CloakpackRunOnce = true;
}
}
}
//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, 'MsgCloakingPackOn', '\c2Cloakpack is disabled.');
}
else
{
//Nothing
}
}
else
{
messageClient(%obj.client, 'MsgCloakingPackInvalid', '\c2Cloaking available for light armors only.');
}
}
};