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 );
}
__________________