Otherwise I find another method to remove. Is it any problem about my method?
PHP Code:
new const szRemoveEntities[][] = {
"func_bomb_target", "func_escapezone", "func_hostage_rescue", "func_vip_safetyzone", "info_vip_start",
"hostage_entity", "info_bomb_target", "func_buyzone","info_hostage_rescue", "monster_scientist",
"player_weaponstrip", "game_player_equip"
}
public plugin_cfg()
{
TrieDestroy(g_tRemoveEntities);
unregister_forward(FM_Spawn, g_iForwardSpawn, 0);
}
public plugin_precache()
{
g_tRemoveEntities = TrieCreate();
for(new i = 0; i < sizeof(szRemoveEntities); i++)
{
TrieSetCell(g_tRemoveEntities, szRemoveEntities[i], i);
}
g_iForwardSpawn = register_forward(FM_Spawn, "FM_Spawn_Pre", false);
engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "func_buyzone"));
}
public FM_Spawn_Pre(ent)
{
if(!pev_valid(ent))
{
return 1;
}
new classname[32];
get_entvar(ent, var_classname, classname, charsmax(classname));
if(TrieKeyExists(g_tRemoveEntities, classname))
{
engfunc(EngFunc_RemoveEntity, ent);
return 4;
}
return 1;
}