Raised This Month: $ Target: $400
 0% 

Removing ents with HAM


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-01-2009 , 09:07   Re: Removing ents with HAM
Reply With Quote #7

Someone has already talked about that ( there is a thread somewhere by xPaw If I'm right ), it's because Ham will spawn all entities with the same internal class and not the classname. The player spawn entities and others entities related to the hostage ( don't remember which ) use the same internal class.

Using trie :

Code:
    #include <amxmodx>     #include <fakemeta>         new Trie:tEntities;     new gFwdId;         public plugin_precache ()     {         new const EntitiesToRemove[][] =         {             "func_bomb_target"   , "info_bomb_target",             "hostage_entity"     , "monster_scientist",             "func_hostage_rescue", "info_hostage_rescue",             "info_vip_start"     , "func_vip_safetyzone",             "func_escapezone"    , "func_buyzone"         }                 for ( new i = 0; i < sizeof EntitiesToRemove; i++ )         {             TrieSetCell( tEntities, EntitiesToRemove[ i ], true );         }                 gFwdId = register_forward( FM_Spawn, "Foward_Spawn" );     }         public Foward_Spawn( const Entity )     {         new ClassName[ 32 ];         pev( Entity, pev_classname, ClassName, charsmax( ClassName ) );             if ( TrieKeyExists( tEntities, ClassName ) )         {             engfunc( EngFunc_RemoveEntity, Entity );         }     }         public plugin_init ()     {         unregister_forward( FM_Spawn, gFwdId );         TrieDestroy( tEntities );     }
__________________
Arkshine is offline
 



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 22:31.


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