Contains a src for a NPC system i coded and was fixed up by Dr. Shadowborg. By looking over this source you should be able to learn how to code an npc, menu , and a use key.
want your npcs to say different things? change the code like so.
Different menus can be done as simply as changing this bit in npc_use(); from this:
// if we hits an npc, then yays, we can talk to him!
self.npc_menu = 1;
to this:
// if we hits an npc, then yays, we can talk to him!
self.npc_menu = trace_ent.npc_menu;
and then setting the map entity's npc_menu field to whatever you want.