mirror of
https://github.com/ChocoTaco1/TacoServer.git
synced 2026-07-15 08:04:39 +00:00
Banned item check
This commit is contained in:
parent
29be92e322
commit
e9d0be4551
1 changed files with 85 additions and 82 deletions
39
Classic/scripts/inventoryHud.cs
Executable file → Normal file
39
Classic/scripts/inventoryHud.cs
Executable file → Normal file
|
|
@ -566,27 +566,30 @@ function buyFavorites(%client)
|
||||||
for(%i = 0; %i < getFieldCount( %client.weaponIndex ); %i++)
|
for(%i = 0; %i < getFieldCount( %client.weaponIndex ); %i++)
|
||||||
{
|
{
|
||||||
%inv = $NameToInv[%client.favorites[getField( %client.weaponIndex, %i )]];
|
%inv = $NameToInv[%client.favorites[getField( %client.weaponIndex, %i )]];
|
||||||
|
if(!($InvBanList[%cmt, %inv])){
|
||||||
|
if( %inv !$= "" )
|
||||||
|
{
|
||||||
|
%weaponCount++;
|
||||||
|
%client.player.setInventory( %inv, 1 );
|
||||||
|
}
|
||||||
|
|
||||||
if( %inv !$= "" )
|
// ----------------------------------------------------
|
||||||
{
|
// z0dd - ZOD, 4/24/02. Code optimization.
|
||||||
%weaponCount++;
|
if ( %inv.image.ammo !$= "" )
|
||||||
%client.player.setInventory( %inv, 1 );
|
%client.player.setInventory( %inv.image.ammo, 999 );
|
||||||
|
// ----------------------------------------------------
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------
|
|
||||||
// z0dd - ZOD, 4/24/02. Code optimization.
|
|
||||||
if ( %inv.image.ammo !$= "" )
|
|
||||||
%client.player.setInventory( %inv.image.ammo, 999 );
|
|
||||||
// ----------------------------------------------------
|
|
||||||
}
|
}
|
||||||
%client.player.weaponCount = %weaponCount;
|
%client.player.weaponCount = %weaponCount;
|
||||||
|
|
||||||
// pack
|
// pack
|
||||||
%pCh = $NameToInv[%client.favorites[%client.packIndex]];
|
%pCh = $NameToInv[%client.favorites[%client.packIndex]];
|
||||||
if ( %pCh $= "" )
|
if(!($InvBanList[%cmt, %pCh])){
|
||||||
%client.clearBackpackIcon();
|
if ( %pCh $= "" )
|
||||||
else
|
%client.clearBackpackIcon();
|
||||||
%client.player.setInventory( %pCh, 1 );
|
else
|
||||||
|
%client.player.setInventory( %pCh, 1 );
|
||||||
|
}
|
||||||
|
|
||||||
// if this pack is a deployable that has a team limit, warn the purchaser
|
// if this pack is a deployable that has a team limit, warn the purchaser
|
||||||
// if it's a deployable turret, the limit depends on the number of players (deployables.cs)
|
// if it's a deployable turret, the limit depends on the number of players (deployables.cs)
|
||||||
|
|
@ -665,7 +668,7 @@ function buyDeployableFavorites(%client)
|
||||||
for ( %i = 0; %i < getFieldCount( %client.weaponIndex ); %i++ )
|
for ( %i = 0; %i < getFieldCount( %client.weaponIndex ); %i++ )
|
||||||
{
|
{
|
||||||
%inv = $NameToInv[%client.favorites[getField( %client.weaponIndex, %i )]];
|
%inv = $NameToInv[%client.favorites[getField( %client.weaponIndex, %i )]];
|
||||||
if ( !($InvBanList[DeployInv, %inv]) )
|
if ( !($InvBanList[DeployInv, %inv]) && !$InvBanList[%cmt, %inv])
|
||||||
{
|
{
|
||||||
%player.setInventory( %inv, 1 );
|
%player.setInventory( %inv, 1 );
|
||||||
// increment weapon count if current armor can hold this weapon
|
// increment weapon count if current armor can hold this weapon
|
||||||
|
|
@ -686,7 +689,7 @@ function buyDeployableFavorites(%client)
|
||||||
{
|
{
|
||||||
%GInv = $NameToInv[%client.favorites[getField( %client.grenadeIndex, %i )]];
|
%GInv = $NameToInv[%client.favorites[getField( %client.grenadeIndex, %i )]];
|
||||||
%client.player.lastGrenade = %GInv;
|
%client.player.lastGrenade = %GInv;
|
||||||
if ( !($InvBanList[DeployInv, %GInv]) )
|
if ( !($InvBanList[DeployInv, %GInv]) && !$InvBanList[%cmt, %GInv])
|
||||||
%player.setInventory( %GInv, 30 );
|
%player.setInventory( %GInv, 30 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -705,7 +708,7 @@ function buyDeployableFavorites(%client)
|
||||||
for ( %i = 0; %i < getFieldCount( %client.mineIndex ); %i++ )
|
for ( %i = 0; %i < getFieldCount( %client.mineIndex ); %i++ )
|
||||||
{
|
{
|
||||||
%MInv = $NameToInv[%client.favorites[getField( %client.mineIndex, %i )]];
|
%MInv = $NameToInv[%client.favorites[getField( %client.mineIndex, %i )]];
|
||||||
if ( !($InvBanList[DeployInv, %MInv]) )
|
if ( !($InvBanList[DeployInv, %MInv]) && !$InvBanList[%cmt, %MInv])
|
||||||
%player.setInventory( %MInv, 30 );
|
%player.setInventory( %MInv, 30 );
|
||||||
}
|
}
|
||||||
if ( !($InvBanList[DeployInv, Beacon]) && !($InvBanList[%cmt, Beacon]) )
|
if ( !($InvBanList[DeployInv, Beacon]) && !($InvBanList[%cmt, Beacon]) )
|
||||||
|
|
@ -717,7 +720,7 @@ function buyDeployableFavorites(%client)
|
||||||
|
|
||||||
// players cannot buy deployable station packs from a deployable inventory station
|
// players cannot buy deployable station packs from a deployable inventory station
|
||||||
%packChoice = $NameToInv[%client.favorites[%client.packIndex]];
|
%packChoice = $NameToInv[%client.favorites[%client.packIndex]];
|
||||||
if ( !($InvBanList[DeployInv, %packChoice]) )
|
if ( !($InvBanList[DeployInv, %packChoice]) && !$InvBanList[%cmt, %packChoice])
|
||||||
%player.setInventory( %packChoice, 1 );
|
%player.setInventory( %packChoice, 1 );
|
||||||
|
|
||||||
// if this pack is a deployable that has a team limit, warn the purchaser
|
// if this pack is a deployable that has a team limit, warn the purchaser
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue