Well...yes.
remove_entity and
remove_entity_name are the same thing, the last one is a stock which call
remove_entity on the specified classname(it loops all ents that have the given identifier). Since remove means actually remove, using such functions on armoury_entities will make them unable to spawn on new round.
Metalicross way sets the item count to 0, so it will contain 0 weapons of it's type and make them invisible, this is the trick.
Now, why removing them make them unable to respawn ?
When the item count from an armoury is decremented to 0 the armoury will get hidden and on new round the m_iCount is restored, so the actual ent is not removed when m_iCount is 0.
Look at this decompiled code by Arkshine:
PHP Code:
void CArmoury::ArmouryTouch( CBaseEntity *pOther )
{
if( pOther->IsPlayer() && !pOther->m_fIsVIP )
{
if( m_iCount > 0 )
{
if( m_iItem <= 13 )
{
if( pOther->m_fHasPrimaryWeapon )
{
return;
}
m_iCount--;
switch ( m_iItem )
{
case 0 :
pOther->GiveNamedItem( "weapon_mp5navy" );
pOther->GiveAmmo( 60, "9mm", 120 );
break;
case 1 :
pOther->GiveNamedItem( "weapon_tmp" );
pOther->GiveAmmo( 60, "9mm", 120 );
break;
case 2 :
pOther->GiveNamedItem( "weapon_p90" );
pOther->GiveAmmo( 50, "57mm", 100 );
break;
case 3 :
pOther->GiveNamedItem( "weapon_mac10" );
pOther->GiveAmmo( 60, "45acp", 100 );
break;
case 4 :
pOther->GiveNamedItem( "weapon_ak47" );
pOther->GiveAmmo( 60, "762Nato", 90 );
break;
case 5 :
pOther->GiveNamedItem( "weapon_sg552" );
pOther->GiveAmmo( 60, "556Nato", 90 );
break;
case 6 :
pOther->GiveNamedItem( "weapon_m4a1" );
pOther->GiveAmmo( 60, "556Nato", 90 );
break;
case 7 :
pOther->GiveNamedItem( "weapon_aug" );
pOther->GiveAmmo( 60, "556Nato", 90 );
break;
case 8 :
pOther->GiveNamedItem( "weapon_scout" );
pOther->GiveAmmo( 30, "762Nato", 90 );
break;
case 9 :
pOther->GiveNamedItem( "weapon_g3sg1" );
pOther->GiveAmmo( 30, "762Nato", 90 );
break;
case 10 :
pOther->GiveNamedItem( "weapon_awp" );
pOther->GiveAmmo( 20, "338Magnum", 30 );
break;
case 11 :
pOther->GiveNamedItem( "weapon_m3" );
pOther->GiveAmmo( 24, "buckshot", 32 );
break;
case 12 :
pOther->GiveNamedItem( "weapon_xm1014" );
pOther->GiveAmmo( 24, "buckshot", 32 );
break;
case 13 :
pOther->GiveNamedItem( "weapon_m249" );
pOther->GiveAmmo( 60, "556NatoBox", 200 );
break;
default:
break;
}
}
else
{
switch ( m_iItem )
{
case 14 :
if( pOther->AmmoInventory( pOther->GetAmmoIndex( "Flashbang" ) ) >= 2 )
return;
pOther->GiveNamedItem( "weapon_flashbang" );
break;
case 15 :
if( pOther->AmmoInventory( pOther->GetAmmoIndex( "HEGrenade" ) ) >= 1 )
return;
pOther->GiveNamedItem( "weapon_hegrenade" );
break;
case 16 :
if( m_iKevlar == 1 )
return;
pOther->GiveNamedItem( "item_kevlar" );
break;
case 17 :
if( m_iKevlar == 2 )
return;
pOther->GiveNamedItem( "item_assaultsuit" );
break;
case 18 :
if( pOther->AmmoInventory( pOther->GetAmmoIndex( "SmokeGrenade" ) ) >= 1 )
return;
pOther->GiveNamedItem( "weapon_smokegrenade" );
break;
default:
break;
}
m_iCount--;
}
}
if( !m_iCount )
{
pev->effects |= EF_NODRAW;
}
}
}
PHP Code:
if( !m_iCount )
{
pev->effects |= EF_NODRAW;
}
The snippet shows that when the item count is 0 the armoury is set to invisible.
__________________