View Single Post
Author Message
vitorrossi
Senior Member
Join Date: Apr 2012
Location: NY, USA
Old 09-05-2012 , 14:29   Removing entities
Reply With Quote #1

Is this the proper way?

Code:
new const cMyEntities[ ] =
{
    "func_bomb_target",
    "info_bomb_target",
    "hostage_entity",
    "monster_scientist",
    "func_hostage_rescue",
    "info_hostage_rescue",
    "info_vip_start",
    "func_vip_safetyzone",
    "func_escapezone",
    "armoury_entity",
    "game_player_equip",
    "player_weaponstrip"
}; new g_iSpawn;

public plugin_precache( )
  g_iSpawn = register_forward( FM_Spawn, "Spawn" );

public plugin_init( )
  unregister_forward( FM_Spawn, g_iSpawn );

public Spawn( E )
{
    if( pev_valid( E ) )
    {
        static C[ 32 ], I;
        pev( E, pev_classname, C, 32 );

        for( I = 0; I < sizeof( cMyEntities ); I++ ) {
          if( equal( cMyEntities[ I ], C ) ) {
              engfunc( EngFunc_RemoveEntity, E ); break; }
        }
    }
}  
vitorrossi is offline