I modified it a bit for my own use, but the code you have there will cause an infinite loop and hang a server. Thank karlos for the fix.
Try this instead (I tested it -- it works beautifully):
[[I'd rather use a cfg file per-map instead of cvars]]
Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
public plugin_init() {
register_plugin("Remove Doors","1.4","[BSP] Thijs");
register_concmd("amx_removedoors","RemoveDoors",ADMIN_LEVEL_C,"- remove ALL DOORS from a map");
}
public RemoveDoors() {
new Door = -1;
while( ( Door = find_ent_by_class(Door,"func_door") ) > 0 )
remove_entity(Door);
Door = -1
while( ( Door = find_ent_by_class(Door,"func_door_rotating") ) > 0 )
remove_entity(Door);
return PLUGIN_HANDLED;
}