The easiest way is to have the NPC tell the alarm he is attempting to press the alarm and store that in a safe pointer. CHandle<CAI_BaseNPC>. Then anytime someone wants to use the alarm they first must check if there is no other npc trying to use the alarm by checking if the chandle is not NULL. If it is NULL they will set the chandle to themselves and attempt to use the alarm. When the npc dies and did not complete the goal of the use of alarm the chandle should return to NULL once the npc is cleaned out of the gEntList.
Chris -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Mark Chandler Sent: Saturday, December 27, 2008 11:13 PM To: Discussion of Half-Life Programming Subject: [hlcoders] NPC's One npc for goal Hey, got more npcs problems. I have an alarm that all npcs can use and the schedule to do that is defined in a base class for all my npcs. The problem comes from the fact that they all try to activate it at the same time. What i cant work out is a way to only allow one npc to activate it (pref closes npc) with out having to put them all in a command group. Any ideas? Mark _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders

