Raised This Month: $ Target: $400
 0% 

Removing entities


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:22.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode