Entity removed by code? Help?

This may sound very confusing - but its really not. Please tell me if this should go into a different section AFTER you read the entire thread. If you think so - just tell me.

I am wondering if it is possible to have an entity in a map, be killed or removed by a code, only I need it to work for Team Fortress 2. If that still does not make since to you for whatever reason, picture it this way. I need a code that runs on the goes of when a certain map starts (Lets call it cp_blah) and then I need it to remove the entity’s name from the map. Any ideas - solutions? Please post! Thanks!

Would probably need a script.

What about the I/O system that comes with all of the entities in the source engine?

http://www.editlife.net/tutorial.php?tutid=1

For your specific example I would use a logic_auto with an “on map load” condition to fire “kill” on your entity

EDIT: Oh, you don’t mean in a specific map you’re making, you mean on any map made by anybody?

I would make an autoexec.cfg file with the lines

sv_cheats 1
ent_fire <yourentname> kill
sv_cheats 0

but it would work on any map, not just specific CP maps. You would put it in the config folder of tf2.