I don't know what is the problem, but doesn't work :\
Code:
//Global
new const MapEntitys[] =
{
"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"
};
//Init
register_forward(FM_Spawn, "fwdSpawn");
public fwdSpawn(Ent)
{
if(pev_valid(Ent))
{
set_task(0.1,"cmdRemoveEnt",Ent+TASK_ENTITYS);
return FMRES_HANDLED;
}
return FMRES_IGNORED;
}
//-----------------------------//
public cmdRemoveEnt(Ent)
{
Ent -= TASK_ENTITYS;
if(!pev_valid(Ent))
return PLUGIN_HANDLED;
new EntClass[32];
entity_get_string(Ent, EV_SZ_classname, EntClass, charsmax(EntClass));
for(new i = 0;i < charsmax(MapEntitys);i++)
{
if(equali(EntClass, MapEntitys[i]))
{
engfunc(EngFunc_RemoveEntity, Ent);
break;
}
}
return PLUGIN_HANDLED;
}